Test Planning
Use this skill when creating or refreshing a test plan before or around
implementation.
Relationship to Copilot built-ins
- Use this skill when a generic planning pass is not enough because the team
wants tests to define the contract first.
- Use built-in
/plan for overall implementation planning; use this skill for
test-specific decomposition.
Discovery steps
- detect the test framework and file naming conventions
- read at least one existing test file before generating new test specs
- verify import paths, source signatures, and types from the real codebase
- prefer project conventions over generic testing advice
Plan mode
Generate test specifications as executable stubs or clearly structured cases
that cover:
- happy paths
- required validation
- error paths
- edge cases
- lifecycle or state transitions when real state exists
Validate mode
When validating an existing suite, report:
- pass/fail/todo counts
- major coverage gaps
- framework-specific issues such as missing async awaits
Refresh mode
When implementation changed after the original plan:
- re-read the changed code
- refresh stale specs
- keep the test plan aligned with current signatures and behavior
Dependency classification
Classify each dependency to determine the testing approach:
| Category |
Testing Strategy |
Example |
| In-process |
Test directly — no mocks |
Validation, transforms, calculations |
| Local-substitutable |
Use real substitute — higher fidelity than mocks |
PGLite for Postgres, in-memory FS |
| Remote but owned |
Ports & Adapters — inject in-memory adapter |
Your own API services, queues |
| True external |
Mock at boundary — only valid mock target |
Stripe, SendGrid, AWS S3 |
Do NOT mock in-process or local-substitutable dependencies — mocks hide real bugs.
Examples
- Plan mode: Read an existing test file and the real source signatures, then
produce behavior-focused test cases covering happy path, validation, error
paths, and edge cases.
- Validate mode: Review an existing suite, report pass/fail/todo counts and
the major coverage gaps, and call out framework-specific issues such as
missing async awaits.
Do Nots
- Do not invent framework, file layout, or API signatures.
- Do not require file writing if the user only wants a plan in chat.
- Keep the plan behavior-focused, not implementation-coupled.
Analyst References
Specialist analysts used during plan and validate modes. Each reference file contains the full process, output format, and rules for that analyst.
- contract-compliance.md — Decomposes task descriptions into testable requirements, maps Zod schema fields to assertions, and verifies CRUD completeness. Included in every test plan.
- boundary-validation.md — Tests required field enforcement, Zod constraint boundaries, NOT_FOUND handling, error code specificity, and soft-delete behavior.
- integration-surface.md — Tests router-to-service wiring, query vs mutation assignment, Zod schema binding, auth requirements, and cross-boundary contracts.
- state-lifecycle.md — Tests state machine transitions for entities with status fields: every valid transition, representative invalid transitions, and side effects. Selected only when the entity has a status enum.
- test-writer.md — Converts consolidated TestSpecification objects into valid Vitest
.test.ts files with it.todo() stubs, organized by describe block, priority, and category.
Closed Decisions
- This skill is TDD-first and test-specific; built-in
/plan still owns overall
implementation planning.
- Real repo signatures, test framework conventions, and file layout are the
baseline.
- In-process and local-substitutable dependencies should not be mocked by
default.
- Test plans should stay behavior-focused rather than implementation-coupled.
1---2name: test-planning3description: TDD-first planning rubric for generating test specifications and validating test readiness before implementation.4---56# Test Planning78Use this skill when creating or refreshing a test plan before or around9implementation.1011## Relationship to Copilot built-ins1213- Use this skill when a generic planning pass is not enough because the team14 wants tests to define the contract first.15- Use built-in `/plan` for overall implementation planning; use this skill for16 test-specific decomposition.1718## Discovery steps1920- detect the test framework and file naming conventions21- read at least one existing test file before generating new test specs22- verify import paths, source signatures, and types from the real codebase23- prefer project conventions over generic testing advice2425## Plan mode2627Generate test specifications as executable stubs or clearly structured cases28that cover:2930- happy paths31- required validation32- error paths33- edge cases34- lifecycle or state transitions when real state exists3536## Validate mode3738When validating an existing suite, report:3940- pass/fail/todo counts41- major coverage gaps42- framework-specific issues such as missing async awaits4344## Refresh mode4546When implementation changed after the original plan:4748- re-read the changed code49- refresh stale specs50- keep the test plan aligned with current signatures and behavior5152## Dependency classification5354Classify each dependency to determine the testing approach:5556| Category | Testing Strategy | Example |57|----------|-----------------|---------|58| **In-process** | Test directly — no mocks | Validation, transforms, calculations |59| **Local-substitutable** | Use real substitute — higher fidelity than mocks | PGLite for Postgres, in-memory FS |60| **Remote but owned** | Ports & Adapters — inject in-memory adapter | Your own API services, queues |61| **True external** | Mock at boundary — only valid mock target | Stripe, SendGrid, AWS S3 |6263Do NOT mock in-process or local-substitutable dependencies — mocks hide real bugs.6465## Examples6667- **Plan mode:** Read an existing test file and the real source signatures, then68 produce behavior-focused test cases covering happy path, validation, error69 paths, and edge cases.70- **Validate mode:** Review an existing suite, report pass/fail/todo counts and71 the major coverage gaps, and call out framework-specific issues such as72 missing async awaits.7374## Do Nots7576- Do not invent framework, file layout, or API signatures.77- Do not require file writing if the user only wants a plan in chat.78- Keep the plan behavior-focused, not implementation-coupled.7980## Analyst References8182Specialist analysts used during plan and validate modes. Each reference file contains the full process, output format, and rules for that analyst.8384- **[contract-compliance.md](references/contract-compliance.md)** — Decomposes task descriptions into testable requirements, maps Zod schema fields to assertions, and verifies CRUD completeness. Included in every test plan.85- **[boundary-validation.md](references/boundary-validation.md)** — Tests required field enforcement, Zod constraint boundaries, NOT_FOUND handling, error code specificity, and soft-delete behavior.86- **[integration-surface.md](references/integration-surface.md)** — Tests router-to-service wiring, query vs mutation assignment, Zod schema binding, auth requirements, and cross-boundary contracts.87- **[state-lifecycle.md](references/state-lifecycle.md)** — Tests state machine transitions for entities with status fields: every valid transition, representative invalid transitions, and side effects. Selected only when the entity has a status enum.88- **[test-writer.md](references/test-writer.md)** — Converts consolidated TestSpecification objects into valid Vitest `.test.ts` files with `it.todo()` stubs, organized by describe block, priority, and category.8990## Closed Decisions9192- This skill is TDD-first and test-specific; built-in `/plan` still owns overall93 implementation planning.94- Real repo signatures, test framework conventions, and file layout are the95 baseline.96- In-process and local-substitutable dependencies should not be mocked by97 default.98- Test plans should stay behavior-focused rather than implementation-coupled.