Create and manage specs including capabilities, features, stories, PRDs, TRDs, and ADRs. Use when creating a feature, creating a story, adding specs, or setting up spec structure.
<accessing_templates> FIRST to understand where templates are located<structure_definition> for specs/ directory hierarchy, BSP numbering, co-located tests<adr_templates> for Architectural Decision Record patterns<pdr_templates> for Product Decision Record patterns<requirement_templates> for Product and Technical Requirements<work_item_templates> for capability, feature, story, and DONE.md patternsUse progressive disclosure - read only what you need.
When this skill is invoked, Claude Code provides the base directory in the loading message:
Base directory for this skill: {skill_dir}
Use this exact path for all file access. Throughout this documentation, ${SKILL_DIR} is a placeholderβClaude must substitute it manually from the loading message.
IMPORTANT: Do NOT search the project directory for skill files.
The skill's base directory path pattern:
.claude/plugins/cache/{marketplace-name}/{plugin-name}/{version}/skills/managing-specs/
Example: For outcomeeng marketplace, specs plugin version 0.3.3:
${SKILL_DIR} = .claude/plugins/cache/outcomeeng/specs/0.3.3/skills/managing-specs/
All templates are under ${SKILL_DIR}/templates/:
${SKILL_DIR}/
βββ SKILL.md # This file
βββ templates/
βββ decisions/
β βββ architectural-decision.adr.md
β βββ product-decision.pdr.md
βββ requirements/
β βββ product-change.prd.md
β βββ technical-change.trd.md
βββ work-items/
βββ capability-name.capability.md
βββ feature-name.feature.md
βββ story-name.story.md
βββ DONE.md
Always use the skill's base directory, not the user's project directory.
# Pattern
Read: ${SKILL_DIR}/templates/{category}/{template-name}
# Example: Read feature template
Read: ${SKILL_DIR}/templates/work-items/feature-name.feature.md
# With actual path (example for outcomeeng marketplace, version 0.3.3)
Read: .claude/plugins/cache/outcomeeng/specs/0.3.3/skills/managing-specs/templates/work-items/feature-name.feature.md
If you cannot find a template:
${SKILL_DIR}/templates/... or .claude/plugins/cache/...Glob: .claude/plugins/cache/**/managing-specs/templates/**/*.mdspecs/templates/)specs/
βββ [product-name].prd.md # Product-wide PRD
βββ decisions/ # Product-wide ADRs (optional)
β βββ adr-NN_{slug}.md
βββ work/
βββ backlog/
βββ doing/
β βββ capability-NN_{slug}/
β βββ {slug}.capability.md
β βββ {slug}.prd.md # Optional capability-scoped PRD from which the capability work item (`{slug}.capability.md`) is derived
β βββ {slug}.prd.md # Optional capability-scoped TRD from which capability-scoped ADRs are derived
β βββ decisions/ # Capability-scoped ADRs
β βββ tests/
β βββ feature-NN_{slug}/
β βββ {slug}.prd.md # Optional capability-scoped PRD from which the feature spec in `{slug}.feature.md` is derived
β βββ {slug}.trd.md # Optional capability-scoped TRD from which the feature-scoped ADRs are derived
β βββ {slug}.feature.md
β βββ decisions/ # Feature-scoped ADRs
β βββ tests/
β βββ story-NN_{slug}/
β βββ {slug}.story.md
β βββ tests/
βββ done/
Capability: E2E scenario with product-wide impact
specs/.../capability-NN/tests/ (E2E level)Feature: Integration scenario with specific functionality
specs/.../feature-NN/tests/ (Integration level)Story: Unit-tested atomic implementation
specs/.../story-NN/tests/ (Unit level)<bsp_sibling_uniqueness> below)specs/.../tests/ permanently (no graduation)π¨ CRITICAL: BSP numbers are ONLY unique among siblings at the same level.
capability-21/feature-01/story-54 β One story-54
capability-22/feature-01/story-54 β DIFFERENT story-54
capability-21/feature-02/story-54 β DIFFERENT story-54
ALWAYS use the FULL PATH when referencing work items:
| β WRONG (Ambiguous) | β CORRECT (Unambiguous) |
|---|---|
| "story-54" | "capability-21/feature-54/story-54" |
| "implement feature-01" | "implement capability-21/feature-01" |
| "Continue with story-54" | "Continue capability-21/feature-54/story-54" |
Why this matters:
When communicating about work items:
specs/work/| State | Meaning |
|---|---|
| OPEN | Work not started |
| IN_PROGRESS | Work underway |
| DONE | Complete |
Lower BSP number = must complete FIRST.
You CANNOT work on item N until ALL items with numbers < N are DONE.
This applies at every level:
| If you see... | It means... |
|---|---|
feature-48 before feature-87 |
feature-48 MUST be DONE before feature-87 starts |
story-21 before story-32 |
story-21 MUST be DONE before story-32 starts |
feature-48 [OPEN], feature-87 [IN_PROGRESS] |
BUG: Dependency violation |
1. List all work items in BSP order (capability β feature β story)
2. Return the FIRST item where status β DONE
3. That item blocks everything after it
Example:
feature-48_test-harness [OPEN] β Was added after feature-87 but blocks it
feature-87_e2e-workflow [IN_PROGRESS] β Was already started, then dependency discovered
Next work item: feature-48_test-harness β its first OPEN story.
Use position 21 (leaves room for ~10 items before/after):
# First feature in a new capability
capability-21_foo/
βββ feature-21_first-feature/
Use midpoint: new = floor((left + right) / 2)
# Insert between feature-21 and feature-54
new = floor((21 + 54) / 2) = 37
feature-21_first/
feature-37_inserted/ β NEW
feature-54_second/
Use midpoint to upper bound: new = floor((last + 99) / 2)
# Append after feature-54
new = floor((54 + 99) / 2) = 76
feature-21_first/
feature-54_second/
feature-76_appended/ β NEW
NN_{slug}/{slug}.{capability|feature|story}.mdtests/ (create when starting work)Optional:
{topic}.prd.md or {topic}.trd.mddecisions/adr-NNN_{slug}.md${SKILL_DIR}/templates/decisions/architectural-decision.adr.md
Read the template and adapt:
# Read ADR template
Read: ${SKILL_DIR}/templates/decisions/architectural-decision.adr.md
# Adapt for your decision
- State the architectural concern this decision governs (atemporal voice β no history)
- Document the chosen option and rationale
- Specify consequences and trade-offs
- Define compliance criteria
ADRs can exist at three levels:
specs/decisions/adr-NN_{slug}.mdspecs/work/doing/capability-NN/decisions/adr-NN_{slug}.mdspecs/work/doing/.../feature-NN/decisions/adr-NN_{slug}.mdStories inherit decisions from parent feature/capability.
Format: adr-{NN}_{slug}.md
use-postgresql-for-persistence)Lower BSP number = must decide first (within scope).
ADRs follow the same BSP numbering as work items:
Use position 21 (leaves room for ~10 items before/after):
decisions/adr-21_first-decision.md
Use midpoint: new = floor((left + right) / 2)
# Insert between adr-21 and adr-54
new = floor((21 + 54) / 2) = 37
decisions/adr-21_type-safety.md
decisions/adr-37_inserted-decision.md β NEW
decisions/adr-54_cli-framework.md
Use midpoint to upper bound: new = floor((last + 99) / 2)
# Append after adr-54
new = floor((54 + 99) / 2) = 76
decisions/adr-21_type-safety.md
decisions/adr-54_cli-framework.md
decisions/adr-76_appended-decision.md β NEW
Scope boundaries: ADRs are scoped to product/capability/feature.
Within scope: Lower BSP = must decide first.
| If you see... | It means... |
|---|---|
adr-21_type-safety.md |
Foundational decision, must decide first |
adr-37_validation.md |
Depends on adr-21, must come after |
adr-54_cli-framework.md |
May depend on both adr-21 and adr-37 |
Cross-scope dependencies: Must be documented explicitly in the ADR content.
| Dependency | How to Express |
|---|---|
| Feature ADR depends on capability ADR | Reference in "Context" section with link |
| Capability ADR depends on product ADR | Reference in "Context" section with link |
Problem: Sequential numbering (01, 02, 03) cannot accommodate discovered dependencies.
Example: You have decisions adr-01, adr-02, adr-03. You discover adr-02 needs a prior decision about type safety. With sequential numbering, you must renumber all subsequent ADRs.
Solution: BSP numbering allows insertion at any point using midpoint calculation.
Problem: If ADR file is renumbered (e.g., adr-23 β adr-37), content with embedded numbers becomes stale.
Examples:
# ADR 23: Foo - wrong after renumberingSolution:
# ADR: Foo (document type prefix, no number)[Foo](decisions/adr-37_foo.md) (markdown link with path)Problem: Plain text references like "ADR-23" or even `adr-23_foo.md` break when files are renumbered.
Solution: Markdown links [Decision Title](relative/path/to/adr-NN_slug.md):
${SKILL_DIR}/templates/decisions/product-decision.pdr.md
Read the template and adapt:
# Read PDR template
Read: ${SKILL_DIR}/templates/decisions/product-decision.pdr.md
# Adapt for your decision
- State the product behavior this decision governs (atemporal voice β no history)
- Describe the chosen product behavior
- List product invariants users can rely on
- Specify compliance criteria for product behavior
PDRs can exist at three levels:
specs/decisions/pdr-NN_{slug}.mdspecs/work/doing/capability-NN/decisions/pdr-NN_{slug}.mdspecs/work/doing/.../feature-NN/decisions/pdr-NN_{slug}.mdStories inherit product decisions from parent feature/capability.
Format: pdr-{NN}_{slug}.md
simulation-lifecycle-phases)| Aspect | ADR | PDR |
|---|---|---|
| Governs | Code architecture | Product behavior |
| Invariants | Algebraic code properties | Observable user guarantees |
| Compliance | Code review criteria | Product behavior validation |
| Example | "Use PostgreSQL for persistence" | "Simulation has three phases" |
When to use which:
See [Type Safety](adr-21_type-safety.md) for validation approach.
<!-- Feature ADR referencing capability ADR -->
This decision builds on [Config Loading](../../decisions/adr-21_config-loading.md).
<!-- Story referencing feature ADR -->
Implementation follows [CLI Structure](../../decisions/adr-21_cli-structure.md).
<!-- From story to capability ADR -->
Architectural constraints: [Commander Pattern](../../decisions/adr-21_commander-pattern.md)
<!-- From feature to product ADR -->
Type system: [Type Safety](../../../../decisions/adr-21_type-safety.md)
β Plain text reference: "See ADR-21"
β Code-only reference: `adr-21_type-safety.md`
β Number-only reference: "ADR 21 specifies..."
Location: ${SKILL_DIR}/templates/requirements/product-change.prd.md
Purpose: Product requirements - user value, customer journey, measurable outcomes
Usage:
# Read PRD template
Read: ${SKILL_DIR}/templates/requirements/product-change.prd.md
# Adapt for product change
- Define user value proposition
- Document measurable outcomes with targets
- Specify acceptance criteria
- Avoid implementation details
Placement:
specs/{product-name}.prd.mdspecs/work/doing/capability-NN/{topic}.prd.mdLocation: ${SKILL_DIR}/templates/requirements/technical-change.trd.md
Purpose: Technical requirements - system architecture, validation strategy, test infrastructure
Usage:
# Read TRD template
Read: ${SKILL_DIR}/templates/requirements/technical-change.trd.md
# Adapt for technical change
- Specify technical architecture
- Define testing strategy (Level 1/2/3)
- Document validation approach
- Identify infrastructure needs
Placement:
specs/work/doing/.../feature-NN/{topic}.trd.md${SKILL_DIR}/templates/work-items/capability-name.capability.md
${SKILL_DIR}/templates/work-items/feature-name.feature.md
${SKILL_DIR}/templates/work-items/story-name.story.md
${SKILL_DIR}/templates/work-items/DONE.md
# For capability
Read: ${SKILL_DIR}/templates/work-items/capability-name.capability.md
Adapt: Replace {slug} with kebab-case name
Fill functional requirements
Add user value context
# For feature
Read: ${SKILL_DIR}/templates/work-items/feature-name.feature.md
Adapt: Replace {slug} with kebab-case name
Specify integration scope
Define component interactions
# For story
Read: ${SKILL_DIR}/templates/work-items/story-name.story.md
Adapt: Replace {slug} with kebab-case name
Detail atomic implementation
List specific functions/classes
# For completion
Read: ${SKILL_DIR}/templates/work-items/DONE.md
Adapt: List co-located tests by level
Document verification steps
Include evidence of completion
Work items follow this pattern:
specs/work/{backlog|doing|done}/{level}-{bsp}_{slug}/{slug}.{level}.md
Examples:
specs/work/doing/capability-21_core-cli/core-cli.capability.mdspecs/work/doing/capability-21_core-cli/feature-10_init/init.feature.mdspecs/work/doing/capability-21_core-cli/feature-15_init/story-87_parse-flags/parse-flags.story.mdTests stay co-located with their work item permanently:
specs/.../capability-NN/tests/*.e2e.test.tsspecs/.../feature-NN/tests/*.integration.test.tsspecs/.../story-NN/tests/*.unit.test.tsDONE.md documents test verification and provides completion evidence.
templates/ subdirectories