/prd-v07-test-planning
Define test cases BEFORE implementation, ensuring every API, business rule, and user journey has verifiable acceptance criteria during PRD v0.7 Build Execution. Triggers on requests to define tests, plan test coverage, create test cases, or when user asks "define tests", "test
$ npx -y skills add mattgierhart/PRD-driven-context-engineering --skill prd-v07-test-planning --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/prd-v07-test-planning
Context preview
The summary Claude sees to decide when to auto-load this skill.
Define test cases BEFORE implementation, ensuring every API, business rule, and user journey has verifiable acceptance criteria during PRD v0.7 Build Execution. Triggers on requests to define tests, plan test coverage, create test cases, or when user asks "define tests", "test
SKILL.md
prd-v07-test-planning.SKILL.mdname: prd-v07-test-planning
description: Define test cases BEFORE implementation, ensuring every API, business rule, and user journey has verifiable acceptance criteria during PRD v0.7 Build Execution. Triggers on requests to define tests, plan test coverage, create test cases, or when user asks "define tests", "test planning", "what to test?", "test cases", "test coverage", "TEST-", "test-first". Consumes EPIC- (scope), API-, DBT-, BR-, UJ-. Outputs TEST- entries with Given-When-Then format. Feeds v0.7 Implementation Loop.
context: fork
allowed-tools:
- Read
- Write
- Edit
- Glob
- Grep
- Bash
Test Planning
Position in workflow: v0.7 Epic Scoping → **v0.7 Test Planning** → v0.7 Implementation Loop
Consumes
This skill requires prior work from v0.7 Epic Scoping and v0.6 specifications:
- **EPIC-\* entries** (from v0.7 Epic Scoping) — EPIC scope defines test boundaries; test plan must cover all APIs/BRs/UJs within EPIC Context & IDs section
- **API-\* endpoint contracts** (from v0.6 Technical Specification) — Each endpoint has request/response shape and error codes that must be tested
- **DBT-\* data model specifications** (from v0.6 Technical Specification) — Schema constraints, relationships, and business rules enforce data integrity tests
- **BR-\* business rules** (from v0.3 Commercial Model) — Each rule must have at least one test verifying positive (rule allows) and negative (rule blocks) cases
- **UJ-\* user journey entries** (from v0.4 User Journeys) — Critical journeys need E2E tests verifying complete flow from trigger to value moment
This skill assumes EPIC- entries are complete with full API-/DBT-/BR-/UJ- references in Context & IDs section.
Produces
This skill creates/updates:
- **TEST-\* entries** (test case specifications, automation path) — Concrete, verifiable test cases with Given-When-Then format, test type, and coverage mapping to upstream IDs
- **Test coverage matrix** (per EPIC) — Validation showing every API- endpoint, BR- rule, and core UJ- journey has TEST- entries; identifies gaps
- **Test automation specification** — For each Critical/High priority TEST-, identifies test file path and automation framework (unit/integration/E2E)
All TEST- entries are **acceptance criteria specifications**, not confidence-based. They are:
- **Derivable from upstream IDs** (every TEST- ties to specific API-/BR-/UJ-/DBT-)
- **Executable** (Given-When-Then format is testable; automation paths are specified)
- **Complete for acceptance** (passing all TEST- for EPIC means EPIC is done)
- **Focused on behavior** (tests what the system does, not implementation details)
Example TEST- entry (API endpoint test):
TEST-001: User creation succeeds with valid data
Type: Integration
Tests: API-001 (POST /users), BR-001 (email uniqueness), DBT-010 (users table)
EPIC: EPIC-01
Given: No user with email "test@example.com" exists, database ready
When: POST /api/users with { email: "test@example.com", password: "Valid123!" }
Then:
- Response status: 201 Created
- Response body contains user id and email
- User record exists in DBT-010 (users table)
- Password is hashed, not plaintext
- Email verification email queued
Validation Method: Automated
Automation: tests/api/users.test.ts (Integration test)
Priority: CriticalExample TEST- entry (Business rule test):
TEST-005: Password validation enforces minimum length
Type: Unit
Tests: BR-002 (password requirements)
EPIC: EPIC-01
Given: Password validation function configured per BR-002
When: Validate password "weak" (length 4)
Then:
- Returns validation failure
- Error message: "Password must be at least 8 characters"
- No user record created
Validation Method: Automated
Automation: tests/unit/validation.test.ts
Priority: High
Example TEST- entry (User journey E2E test):
TEST-010: Onboarding journey completes successfully
Type: E2E
Tests: UJ-000 (onboarding), API-001 (signup), API-002 (login), SCR-001 (dashboard)
EPIC: EPIC-01
Given: New user on signup page, all services ready
When: User enters email/password → submits → verifies email → enters profile info → confirms
Then:
- User redirected to dashboard (SCR-001)
- Welcome message displayed with user name
- User session is active and persisted
- KPI-001 (activation) event tracked with timestamp
- UJ-000 completion confirmed
Validation Method: Both (Automated + manual verification of final state)
Automation: tests/e2e/onboarding.spec.ts
Priority: Critical
Core Principle: Test-First
> Tests are not an afterthought. They are the **contract** that defines what "done" means. > If you can't write the test, you don't understand the requirement.
Write TEST- entries **before** writing code. This forces clarity about what you're building.
If you cannot write a concrete Given-When-Then for a specification, the requirement is ambiguous. Do not write a vague test and move on. Instead, identify the specific ID (API-XXX, BR-XXX) that is unclear, note the competing interpretations, and log an AMBIGUITY in the EPIC's Assumptions & Ambiguities table. A test you cannot write precisely is more valuable as a flagged gap than a test you write by guessing.
Test Types
| Type | What It Tests | When to Use | Scope | |------|---------------|-------------|-------| | **Unit** | Single function/method | Business logic, calculations | Smallest unit | | **Integration** | Component boundaries | API ↔ Database | Module level | | **E2E** | Full user flow | Critical journeys | System level | | **Contract** | API shape/types | External integrations | Interface level | | **Performance** | Speed/load | Critical paths | Benchmark |
Coverage Requirements
| ID Type | Minimum Coverage | Rationale | |---------|------------------|-----------| | **API-** | 1 happy path + 1 error case per endpoint | Endpoints are integration points | | **BR-** | 1 test per rule, including boundary cases | Rules are product logic | |
Read more
name: prd-v07-test-planning description: Define test cases BEFORE implementation, ensuring every API, business rule, and user journey has verifiable acceptance criteria during PRD v0.7 Build Execution. Triggers on requests to define tests, plan test coverage, create test cases, or when user asks "define tests", "test planning", "what to test?", "test cases", "test coverage", "TEST-", "test-first". Consumes EPIC- (scope), API-, DBT-, BR-, UJ-. Outputs TEST- entries with Given-When-Then format. Feeds v0.7 Implementation Loop. context: fork allowed-tools: - Read - Write - Edit - Glob - Grep - Bash
Test Planning
Position in workflow: v0.7 Epic Scoping → **v0.7 Test Planning** → v0.7 Implementation Loop
Consumes
This skill requires prior work from v0.7 Epic Scoping and v0.6 specifications:
- **EPIC-\* entries** (from v0.7 Epic Scoping) — EPIC scope defines test boundaries; test plan must cover all APIs/BRs/UJs within EPIC Context & IDs section
- **API-\* endpoint contracts** (from v0.6 Technical Specification) — Each endpoint has request/response shape and error codes that must be tested
- **DBT-\* data model specifications** (from v0.6 Technical Specification) — Schema constraints, relationships, and business rules enforce data integrity tests
- **BR-\* business rules** (from v0.3 Commercial Model) — Each rule must have at least one test verifying positive (rule allows) and negative (rule blocks) cases
- **UJ-\* user journey entries** (from v0.4 User Journeys) — Critical journeys need E2E tests verifying complete flow from trigger to value moment
This skill assumes EPIC- entries are complete with full API-/DBT-/BR-/UJ- references in Context & IDs section.
Produces
This skill creates/updates:
- **TEST-\* entries** (test case specifications, automation path) — Concrete, verifiable test cases with Given-When-Then format, test type, and coverage mapping to upstream IDs
- **Test coverage matrix** (per EPIC) — Validation showing every API- endpoint, BR- rule, and core UJ- journey has TEST- entries; identifies gaps
- **Test automation specification** — For each Critical/High priority TEST-, identifies test file path and automation framework (unit/integration/E2E)
All TEST- entries are **acceptance criteria specifications**, not confidence-based. They are:
- **Derivable from upstream IDs** (every TEST- ties to specific API-/BR-/UJ-/DBT-)
- **Executable** (Given-When-Then format is testable; automation paths are specified)
- **Complete for acceptance** (passing all TEST- for EPIC means EPIC is done)
- **Focused on behavior** (tests what the system does, not implementation details)
Example TEST- entry (API endpoint test):
TEST-001: User creation succeeds with valid data
Type: Integration
Tests: API-001 (POST /users), BR-001 (email uniqueness), DBT-010 (users table)
EPIC: EPIC-01
Given: No user with email "test@example.com" exists, database ready
When: POST /api/users with { email: "test@example.com", password: "Valid123!" }
Then:
- Response status: 201 Created
- Response body contains user id and email
- User record exists in DBT-010 (users table)
- Password is hashed, not plaintext
- Email verification email queued
Validation Method: Automated
Automation: tests/api/users.test.ts (Integration test)
Priority: CriticalExample TEST- entry (Business rule test):
TEST-005: Password validation enforces minimum length Type: Unit Tests: BR-002 (password requirements) EPIC: EPIC-01 Given: Password validation function configured per BR-002 When: Validate password "weak" (length 4) Then: - Returns validation failure - Error message: "Password must be at least 8 characters" - No user record created Validation Method: Automated Automation: tests/unit/validation.test.ts Priority: High
Example TEST- entry (User journey E2E test):
TEST-010: Onboarding journey completes successfully Type: E2E Tests: UJ-000 (onboarding), API-001 (signup), API-002 (login), SCR-001 (dashboard) EPIC: EPIC-01 Given: New user on signup page, all services ready When: User enters email/password → submits → verifies email → enters profile info → confirms Then: - User redirected to dashboard (SCR-001) - Welcome message displayed with user name - User session is active and persisted - KPI-001 (activation) event tracked with timestamp - UJ-000 completion confirmed Validation Method: Both (Automated + manual verification of final state) Automation: tests/e2e/onboarding.spec.ts Priority: Critical
Core Principle: Test-First
> Tests are not an afterthought. They are the **contract** that defines what "done" means. > If you can't write the test, you don't understand the requirement.
Write TEST- entries **before** writing code. This forces clarity about what you're building.
If you cannot write a concrete Given-When-Then for a specification, the requirement is ambiguous. Do not write a vague test and move on. Instead, identify the specific ID (API-XXX, BR-XXX) that is unclear, note the competing interpretations, and log an AMBIGUITY in the EPIC's Assumptions & Ambiguities table. A test you cannot write precisely is more valuable as a flagged gap than a test you write by guessing.
Test Types
| Type | What It Tests | When to Use | Scope | |------|---------------|-------------|-------| | **Unit** | Single function/method | Business logic, calculations | Smallest unit | | **Integration** | Component boundaries | API ↔ Database | Module level | | **E2E** | Full user flow | Critical journeys | System level | | **Contract** | API shape/types | External integrations | Interface level | | **Performance** | Speed/load | Critical paths | Benchmark |
Coverage Requirements
| ID Type | Minimum Coverage | Rationale | |---------|------------------|-----------| | **API-** | 1 happy path + 1 error case per endpoint | Endpoints are integration points | | **BR-** | 1 test per rule, including boundary cases | Rules are product logic | |
PRD-driven Context Engineering: A systematic approach to building AI-powered products using progressive documentation and context-aware development workflows
Repo: mattgierhart/PRD-driven-context-engineering
Other skills on prd-driven-context-engineering.
- /SKILL_TEMPLATE
[1-2 sentence description of what this skill does]. Triggers on [specific phrases/contexts that should activate this skill]. Outputs [what the skill produces].
Open skill - /ghm-gate-check
Validates gate criteria before PRD lifecycle advancement by delegating to the readiness scoring pipeline (scripts/readiness.py). Returns a graduated PASS / WARN / BLOCK verdict with top blockers and their causal chain. Triggers before advancing from v0.X to v0.Y or explicit
Open skill - /ghm-harvest
Extracts durable insights from temp/ files to SoT during EPIC Phase E. Triggers at EPIC completion or explicit `/ghm-harvest` invocation. Outputs new SoT entries and archive manifest.
Open skill - /ghm-id-register
Validates and registers new SoT IDs with cross-reference integrity. Triggers when creating BR-XXX, UJ-XXX, API-XXX, or CFD-XXX entries. Outputs formatted SoT entry with validated cross-references.
Open skill - /ghm-self-install
Install the PRD-Driven Context Engineering methodology into a fresh OR existing repository — the subscription-native alternative to forking the whole repo. Runs an interactive wizard that seeds the framework (.claude/ hooks, skills, agents, rules, scripts) without clobbering
Open skill - /ghm-sot-builder
Creates new Source of Truth (SoT) files when existing templates don't fit your needs. Triggers on requests to create a new SoT file, add a new artifact type, or when user says "I need to track [X] but there's no SoT for it", "create SoT", "new source of truth". Outputs a
Open skill

