npx claudepluginhub mayurpise/draft --plugin draftThis skill uses the workspace's default tool permissions.
You are designing a testing strategy and test plan for this project or track.
Designs test strategies and plans with testing pyramid. Covers APIs, frontend, data pipelines, infrastructure; outputs plans including coverage targets, examples, and gaps.
Produces test strategies for projects or features: risk maps, test type decisions (unit/integration/E2E), coverage targets, CI configs. Scans for Jest, Vitest, Playwright, Cypress, pytest setups.
Share bugs, ideas, or general feedback.
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