test-strategy
Generates a test strategy document for a project or module. Analyzes existing coverage, identifies gaps, prioritizes what to test, and recommends test types (unit, integration, e2e) per module. Use before add-tests for informed testing decisions.
Best use case
test-strategy is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Generates a test strategy document for a project or module. Analyzes existing coverage, identifies gaps, prioritizes what to test, and recommends test types (unit, integration, e2e) per module. Use before add-tests for informed testing decisions.
Teams using test-strategy should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/test-strategy/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How test-strategy Compares
| Feature / Agent | test-strategy | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Generates a test strategy document for a project or module. Analyzes existing coverage, identifies gaps, prioritizes what to test, and recommends test types (unit, integration, e2e) per module. Use before add-tests for informed testing decisions.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Skill: Test Strategy ## What This Skill Does Creates a **test strategy document** that answers: what should we test, how, and in what priority? Analyzes the codebase to produce a structured testing plan rather than ad-hoc test writing. ## When to Use - Before starting a testing initiative - When the user says "we need better test coverage" - As input for `add-tests` (which tests to generate first) - When onboarding a project with poor test coverage ## Execution Model - **Phase 1**: primary agent analyzes codebase structure, existing tests, and coverage. - **Phase 2**: primary spawns `doc-explorer` to write the strategy document to `docs/test-strategy.md`. ## Workflow ### Step 1: Inventory Existing Tests Map what tests exist: ```bash # Count test files vs source files find . -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" | wc -l find . -name "*.ts" -o -name "*.py" -o -name "*.go" | grep -v test | grep -v node_modules | wc -l ``` For each module, check if a corresponding test file exists. ### Step 2: Categorize Modules by Risk Assess each module's testing priority: | Risk Factor | Weight | |-------------|--------| | Handles user input / external data | High | | Has complex business logic | High | | Manages state / data persistence | High | | Has many dependents (widely imported) | Medium | | Performs I/O (file, network, DB) | Medium | | Is pure utility / helper | Low | ### Step 3: Identify Coverage Gaps For each module: - Does it have any tests? (binary check) - Do tests cover happy path? Error cases? Edge cases? - Are integration points tested? ### Step 4: Recommend Test Types Per module, recommend the appropriate test types: | Module Type | Recommended Tests | |-------------|------------------| | Business logic | Unit tests with edge cases | | API endpoints | Integration tests | | UI components | Component/snapshot tests | | Data layer | Integration tests with test DB | | Utilities | Unit tests | | CLI | Integration tests | ### Step 5: Generate Strategy Document Write to `docs/test-strategy.md`: ```markdown # Test Strategy ## Current State - Source files: N - Test files: N - Coverage ratio: N% ## Priority Matrix | Module | Risk | Current Coverage | Recommended Tests | Priority | |--------|------|-----------------|-------------------|----------| ## Testing Approach ### Unit Tests ### Integration Tests ### E2E Tests ## Recommended Order 1. <highest priority module> 2. <next> ## Test Infrastructure Needs - Fixtures needed - Mocks needed - CI integration ``` ## Rules 1. **Analysis, not implementation**: this skill produces a strategy document. It does not write tests (use `add-tests` for that). 2. **Risk-based prioritization**: not all code needs the same level of testing. Focus on high-risk, high-impact areas. 3. **Be pragmatic**: 80% coverage of critical paths beats 100% coverage of trivial code. 4. **Respect existing patterns**: recommend test types and tools that align with the project's existing test infrastructure. 5. **No built-in explore agent**: do NOT use the built-in `explore` subagent type.
Related Skills
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browse...
web3-testing
Test smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, setting up blockchain test suites, or va...
vue-testing-best-practices
Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.
screen-reader-testing
Test web applications with screen readers including VoiceOver, NVDA, and JAWS. Use when validating screen reader compatibility, debugging accessibility issues, or ensuring assistive technology supp...
unit-testing-test-generate
Generate comprehensive, maintainable unit tests across languages with strong coverage and edge case focus.
test-fixing
Run tests and systematically fix all failing tests using smart error grouping. Use when user asks to fix failing tests, mentions test failures, runs test suite and failures occur, or requests to ma...
tdd:test-driven-development
Use when implementing any feature or bugfix, before writing implementation code - write the test first, watch it fail, write minimal code to pass; ensures tests actually verify behavior by requiring failure first
test-automator
Master AI-powered test automation with modern frameworks, self-healing tests, and comprehensive quality engineering. Build scalable testing strategies with advanced CI/CD integration.
perf-theory-tester
Use when running controlled perf experiments to validate hypotheses.
pentest-commands
This skill should be used when the user asks to "run pentest commands", "scan with nmap", "use metasploit exploits", "crack passwords with hydra or john", "scan web vulnerabilities ...
pentest-checklist
This skill should be used when the user asks to "plan a penetration test", "create a security assessment checklist", "prepare for penetration testing", "define pentest scope", "foll...
ab-test-setup
Structured guide for setting up A/B tests with mandatory gates for hypothesis, metrics, and execution readiness.