From draft
Design test strategies and test plans with coverage targets. Complements /draft:coverage which measures what this skill plans. Auto-loaded by /draft:implement before TDD.
How this skill is triggered — by the user, by Claude, or both
Slash command
/draft:testing-strategyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are designing a testing strategy and test plan for this project or track.
You are designing a testing strategy and test plan for this project or track.
A good testing strategy matches the architecture. Not every project needs the same pyramid.
Before starting, capture the current git state:
git branch --show-current # Current branch name
git rev-parse --short HEAD # Current commit hash
Store this for the report header. The strategy is scoped to this specific branch/commit.
ls draft/ 2>/dev/null
If draft/ doesn't exist, this skill can still run standalone with reduced context.
Read and follow the base procedure in core/shared/draft-context-loading.md.
/draft:testing-strategy — Project-wide strategy (default if no active track)/draft:testing-strategy track <id> — Track-scoped strategy/draft:testing-strategy module <name> — Module-scoped strategyIdentify component types:
Discover existing tests:
find . -name "*test*" -o -name "*spec*" | head -50
Identify: test frameworks, test directories, existing coverage config, test runners.
Assess current coverage: Check for existing coverage reports or configuration:
ls coverage/ .nyc_output/ htmlcov/ .coverage 2>/dev/null
Read project context:
draft/tech-stack.md — Test frameworks, testing conventionsdraft/workflow.md — TDD preferences (strict/flexible/none)draft/.ai-context.md — INVARIANTS section (critical paths), module boundaries, concurrency modeldraft/guardrails.md — Anti-patterns that need test coveragedraft/product.md — Critical user flows that demand E2E testsTailor to the project architecture:
┌─────────┐
│ E2E │ Few, critical paths only
├─────────┤
│ Integr. │ Service boundaries, DB, APIs
├─────────┤
│ Unit │ Business logic, utilities
└─────────┘
Adjust the pyramid shape per architecture. A microservices backend may need a wider integration band. A UI-heavy app may need more E2E. A library may be almost entirely unit tests.
| Component Type | Unit | Integration | E2E | Focus |
|---|---|---|---|---|
| API endpoints | Input validation, handlers | DB queries, auth | Critical flows | Contract testing |
| Data pipelines | Transform logic | Source/sink connections | Full pipeline | Data integrity |
| Frontend | Component rendering, hooks | API integration | User journeys | Visual regression |
| Infrastructure | Config validation | Resource provisioning | Deployment | Drift detection |
| Libraries | Public API surface | Cross-module | Consumer scenarios | Backward compat |
| CLI tools | Argument parsing, logic | File I/O, system calls | Full workflows | Exit codes, output |
Set realistic targets based on component criticality:
Coverage alone is insufficient. Include guidance on:
Compare current state to targets:
Present as a gap matrix:
| Module | Current Tests | Target | Gap | Risk | Priority |
|---|---|---|---|---|---|
| ... | ... | ... | ... | ... | ... |
Priority test cases to write, ordered by impact:
For each priority test, specify:
MANDATORY: Include YAML frontmatter with git metadata. Follow core/shared/git-report-metadata.md.
Include the report header table immediately after frontmatter:
| Field | Value |
|-------|-------|
| **Branch** | `{LOCAL_BRANCH}` → `{REMOTE/BRANCH}` |
| **Commit** | `{SHORT_SHA}` — {COMMIT_MESSAGE} |
| **Generated** | {ISO_TIMESTAMP} |
| **Synced To** | `{FULL_SHA}` |
Save to:
draft/testing-strategy.mddraft/tracks/<id>/testing-strategy.md/draft:implement (before TDD cycle)/draft:decompose (after module definition), /draft:init (after setup)/draft:coverage (measurement against targets set here)/draft:bughunt findings as regression test candidatesIf no test infrastructure found: Recommend test framework based on tech-stack.md, include setup steps needed before tests can be written
If no draft context: Generate generic strategy, suggest running /draft:init for better results
If conflicting test patterns found: Document both patterns, recommend consolidation as a tech-debt item
npx claudepluginhub drafthq/draft --plugin draftProduce a test strategy for a project or feature — risk map, test type decisions, coverage targets, CI config. Use when asked to "create test strategy", "what should we test", "testing plan", or "improve test coverage".
Produces test strategy for projects or features: risk map, test type decisions (unit/integration/E2E), coverage targets, CI config. Use for 'test strategy', 'testing plan', or coverage improvement queries.
Guides test pyramid structure, coverage targets, and patterns for unit, integration, and E2E tests. Includes AAA pattern, naming conventions, and API test checklist.