Spec & Test Generator Skill
Scope
Use this skill when you want to transform informal requirements (PRD, user stories, notes) into auditable engineering artifacts:
REQUIREMENTS.md with stable IDs (REQ-0001...)
TEST_PLAN.md aligned to a pragmatic test pyramid
TEST_CASES.md with stable test IDs (TEST-0001...)
TRACEABILITY.csv linking REQ <-> TEST
Default mode is pragmatic internal: sufficient rigor without heavy compliance overhead.
A strict preset is included for regulated/high-assurance workflows.
Inputs expected
Provide one or more of:
- PRD markdown file (recommended):
prd.md
- User story list / tickets export (markdown or text)
- Existing spec artifacts (optional), to preserve stable IDs
Optional:
- Target stack info: language/framework (pytest, jest, junit, etc.)
- Quality constraints (latency, security, privacy, reliability)
Outputs produced (stable contract)
Write outputs to spec/ (or a user-specified directory):
REQUIREMENTS.md (always)
- Requirements grouped by feature area
- Each requirement has: ID, statement, rationale, priority, acceptance criteria, edge cases, notes
TEST_PLAN.md (always)
- Unit/integration/e2e strategy
- Test data strategy
- Environment and CI assumptions
- Non-functional test considerations (security, performance) as applicable
TEST_CASES.md (always)
- Each test has: ID, title, type, priority, preconditions, steps, expected, requirements covered
TRACEABILITY.csv (always)
Columns: REQ_ID,TEST_ID,TYPE,PRIORITY
Optional:
tests/ skeletons in the selected framework (if requested)
Stable ID rules (critical)
- Do not renumber existing REQ/TEST IDs when rerunning.
- If an item is edited, keep its ID unless the meaning changes substantially.
- If a requirement splits into two, keep original ID on the closest match and allocate a new ID for the new split requirement.
- Maintain an internal ID map file if present (recommended):
spec/.idmap.json.
Procedure
Step 1 — Parse and segment input
- Identify feature areas / epics.
- Extract functional requirements and non-functional constraints.
- Record assumptions and clarifications needed (but do not block output).
Step 2 — Generate requirements with stable IDs
For each feature area:
- Produce
REQ-xxxx items with:
- Statement (testable)
- Priority (Must/Should/Could; or P0/P1/P2)
- Rationale
- Acceptance Criteria (Given/When/Then OR bullet checks)
- Edge Cases (data bounds, concurrency, failure modes)
- Notes (dependencies, open questions)
Step 3 — Generate test plan
- Propose a pragmatic test pyramid:
- Unit tests for pure logic and validators
- Integration tests for service boundaries (DB, cache, external APIs)
- E2E tests for top user flows (not everything)
- Include environment, data, and CI considerations.
Step 4 — Generate test cases and traceability
For each requirement:
- Create at least one test mapped to it.
- Include negative tests for meaningful failure modes.
- If security/auth exists, include authz + abuse-path tests where applicable.
Step 5 — Validate coverage
- Ensure every requirement has at least one test in
TRACEABILITY.csv.
- Ensure test cases reference at least one requirement.
- If strict preset: enforce stronger criteria (see policy).
Quality gates
- Every
REQ-xxxx has at least one TEST-xxxx.
- Acceptance criteria are objectively verifiable (avoid subjective language).
- Edge cases include at least: invalid input, boundary values, and error handling.
- Keep artifacts concise enough to be useful, but complete enough to implement.
Failure modes & recovery
- If input is ambiguous: list clarifications in an "Open Questions" section, but still produce best-effort requirements/tests.
- If scope is huge: produce an MVP slice first and explicitly mark what is deferred.
Templates and examples
See:
resources/examples/ for demo PRD and expected artifacts.
resources/catalogs/ for edge-case libraries.
policy/ for default internal policy and strict preset.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: spec-test-generator3description: Converts PRDs/user stories into stable-ID requirements (REQ-xxxx), a structured test plan, a test case catalog (TEST-xxxx), and a traceability matrix. Supports iterative updates without renumbering IDs. Ships with pragmatic internal default and strict preset.4---56# Spec & Test Generator Skill78## Scope9Use this skill when you want to transform informal requirements (PRD, user stories, notes) into **auditable engineering artifacts**:10- `REQUIREMENTS.md` with stable IDs (`REQ-0001...`)11- `TEST_PLAN.md` aligned to a pragmatic test pyramid12- `TEST_CASES.md` with stable test IDs (`TEST-0001...`)13- `TRACEABILITY.csv` linking REQ <-> TEST1415Default mode is **pragmatic internal**: sufficient rigor without heavy compliance overhead.16A strict preset is included for regulated/high-assurance workflows.1718## Inputs expected19Provide one or more of:20- PRD markdown file (recommended): `prd.md`21- User story list / tickets export (markdown or text)22- Existing spec artifacts (optional), to preserve stable IDs2324Optional:25- Target stack info: language/framework (pytest, jest, junit, etc.)26- Quality constraints (latency, security, privacy, reliability)2728## Outputs produced (stable contract)29Write outputs to `spec/` (or a user-specified directory):30311) `REQUIREMENTS.md` (always)32- Requirements grouped by feature area33- Each requirement has: ID, statement, rationale, priority, acceptance criteria, edge cases, notes34352) `TEST_PLAN.md` (always)36- Unit/integration/e2e strategy37- Test data strategy38- Environment and CI assumptions39- Non-functional test considerations (security, performance) as applicable40413) `TEST_CASES.md` (always)42- Each test has: ID, title, type, priority, preconditions, steps, expected, requirements covered43444) `TRACEABILITY.csv` (always)45Columns: `REQ_ID,TEST_ID,TYPE,PRIORITY`4647Optional:48- `tests/` skeletons in the selected framework (if requested)4950## Stable ID rules (critical)51- Do not renumber existing REQ/TEST IDs when rerunning.52- If an item is edited, keep its ID unless the meaning changes substantially.53- If a requirement splits into two, keep original ID on the closest match and allocate a new ID for the new split requirement.54- Maintain an internal ID map file if present (recommended): `spec/.idmap.json`.5556## Procedure57### Step 1 — Parse and segment input58- Identify feature areas / epics.59- Extract functional requirements and non-functional constraints.60- Record assumptions and clarifications needed (but do not block output).6162### Step 2 — Generate requirements with stable IDs63For each feature area:64- Produce `REQ-xxxx` items with:65 - Statement (testable)66 - Priority (Must/Should/Could; or P0/P1/P2)67 - Rationale68 - Acceptance Criteria (Given/When/Then OR bullet checks)69 - Edge Cases (data bounds, concurrency, failure modes)70 - Notes (dependencies, open questions)7172### Step 3 — Generate test plan73- Propose a pragmatic test pyramid:74 - Unit tests for pure logic and validators75 - Integration tests for service boundaries (DB, cache, external APIs)76 - E2E tests for top user flows (not everything)77- Include environment, data, and CI considerations.7879### Step 4 — Generate test cases and traceability80For each requirement:81- Create at least one test mapped to it.82- Include negative tests for meaningful failure modes.83- If security/auth exists, include authz + abuse-path tests where applicable.8485### Step 5 — Validate coverage86- Ensure every requirement has at least one test in `TRACEABILITY.csv`.87- Ensure test cases reference at least one requirement.88- If strict preset: enforce stronger criteria (see policy).8990## Quality gates91- Every `REQ-xxxx` has at least one `TEST-xxxx`.92- Acceptance criteria are objectively verifiable (avoid subjective language).93- Edge cases include at least: invalid input, boundary values, and error handling.94- Keep artifacts concise enough to be useful, but complete enough to implement.9596## Failure modes & recovery97- If input is ambiguous: list clarifications in an "Open Questions" section, but still produce best-effort requirements/tests.98- If scope is huge: produce an MVP slice first and explicitly mark what is deferred.99100## Templates and examples101See:102- `resources/examples/` for demo PRD and expected artifacts.103- `resources/catalogs/` for edge-case libraries.104- `policy/` for default internal policy and strict preset.105106---107> Converted and distributed by [TomeVault](https://tomevault.io/claim/akz4ol) — claim your Tome and manage your conversions.108<!-- tomevault:4.0:skill_md:2026-04-15 -->