skills/test-automator/SKILL.md
Test automation framework expert for creating and maintaining automated tests. Use when user asks to write tests, automate testing, or improve test coverage.
npx skillsauth add charon-fan/agent-playbook test-automatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert in creating and maintaining automated tests for various frameworks and languages.
Activates when you:
/\
/E2E\ - Few, expensive, slow
/------\
/ Integration \ - Moderate number
/--------------\
/ Unit Tests \ - Many, cheap, fast
/------------------\
describe('UserService', () => {
describe('createUser', () => {
it('should create a user with valid data', async () => {
// Arrange
const userData = {
name: 'John Doe',
email: '[email protected]'
};
// Act
const user = await userService.create(userData);
// Assert
expect(user.id).toBeDefined();
expect(user.email).toBe(userData.email);
});
it('should throw error for invalid email', async () => {
// Arrange
const userData = { email: 'invalid' };
// Act & Assert
await expect(userService.create(userData))
.rejects.toThrow('Invalid email');
});
});
});
describe('POST /api/users', () => {
it('should create a user', async () => {
const response = await request(app)
.post('/api/users')
.send({
name: 'John Doe',
email: '[email protected]'
})
.expect(201)
.expect((res) => {
expect(res.body.id).toBeDefined();
expect(res.body.email).toBe('[email protected]');
});
});
});
test('user can login', async ({ page }) => {
await page.goto('/login');
await page.fill('[name="email"]', '[email protected]');
await page.fill('[name="password"]', 'password123');
await page.click('button[type="submit"]');
await expect(page).toHaveURL('/dashboard');
await expect(page.locator('h1')).toContainText('Welcome');
});
| Type | Target | |------|--------| | Lines | > 80% | | Branches | > 75% | | Functions | > 80% | | Statements | > 80% |
# Jest
npm test -- --coverage
# Python (pytest-cov)
pytest --cov=src --cov-report=html
# Go
go test -coverprofile=coverage.out
go tool cover -html=coverage.out
// Good: Describes what is being tested
it('should reject invalid email addresses')
// Good: Describes the scenario and outcome
it('returns 401 when user provides invalid credentials')
// Bad: Vague
it('works correctly')
| Language | Framework | Command |
|----------|-----------|---------|
| TypeScript/JS | Jest, Vitest | npm test |
| Python | pytest | pytest |
| Go | testing | go test |
| Java | JUnit | mvn test |
| Rust | built-in | cargo test |
Generate test boilerplate:
python scripts/generate_test.py <filename>
Check test coverage:
python scripts/coverage_report.py
references/best-practices.md - Testing best practicesreferences/examples/ - Framework-specific examplesreferences/mocking.md - Mocking guidelinesdata-ai
Automatically coordinates multi-skill workflows and triggers follow-up actions. Use when completing PRD creation, implementation, or any milestone that should trigger additional skills. This skill reads the auto-trigger configuration and executes the workflow chain.
development
Intelligently routes user requests to the most appropriate Claude Code skill. ALWAYS use this skill FIRST when user asks for help, mentions "skill", "which", "how to", or seems unsure about which approach to take. This is the default entry point for all skill-related requests.
tools
Saves conversation history to session log files. Use when user says "保存对话", "保存对话信息", "记录会话", "save session", or "save conversation". Automatically creates timestamped session log in sessions/ directory.
development
A universal self-improving agent that learns from ALL skill experiences. Uses multi-memory architecture (semantic + episodic + working) to continuously evolve the codebase. Auto-triggers on skill completion/error with hooks-based self-correction.