
Test Automator
- 758 installs
- 65 repo stars
- Updated June 21, 2026
- charon-fan/agent-playbook
test-automator is a Claude Code skill that generates and extends automated unit and integration tests with framework-aware patterns and optional coverage scripts for developers who need to improve test coverage across Ty
About
test-automator is a test generation skill from charon-fan/agent-playbook that creates and maintains automated unit and integration tests with framework-specific patterns. The skill supports 7 test frameworks: Jest, Vitest, and Mocha for TypeScript/JavaScript, pytest and unittest for Python, Go's testing package, and JUnit for Java. Developers reach for test-automator when writing tests for new functions, improving coverage on existing modules, or scaffolding test boilerplate. The skill bundles 2 Python scripts—generate_test.py for boilerplate generation and coverage_report.py for coverage analysis—invoked from the command line alongside conversational test authoring.
- Framework matrix for TypeScript/JS (Jest, Vitest, Mocha), Python (pytest), Go, and Java (JUnit)
- Python scripts generate_test.py and coverage_report.py for boilerplate and coverage reporting
- Best-practice rules: deterministic tests, explicit fixtures, no order dependencies, CI on every change
- Mocking guidance favors external services over internal logic mocks
- Small focused examples directory for copy-paste patterns
Test Automator by the numbers
- 758 all-time installs (skills.sh)
- Ranked #564 of 2,184 Testing & QA skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/charon-fan/agent-playbook --skill test-automatorAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 758 |
|---|---|
| repo stars | ★ 65 |
| Security audit | 3 / 3 scanners passed |
| Last updated | June 21, 2026 |
| Repository | charon-fan/agent-playbook ↗ |
How do you generate unit tests for existing code?
Generate and extend automated unit and integration tests with framework-aware patterns and optional coverage scripts.
Who is it for?
Developers adding or extending automated tests in TypeScript, Python, Go, or Java projects who want framework-aware patterns and optional coverage reporting.
Skip if: End-to-end browser testing, load testing, or teams with zero existing test infrastructure and no target framework preference.
When should I use this skill?
User asks to write tests for a function, create test cases, improve test coverage, or generate test boilerplate.
What you get
Framework-specific test files, test boilerplate from generate_test.py, and coverage reports from coverage_report.py.
- unit test files
- integration test files
- coverage reports
By the numbers
- Supports 7 test frameworks across TypeScript, Python, Go, and Java
- Bundles 2 Python scripts: generate_test.py and coverage_report.py
Files
Test Automator
Expert in creating and maintaining automated tests for various frameworks and languages.
When This Skill Activates
Activates when you:
- Ask to write tests
- Mention test automation
- Request test coverage improvement
- Need to set up testing framework
Testing Pyramid
/\
/E2E\ - Few, expensive, slow
/------\
/ Integration \ - Moderate number
/--------------\
/ Unit Tests \ - Many, cheap, fast
/------------------\Unit Testing
Principles
1. Test behavior, not implementation 2. One assertion per test (generally) 3. Arrange-Act-Assert pattern 4. Descriptive test names
Example (Jest)
describe('UserService', () => {
describe('createUser', () => {
it('should create a user with valid data', async () => {
// Arrange
const userData = {
name: 'John Doe',
email: 'john@example.com'
};
// 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');
});
});
});Integration Testing
Principles
1. Test component interactions 2. Use test doubles for external services 3. Clean up test data 4. Run in isolation
Example (Supertest)
describe('POST /api/users', () => {
it('should create a user', async () => {
const response = await request(app)
.post('/api/users')
.send({
name: 'John Doe',
email: 'john@example.com'
})
.expect(201)
.expect((res) => {
expect(res.body.id).toBeDefined();
expect(res.body.email).toBe('john@example.com');
});
});
});E2E Testing
Principles
1. Test critical user flows 2. Use realistic test data 3. Handle async operations properly 4. Clean up after tests
Example (Playwright)
test('user can login', async ({ page }) => {
await page.goto('/login');
await page.fill('[name="email"]', 'user@example.com');
await page.fill('[name="password"]', 'password123');
await page.click('button[type="submit"]');
await expect(page).toHaveURL('/dashboard');
await expect(page.locator('h1')).toContainText('Welcome');
});Test Coverage
Coverage Goals
| Type | Target |
|---|---|
| Lines | > 80% |
| Branches | > 75% |
| Functions | > 80% |
| Statements | > 80% |
Coverage Reports
# Jest
npm test -- --coverage
# Python (pytest-cov)
pytest --cov=src --cov-report=html
# Go
go test -coverprofile=coverage.out
go tool cover -html=coverage.outTesting Best Practices
DO's
- Write tests before fixing bugs (TDD)
- Test edge cases
- Keep tests independent
- Use descriptive test names
- Mock external dependencies
- Clean up test data
DON'Ts
- Don't test implementation details
- Don't write brittle tests
- Don't skip tests without a reason
- Don't commit commented-out tests
- Don't test third-party libraries
Test Naming Conventions
// 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')Common Testing Frameworks
| 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 |
Scripts
Generate test boilerplate:
python scripts/generate_test.py <filename>Check test coverage:
python scripts/coverage_report.pyReferences
references/best-practices.md- Testing best practicesreferences/examples/- Framework-specific examplesreferences/mocking.md- Mocking guidelines
Test Automator
A Claude Code skill for creating and maintaining automated tests.
Installation
This skill is part of the agent-playbook collection.
Usage
You: Write tests for this function
You: Create test cases
You: Improve test coverageTesting Frameworks
| Language | Framework |
|---|---|
| TypeScript/JS | Jest, Vitest, Mocha |
| Python | pytest, unittest |
| Go | testing package |
| Java | JUnit |
Scripts
Generate test boilerplate:
python scripts/generate_test.py <filename>Check test coverage:
python scripts/coverage_report.pyResources
Test Automation Best Practices
- Keep tests deterministic
- Avoid test order dependencies
- Prefer explicit fixtures
- Run tests in CI on every change
Examples
This directory contains small, focused test automation examples.
Unit Test Example
from my_module import add
def test_add():
assert add(2, 3) == 5Mocking Guide
- Mock external services
- Avoid mocking internal logic
- Use realistic data shapes
#!/usr/bin/env python3
# Template generator for coverage report.
from pathlib import Path
import argparse
import textwrap
def write_output(path: Path, content: str, force: bool) -> bool:
if path.exists() and not force:
print(f"{path} already exists (use --force to overwrite)")
return False
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(content, encoding="utf-8")
return True
def main() -> int:
parser = argparse.ArgumentParser(description="Generate a coverage report.")
parser.add_argument("--output", default="coverage-report.md", help="Output file path")
parser.add_argument("--name", default="example", help="Component or repo name")
parser.add_argument("--owner", default="team", help="Owning team")
parser.add_argument("--force", action="store_true", help="Overwrite existing file")
args = parser.parse_args()
content = textwrap.dedent(
f"""\
# Coverage Report
## Summary
Coverage for {args.name}
## Ownership
- Owner: {args.owner}
## Coverage Breakdown
- Lines:
- Branches:
- Functions:
## Low Coverage Areas
- Module:
- Module:
## Action Items
- Add missing tests
- Track progress
"""
).strip() + "\n"
output = Path(args.output)
if not write_output(output, content, args.force):
return 1
print(f"Wrote {output}")
return 0
if __name__ == "__main__":
raise SystemExit(main())
#!/usr/bin/env python3
# Template generator for test plan.
from pathlib import Path
import argparse
import textwrap
def write_output(path: Path, content: str, force: bool) -> bool:
if path.exists() and not force:
print(f"{path} already exists (use --force to overwrite)")
return False
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(content, encoding="utf-8")
return True
def main() -> int:
parser = argparse.ArgumentParser(description="Generate a test plan.")
parser.add_argument("--output", default="tests/test-plan.md", help="Output file path")
parser.add_argument("--name", default="example", help="Feature or release name")
parser.add_argument("--owner", default="team", help="Owning team")
parser.add_argument("--force", action="store_true", help="Overwrite existing file")
args = parser.parse_args()
content = textwrap.dedent(
f"""\
# Test Plan
## Scope
{args.name}
## Ownership
- Owner: {args.owner}
- QA contact: TBD
## Scenarios
- Happy path
- Error handling
- Edge cases
## Test Types
- Unit
- Integration
- End-to-end
## Environments
- Local
- Staging
- Production
## Exit Criteria
- Tests passing
- Defects triaged
"""
).strip() + "\n"
output = Path(args.output)
if not write_output(output, content, args.force):
return 1
print(f"Wrote {output}")
return 0
if __name__ == "__main__":
raise SystemExit(main())
Related skills
How it compares
Choose test-automator over manual test writing when you need multi-framework boilerplate generation with bundled coverage reporting scripts.
FAQ
Which test frameworks does test-automator support?
test-automator supports 7 frameworks across 4 languages: Jest, Vitest, and Mocha for TypeScript/JavaScript, pytest and unittest for Python, Go's testing package, and JUnit for Java. Each framework receives pattern-aware test generation rather than generic assertions.
What scripts does test-automator include?
test-automator bundles 2 Python scripts: generate_test.py for creating test boilerplate from a filename argument, and coverage_report.py for analyzing test coverage across the project. Both scripts run from the command line alongside conversational test authoring.
Is Test Automator safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.