Skip to content

Commit 4023bd7

Browse files
committed
feat: add structured spec discovery step to proposal instruction
Replace vague "Check openspec/specs/ for existing spec names" with a concrete CLI-based discovery step using `openspec list --specs --json --detail`. This gives the AI a repeatable workflow for identifying New vs Modified capabilities before writing the Capabilities section, with a graceful fallback for environments where --detail is not yet available. Closes #901
1 parent afdca0d commit 4023bd7

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

schemas/spec-driven/schema.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ artifacts:
1313
- **Why**: 1-2 sentences on the problem or opportunity. What problem does this solve? Why now?
1414
- **What Changes**: Bullet list of changes. Be specific about new capabilities, modifications, or removals. Mark breaking changes with **BREAKING**.
1515
- **Capabilities**: Identify which specs will be created or modified:
16-
- **New Capabilities**: List capabilities being introduced. Each becomes a new `specs/<name>/spec.md`. Use kebab-case names (e.g., `user-auth`, `data-export`).
17-
- **Modified Capabilities**: List existing capabilities whose REQUIREMENTS are changing. Only include if spec-level behavior changes (not just implementation details). Each needs a delta spec file. Check `openspec/specs/` for existing spec names. Leave empty if no requirement changes.
16+
- Before filling this in, discover existing specs by running `openspec list --specs --json --detail`. Review each spec's `overview` to understand what it covers. If `--detail` is unavailable, browse `openspec/specs/` and read each spec's Purpose section instead.
17+
- **New Capabilities**: List capabilities being introduced that don't overlap with any existing spec. Each becomes a new `specs/<name>/spec.md`. Use kebab-case names (e.g., `user-auth`, `data-export`).
18+
- **Modified Capabilities**: List existing capabilities whose REQUIREMENTS are changing. Only include if spec-level behavior changes (not just implementation details). Each needs a delta spec file. Use the `id` from the catalog output above. Leave empty if no requirement changes.
1819
- **Impact**: Affected code, APIs, dependencies, or systems.
1920
2021
IMPORTANT: The Capabilities section is critical. It creates the contract between
21-
proposal and specs phases. Research existing specs before filling this in.
22+
proposal and specs phases. Always run spec discovery before filling this in.
2223
Each capability listed here will need a corresponding spec file.
2324
2425
Keep it concise (1-2 pages). Focus on the "why" not the "how" -

src/core/templates/workflows/continue-change.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ The artifact types and their purpose depend on the schema. Use the \`instruction
9898
9999
Common artifact patterns:
100100
101-
**spec-driven schema** (proposal specs design tasks):
101+
**spec-driven schema** (proposal \u2192 specs \u2192 design \u2192 tasks):
102102
- **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
103+
- Before writing Capabilities, run \`openspec list --specs --json --detail\` to discover existing specs. Compare each spec's overview against the proposed change to determine New vs Modified capabilities.
103104
- The Capabilities section is critical - each capability listed will need a spec file.
104105
- **specs/<capability>/spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name).
105106
- **design.md**: Document technical decisions, architecture, and implementation approach.
@@ -217,8 +218,9 @@ The artifact types and their purpose depend on the schema. Use the \`instruction
217218
218219
Common artifact patterns:
219220
220-
**spec-driven schema** (proposal specs design tasks):
221+
**spec-driven schema** (proposal \u2192 specs \u2192 design \u2192 tasks):
221222
- **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
223+
- Before writing Capabilities, run \`openspec list --specs --json --detail\` to discover existing specs. Compare each spec's overview against the proposed change to determine New vs Modified capabilities.
222224
- The Capabilities section is critical - each capability listed will need a spec file.
223225
- **specs/<capability>/spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name).
224226
- **design.md**: Document technical decisions, architecture, and implementation approach.

0 commit comments

Comments
 (0)