@fission-ai/openspec 1.6.0 → 1.8.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 (208) hide show
  1. package/README.md +31 -2
  2. package/dist/cli/index.js +79 -8
  3. package/dist/commands/change.d.ts +0 -1
  4. package/dist/commands/change.js +105 -51
  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 +110 -31
  9. package/dist/commands/show.js +5 -2
  10. package/dist/commands/spec.js +49 -29
  11. package/dist/commands/validate.js +20 -5
  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 +121 -33
  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 +9 -4
  19. package/dist/commands/workflow/templates.js +15 -5
  20. package/dist/core/archive.d.ts +14 -1
  21. package/dist/core/archive.js +1332 -155
  22. package/dist/core/artifact-graph/graph.d.ts +16 -0
  23. package/dist/core/artifact-graph/graph.js +30 -6
  24. package/dist/core/artifact-graph/index.d.ts +1 -1
  25. package/dist/core/artifact-graph/index.js +1 -1
  26. package/dist/core/artifact-graph/instruction-loader.d.ts +30 -3
  27. package/dist/core/artifact-graph/instruction-loader.js +70 -12
  28. package/dist/core/artifact-graph/outputs.d.ts +1 -0
  29. package/dist/core/artifact-graph/outputs.js +67 -5
  30. package/dist/core/artifact-graph/resolver.d.ts +14 -0
  31. package/dist/core/artifact-graph/resolver.js +69 -15
  32. package/dist/core/artifact-graph/types.js +21 -3
  33. package/dist/core/available-tools.d.ts +2 -2
  34. package/dist/core/available-tools.js +14 -3
  35. package/dist/core/change-metadata/schema.d.ts +2 -0
  36. package/dist/core/change-metadata/schema.js +13 -0
  37. package/dist/core/change-status-policy.d.ts +1 -1
  38. package/dist/core/change-status-policy.js +2 -2
  39. package/dist/core/command-generation/adapters/amazon-q.d.ts +4 -0
  40. package/dist/core/command-generation/adapters/amazon-q.js +7 -1
  41. package/dist/core/command-generation/adapters/antigravity.js +2 -1
  42. package/dist/core/command-generation/adapters/auggie.js +2 -1
  43. package/dist/core/command-generation/adapters/bob.d.ts +5 -1
  44. package/dist/core/command-generation/adapters/bob.js +6 -5
  45. package/dist/core/command-generation/adapters/claude.js +1 -8
  46. package/dist/core/command-generation/adapters/codebuddy.js +3 -2
  47. package/dist/core/command-generation/adapters/continue.js +3 -2
  48. package/dist/core/command-generation/adapters/costrict.js +2 -1
  49. package/dist/core/command-generation/adapters/crush.js +5 -5
  50. package/dist/core/command-generation/adapters/cursor.js +2 -2
  51. package/dist/core/command-generation/adapters/devin.d.ts +19 -0
  52. package/dist/core/command-generation/adapters/devin.js +36 -0
  53. package/dist/core/command-generation/adapters/factory.js +2 -1
  54. package/dist/core/command-generation/adapters/gemini.js +37 -2
  55. package/dist/core/command-generation/adapters/github-copilot.js +2 -1
  56. package/dist/core/command-generation/adapters/iflow.js +5 -4
  57. package/dist/core/command-generation/adapters/index.d.ts +2 -2
  58. package/dist/core/command-generation/adapters/index.js +2 -2
  59. package/dist/core/command-generation/adapters/junie.js +2 -1
  60. package/dist/core/command-generation/adapters/kiro.js +2 -1
  61. package/dist/core/command-generation/adapters/lingma.js +5 -5
  62. package/dist/core/command-generation/adapters/oh-my-pi.d.ts +2 -2
  63. package/dist/core/command-generation/adapters/oh-my-pi.js +3 -5
  64. package/dist/core/command-generation/adapters/opencode.js +3 -5
  65. package/dist/core/command-generation/adapters/pi.d.ts +2 -2
  66. package/dist/core/command-generation/adapters/pi.js +3 -6
  67. package/dist/core/command-generation/adapters/qoder.js +5 -5
  68. package/dist/core/command-generation/adapters/qwen.d.ts +7 -3
  69. package/dist/core/command-generation/adapters/qwen.js +12 -7
  70. package/dist/core/command-generation/adapters/roocode.d.ts +4 -4
  71. package/dist/core/command-generation/adapters/roocode.js +4 -4
  72. package/dist/core/command-generation/adapters/trae.js +1 -21
  73. package/dist/core/command-generation/adapters/zcode.d.ts +16 -0
  74. package/dist/core/command-generation/adapters/zcode.js +33 -0
  75. package/dist/core/command-generation/generator.d.ts +8 -0
  76. package/dist/core/command-generation/generator.js +15 -1
  77. package/dist/core/command-generation/index.d.ts +1 -1
  78. package/dist/core/command-generation/index.js +1 -1
  79. package/dist/core/command-generation/invocation.d.ts +73 -0
  80. package/dist/core/command-generation/invocation.js +77 -0
  81. package/dist/core/command-generation/registry.js +4 -4
  82. package/dist/core/command-generation/types.d.ts +9 -2
  83. package/dist/core/command-generation/yaml.d.ts +20 -6
  84. package/dist/core/command-generation/yaml.js +31 -21
  85. package/dist/core/command-surface.d.ts +15 -0
  86. package/dist/core/command-surface.js +33 -0
  87. package/dist/core/completions/command-registry.js +16 -2
  88. package/dist/core/completions/generators/powershell-generator.js +15 -8
  89. package/dist/core/completions/installers/zsh-installer.d.ts +9 -0
  90. package/dist/core/completions/installers/zsh-installer.js +20 -4
  91. package/dist/core/config-prompts.d.ts +1 -1
  92. package/dist/core/config-prompts.js +14 -1
  93. package/dist/core/config-schema.d.ts +10 -1
  94. package/dist/core/config-schema.js +67 -1
  95. package/dist/core/config.d.ts +15 -0
  96. package/dist/core/config.js +45 -5
  97. package/dist/core/file-state.js +56 -24
  98. package/dist/core/github-copilot/cloud-agent.d.ts +95 -0
  99. package/dist/core/github-copilot/cloud-agent.js +497 -0
  100. package/dist/core/global-config.d.ts +16 -0
  101. package/dist/core/init.d.ts +58 -0
  102. package/dist/core/init.js +450 -69
  103. package/dist/core/legacy-cleanup.d.ts +59 -0
  104. package/dist/core/legacy-cleanup.js +253 -24
  105. package/dist/core/list.js +5 -7
  106. package/dist/core/migration.d.ts +73 -1
  107. package/dist/core/migration.js +360 -11
  108. package/dist/core/onboarding-commands.d.ts +30 -0
  109. package/dist/core/onboarding-commands.js +38 -0
  110. package/dist/core/parsers/change-parser.d.ts +17 -2
  111. package/dist/core/parsers/change-parser.js +33 -20
  112. package/dist/core/parsers/code-fence.d.ts +15 -0
  113. package/dist/core/parsers/code-fence.js +49 -0
  114. package/dist/core/parsers/markdown-parser.js +2 -1
  115. package/dist/core/parsers/requirement-blocks.d.ts +18 -0
  116. package/dist/core/parsers/requirement-blocks.js +120 -35
  117. package/dist/core/parsers/requirement-text.d.ts +1 -8
  118. package/dist/core/parsers/requirement-text.js +4 -42
  119. package/dist/core/parsers/spec-structure.d.ts +1 -1
  120. package/dist/core/parsers/spec-structure.js +20 -30
  121. package/dist/core/profile-sync-drift.d.ts +0 -8
  122. package/dist/core/profile-sync-drift.js +48 -49
  123. package/dist/core/project-config.d.ts +28 -6
  124. package/dist/core/project-config.js +108 -8
  125. package/dist/core/references.js +42 -4
  126. package/dist/core/relationship-health.d.ts +8 -0
  127. package/dist/core/relationship-health.js +13 -0
  128. package/dist/core/root-selection.d.ts +9 -6
  129. package/dist/core/root-selection.js +42 -5
  130. package/dist/core/shared/index.d.ts +1 -0
  131. package/dist/core/shared/index.js +1 -0
  132. package/dist/core/shared/skill-content-equivalence.d.ts +7 -0
  133. package/dist/core/shared/skill-content-equivalence.js +41 -0
  134. package/dist/core/shared/skill-paths.d.ts +13 -0
  135. package/dist/core/shared/skill-paths.js +23 -0
  136. package/dist/core/shared/tool-detection.d.ts +25 -5
  137. package/dist/core/shared/tool-detection.js +166 -36
  138. package/dist/core/shared-skill-target.d.ts +16 -0
  139. package/dist/core/shared-skill-target.js +156 -0
  140. package/dist/core/specs-apply.d.ts +80 -33
  141. package/dist/core/specs-apply.js +659 -171
  142. package/dist/core/store/git.d.ts +13 -0
  143. package/dist/core/store/git.js +24 -0
  144. package/dist/core/templates/skill-templates.d.ts +1 -1
  145. package/dist/core/templates/skill-templates.js +1 -1
  146. package/dist/core/templates/workflows/apply-change.d.ts +10 -0
  147. package/dist/core/templates/workflows/apply-change.js +48 -158
  148. package/dist/core/templates/workflows/archive-change.js +170 -42
  149. package/dist/core/templates/workflows/bulk-archive-change.js +256 -75
  150. package/dist/core/templates/workflows/continue-change.js +38 -46
  151. package/dist/core/templates/workflows/explore.js +54 -18
  152. package/dist/core/templates/workflows/ff-change.js +46 -30
  153. package/dist/core/templates/workflows/new-change.js +2 -2
  154. package/dist/core/templates/workflows/onboard.js +13 -7
  155. package/dist/core/templates/workflows/propose.js +116 -46
  156. package/dist/core/templates/workflows/store-selection.d.ts +1 -1
  157. package/dist/core/templates/workflows/store-selection.js +1 -1
  158. package/dist/core/templates/workflows/sync-specs.js +260 -32
  159. package/dist/core/templates/workflows/update-change.js +26 -16
  160. package/dist/core/templates/workflows/verify-change.js +16 -10
  161. package/dist/core/update.d.ts +40 -5
  162. package/dist/core/update.js +389 -93
  163. package/dist/core/validation/constants.d.ts +4 -1
  164. package/dist/core/validation/constants.js +4 -1
  165. package/dist/core/validation/validator.d.ts +22 -8
  166. package/dist/core/validation/validator.js +222 -50
  167. package/dist/core/version-check.d.ts +152 -0
  168. package/dist/core/version-check.js +731 -0
  169. package/dist/core/view.js +12 -17
  170. package/dist/prompts/searchable-multi-select.js +1 -1
  171. package/dist/telemetry/config.d.ts +3 -4
  172. package/dist/telemetry/index.d.ts +10 -5
  173. package/dist/telemetry/index.js +75 -41
  174. package/dist/ui/welcome-screen.d.ts +9 -1
  175. package/dist/ui/welcome-screen.js +91 -38
  176. package/dist/utils/change-metadata.d.ts +43 -0
  177. package/dist/utils/change-metadata.js +123 -7
  178. package/dist/utils/change-utils.d.ts +10 -4
  179. package/dist/utils/change-utils.js +20 -13
  180. package/dist/utils/ci.d.ts +12 -0
  181. package/dist/utils/ci.js +16 -0
  182. package/dist/utils/command-references.d.ts +92 -6
  183. package/dist/utils/command-references.js +180 -7
  184. package/dist/utils/date.d.ts +8 -0
  185. package/dist/utils/date.js +13 -0
  186. package/dist/utils/file-system.d.ts +10 -0
  187. package/dist/utils/file-system.js +70 -0
  188. package/dist/utils/index.d.ts +1 -1
  189. package/dist/utils/index.js +1 -1
  190. package/dist/utils/interactive.d.ts +23 -0
  191. package/dist/utils/interactive.js +32 -0
  192. package/dist/utils/item-discovery.d.ts +19 -0
  193. package/dist/utils/item-discovery.js +30 -48
  194. package/dist/utils/shell-detection.d.ts +1 -1
  195. package/dist/utils/shell-detection.js +64 -11
  196. package/dist/utils/spec-discovery.d.ts +40 -0
  197. package/dist/utils/spec-discovery.js +115 -0
  198. package/dist/utils/task-progress.d.ts +17 -0
  199. package/dist/utils/task-progress.js +41 -13
  200. package/package.json +14 -12
  201. package/schemas/spec-driven/schema.yaml +67 -10
  202. package/schemas/spec-driven/templates/design.md +2 -2
  203. package/schemas/spec-driven/templates/proposal.md +10 -4
  204. package/schemas/spec-driven/templates/spec.md +3 -0
  205. package/dist/core/command-generation/adapters/codex.d.ts +0 -16
  206. package/dist/core/command-generation/adapters/codex.js +0 -39
  207. package/dist/core/command-generation/adapters/windsurf.d.ts +0 -14
  208. 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,18 +34,18 @@ ${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")
35
- - \`isComplete\`: Boolean indicating if all artifacts are complete
37
+ - \`artifacts\`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
38
+ - \`isPlanningComplete\`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as \`isComplete\`.
36
39
  - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
37
40
 
38
41
  3. **Act based on status**:
39
42
 
40
43
  ---
41
44
 
42
- **If all artifacts are complete (\`isComplete: true\`)**:
45
+ **If all planning artifacts are complete (\`isPlanningComplete: true\`, or legacy \`isComplete: true\`)**:
43
46
  - Congratulate the user
44
47
  - Show final status including the schema used
45
- - Suggest: "All artifacts created! You can now implement this change or archive it."
48
+ - Suggest: "Planning is complete! You can now implement this change. Once implementation and any tracked work are complete, archive it."
46
49
  - STOP
47
50
 
48
51
  ---
@@ -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,18 +151,18 @@ ${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")
156
- - \`isComplete\`: Boolean indicating if all artifacts are complete
154
+ - \`artifacts\`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
155
+ - \`isPlanningComplete\`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as \`isComplete\`.
157
156
  - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
158
157
 
159
158
  3. **Act based on status**:
160
159
 
161
160
  ---
162
161
 
163
- **If all artifacts are complete (\`isComplete: true\`)**:
162
+ **If all planning artifacts are complete (\`isPlanningComplete: true\`, or legacy \`isComplete: true\`)**:
164
163
  - Congratulate the user
165
164
  - Show final status including the schema used
166
- - Suggest: "All artifacts created! You can now implement this change with \`/opsx:apply\` or archive it with \`/opsx:archive\`."
165
+ - Suggest: "Planning is complete! You can now implement this change with \`/opsx:apply\`. Once implementation and any tracked work are complete, archive it with \`/opsx:archive\`."
167
166
  - STOP
168
167
 
169
168
  ---
@@ -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
@@ -5,7 +5,7 @@ export function getExploreSkillTemplate() {
5
5
  description: 'Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.',
6
6
  instructions: `Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
7
7
 
8
- **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
8
+ **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing. For a new change, scaffold it first as described below.
9
9
 
10
10
  **This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
11
11
 
@@ -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:
@@ -94,6 +100,15 @@ Think freely. When insights crystallize, you might offer:
94
100
  - "This feels solid enough to start a change. Want me to create a proposal?"
95
101
  - Or keep exploring - no pressure to formalize
96
102
 
103
+ If the user asks you to capture the exploration as a new change, transition seamlessly into the requested capture:
104
+
105
+ 1. Run \`openspec new change "<name>"\` (with \`--store <id>\` when applicable) before creating any artifacts. Never create a new change directory under \`openspec/changes/\` by hand; the CLI scaffold creates required metadata such as \`.openspec.yaml\`. Keep the selected \`--store <id>\` on every applicable follow-up \`status\` and \`instructions\` command.
106
+ 2. Run \`openspec status --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store), then process the requested artifacts in dependency order. For each requested artifact that is \`ready\`, run \`openspec instructions "<artifact-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store). Before creating a requested artifact, evaluate any condition in its own \`instruction\` against the explored change; record a deliberate skip instead when the condition does not apply. If a requested artifact is blocked by a direct prerequisite the user did not request, run \`openspec instructions "<prerequisite-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) for that prerequisite whether it is \`ready\` or \`blocked\`. If its own \`instruction\` states a condition, evaluate that condition against the explored change and record a deliberate skip only when the condition does not apply. If the condition applies, or the prerequisite is not conditional, treat it as a normal prerequisite and ask before expanding the capture. Do not create an unrequested prerequisite unless the user approves.
107
+ 3. Follow the returned \`template\` and \`instruction\` fields. Read completed dependency files listed in \`dependencies\`, and apply \`context\` and \`rules\` as constraints without copying them into the artifact. If the instruction delegates creation to a specific skill or command, invoke it; otherwise write the artifact to \`resolvedOutputPath\`, using the instruction to choose a concrete path when it is a glob. Verify that the selected concrete output exists.
108
+ 4. After creating each artifact, re-run \`openspec status --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) and continue until every requested artifact is \`done\`, \`skipped\`, or was deliberately skipped because its own \`instruction\` stated a condition that did not apply. Tell the user about a deliberate conditional skip, remember it, and do not reconsider it. Dependencies are enablers, not gates: if a requested artifact is still \`blocked\` only because you deliberately skipped a conditional prerequisite, run \`openspec instructions "<artifact-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) despite the blocked status, then create it using step 3 only when those recorded conditional skips are its sole missing dependencies. If a requested artifact is blocked by a prerequisite the user did not ask to capture and cannot be conditionally skipped, explain that dependency and ask before expanding the capture.
109
+
110
+ Capture the artifact(s) the user requested without asking them to invoke another workflow command. If they asked only to start a change, stop after scaffolding and show its status.
111
+
97
112
  ### When a change exists
98
113
 
99
114
  If the user mentions a change or you detect one is relevant:
@@ -109,14 +124,16 @@ If the user mentions a change or you detect one is relevant:
109
124
 
110
125
  3. **Offer to capture when decisions are made**
111
126
 
112
- | Insight Type | Where to Capture |
113
- |----------------------------|--------------------------------|
114
- | New requirement discovered | \`specs/<capability>/spec.md\` |
115
- | Requirement changed | \`specs/<capability>/spec.md\` |
116
- | Design decision made | \`design.md\` |
117
- | Scope changed | \`proposal.md\` |
118
- | New work identified | \`tasks.md\` |
119
- | Assumption invalidated | Relevant artifact |
127
+ \`<capability-path>\` is the spec directory relative to \`specs/\` (for example, \`user-auth\` or \`identity/user-auth\`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
128
+
129
+ | Insight Type | Where to Capture |
130
+ |----------------------------|-------------------------------------|
131
+ | New requirement discovered | \`specs/<capability-path>/spec.md\` |
132
+ | Requirement changed | \`specs/<capability-path>/spec.md\` |
133
+ | Design decision made | \`design.md\` |
134
+ | Scope changed | \`proposal.md\` |
135
+ | New work identified | \`tasks.md\` |
136
+ | Assumption invalidated | Relevant artifact |
120
137
 
121
138
  Example offers:
122
139
  - "That's a design decision. Capture it in design.md?"
@@ -278,6 +295,7 @@ But this summary is optional. Sometimes the thinking IS the value.
278
295
  - **Don't rush** - Discovery is thinking time, not task time
279
296
  - **Don't force structure** - Let patterns emerge naturally
280
297
  - **Don't auto-capture** - Offer to save insights, don't just do it
298
+ - **Don't manually scaffold changes** - Never create a new change directory under \`openspec/changes/\` by hand. Always use \`openspec new change "<name>"\` (with \`--store <id>\` when applicable) so required metadata such as \`.openspec.yaml\` is created before writing artifacts.
281
299
  - **Do visualize** - A good diagram is worth many paragraphs
282
300
  - **Do explore the codebase** - Ground discussions in reality
283
301
  - **Do question assumptions** - Including the user's and your own`,
@@ -294,7 +312,7 @@ export function getOpsxExploreCommandTemplate() {
294
312
  tags: ['workflow', 'explore', 'experimental', 'thinking'],
295
313
  content: `Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
296
314
 
297
- **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
315
+ **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing. For a new change, scaffold it first as described below.
298
316
 
299
317
  **This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
300
318
 
@@ -383,6 +401,12 @@ This tells you:
383
401
  - Their names, schemas, and status
384
402
  - What the user might be working on
385
403
 
404
+ 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:
405
+ - \`context\`: project background - tech stack, conventions, constraints
406
+ - \`rules\`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
407
+
408
+ 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.
409
+
386
410
  If the user mentioned a specific change name, read its artifacts for context.
387
411
 
388
412
  ### When no change exists
@@ -392,6 +416,15 @@ Think freely. When insights crystallize, you might offer:
392
416
  - "This feels solid enough to start a change. Want me to create a proposal?"
393
417
  - Or keep exploring - no pressure to formalize
394
418
 
419
+ If the user asks you to capture the exploration as a new change, transition seamlessly into the requested capture:
420
+
421
+ 1. Run \`openspec new change "<name>"\` (with \`--store <id>\` when applicable) before creating any artifacts. Never create a new change directory under \`openspec/changes/\` by hand; the CLI scaffold creates required metadata such as \`.openspec.yaml\`. Keep the selected \`--store <id>\` on every applicable follow-up \`status\` and \`instructions\` command.
422
+ 2. Run \`openspec status --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store), then process the requested artifacts in dependency order. For each requested artifact that is \`ready\`, run \`openspec instructions "<artifact-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store). Before creating a requested artifact, evaluate any condition in its own \`instruction\` against the explored change; record a deliberate skip instead when the condition does not apply. If a requested artifact is blocked by a direct prerequisite the user did not request, run \`openspec instructions "<prerequisite-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) for that prerequisite whether it is \`ready\` or \`blocked\`. If its own \`instruction\` states a condition, evaluate that condition against the explored change and record a deliberate skip only when the condition does not apply. If the condition applies, or the prerequisite is not conditional, treat it as a normal prerequisite and ask before expanding the capture. Do not create an unrequested prerequisite unless the user approves.
423
+ 3. Follow the returned \`template\` and \`instruction\` fields. Read completed dependency files listed in \`dependencies\`, and apply \`context\` and \`rules\` as constraints without copying them into the artifact. If the instruction delegates creation to a specific skill or command, invoke it; otherwise write the artifact to \`resolvedOutputPath\`, using the instruction to choose a concrete path when it is a glob. Verify that the selected concrete output exists.
424
+ 4. After creating each artifact, re-run \`openspec status --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) and continue until every requested artifact is \`done\`, \`skipped\`, or was deliberately skipped because its own \`instruction\` stated a condition that did not apply. Tell the user about a deliberate conditional skip, remember it, and do not reconsider it. Dependencies are enablers, not gates: if a requested artifact is still \`blocked\` only because you deliberately skipped a conditional prerequisite, run \`openspec instructions "<artifact-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) despite the blocked status, then create it using step 3 only when those recorded conditional skips are its sole missing dependencies. If a requested artifact is blocked by a prerequisite the user did not ask to capture and cannot be conditionally skipped, explain that dependency and ask before expanding the capture.
425
+
426
+ Capture the artifact(s) the user requested without asking them to invoke another workflow command. If they asked only to start a change, stop after scaffolding and show its status.
427
+
395
428
  ### When a change exists
396
429
 
397
430
  If the user mentions a change or you detect one is relevant:
@@ -407,14 +440,16 @@ If the user mentions a change or you detect one is relevant:
407
440
 
408
441
  3. **Offer to capture when decisions are made**
409
442
 
410
- | Insight Type | Where to Capture |
411
- |----------------------------|--------------------------------|
412
- | New requirement discovered | \`specs/<capability>/spec.md\` |
413
- | Requirement changed | \`specs/<capability>/spec.md\` |
414
- | Design decision made | \`design.md\` |
415
- | Scope changed | \`proposal.md\` |
416
- | New work identified | \`tasks.md\` |
417
- | Assumption invalidated | Relevant artifact |
443
+ \`<capability-path>\` is the spec directory relative to \`specs/\` (for example, \`user-auth\` or \`identity/user-auth\`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
444
+
445
+ | Insight Type | Where to Capture |
446
+ |----------------------------|-------------------------------------|
447
+ | New requirement discovered | \`specs/<capability-path>/spec.md\` |
448
+ | Requirement changed | \`specs/<capability-path>/spec.md\` |
449
+ | Design decision made | \`design.md\` |
450
+ | Scope changed | \`proposal.md\` |
451
+ | New work identified | \`tasks.md\` |
452
+ | Assumption invalidated | Relevant artifact |
418
453
 
419
454
  Example offers:
420
455
  - "That's a design decision. Capture it in design.md?"
@@ -456,6 +491,7 @@ When things crystallize, you might offer a summary - but it's optional. Sometime
456
491
  - **Don't rush** - Discovery is thinking time, not task time
457
492
  - **Don't force structure** - Let patterns emerge naturally
458
493
  - **Don't auto-capture** - Offer to save insights, don't just do it
494
+ - **Don't manually scaffold changes** - Never create a new change directory under \`openspec/changes/\` by hand. Always use \`openspec new change "<name>"\` (with \`--store <id>\` when applicable) so required metadata such as \`.openspec.yaml\` is created before writing artifacts.
459
495
  - **Do visualize** - A good diagram is worth many paragraphs
460
496
  - **Do explore the codebase** - Ground discussions in reality
461
497
  - **Do question assumptions** - Including the user's and your own`
@@ -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\`).
@@ -211,6 +211,11 @@ I'll draft one based on our task.
211
211
 
212
212
  **DO:** Draft the proposal content (don't save yet):
213
213
 
214
+ \`<capability-path>\` is the spec directory relative to \`specs/\` (for example,
215
+ \`user-auth\` or \`identity/user-auth\`). Use the exact existing path for modified
216
+ capabilities. For new capabilities, follow the project's established spec
217
+ organization.
218
+
214
219
  \`\`\`
215
220
  Here's a draft proposal:
216
221
 
@@ -227,10 +232,11 @@ Here's a draft proposal:
227
232
  ## Capabilities
228
233
 
229
234
  ### New Capabilities
230
- - \`<capability-name>\`: [brief description]
235
+ - \`<capability-path>\`: [brief description]
231
236
 
232
237
  ### Modified Capabilities
233
238
  <!-- If modifying existing behavior -->
239
+ - \`<existing-capability-path>\`: [brief description]
234
240
 
235
241
  ## Impact
236
242
 
@@ -431,14 +437,14 @@ When a change is complete, we archive it. The archive path is derived from \`pla
431
437
  Archived changes become your project's decision history—you can always find them later to understand why something was built a certain way.
432
438
  \`\`\`
433
439
 
434
- **DO:**
440
+ **DO:** Archive the change (\`--yes\` answers the confirmation prompts, which you cannot answer from a tool call):
435
441
  \`\`\`bash
436
- openspec archive "<name>"
442
+ openspec archive "<name>" --yes
437
443
  \`\`\`
438
444
 
439
445
  **SHOW:**
440
446
  \`\`\`
441
- Archived to: \`<planningHome.changesDir>/archive/YYYY-MM-DD-<name>/\`
447
+ 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
448
 
443
449
  The change is now part of your project's history. The code is in your codebase, the decision record is preserved.
444
450
  \`\`\`
@@ -476,7 +482,7 @@ This same rhythm works for any size change—a small fix or a major feature.
476
482
  | \`/opsx:apply\` | Implement tasks from a change |
477
483
  | \`/opsx:archive\` | Archive a completed change |
478
484
 
479
- **Additional commands:**
485
+ **Additional commands** (only if installed - availability depends on your profile):
480
486
 
481
487
  | Command | What it does |
482
488
  |--------------------|----------------------------------------------------------|
@@ -504,7 +510,7 @@ If the user says they need to stop, want to pause, or seem disengaged:
504
510
  No problem! Your change is saved at the \`changeRoot\` reported by \`openspec status --change "<name>" --json\`.
505
511
 
506
512
  To pick up where we left off later:
507
- - \`/opsx:continue <name>\` - Resume artifact creation
513
+ - \`/opsx:continue <name>\` - Resume artifact creation (if installed; otherwise \`openspec status --change "<name>" --json\` shows the next artifact)
508
514
  - \`/opsx:apply <name>\` - Jump to implementation (if tasks exist)
509
515
 
510
516
  The work won't be lost. Come back whenever you're ready.
@@ -528,7 +534,7 @@ If the user says they just want to see the commands or skip the tutorial:
528
534
  | \`/opsx:apply <name>\` | Implement tasks |
529
535
  | \`/opsx:archive <name>\` | Archive when done |
530
536
 
531
- **Additional commands:**
537
+ **Additional commands** (only if installed - availability depends on your profile):
532
538
 
533
539
  | Command | What it does |
534
540
  |---------------------------|-------------------------------------|