prd
Generate a PRD or decision-record draft for Full or Standard tier. Use when requirements are brainstormed and a written spec is needed before persona review. Does not freeze, run doc-review, or generate tasks.
- License 许可
- MIT
- 最近更新
- 2026-11-03
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- prd
- description
- Generate a PRD or decision-record draft for Full or Standard tier. Use when requirements are brainstormed and a written spec is needed before persona review. Does not freeze, run doc-review, or generate tasks.
03 SKILL.md 正文
PRD / decision-record draft (/sw-prd)
Port of v1 spec-prd under sw-. Freeze and task generation are separate steps. Generalized into a typed frozen-deliverable author via --type.
Model tier: deep — resolve via python3 scripts/sw_bootstrap.py resolve-model-tier.py -- --skill prd. When using the Task tool for subagent dispatch, resolve concrete model IDs from models.tiers in config (never semantic tier names in subagent model: frontmatter).
Deliverable types
--type |
Path | ID namespace | Brainstorm guard |
|---|---|---|---|
prd (default) |
docs/prds/<n>-<slug>/<n>-prd-<slug>.md |
R-IDs | Full tier requires brainstorm |
decision |
docs/decisions/<n>-<slug>.md |
D-IDs | optional (up-front decisions) |
PRD sections (required, --type prd)
- Overview
- Goals
- Non-Goals
- Requirements (stable R-IDs; carry forward from brainstorm when present). Hyphen and asterisk
RID bullets are both valid:
- **R1** …and* **R1** …(Linear Public Markdown). Spec-rigor on the stored body must extract both; pass consumer--rootto installedspec-rigor-check.py. - Technical Requirements
- Security & Compliance
- Testing Strategy
- Acceptance Scenarios (required for new PRDs —
prdBodyContract: v2) - Success Criteria (required for new PRDs —
prdBodyContract: v2) - Rollout Plan
- Decision Log
- Open Questions
New PRDs authored after PRD 342 unit 4 must set frontmatter prdBodyContract: v2 and include
Acceptance Scenarios and Success Criteria on the PRD body (not in a sibling asset).
Existing PRDs without that contract key are grandfathered and must not be retroactively failed
by the spec-rigor authoring gate.
Decision-record sections (required, --type decision)
- Context
- Decision (stable D-IDs as bullets:
- **D1** ...) - Rationale
- Alternatives
- Consequences
The decision section contract must stay in lockstep with scripts/spec-rigor-check.py --root <consumer-repo> --artifact decision.
Installed spec-rigor requires consumer --root (omit or package-scripts/ parent fails closed).
Asterisk RID bullets (* **D1** / * **R1**) parse on the stored body.
Issue-store authoring (PRD 056 R11–R12)
When effective backend is issue-store:
-
Never create or edit files under
docs/prds/in the code repo. -
Allocate the next PRD number by scanning the issue index / planning graph (not
docs/prds/directory listing). -
Persist via
planning_store.putwith stable unit id<n>-prd-<slug>and virtual body-pathdocs/prds/<n>-<slug>/<n>-prd-<slug>.md. -
Frontmatter traceability uses the same virtual paths; write refs via:
python3 scripts/doc_link.py write-backref --brainstorm <body-path> --prd <body-path> [--brainstorm-unit-id <id>] [--prd-unit-id <id>] -
Handoffs cite unit id + virtual
body-path— not code-repo file paths.
File-store repos: unchanged — paths and file writes below apply.
Path
- PRD:
docs/prds/<n>-<slug>/<n>-prd-<slug>.mdper.shipwright/layout.md. - Decision:
docs/decisions/<n>-<slug>.mdper.shipwright/layout.md.
Tier routing (PRD only)
- Full: require brainstorm doc path as input; refuse to draft without it (R6 ordering).
- Standard: accept triaged request directly (no brainstorm required).
Frontmatter traceability (Full tier — R52/R53)
At save time on the Full path:
- Write
brainstorm: <repo-relative-path>on the PRD viapython3 scripts/doc_link.py write-backref --brainstorm <body-path> --prd <body-path> [--brainstorm-unit-id …] [--prd-unit-id …]. - When the brainstorm is not frozen, write the forward
prd:reference viapython3 scripts/doc_link.py write-forwardref --brainstorm <brainstorm> --prd <prd>.
/sw-freeze re-verifies linkage (doc-link-check.py, R55) and may write the forward ref if still writable (R53).
Fields are documented in .shipwright/layout.md.
DecisionGraph scope (PRD 280 R15)
When a PRD drives engineering decisions that require a DecisionGraph:
-
Persist the graph via
planning_store.putwith unit id<prd-unit-id>-decision-graphand virtual body-pathdocs/planning/decision/<unit-id>/decision-graph.json(sw:decisionissue type). -
Link PRD ↔ graph without code-repo file writes:
python3 scripts/doc_link.py write-decision-graph-link --prd <prd-body-path> [--prd-unit-id <id>] [--graph-unit-id <id>] -
Doc-review and freeze gates validate the
decision-graphback-reference resolves via issue-store handles.
Collision policy
- Same feature/topic, new run: increment
<n>, distinct slug; do not overwrite. - Update existing: edit in place only with explicit user confirmation + Decision Log entry (PRD) or amendment (frozen decision).
- Default: never overwrite without confirmation.
- Refuse to draft over an existing frozen decision record without explicit confirmation.
Numbering
- PRD: scan
docs/prds/for highest<n>, increment, zero-pad to 3 digits. - Decision: scan
docs/decisions/for highest<n>, increment, zero-pad to 3 digits — separate counter.
Domain vocabulary divergence (PRD 280 R10, D4)
After persisting a PRD draft (--type prd only — skip decision records):
-
Run terminology drift detection against the saved body:
# file-store (body on disk) python3 scripts/domain_vocabulary.py check-divergence --file <prd-path> # issue-store (authoritative body in planning store) python3 scripts/domain_vocabulary.py check-divergence --unit-id <prd-unit-id> -
Advisory default —
planning.intelligence.vocabulary.strictModedefaultsfalse;verdict: passwithmaxSeverity: warndoes not block handoff to/sw-doc-review. -
Strict escalation — when
strictMode: true(config or CLI--strict),verdict: failwith exit code20halts/sw-prdbefore doc-review handoff (fail-closed). -
Artifact — results persist read-only at
.cursor/sw-vocabulary-divergence/last.jsonfor downstream doc-review (coherence persona). -
No canonical promotion — divergence output is
humanGated; this step never callsput-termor mutates the vocabulary registry.
Surface a short divergence summary in the /sw-prd report when divergence is non-empty (concepts,
maxSeverity, artifact path).
Handoff
→ /sw-doc-review (not /sw-freeze or /sw-tasks). Resolve Open Questions before freeze (spec-rigor clarify gate on Full tier PRDs).
Open questions
GitHub tracking-issue convention deferred to implementation workstream (003). Default: index + git are the status source — no issue opened unless user requests.
04 同仓库更多 Skills
wrong-name
Missing use when phrase and wrong directory name for critical lint failure.
demo-skill
Demo workflow pack skill fixture. Use when validating workflow-pack-sdk golden paths in CI.
good-skill
Validates Agent Skills spec conformance for fixture trees. Use when testing skills-spec-guard pass paths across core and dist mirrors. Does not ship production skills.
wrong-name
Fixture with name/dir mismatch for guard failure tests. Use when verifying skills-spec-guard rejects invalid identity. Does not ship production skills.
bad-description
Missing the required when trigger phrase in this fixture skill.
dropin-demo
暂无简介