Use when you have a written implementation plan to execute in a separate session with review checkpoints
npx skills add po-sen/skills --skill "sdd-spec"
Install specific skill from multi-skill repository
# Description
>-
# SKILL.md
name: sdd-spec
description: >-
Convert rough ideas into Spec-Driven Development artifacts: problem statement, requirements,
design, task plan, and test plan. Use when the user asks for SDD/specs, to clarify requirements,
or to turn a rough idea into an implementable plan before coding.
sdd-spec
Purpose
- Turn rough ideas into a clear, verifiable spec package before coding.
When to Use
- Follow the trigger guidance in the frontmatter description.
File IO rule
- Always create/update files in the repo (not only chat output).
- Must create
specs/<YYYY-MM-DD>-<slug>/and write the spec files there. - If the user only wants a draft, still write files, but mark them via the document header:
- Set
status: DRAFTin YAML frontmatter. - Do NOT add any text before the leading
---(keeps frontmatter valid).
Inputs
- Rough idea or problem statement.
- Target users or stakeholders and goals.
- In-scope vs out-of-scope.
- Constraints (tech, time, cost, compliance).
- Integrations or dependencies.
- Non-functional requirements or quality targets.
Outputs
- A spec folder under
specs/<YYYY-MM-DD>-<slug>/. - Quick mode required output:
00_problem.md01_requirements.md03_tasks.md- Quick mode optional output:
04_test_plan.md- Full mode output:
00_problem.md01_requirements.md02_design.md03_tasks.md04_test_plan.md- Explicit assumptions and open questions.
Conventions
- Spec folder:
specs/<YYYY-MM-DD>-<slug>/(slug = kebab-case, short and specific).
Document header rules
- Every spec file MUST start with YAML frontmatter (
---...---). - Fill these fields in every produced file:
spec_date:<YYYY-MM-DD>(real date)slug:<slug>(real slug)mode:QuickorFull(match selected mode)status:DRAFTorREADYowners: at least one owner/team if known, else keep placeholder- Links MUST NOT point to non-existent files:
- Use
nullwhen a doc is not produced (e.g.,links.design: nullin Quick mode). - If you later produce the doc, update links in the other spec docs immediately.
Slug rules
- Source: 3-5 keywords from the problem or title.
- Format: lowercase, kebab-case, no punctuation.
- Remove filler words (a/an/the/of/for/and, etc.).
- Max length: 40 characters.
IDs and traceability
- Requirement IDs:
- Functional:
FR-001,FR-002, ... - Non-functional:
NFR-001, ... - Task IDs:
T-001,T-002, ... - Test case IDs:
TC-001,TC-002, ... - Traceability rule:
- Every
T-XXXMUST reference one or moreFR/NFRIDs. - Every
TC-XXXMUST reference one or moreFR/NFRIDs.
Quality bar
- Requirements must be verifiable (acceptance criteria / measurable targets).
- Design must cover: flows, data, contracts, failure modes, observability, security.
- Task plan must be ordered, small, independently verifiable, and traceable.
Modes
Quick mode (default for small changes)
Use when:
- 1-2 endpoints / a small feature flag / a simple refactor
- No new integrations, no new persistent data model, no risky rollout
Produce:
- Required:
00_problem.md01_requirements.md03_tasks.md- Optional:
04_test_plan.md(recommended)
Skip:
02_design.mdunless any of these are true:- New DB schema / migrations
- New external integration
- Non-trivial failure modes / async flow
- Meaningful NFR impact (latency, availability, security)
Full mode
Use when any of the "Skip" triggers above apply. Produce all 5 files.
Steps
- Scaffold first (must happen before writing content):
- Derive
<YYYY-MM-DD>and<slug>using "Slug rules". - Create
specs/<YYYY-MM-DD>-<slug>/if missing. - Create required Quick-mode files by copying templates (not empty files):
00_problem.mdfromassets/00_problem_template.md01_requirements.mdfromassets/01_requirements_template.md03_tasks.mdfromassets/03_tasks_template.md
- Populate document headers (
spec_date,slug,mode,status) immediately.- Default
mode: Quickandstatus: DRAFTduring scaffolding (safe defaults). - After mode is decided, update
mode(andlinks) across all produced files to match.
- Default
- Ask the minimum clarifying questions needed to fill gaps (goal/value, scope, constraints,
acceptance criteria, integrations, NFRs). If answers are missing, state assumptions explicitly. - Decide mode (Quick or Full) using the triggers under "Modes" and record the decision and
rationale in03_tasks.md(or00_problem.mdif you prefer). - After deciding mode:
- Update YAML frontmatter
modein every already-produced spec file to match (Quick/Full). - If switching to Full:
- Create
02_design.mdfrom template and setlinks.designto02_design.md. - Create
04_test_plan.mdfrom template and setlinks.test_planto04_test_plan.md. - After creating new docs, immediately update their YAML frontmatter fields (
spec_date,
slug,mode,status, andlinks) to match the selected mode. - Update links in
00_problem.md,01_requirements.md,03_tasks.md:links.design: 02_design.mdlinks.test_plan: 04_test_plan.md
- If staying Quick:
- Keep
links.design: null. - If you decide to produce
04_test_plan.md, create it and setlinks.test_planin all
produced docs.
- Update YAML frontmatter
- Fill
00_problem.mdfromassets/00_problem_template.mdwith concrete context, goals,
non-goals, and success metrics. - Fill
01_requirements.mdfromassets/01_requirements_template.md. Ensure every functional
requirement has acceptance criteria and NFRs are measurable. - If Full mode (or any "Skip" triggers apply):
- Ensure
02_design.mdexists (create if missing), then fill it from
assets/02_design_template.md. - Fill
03_tasks.mdfromassets/03_tasks_template.md. Order tasks, make each independently
verifiable, and link tasks back to requirements. - If producing
04_test_plan.md: - In Full mode: MUST produce
04_test_plan.md. - In Quick mode: OPTIONAL (recommended) to produce
04_test_plan.md. - Ensure
04_test_plan.mdexists (create if missing), then fill it from
assets/04_test_plan_template.md. - Cover unit/integration/e2e as appropriate, plus edge cases and NFR verification.
- If produced:
- Set
links.test_plan: 04_test_plan.mdin00_problem.md,01_requirements.md,
03_tasks.md.
- Set
- Provide a readiness checklist. Do not change code until the spec package exists. If the user
requests immediate coding, produce a minimal spec package first and proceed with explicit,
labeled assumptions (do not invent integrations/constraints silently). - If the Ready-to-code checklist is satisfied:
- Before setting
READY, run the spec-lint checks below and ensure they pass. - Update
status: READYin the YAML frontmatter of every produced spec file in the folder (keep
statuses consistent across docs).
Spec-lint (recommended)
Run these checks against the spec folder before marking status: READY.
# Replace <SPEC_DIR> with specs/<YYYY-MM-DD>-<slug>
SPEC_DIR="<SPEC_DIR>"
set -euo pipefail
fail() { echo "β $1" >&2; exit 1; }
# 1) Header placeholders must be gone before READY
if rg -n "<YYYY-MM-DD>|<slug>|<name-or-team>" "$SPEC_DIR"; then
fail "header placeholders remain"
fi
# 2) Traceability placeholders must be gone
if rg -n "FR-\\?\\?\\?|NFR-\\?\\?\\?|T-\\?\\?\\?|TC-\\?\\?\\?" "$SPEC_DIR"; then
fail "traceability placeholders remain"
fi
# 3) Required link integrity (no dangling links)
if rg -n "^\\s*design:\\s*02_design\\.md\\s*$" "$SPEC_DIR" >/dev/null; then
test -f "$SPEC_DIR/02_design.md" || fail "links.design points to missing 02_design.md"
fi
if rg -n "^\\s*test_plan:\\s*04_test_plan\\.md\\s*$" "$SPEC_DIR" >/dev/null; then
test -f "$SPEC_DIR/04_test_plan.md" || fail "links.test_plan points to missing 04_test_plan.md"
fi
# 4) Mode consistency (no mixed Quick/Full in the same spec folder)
HAS_QUICK=0
HAS_FULL=0
if rg -n "^mode:\\s*Quick\\s*$" "$SPEC_DIR" >/dev/null; then HAS_QUICK=1; fi
if rg -n "^mode:\\s*Full\\s*$" "$SPEC_DIR" >/dev/null; then HAS_FULL=1; fi
if [ "$HAS_QUICK" -eq 1 ] && [ "$HAS_FULL" -eq 1 ]; then
fail "mode mismatch: both Quick and Full exist in the same spec folder"
fi
# 5) Full mode completeness + link sanity
if [ "$HAS_FULL" -eq 1 ]; then
test -f "$SPEC_DIR/02_design.md" || fail "Full mode requires 02_design.md"
test -f "$SPEC_DIR/04_test_plan.md" || fail "Full mode requires 04_test_plan.md"
if rg -n "^\\s*design:\\s*null\\s*$" "$SPEC_DIR"; then
fail "Full mode must not have links.design: null"
fi
if rg -n "^\\s*test_plan:\\s*null\\s*$" "$SPEC_DIR"; then
fail "Full mode must not have links.test_plan: null"
fi
fi
# 6) Status consistency (no mixed READY/DRAFT in the same spec folder)
HAS_READY=0
HAS_DRAFT=0
if rg -n "^status:\\s*READY\\s*$" "$SPEC_DIR" >/dev/null; then HAS_READY=1; fi
if rg -n "^status:\\s*DRAFT\\s*$" "$SPEC_DIR" >/dev/null; then HAS_DRAFT=1; fi
if [ "$HAS_READY" -eq 1 ] && [ "$HAS_DRAFT" -eq 1 ]; then
fail "status mismatch: both READY and DRAFT exist in the same spec folder"
fi
Ready-to-code checklist
Quick mode checklist
- [ ]
specs/<YYYY-MM-DD>-<slug>/exists and contains00_problem.md,01_requirements.md,
03_tasks.md - [ ] Document headers are filled (
spec_date,slug,mode,status) with real values (no
<...>placeholders) - [ ] Mode decision and rationale is recorded (and why
02_design.mdis skipped) - [ ] Every
FR-XXXhas acceptance criteria - [ ] Every
NFR-XXXis measurable (targets, limits, SLO-like) if applicable - [ ] Every
T-XXXlinks toFR/NFRIDs - [ ] If
04_test_plan.mdis skipped,03_tasks.mdincludes explicit validation steps per task - [ ] Spec-lint checks pass
- [ ] Set
status: READYacross produced docs (keep statuses consistent)
Full mode checklist
- [ ]
specs/<YYYY-MM-DD>-<slug>/exists and contains all 5 files - [ ] Document headers are filled (
spec_date,slug,mode,status) with real values (no
<...>placeholders) - [ ] Every
FR-XXXhas acceptance criteria - [ ] Every
NFR-XXXis measurable (targets, limits, SLO-like) - [ ] Design covers flows, data, contracts, failure modes, observability, security
- [ ] Every
T-XXXlinks toFR/NFRIDs - [ ] Every
TC-XXXlinks toFR/NFRIDs - [ ] Spec-lint checks pass
- [ ] Set
status: READYacross all docs (keep statuses consistent)
Notes
- Treat the spec as the source of truth; update the spec before changing code.
- Keep templates minimal. Adapt to existing repo conventions (ADR/RFC/docs) but preserve the section
structure. - Avoid inventing integrations or requirements. Ask or mark as assumptions.
- Prefer concise, testable statements over narrative prose.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.