@fission-ai/openspec 1.6.0-beta.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/README.md +28 -1
  2. package/dist/cli/index.js +73 -7
  3. package/dist/commands/change.d.ts +0 -1
  4. package/dist/commands/change.js +90 -50
  5. package/dist/commands/config.js +14 -8
  6. package/dist/commands/doctor.js +9 -4
  7. package/dist/commands/feedback.js +74 -23
  8. package/dist/commands/schema.js +21 -11
  9. package/dist/commands/show.js +5 -2
  10. package/dist/commands/spec.js +20 -24
  11. package/dist/commands/validate.js +18 -3
  12. package/dist/commands/workflow/index.d.ts +1 -1
  13. package/dist/commands/workflow/index.js +1 -1
  14. package/dist/commands/workflow/instructions.d.ts +7 -1
  15. package/dist/commands/workflow/instructions.js +89 -6
  16. package/dist/commands/workflow/shared.d.ts +13 -2
  17. package/dist/commands/workflow/shared.js +34 -4
  18. package/dist/commands/workflow/status.js +7 -2
  19. package/dist/core/archive.d.ts +0 -1
  20. package/dist/core/archive.js +96 -33
  21. package/dist/core/artifact-graph/graph.d.ts +16 -0
  22. package/dist/core/artifact-graph/graph.js +30 -6
  23. package/dist/core/artifact-graph/instruction-loader.d.ts +27 -2
  24. package/dist/core/artifact-graph/instruction-loader.js +55 -7
  25. package/dist/core/artifact-graph/resolver.d.ts +14 -0
  26. package/dist/core/artifact-graph/resolver.js +34 -6
  27. package/dist/core/change-metadata/schema.d.ts +1 -0
  28. package/dist/core/change-metadata/schema.js +6 -0
  29. package/dist/core/change-status-policy.d.ts +1 -1
  30. package/dist/core/command-generation/adapters/amazon-q.d.ts +4 -0
  31. package/dist/core/command-generation/adapters/amazon-q.js +7 -1
  32. package/dist/core/command-generation/adapters/antigravity.js +2 -1
  33. package/dist/core/command-generation/adapters/auggie.js +2 -1
  34. package/dist/core/command-generation/adapters/bob.d.ts +5 -1
  35. package/dist/core/command-generation/adapters/bob.js +6 -5
  36. package/dist/core/command-generation/adapters/claude.js +1 -8
  37. package/dist/core/command-generation/adapters/codebuddy.js +3 -2
  38. package/dist/core/command-generation/adapters/continue.js +3 -2
  39. package/dist/core/command-generation/adapters/costrict.js +2 -1
  40. package/dist/core/command-generation/adapters/crush.js +5 -5
  41. package/dist/core/command-generation/adapters/cursor.js +2 -2
  42. package/dist/core/command-generation/adapters/devin.d.ts +19 -0
  43. package/dist/core/command-generation/adapters/devin.js +36 -0
  44. package/dist/core/command-generation/adapters/factory.js +2 -1
  45. package/dist/core/command-generation/adapters/gemini.js +37 -2
  46. package/dist/core/command-generation/adapters/github-copilot.js +2 -1
  47. package/dist/core/command-generation/adapters/iflow.js +5 -4
  48. package/dist/core/command-generation/adapters/index.d.ts +2 -2
  49. package/dist/core/command-generation/adapters/index.js +2 -2
  50. package/dist/core/command-generation/adapters/junie.js +2 -1
  51. package/dist/core/command-generation/adapters/kiro.js +2 -1
  52. package/dist/core/command-generation/adapters/lingma.js +5 -5
  53. package/dist/core/command-generation/adapters/oh-my-pi.d.ts +2 -2
  54. package/dist/core/command-generation/adapters/oh-my-pi.js +3 -5
  55. package/dist/core/command-generation/adapters/opencode.js +3 -5
  56. package/dist/core/command-generation/adapters/pi.d.ts +2 -2
  57. package/dist/core/command-generation/adapters/pi.js +3 -6
  58. package/dist/core/command-generation/adapters/qoder.js +5 -5
  59. package/dist/core/command-generation/adapters/qwen.d.ts +7 -3
  60. package/dist/core/command-generation/adapters/qwen.js +12 -7
  61. package/dist/core/command-generation/adapters/roocode.d.ts +4 -4
  62. package/dist/core/command-generation/adapters/roocode.js +4 -4
  63. package/dist/core/command-generation/adapters/trae.js +1 -21
  64. package/dist/core/command-generation/adapters/zcode.d.ts +16 -0
  65. package/dist/core/command-generation/adapters/zcode.js +33 -0
  66. package/dist/core/command-generation/generator.d.ts +8 -0
  67. package/dist/core/command-generation/generator.js +15 -1
  68. package/dist/core/command-generation/index.d.ts +1 -1
  69. package/dist/core/command-generation/index.js +1 -1
  70. package/dist/core/command-generation/invocation.d.ts +73 -0
  71. package/dist/core/command-generation/invocation.js +77 -0
  72. package/dist/core/command-generation/registry.js +4 -4
  73. package/dist/core/command-generation/types.d.ts +9 -2
  74. package/dist/core/command-generation/yaml.d.ts +20 -6
  75. package/dist/core/command-generation/yaml.js +31 -21
  76. package/dist/core/command-surface.d.ts +15 -0
  77. package/dist/core/command-surface.js +33 -0
  78. package/dist/core/completions/command-registry.js +8 -2
  79. package/dist/core/completions/generators/powershell-generator.js +15 -8
  80. package/dist/core/completions/installers/zsh-installer.d.ts +9 -0
  81. package/dist/core/completions/installers/zsh-installer.js +20 -4
  82. package/dist/core/config-prompts.d.ts +1 -1
  83. package/dist/core/config-prompts.js +14 -1
  84. package/dist/core/config-schema.d.ts +7 -1
  85. package/dist/core/config-schema.js +40 -1
  86. package/dist/core/config.d.ts +12 -0
  87. package/dist/core/config.js +21 -3
  88. package/dist/core/global-config.d.ts +5 -0
  89. package/dist/core/init.d.ts +35 -0
  90. package/dist/core/init.js +225 -39
  91. package/dist/core/legacy-cleanup.d.ts +59 -0
  92. package/dist/core/legacy-cleanup.js +249 -22
  93. package/dist/core/list.js +5 -7
  94. package/dist/core/migration.d.ts +71 -1
  95. package/dist/core/migration.js +294 -1
  96. package/dist/core/onboarding-commands.d.ts +30 -0
  97. package/dist/core/onboarding-commands.js +38 -0
  98. package/dist/core/parsers/change-parser.d.ts +17 -2
  99. package/dist/core/parsers/change-parser.js +33 -20
  100. package/dist/core/parsers/code-fence.d.ts +15 -0
  101. package/dist/core/parsers/code-fence.js +49 -0
  102. package/dist/core/parsers/markdown-parser.js +2 -1
  103. package/dist/core/parsers/requirement-blocks.d.ts +8 -0
  104. package/dist/core/parsers/requirement-blocks.js +60 -35
  105. package/dist/core/parsers/requirement-text.d.ts +1 -8
  106. package/dist/core/parsers/requirement-text.js +4 -42
  107. package/dist/core/parsers/spec-structure.js +3 -29
  108. package/dist/core/profile-sync-drift.d.ts +0 -8
  109. package/dist/core/profile-sync-drift.js +9 -45
  110. package/dist/core/project-config.d.ts +25 -6
  111. package/dist/core/project-config.js +77 -7
  112. package/dist/core/references.js +42 -4
  113. package/dist/core/relationship-health.d.ts +8 -0
  114. package/dist/core/relationship-health.js +13 -0
  115. package/dist/core/root-selection.d.ts +9 -6
  116. package/dist/core/root-selection.js +42 -5
  117. package/dist/core/shared/tool-detection.d.ts +25 -5
  118. package/dist/core/shared/tool-detection.js +105 -6
  119. package/dist/core/specs-apply.d.ts +8 -33
  120. package/dist/core/specs-apply.js +252 -157
  121. package/dist/core/store/git.d.ts +13 -0
  122. package/dist/core/store/git.js +24 -0
  123. package/dist/core/templates/workflows/apply-change.js +54 -4
  124. package/dist/core/templates/workflows/archive-change.js +166 -42
  125. package/dist/core/templates/workflows/bulk-archive-change.js +240 -63
  126. package/dist/core/templates/workflows/continue-change.js +32 -40
  127. package/dist/core/templates/workflows/explore.js +12 -0
  128. package/dist/core/templates/workflows/ff-change.js +46 -30
  129. package/dist/core/templates/workflows/new-change.js +2 -2
  130. package/dist/core/templates/workflows/onboard.js +4 -4
  131. package/dist/core/templates/workflows/propose.js +50 -32
  132. package/dist/core/templates/workflows/store-selection.d.ts +1 -1
  133. package/dist/core/templates/workflows/store-selection.js +1 -1
  134. package/dist/core/templates/workflows/sync-specs.js +172 -22
  135. package/dist/core/templates/workflows/update-change.js +20 -12
  136. package/dist/core/templates/workflows/verify-change.js +16 -10
  137. package/dist/core/update.d.ts +39 -5
  138. package/dist/core/update.js +288 -71
  139. package/dist/core/validation/constants.d.ts +4 -1
  140. package/dist/core/validation/constants.js +4 -1
  141. package/dist/core/validation/validator.d.ts +1 -7
  142. package/dist/core/validation/validator.js +92 -36
  143. package/dist/core/version-check.d.ts +152 -0
  144. package/dist/core/version-check.js +736 -0
  145. package/dist/core/view.js +12 -17
  146. package/dist/prompts/searchable-multi-select.js +1 -1
  147. package/dist/telemetry/index.d.ts +1 -1
  148. package/dist/telemetry/index.js +55 -33
  149. package/dist/ui/welcome-screen.d.ts +9 -1
  150. package/dist/ui/welcome-screen.js +91 -38
  151. package/dist/utils/change-metadata.d.ts +30 -0
  152. package/dist/utils/change-metadata.js +101 -7
  153. package/dist/utils/change-utils.d.ts +10 -4
  154. package/dist/utils/change-utils.js +20 -13
  155. package/dist/utils/command-references.d.ts +80 -6
  156. package/dist/utils/command-references.js +138 -7
  157. package/dist/utils/date.d.ts +8 -0
  158. package/dist/utils/date.js +13 -0
  159. package/dist/utils/index.d.ts +1 -1
  160. package/dist/utils/index.js +1 -1
  161. package/dist/utils/item-discovery.d.ts +19 -0
  162. package/dist/utils/item-discovery.js +30 -48
  163. package/dist/utils/shell-detection.d.ts +1 -1
  164. package/dist/utils/shell-detection.js +64 -11
  165. package/dist/utils/spec-discovery.d.ts +40 -0
  166. package/dist/utils/spec-discovery.js +102 -0
  167. package/package.json +29 -30
  168. package/schemas/spec-driven/schema.yaml +60 -5
  169. package/schemas/spec-driven/templates/design.md +2 -2
  170. package/schemas/spec-driven/templates/proposal.md +5 -1
  171. package/schemas/spec-driven/templates/spec.md +3 -0
  172. package/dist/core/command-generation/adapters/codex.d.ts +0 -16
  173. package/dist/core/command-generation/adapters/codex.js +0 -39
  174. package/dist/core/command-generation/adapters/windsurf.d.ts +0 -14
  175. package/dist/core/command-generation/adapters/windsurf.js +0 -38
@@ -11,11 +11,14 @@ ${STORE_SELECTION_GUIDANCE}
11
11
 
12
12
  **Steps**
13
13
 
14
- 1. **If no change name provided, prompt for selection**
14
+ 1. **Select the change**
15
15
 
16
- Run \`openspec list --json\` to get available changes sorted by most recently modified. Then use the **AskUserQuestion tool** to let the user select which change to work on.
16
+ If a name is provided, use it. Otherwise:
17
+ - Infer from conversation context if the user mentioned a change
18
+ - Auto-select if only one active change exists
19
+ - If ambiguous, run \`openspec list --json\` to get available changes sorted by most recently modified, and ask the user to select one
17
20
 
18
- Present the top 3-4 most recently modified changes as options, showing:
21
+ When prompting, present the top 3-4 most recently modified changes as options, showing:
19
22
  - Change name
20
23
  - Schema (from \`schema\` field if present, otherwise "spec-driven")
21
24
  - Status (e.g., "0/5 tasks", "complete", "no tasks")
@@ -23,7 +26,7 @@ ${STORE_SELECTION_GUIDANCE}
23
26
 
24
27
  Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to continue.
25
28
 
26
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
29
+ Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:continue <other>\`).
27
30
 
28
31
  2. **Check current status**
29
32
  \`\`\`bash
@@ -31,7 +34,7 @@ ${STORE_SELECTION_GUIDANCE}
31
34
  \`\`\`
32
35
  Parse the JSON to understand current state. The response includes:
33
36
  - \`schemaName\`: The workflow schema being used (e.g., "spec-driven")
34
- - \`artifacts\`: Array of artifacts with their status ("done", "ready", "blocked")
37
+ - \`artifacts\`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
35
38
  - \`isComplete\`: Boolean indicating if all artifacts are complete
36
39
  - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
37
40
 
@@ -59,10 +62,12 @@ ${STORE_SELECTION_GUIDANCE}
59
62
  - \`template\`: The structure to use for your output file
60
63
  - \`instruction\`: Schema-specific guidance
61
64
  - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
62
- - \`dependencies\`: Completed artifacts to read for context
65
+ - \`dependencies\`: Completed artifacts to read for context (entries with \`skipped: true\` have no files - do not look for them)
66
+ - \`skipped\`/\`warning\`: present when the change declares skip_specs and this artifact must NOT be created - pick another artifact
63
67
  - **Create the artifact file**:
64
- - Read any completed dependency files for context
65
- - Use \`template\` as the structure - fill in its sections
68
+ - Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
69
+ - If the \`instruction\` field delegates creation to a specific skill or command, invoke it to produce the artifact instead of writing the file yourself, then verify the artifact file exists at \`resolvedOutputPath\`
70
+ - Otherwise use \`template\` as the structure - fill in its sections
66
71
  - Apply \`context\` and \`rules\` as constraints when writing - but do NOT copy them into the file
67
72
  - Write to the \`resolvedOutputPath\` specified in instructions. If it is a glob pattern, choose the concrete file path using the schema instruction and the change's context
68
73
  - Show what was created and what's now unlocked
@@ -90,22 +95,13 @@ After each invocation, show:
90
95
 
91
96
  **Artifact Creation Guidelines**
92
97
 
93
- The artifact types and their purpose depend on the schema. Use the \`instruction\` field from the instructions output to understand what to create.
98
+ The artifact types and their purpose depend on the schema. The \`instruction\` field from the instructions output is the authoritative guidance for each artifact - follow it even when the artifact has a familiar name (proposal.md, tasks.md, etc.), since custom schemas may define different content or a different process for the same file names.
94
99
 
95
- Common artifact patterns:
96
-
97
- **spec-driven schema** (proposal → specs → design → tasks):
98
- - **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
99
- - The Capabilities section is critical - each capability listed will need a spec file.
100
- - **specs/<capability>/spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name).
101
- - **design.md**: Document technical decisions, architecture, and implementation approach.
102
- - **tasks.md**: Break down implementation into checkboxed tasks.
103
-
104
- For other schemas, follow the \`instruction\` field from the CLI output.
100
+ If the \`instruction\` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly.
105
101
 
106
102
  **Guardrails**
107
103
  - Create ONE artifact per invocation
108
- - Always read dependency artifacts before creating a new one
104
+ - Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
109
105
  - Never skip artifacts or create out of order
110
106
  - If context is unclear, ask the user before creating
111
107
  - Verify the artifact file exists after writing before marking progress
@@ -132,11 +128,14 @@ ${STORE_SELECTION_GUIDANCE}
132
128
 
133
129
  **Steps**
134
130
 
135
- 1. **If no change name provided, prompt for selection**
131
+ 1. **Select the change**
136
132
 
137
- Run \`openspec list --json\` to get available changes sorted by most recently modified. Then use the **AskUserQuestion tool** to let the user select which change to work on.
133
+ If a name is provided, use it. Otherwise:
134
+ - Infer from conversation context if the user mentioned a change
135
+ - Auto-select if only one active change exists
136
+ - If ambiguous, run \`openspec list --json\` to get available changes sorted by most recently modified, and ask the user to select one
138
137
 
139
- Present the top 3-4 most recently modified changes as options, showing:
138
+ When prompting, present the top 3-4 most recently modified changes as options, showing:
140
139
  - Change name
141
140
  - Schema (from \`schema\` field if present, otherwise "spec-driven")
142
141
  - Status (e.g., "0/5 tasks", "complete", "no tasks")
@@ -144,7 +143,7 @@ ${STORE_SELECTION_GUIDANCE}
144
143
 
145
144
  Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to continue.
146
145
 
147
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
146
+ Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:continue <other>\`).
148
147
 
149
148
  2. **Check current status**
150
149
  \`\`\`bash
@@ -152,7 +151,7 @@ ${STORE_SELECTION_GUIDANCE}
152
151
  \`\`\`
153
152
  Parse the JSON to understand current state. The response includes:
154
153
  - \`schemaName\`: The workflow schema being used (e.g., "spec-driven")
155
- - \`artifacts\`: Array of artifacts with their status ("done", "ready", "blocked")
154
+ - \`artifacts\`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
156
155
  - \`isComplete\`: Boolean indicating if all artifacts are complete
157
156
  - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
158
157
 
@@ -180,10 +179,12 @@ ${STORE_SELECTION_GUIDANCE}
180
179
  - \`template\`: The structure to use for your output file
181
180
  - \`instruction\`: Schema-specific guidance
182
181
  - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
183
- - \`dependencies\`: Completed artifacts to read for context
182
+ - \`dependencies\`: Completed artifacts to read for context (entries with \`skipped: true\` have no files - do not look for them)
183
+ - \`skipped\`/\`warning\`: present when the change declares skip_specs and this artifact must NOT be created - pick another artifact
184
184
  - **Create the artifact file**:
185
- - Read any completed dependency files for context
186
- - Use \`template\` as the structure - fill in its sections
185
+ - Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
186
+ - If the \`instruction\` field delegates creation to a specific skill or command, invoke it to produce the artifact instead of writing the file yourself, then verify the artifact file exists at \`resolvedOutputPath\`
187
+ - Otherwise use \`template\` as the structure - fill in its sections
187
188
  - Apply \`context\` and \`rules\` as constraints when writing - but do NOT copy them into the file
188
189
  - Write to the \`resolvedOutputPath\` specified in instructions. If it is a glob pattern, choose the concrete file path using the schema instruction and the change's context
189
190
  - Show what was created and what's now unlocked
@@ -211,22 +212,13 @@ After each invocation, show:
211
212
 
212
213
  **Artifact Creation Guidelines**
213
214
 
214
- The artifact types and their purpose depend on the schema. Use the \`instruction\` field from the instructions output to understand what to create.
215
-
216
- Common artifact patterns:
217
-
218
- **spec-driven schema** (proposal → specs → design → tasks):
219
- - **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
220
- - The Capabilities section is critical - each capability listed will need a spec file.
221
- - **specs/<capability>/spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name).
222
- - **design.md**: Document technical decisions, architecture, and implementation approach.
223
- - **tasks.md**: Break down implementation into checkboxed tasks.
215
+ The artifact types and their purpose depend on the schema. The \`instruction\` field from the instructions output is the authoritative guidance for each artifact - follow it even when the artifact has a familiar name (proposal.md, tasks.md, etc.), since custom schemas may define different content or a different process for the same file names.
224
216
 
225
- For other schemas, follow the \`instruction\` field from the CLI output.
217
+ If the \`instruction\` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly.
226
218
 
227
219
  **Guardrails**
228
220
  - Create ONE artifact per invocation
229
- - Always read dependency artifacts before creating a new one
221
+ - Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
230
222
  - Never skip artifacts or create out of order
231
223
  - If context is unclear, ask the user before creating
232
224
  - Verify the artifact file exists after writing before marking progress
@@ -87,6 +87,12 @@ This tells you:
87
87
  - Their names, schemas, and status
88
88
  - What the user might be working on
89
89
 
90
+ Then read the project's own context from the resolved root - \`<root.path>/openspec/config.yaml\` (or \`config.yml\`). Use the \`root.path\` returned above, and skip this if neither file exists:
91
+ - \`context\`: project background - tech stack, conventions, constraints
92
+ - \`rules\`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
93
+
94
+ Ground your thinking in these. They are constraints for you to follow, not content to reproduce: do NOT copy them into the conversation or into any artifact you create.
95
+
90
96
  ### When no change exists
91
97
 
92
98
  Think freely. When insights crystallize, you might offer:
@@ -383,6 +389,12 @@ This tells you:
383
389
  - Their names, schemas, and status
384
390
  - What the user might be working on
385
391
 
392
+ Then read the project's own context from the resolved root - \`<root.path>/openspec/config.yaml\` (or \`config.yml\`). Use the \`root.path\` returned above, and skip this if neither file exists:
393
+ - \`context\`: project background - tech stack, conventions, constraints
394
+ - \`rules\`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
395
+
396
+ Ground your thinking in these. They are constraints for you to follow, not content to reproduce: do NOT copy them into the conversation or into any artifact you create.
397
+
386
398
  If the user mentioned a specific change name, read its artifacts for context.
387
399
 
388
400
  ### When no change exists
@@ -13,7 +13,7 @@ ${STORE_SELECTION_GUIDANCE}
13
13
 
14
14
  1. **If no clear input provided, ask what they want to build**
15
15
 
16
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
16
+ Ask the user (open-ended, no preset options):
17
17
  > "What change do you want to work on? Describe what you want to build or fix."
18
18
 
19
19
  From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
@@ -32,12 +32,12 @@ ${STORE_SELECTION_GUIDANCE}
32
32
  \`\`\`
33
33
  Parse the JSON to get:
34
34
  - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
35
- - \`artifacts\`: list of all artifacts with their status and dependencies
35
+ - \`artifacts\`: list of all artifacts, each with its \`status\` and its \`requires\` edges (the artifact IDs it directly depends on)
36
36
  - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
37
37
 
38
- 4. **Create artifacts in sequence until apply-ready**
38
+ 4. **Create every artifact in the required set**
39
39
 
40
- Use the **TodoWrite tool** to track progress through the artifacts.
40
+ Use a todo list to track progress through the artifacts.
41
41
 
42
42
  Loop through artifacts in dependency order (artifacts with no pending dependencies first):
43
43
 
@@ -51,20 +51,27 @@ ${STORE_SELECTION_GUIDANCE}
51
51
  - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
52
52
  - \`template\`: The structure to use for your output file
53
53
  - \`instruction\`: Schema-specific guidance for this artifact type
54
+ - \`skipped\`/\`warning\`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
54
55
  - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
55
56
  - \`dependencies\`: Completed artifacts to read for context
56
- - Read any completed dependency files for context
57
- - Create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`
57
+ - Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
58
+ - If the \`instruction\` field delegates creation to a specific skill or command, invoke it to produce the artifact instead of writing the file yourself, then verify the artifact file exists at \`resolvedOutputPath\`
59
+ - Otherwise create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`. If \`resolvedOutputPath\` is a glob, follow \`instruction\` to choose the concrete file path
58
60
  - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
59
61
  - Show brief progress: "✓ Created <artifact-id>"
60
62
 
61
- b. **Continue until all \`applyRequires\` artifacts are complete**
63
+ b. **Continue until every artifact in the required set exists (not just \`apply.requires\`)**
62
64
  - After creating each artifact, re-run \`openspec status --change "<name>" --json\`
63
- - Check if every artifact ID in \`applyRequires\` has \`status: "done"\` in the artifacts array
64
- - Stop when all \`applyRequires\` artifacts are done
65
+ - The required set is \`applyRequires\` plus every artifact reachable from those by following the \`requires\` edges in \`status --json\` - walk them transitively (spec-driven closes over proposal, specs, design, tasks). Leave artifacts outside that set alone
66
+ - \`status\` is file-existence only, so an \`applyRequires\` artifact reading \`done\` does NOT mean its dependencies exist - writing \`tasks.md\` early marks \`tasks\` done while \`specs\` was never written. Use each artifact's \`requires\` edges, not its \`status\`, to build the required set: a \`done\` artifact still lists what it depends on
67
+ - An artifact already reading \`status: "skipped"\` is satisfied: the change declares \`skip_specs\` in \`.openspec.yaml\`, so its files must NOT exist. Never try to create one
68
+ - Create every artifact in the required set that is missing, then re-check - creating one can unblock others
69
+ - Skip one only when \`status\` already reports it \`skipped\`, or when its own \`instruction\` says it is conditional: run \`openspec instructions <artifact-id> --change "<name>" --json\` and skip only if its \`instruction\` field marks it optional (e.g. "create only if..."). Spec-driven's \`design.md\` qualifies; \`specs\` qualifies only via the \`skipped\` status above, never by your own judgment. Tell the user, and do not reconsider it
70
+ - Dependencies are enablers, not gates: if a required artifact is still \`blocked\` only because you skipped a conditional dependency, write it anyway
71
+ - Stop when every artifact in the required set is \`done\`, \`skipped\`, or was deliberately skipped
65
72
 
66
73
  c. **If an artifact requires user input** (unclear context):
67
- - Use **AskUserQuestion tool** to clarify
74
+ - Ask the user to clarify
68
75
  - Then continue with creation
69
76
 
70
77
  5. **Show final status**
@@ -76,13 +83,14 @@ ${STORE_SELECTION_GUIDANCE}
76
83
 
77
84
  After completing all artifacts, summarize:
78
85
  - Change name and location
79
- - List of artifacts created with brief descriptions
80
- - What's ready: "All artifacts created! Ready for implementation."
86
+ - List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
87
+ - What's ready: "All artifacts needed for implementation are ready."
81
88
  - Prompt: "Run \`/opsx:apply\` or ask me to implement to start working on the tasks."
82
89
 
83
90
  **Artifact Creation Guidelines**
84
91
 
85
- - Follow the \`instruction\` field from \`openspec instructions\` for each artifact type
92
+ - Follow the \`instruction\` field from \`openspec instructions\` for each artifact type - it is the authoritative guidance, even for familiar artifact names
93
+ - If the \`instruction\` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly
86
94
  - The schema defines what each artifact should contain - follow it
87
95
  - Read dependency artifacts for context before creating new ones
88
96
  - Use \`template\` as the structure for your output file - fill in its sections
@@ -91,8 +99,8 @@ After completing all artifacts, summarize:
91
99
  - These guide what you write, but should never appear in the output
92
100
 
93
101
  **Guardrails**
94
- - Create ALL artifacts needed for implementation (as defined by schema's \`apply.requires\`)
95
- - Always read dependency artifacts before creating a new one
102
+ - Create every artifact the apply phase transitively depends on, not just the ids listed in \`apply.requires\`
103
+ - Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
96
104
  - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
97
105
  - If a change with that name already exists, suggest continuing that change instead
98
106
  - Verify each artifact file exists after writing before proceeding to next`,
@@ -117,7 +125,7 @@ ${STORE_SELECTION_GUIDANCE}
117
125
 
118
126
  1. **If no input provided, ask what they want to build**
119
127
 
120
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
128
+ Ask the user (open-ended, no preset options):
121
129
  > "What change do you want to work on? Describe what you want to build or fix."
122
130
 
123
131
  From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
@@ -136,12 +144,12 @@ ${STORE_SELECTION_GUIDANCE}
136
144
  \`\`\`
137
145
  Parse the JSON to get:
138
146
  - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
139
- - \`artifacts\`: list of all artifacts with their status and dependencies
147
+ - \`artifacts\`: list of all artifacts, each with its \`status\` and its \`requires\` edges (the artifact IDs it directly depends on)
140
148
  - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
141
149
 
142
- 4. **Create artifacts in sequence until apply-ready**
150
+ 4. **Create every artifact in the required set**
143
151
 
144
- Use the **TodoWrite tool** to track progress through the artifacts.
152
+ Use a todo list to track progress through the artifacts.
145
153
 
146
154
  Loop through artifacts in dependency order (artifacts with no pending dependencies first):
147
155
 
@@ -155,20 +163,27 @@ ${STORE_SELECTION_GUIDANCE}
155
163
  - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
156
164
  - \`template\`: The structure to use for your output file
157
165
  - \`instruction\`: Schema-specific guidance for this artifact type
166
+ - \`skipped\`/\`warning\`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
158
167
  - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
159
168
  - \`dependencies\`: Completed artifacts to read for context
160
- - Read any completed dependency files for context
161
- - Create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`
169
+ - Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
170
+ - If the \`instruction\` field delegates creation to a specific skill or command, invoke it to produce the artifact instead of writing the file yourself, then verify the artifact file exists at \`resolvedOutputPath\`
171
+ - Otherwise create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`. If \`resolvedOutputPath\` is a glob, follow \`instruction\` to choose the concrete file path
162
172
  - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
163
173
  - Show brief progress: "✓ Created <artifact-id>"
164
174
 
165
- b. **Continue until all \`applyRequires\` artifacts are complete**
175
+ b. **Continue until every artifact in the required set exists (not just \`apply.requires\`)**
166
176
  - After creating each artifact, re-run \`openspec status --change "<name>" --json\`
167
- - Check if every artifact ID in \`applyRequires\` has \`status: "done"\` in the artifacts array
168
- - Stop when all \`applyRequires\` artifacts are done
177
+ - The required set is \`applyRequires\` plus every artifact reachable from those by following the \`requires\` edges in \`status --json\` - walk them transitively (spec-driven closes over proposal, specs, design, tasks). Leave artifacts outside that set alone
178
+ - \`status\` is file-existence only, so an \`applyRequires\` artifact reading \`done\` does NOT mean its dependencies exist - writing \`tasks.md\` early marks \`tasks\` done while \`specs\` was never written. Use each artifact's \`requires\` edges, not its \`status\`, to build the required set: a \`done\` artifact still lists what it depends on
179
+ - An artifact already reading \`status: "skipped"\` is satisfied: the change declares \`skip_specs\` in \`.openspec.yaml\`, so its files must NOT exist. Never try to create one
180
+ - Create every artifact in the required set that is missing, then re-check - creating one can unblock others
181
+ - Skip one only when \`status\` already reports it \`skipped\`, or when its own \`instruction\` says it is conditional: run \`openspec instructions <artifact-id> --change "<name>" --json\` and skip only if its \`instruction\` field marks it optional (e.g. "create only if..."). Spec-driven's \`design.md\` qualifies; \`specs\` qualifies only via the \`skipped\` status above, never by your own judgment. Tell the user, and do not reconsider it
182
+ - Dependencies are enablers, not gates: if a required artifact is still \`blocked\` only because you skipped a conditional dependency, write it anyway
183
+ - Stop when every artifact in the required set is \`done\`, \`skipped\`, or was deliberately skipped
169
184
 
170
185
  c. **If an artifact requires user input** (unclear context):
171
- - Use **AskUserQuestion tool** to clarify
186
+ - Ask the user to clarify
172
187
  - Then continue with creation
173
188
 
174
189
  5. **Show final status**
@@ -180,13 +195,14 @@ ${STORE_SELECTION_GUIDANCE}
180
195
 
181
196
  After completing all artifacts, summarize:
182
197
  - Change name and location
183
- - List of artifacts created with brief descriptions
184
- - What's ready: "All artifacts created! Ready for implementation."
198
+ - List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
199
+ - What's ready: "All artifacts needed for implementation are ready."
185
200
  - Prompt: "Run \`/opsx:apply\` to start implementing."
186
201
 
187
202
  **Artifact Creation Guidelines**
188
203
 
189
- - Follow the \`instruction\` field from \`openspec instructions\` for each artifact type
204
+ - Follow the \`instruction\` field from \`openspec instructions\` for each artifact type - it is the authoritative guidance, even for familiar artifact names
205
+ - If the \`instruction\` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly
190
206
  - The schema defines what each artifact should contain - follow it
191
207
  - Read dependency artifacts for context before creating new ones
192
208
  - Use \`template\` as the structure for your output file - fill in its sections
@@ -195,8 +211,8 @@ After completing all artifacts, summarize:
195
211
  - These guide what you write, but should never appear in the output
196
212
 
197
213
  **Guardrails**
198
- - Create ALL artifacts needed for implementation (as defined by schema's \`apply.requires\`)
199
- - Always read dependency artifacts before creating a new one
214
+ - Create every artifact the apply phase transitively depends on, not just the ids listed in \`apply.requires\`
215
+ - Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
200
216
  - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
201
217
  - If a change with that name already exists, ask if user wants to continue it or create a new one
202
218
  - Verify each artifact file exists after writing before proceeding to next`
@@ -13,7 +13,7 @@ ${STORE_SELECTION_GUIDANCE}
13
13
 
14
14
  1. **If no clear input provided, ask what they want to build**
15
15
 
16
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
16
+ Ask the user (open-ended, no preset options):
17
17
  > "What change do you want to work on? Describe what you want to build or fix."
18
18
 
19
19
  From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
@@ -89,7 +89,7 @@ ${STORE_SELECTION_GUIDANCE}
89
89
 
90
90
  1. **If no input provided, ask what they want to build**
91
91
 
92
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
92
+ Ask the user (open-ended, no preset options):
93
93
  > "What change do you want to work on? Describe what you want to build or fix."
94
94
 
95
95
  From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
@@ -438,7 +438,7 @@ openspec archive "<name>"
438
438
 
439
439
  **SHOW:**
440
440
  \`\`\`
441
- Archived to: \`<planningHome.changesDir>/archive/YYYY-MM-DD-<name>/\`
441
+ Archived to: \`<planningHome.changesDir>/archive/<target-name>/\` (the target name prepends today's date, unless the name already starts with a \`YYYY-MM-DD-\` prefix — then it is kept as-is, no second date)
442
442
 
443
443
  The change is now part of your project's history. The code is in your codebase, the decision record is preserved.
444
444
  \`\`\`
@@ -476,7 +476,7 @@ This same rhythm works for any size change—a small fix or a major feature.
476
476
  | \`/opsx:apply\` | Implement tasks from a change |
477
477
  | \`/opsx:archive\` | Archive a completed change |
478
478
 
479
- **Additional commands:**
479
+ **Additional commands** (only if installed - availability depends on your profile):
480
480
 
481
481
  | Command | What it does |
482
482
  |--------------------|----------------------------------------------------------|
@@ -504,7 +504,7 @@ If the user says they need to stop, want to pause, or seem disengaged:
504
504
  No problem! Your change is saved at the \`changeRoot\` reported by \`openspec status --change "<name>" --json\`.
505
505
 
506
506
  To pick up where we left off later:
507
- - \`/opsx:continue <name>\` - Resume artifact creation
507
+ - \`/opsx:continue <name>\` - Resume artifact creation (if installed; otherwise \`openspec status --change "<name>" --json\` shows the next artifact)
508
508
  - \`/opsx:apply <name>\` - Jump to implementation (if tasks exist)
509
509
 
510
510
  The work won't be lost. Come back whenever you're ready.
@@ -528,7 +528,7 @@ If the user says they just want to see the commands or skip the tutorial:
528
528
  | \`/opsx:apply <name>\` | Implement tasks |
529
529
  | \`/opsx:archive <name>\` | Archive when done |
530
530
 
531
- **Additional commands:**
531
+ **Additional commands** (only if installed - availability depends on your profile):
532
532
 
533
533
  | Command | What it does |
534
534
  |---------------------------|-------------------------------------|
@@ -5,8 +5,9 @@ export function getOpsxProposeSkillTemplate() {
5
5
  description: 'Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.',
6
6
  instructions: `Propose a new change - create the change and generate all artifacts in one step.
7
7
 
8
- I'll create a change with artifacts:
8
+ I'll create a change with the artifacts your schema defines. With the default spec-driven schema that is:
9
9
  - proposal.md (what & why)
10
+ - \`specs/<capability>/spec.md\` (what the system must do - a delta, not the main spec)
10
11
  - design.md (how)
11
12
  - tasks.md (implementation steps)
12
13
 
@@ -22,7 +23,7 @@ ${STORE_SELECTION_GUIDANCE}
22
23
 
23
24
  1. **If no clear input provided, ask what they want to build**
24
25
 
25
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
26
+ Ask the user (open-ended, no preset options):
26
27
  > "What change do you want to work on? Describe what you want to build or fix."
27
28
 
28
29
  From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
@@ -41,12 +42,12 @@ ${STORE_SELECTION_GUIDANCE}
41
42
  \`\`\`
42
43
  Parse the JSON to get:
43
44
  - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
44
- - \`artifacts\`: list of all artifacts with their status and dependencies
45
+ - \`artifacts\`: list of all artifacts, each with its \`status\` and its \`requires\` edges (the artifact IDs it directly depends on)
45
46
  - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
46
47
 
47
- 4. **Create artifacts in sequence until apply-ready**
48
+ 4. **Create every artifact in the required set**
48
49
 
49
- Use the **TodoWrite tool** to track progress through the artifacts.
50
+ Use a todo list to track progress through the artifacts.
50
51
 
51
52
  Loop through artifacts in dependency order (artifacts with no pending dependencies first):
52
53
 
@@ -60,20 +61,27 @@ ${STORE_SELECTION_GUIDANCE}
60
61
  - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
61
62
  - \`template\`: The structure to use for your output file
62
63
  - \`instruction\`: Schema-specific guidance for this artifact type
64
+ - \`skipped\`/\`warning\`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
63
65
  - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
64
66
  - \`dependencies\`: Completed artifacts to read for context
65
- - Read any completed dependency files for context
66
- - Create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`
67
+ - Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
68
+ - If the \`instruction\` field delegates creation to a specific skill or command, invoke it to produce the artifact instead of writing the file yourself, then verify the artifact file exists at \`resolvedOutputPath\`
69
+ - Otherwise create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`. If \`resolvedOutputPath\` is a glob, follow \`instruction\` to choose the concrete file path
67
70
  - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
68
71
  - Show brief progress: "Created <artifact-id>"
69
72
 
70
- b. **Continue until all \`applyRequires\` artifacts are complete**
73
+ b. **Continue until every artifact in the required set exists (not just \`apply.requires\`)**
71
74
  - After creating each artifact, re-run \`openspec status --change "<name>" --json\`
72
- - Check if every artifact ID in \`applyRequires\` has \`status: "done"\` in the artifacts array
73
- - Stop when all \`applyRequires\` artifacts are done
75
+ - The required set is \`applyRequires\` plus every artifact reachable from those by following the \`requires\` edges in \`status --json\` - walk them transitively (spec-driven closes over proposal, specs, design, tasks). Leave artifacts outside that set alone
76
+ - \`status\` is file-existence only, so an \`applyRequires\` artifact reading \`done\` does NOT mean its dependencies exist - writing \`tasks.md\` early marks \`tasks\` done while \`specs\` was never written. Use each artifact's \`requires\` edges, not its \`status\`, to build the required set: a \`done\` artifact still lists what it depends on
77
+ - An artifact already reading \`status: "skipped"\` is satisfied: the change declares \`skip_specs\` in \`.openspec.yaml\`, so its files must NOT exist. Never try to create one
78
+ - Create every artifact in the required set that is missing, then re-check - creating one can unblock others
79
+ - Skip one only when \`status\` already reports it \`skipped\`, or when its own \`instruction\` says it is conditional: run \`openspec instructions <artifact-id> --change "<name>" --json\` and skip only if its \`instruction\` field marks it optional (e.g. "create only if..."). Spec-driven's \`design.md\` qualifies; \`specs\` qualifies only via the \`skipped\` status above, never by your own judgment. Tell the user, and do not reconsider it
80
+ - Dependencies are enablers, not gates: if a required artifact is still \`blocked\` only because you skipped a conditional dependency, write it anyway
81
+ - Stop when every artifact in the required set is \`done\`, \`skipped\`, or was deliberately skipped
74
82
 
75
83
  c. **If an artifact requires user input** (unclear context):
76
- - Use **AskUserQuestion tool** to clarify
84
+ - Ask the user to clarify
77
85
  - Then continue with creation
78
86
 
79
87
  5. **Show final status**
@@ -85,13 +93,14 @@ ${STORE_SELECTION_GUIDANCE}
85
93
 
86
94
  After completing all artifacts, summarize:
87
95
  - Change name and location
88
- - List of artifacts created with brief descriptions
89
- - What's ready: "All artifacts created! Ready for implementation."
96
+ - List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
97
+ - What's ready: "All artifacts needed for implementation are ready."
90
98
  - Prompt: "Run \`/opsx:apply\` or ask me to implement to start working on the tasks."
91
99
 
92
100
  **Artifact Creation Guidelines**
93
101
 
94
- - Follow the \`instruction\` field from \`openspec instructions\` for each artifact type
102
+ - Follow the \`instruction\` field from \`openspec instructions\` for each artifact type - it is the authoritative guidance, even for familiar artifact names
103
+ - If the \`instruction\` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly
95
104
  - The schema defines what each artifact should contain - follow it
96
105
  - Read dependency artifacts for context before creating new ones
97
106
  - Use \`template\` as the structure for your output file - fill in its sections
@@ -100,8 +109,8 @@ After completing all artifacts, summarize:
100
109
  - These guide what you write, but should never appear in the output
101
110
 
102
111
  **Guardrails**
103
- - Create ALL artifacts needed for implementation (as defined by schema's \`apply.requires\`)
104
- - Always read dependency artifacts before creating a new one
112
+ - Create every artifact the apply phase transitively depends on, not just the ids listed in \`apply.requires\`
113
+ - Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
105
114
  - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
106
115
  - If a change with that name already exists, ask if user wants to continue it or create a new one
107
116
  - Verify each artifact file exists after writing before proceeding to next`,
@@ -118,8 +127,9 @@ export function getOpsxProposeCommandTemplate() {
118
127
  tags: ['workflow', 'artifacts', 'experimental'],
119
128
  content: `Propose a new change - create the change and generate all artifacts in one step.
120
129
 
121
- I'll create a change with artifacts:
130
+ I'll create a change with the artifacts your schema defines. With the default spec-driven schema that is:
122
131
  - proposal.md (what & why)
132
+ - \`specs/<capability>/spec.md\` (what the system must do - a delta, not the main spec)
123
133
  - design.md (how)
124
134
  - tasks.md (implementation steps)
125
135
 
@@ -135,7 +145,7 @@ ${STORE_SELECTION_GUIDANCE}
135
145
 
136
146
  1. **If no input provided, ask what they want to build**
137
147
 
138
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
148
+ Ask the user (open-ended, no preset options):
139
149
  > "What change do you want to work on? Describe what you want to build or fix."
140
150
 
141
151
  From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
@@ -154,12 +164,12 @@ ${STORE_SELECTION_GUIDANCE}
154
164
  \`\`\`
155
165
  Parse the JSON to get:
156
166
  - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
157
- - \`artifacts\`: list of all artifacts with their status and dependencies
167
+ - \`artifacts\`: list of all artifacts, each with its \`status\` and its \`requires\` edges (the artifact IDs it directly depends on)
158
168
  - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
159
169
 
160
- 4. **Create artifacts in sequence until apply-ready**
170
+ 4. **Create every artifact in the required set**
161
171
 
162
- Use the **TodoWrite tool** to track progress through the artifacts.
172
+ Use a todo list to track progress through the artifacts.
163
173
 
164
174
  Loop through artifacts in dependency order (artifacts with no pending dependencies first):
165
175
 
@@ -173,20 +183,27 @@ ${STORE_SELECTION_GUIDANCE}
173
183
  - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
174
184
  - \`template\`: The structure to use for your output file
175
185
  - \`instruction\`: Schema-specific guidance for this artifact type
186
+ - \`skipped\`/\`warning\`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
176
187
  - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
177
188
  - \`dependencies\`: Completed artifacts to read for context
178
- - Read any completed dependency files for context
179
- - Create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`
189
+ - Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
190
+ - If the \`instruction\` field delegates creation to a specific skill or command, invoke it to produce the artifact instead of writing the file yourself, then verify the artifact file exists at \`resolvedOutputPath\`
191
+ - Otherwise create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`. If \`resolvedOutputPath\` is a glob, follow \`instruction\` to choose the concrete file path
180
192
  - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
181
193
  - Show brief progress: "Created <artifact-id>"
182
194
 
183
- b. **Continue until all \`applyRequires\` artifacts are complete**
195
+ b. **Continue until every artifact in the required set exists (not just \`apply.requires\`)**
184
196
  - After creating each artifact, re-run \`openspec status --change "<name>" --json\`
185
- - Check if every artifact ID in \`applyRequires\` has \`status: "done"\` in the artifacts array
186
- - Stop when all \`applyRequires\` artifacts are done
197
+ - The required set is \`applyRequires\` plus every artifact reachable from those by following the \`requires\` edges in \`status --json\` - walk them transitively (spec-driven closes over proposal, specs, design, tasks). Leave artifacts outside that set alone
198
+ - \`status\` is file-existence only, so an \`applyRequires\` artifact reading \`done\` does NOT mean its dependencies exist - writing \`tasks.md\` early marks \`tasks\` done while \`specs\` was never written. Use each artifact's \`requires\` edges, not its \`status\`, to build the required set: a \`done\` artifact still lists what it depends on
199
+ - An artifact already reading \`status: "skipped"\` is satisfied: the change declares \`skip_specs\` in \`.openspec.yaml\`, so its files must NOT exist. Never try to create one
200
+ - Create every artifact in the required set that is missing, then re-check - creating one can unblock others
201
+ - Skip one only when \`status\` already reports it \`skipped\`, or when its own \`instruction\` says it is conditional: run \`openspec instructions <artifact-id> --change "<name>" --json\` and skip only if its \`instruction\` field marks it optional (e.g. "create only if..."). Spec-driven's \`design.md\` qualifies; \`specs\` qualifies only via the \`skipped\` status above, never by your own judgment. Tell the user, and do not reconsider it
202
+ - Dependencies are enablers, not gates: if a required artifact is still \`blocked\` only because you skipped a conditional dependency, write it anyway
203
+ - Stop when every artifact in the required set is \`done\`, \`skipped\`, or was deliberately skipped
187
204
 
188
205
  c. **If an artifact requires user input** (unclear context):
189
- - Use **AskUserQuestion tool** to clarify
206
+ - Ask the user to clarify
190
207
  - Then continue with creation
191
208
 
192
209
  5. **Show final status**
@@ -198,13 +215,14 @@ ${STORE_SELECTION_GUIDANCE}
198
215
 
199
216
  After completing all artifacts, summarize:
200
217
  - Change name and location
201
- - List of artifacts created with brief descriptions
202
- - What's ready: "All artifacts created! Ready for implementation."
218
+ - List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
219
+ - What's ready: "All artifacts needed for implementation are ready."
203
220
  - Prompt: "Run \`/opsx:apply\` to start implementing."
204
221
 
205
222
  **Artifact Creation Guidelines**
206
223
 
207
- - Follow the \`instruction\` field from \`openspec instructions\` for each artifact type
224
+ - Follow the \`instruction\` field from \`openspec instructions\` for each artifact type - it is the authoritative guidance, even for familiar artifact names
225
+ - If the \`instruction\` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly
208
226
  - The schema defines what each artifact should contain - follow it
209
227
  - Read dependency artifacts for context before creating new ones
210
228
  - Use \`template\` as the structure for your output file - fill in its sections
@@ -213,8 +231,8 @@ After completing all artifacts, summarize:
213
231
  - These guide what you write, but should never appear in the output
214
232
 
215
233
  **Guardrails**
216
- - Create ALL artifacts needed for implementation (as defined by schema's \`apply.requires\`)
217
- - Always read dependency artifacts before creating a new one
234
+ - Create every artifact the apply phase transitively depends on, not just the ids listed in \`apply.requires\`
235
+ - Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
218
236
  - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
219
237
  - If a change with that name already exists, ask if user wants to continue it or create a new one
220
238
  - Verify each artifact file exists after writing before proceeding to next`