
Test Automator
Generate and extend automated unit and integration tests with framework-aware patterns and optional coverage scripts.
Overview
Test Automator is an agent skill most often used in Ship (also Build backend) that creates and maintains automated tests across Jest, Vitest, pytest, Go, and JUnit with CI-oriented practices.
Install
npx skills add https://github.com/charon-fan/agent-playbook --skill test-automatorWhat is this skill?
- 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
- 5 language/framework rows in the testing matrix
- 2 helper scripts: generate_test.py and coverage_report.py
Adoption & trust: 663 installs on skills.sh; 58 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You shipped or are about to ship code without dependable automated tests, and manual checks will not scale for your solo release cadence.
Who is it for?
Indie developers adding regression safety to TypeScript, Python, Go, or Java codebases with agent-assisted boilerplate and review-friendly patterns.
Skip if: Teams needing full E2E browser automation, performance load testing, or formal compliance test matrices without human QA ownership.
When should I use this skill?
User asks to write tests, create test cases, or improve test coverage for existing code.
What do I get? / Deliverables
You get framework-appropriate test files, mocking guidance, and optional coverage scripts aligned with deterministic, CI-friendly suites.
- New or extended test modules
- Mocking patterns for external deps
- Coverage summary from coverage_report.py when run
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Ship/testing is the canonical shelf because the skill’s stated job is creating and maintaining automated tests before release confidence. Testing subphase matches Jest, Vitest, pytest, Go testing, and JUnit workflows plus CI-oriented best-practice guidance.
Where it fits
Add Vitest cases for a billing webhook handler before tagging a release.
Scaffold pytest tests alongside a new FastAPI route using generate_test.py.
Use coverage_report.py output to justify which branches still lack assertions in PR review.
How it compares
Skill-guided test authoring with scripts—not a hosted test runner SaaS or a one-click mutation-testing platform.
Common Questions / FAQ
Who is test-automator for?
Solo and small-team builders using Claude Code or similar agents who want maintainable unit and integration tests in mainstream frameworks.
When should I use test-automator?
During Ship testing before releases, during Build backend when adding modules test-first, and when improving coverage or CI gates on existing functions.
Is test-automator safe to install?
It may run Python helper scripts and test commands locally—review the Security Audits panel on this page and inspect scripts/generate_test.py and coverage_report.py before running in sensitive repos.
SKILL.md
READMESKILL.md - Test Automator
# Test Automator > A Claude Code skill for creating and maintaining automated tests. ## Installation This skill is part of the [agent-playbook](../../README.md) collection. ## Usage ``` You: Write tests for this function You: Create test cases You: Improve test coverage ``` ## Testing Frameworks | Language | Framework | |----------|-----------| | TypeScript/JS | Jest, Vitest, Mocha | | Python | pytest, unittest | | Go | testing package | | Java | JUnit | ## Scripts Generate test boilerplate: ```bash python scripts/generate_test.py <filename> ``` Check test coverage: ```bash python scripts/coverage_report.py ``` ## Resources - [Testing Best Practices](https://google.github.io/eng-practices/review/developer/tests.html) - [Test Driven Development](https://www.amazon.com/Test-Driven-Development-Kent-Beck/dp/0321146530) # 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 ```python from my_module import add def test_add(): assert add(2, 3) == 5 ``` # Mocking 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 T