tdd-alignment
Skill85 starsChanged 6 months agoApache-2.0View on GitHub
Use this skill at SOP Step 2 to verify and align a Technical Design Document (TDD) with the final PRD: checks every PRD-stated acceptance criterion has a corresponding test/verification approach, every named stage in PRD has a TDD validation strategy, and every L3/L4 data field has a desensitization / audit step planned. Produces an alignment report and inserts patches into TDD where gaps exist. Chinese trigger examples: "TDD 对齐", "TDD 验收对齐", "测试设计对齐 PRD", "Step 2". Do NOT use for unit-test writing (use during Step 9), code-level design review (Step 8), or when TDD is missing entirely (escalate to author). Success = TDD covers 100% of PRD acceptance criteria with named test strategies; PHI handling addressed; staging tests defined.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ask-questions-if-underspecifiedSkill
- audit-snapshot-microSkill
- audit-snapshotSkill
- compliance-precheckSkill
- compliance-reviewSkill
- memory-curateSkill
- mocking-stubbingSkill
- openspec-apply-changeSkill
- openspec-continue-changeSkill
- openspec-new-changeSkill
- openspec-verify-changeSkill
- phi-desensitizeSkill
- prd-authorSkill
- prd-implementation-precheckSkill
- prd-precheckSkill
- prdSkill
- prompt-injection-scanSkill
- quick-fixSkill
- requesting-code-reviewSkill
- systematic-debuggingSkill
- task-decompositionSkill
- test-data-generationSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 67
After PASS, proceed to Step 3 (OpenSpec change creation).
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TDD Alignment (Step 2)
Core mental model
The TDD is the bridge between what (PRD) and how-to-test (later steps). Misalignment here propagates downstream: an acceptance criterion with no test design becomes an acceptance criterion with no test, becomes a feature shipped without proof.
What it produces
TDD_ALIGNMENT.md with:
- Coverage table: each PRD acceptance criterion → TDD test strategy
- PHI handling table: each L3/L4 field → desensitization step in TDD
- Stage validation table: each PRD stage → TDD's stage-level test plan
- Gaps list (sorted by severity)
Active context bundle
Always load first
- This
SKILL.md - Final PRD
- Submitted TDD
COMPLIANCE_TAG.md(PHI field list)
Load on demand
reference/test-strategy-catalog.md(unit / integration / e2e / chaos / compliance / replay)
Workflow
- Extract PRD acceptance criteria into a flat list (numbered).
- For each criterion, find the TDD section that addresses it; record (criterion → tdd-section + test-strategy).
- Any criterion without a target → gap.
- For every L3/L4 field in COMPLIANCE_TAG, locate desensitization plan in TDD; missing → gap.
- For every PRD stage, locate the corresponding TDD stage validation; missing → gap.
- Emit report; if gaps exist, suggest concrete TDD patches.
Hard gate checklist
- 100% of PRD criteria covered (no gaps)
- Every L3/L4 field has desensitization step named in TDD
- Each PRD stage has corresponding TDD stage validation
- Test strategy named (not just "we'll test it")
Common failure modes
- "Tests will be written later" handwave: TDD says "comprehensive testing" without naming approach. Mitigation: require strategy name from
reference/test-strategy-catalog.md. - Forgotten staging tests: PRD has 3 stages, TDD only describes final-state tests. Mitigation: per-stage row in alignment table.
- PHI assumed handled by infra: developer assumes desensitize happens "somewhere". Mitigation: explicit row per field.
Handoff
After PASS, proceed to Step 3 (OpenSpec change creation).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

