@fission-ai/openspec 1.7.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 (95) hide show
  1. package/README.md +3 -1
  2. package/dist/cli/index.js +6 -1
  3. package/dist/commands/change.js +15 -1
  4. package/dist/commands/schema.js +89 -20
  5. package/dist/commands/spec.js +30 -6
  6. package/dist/commands/validate.js +2 -2
  7. package/dist/commands/workflow/instructions.js +32 -27
  8. package/dist/commands/workflow/status.js +2 -2
  9. package/dist/commands/workflow/templates.js +15 -5
  10. package/dist/core/archive.d.ts +14 -0
  11. package/dist/core/archive.js +1265 -151
  12. package/dist/core/artifact-graph/index.d.ts +1 -1
  13. package/dist/core/artifact-graph/index.js +1 -1
  14. package/dist/core/artifact-graph/instruction-loader.d.ts +3 -1
  15. package/dist/core/artifact-graph/instruction-loader.js +15 -5
  16. package/dist/core/artifact-graph/outputs.d.ts +1 -0
  17. package/dist/core/artifact-graph/outputs.js +67 -5
  18. package/dist/core/artifact-graph/resolver.js +35 -9
  19. package/dist/core/artifact-graph/types.js +21 -3
  20. package/dist/core/available-tools.d.ts +2 -2
  21. package/dist/core/available-tools.js +14 -3
  22. package/dist/core/change-metadata/schema.d.ts +1 -0
  23. package/dist/core/change-metadata/schema.js +7 -0
  24. package/dist/core/change-status-policy.js +2 -2
  25. package/dist/core/completions/command-registry.js +8 -0
  26. package/dist/core/config-schema.d.ts +3 -0
  27. package/dist/core/config-schema.js +28 -1
  28. package/dist/core/config.d.ts +3 -0
  29. package/dist/core/config.js +24 -2
  30. package/dist/core/file-state.js +56 -24
  31. package/dist/core/github-copilot/cloud-agent.d.ts +95 -0
  32. package/dist/core/github-copilot/cloud-agent.js +497 -0
  33. package/dist/core/global-config.d.ts +11 -0
  34. package/dist/core/init.d.ts +23 -0
  35. package/dist/core/init.js +234 -39
  36. package/dist/core/legacy-cleanup.js +4 -2
  37. package/dist/core/migration.d.ts +6 -4
  38. package/dist/core/migration.js +78 -22
  39. package/dist/core/parsers/requirement-blocks.d.ts +10 -0
  40. package/dist/core/parsers/requirement-blocks.js +60 -0
  41. package/dist/core/parsers/spec-structure.d.ts +1 -1
  42. package/dist/core/parsers/spec-structure.js +17 -1
  43. package/dist/core/profile-sync-drift.js +40 -5
  44. package/dist/core/project-config.d.ts +3 -0
  45. package/dist/core/project-config.js +31 -1
  46. package/dist/core/shared/index.d.ts +1 -0
  47. package/dist/core/shared/index.js +1 -0
  48. package/dist/core/shared/skill-content-equivalence.d.ts +7 -0
  49. package/dist/core/shared/skill-content-equivalence.js +41 -0
  50. package/dist/core/shared/skill-paths.d.ts +13 -0
  51. package/dist/core/shared/skill-paths.js +23 -0
  52. package/dist/core/shared/tool-detection.js +66 -35
  53. package/dist/core/shared-skill-target.d.ts +16 -0
  54. package/dist/core/shared-skill-target.js +156 -0
  55. package/dist/core/specs-apply.d.ts +72 -0
  56. package/dist/core/specs-apply.js +448 -55
  57. package/dist/core/templates/skill-templates.d.ts +1 -1
  58. package/dist/core/templates/skill-templates.js +1 -1
  59. package/dist/core/templates/workflows/apply-change.d.ts +10 -0
  60. package/dist/core/templates/workflows/apply-change.js +22 -182
  61. package/dist/core/templates/workflows/archive-change.js +8 -4
  62. package/dist/core/templates/workflows/bulk-archive-change.js +30 -26
  63. package/dist/core/templates/workflows/continue-change.js +6 -6
  64. package/dist/core/templates/workflows/explore.js +42 -18
  65. package/dist/core/templates/workflows/onboard.js +9 -3
  66. package/dist/core/templates/workflows/propose.js +72 -20
  67. package/dist/core/templates/workflows/store-selection.d.ts +1 -1
  68. package/dist/core/templates/workflows/store-selection.js +1 -1
  69. package/dist/core/templates/workflows/sync-specs.js +96 -18
  70. package/dist/core/templates/workflows/update-change.js +10 -8
  71. package/dist/core/update.d.ts +1 -0
  72. package/dist/core/update.js +103 -24
  73. package/dist/core/validation/validator.d.ts +23 -3
  74. package/dist/core/validation/validator.js +134 -18
  75. package/dist/core/version-check.js +6 -11
  76. package/dist/telemetry/config.d.ts +3 -4
  77. package/dist/telemetry/index.d.ts +9 -4
  78. package/dist/telemetry/index.js +20 -8
  79. package/dist/utils/change-metadata.d.ts +17 -4
  80. package/dist/utils/change-metadata.js +26 -4
  81. package/dist/utils/ci.d.ts +12 -0
  82. package/dist/utils/ci.js +16 -0
  83. package/dist/utils/command-references.d.ts +14 -2
  84. package/dist/utils/command-references.js +45 -3
  85. package/dist/utils/file-system.d.ts +10 -0
  86. package/dist/utils/file-system.js +70 -0
  87. package/dist/utils/interactive.d.ts +23 -0
  88. package/dist/utils/interactive.js +32 -0
  89. package/dist/utils/spec-discovery.d.ts +4 -4
  90. package/dist/utils/spec-discovery.js +19 -6
  91. package/dist/utils/task-progress.d.ts +17 -0
  92. package/dist/utils/task-progress.js +41 -13
  93. package/package.json +1 -1
  94. package/schemas/spec-driven/schema.yaml +8 -6
  95. package/schemas/spec-driven/templates/proposal.md +6 -4
@@ -1,13 +1,19 @@
1
1
  import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
2
- export function getApplyChangeSkillTemplate() {
3
- return {
4
- name: 'openspec-apply-change',
5
- description: 'Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.',
6
- instructions: `Implement tasks from an OpenSpec change.
2
+ /**
3
+ * The apply workflow instructions, authored once and rendered by both the
4
+ * skill and command surfaces. The surfaces are intentionally distinct, but
5
+ * they differ only in how they are invoked — the generation transformers
6
+ * rewrite the canonical `/opsx:<id>` tokens per surface downstream (see
7
+ * command-references.ts). The instruction text itself is shared, so the two
8
+ * cannot silently drift. Should a surface ever need genuinely different
9
+ * wording, add a parameter here and pass it from that surface's template.
10
+ */
11
+ export function getApplyInstructions() {
12
+ return `Implement tasks from an OpenSpec change.
7
13
 
8
14
  ${STORE_SELECTION_GUIDANCE}
9
15
 
10
- **Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
16
+ **Input**: Optionally specify a change name (e.g., \`/opsx:apply add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
11
17
 
12
18
  **Steps**
13
19
 
@@ -44,7 +50,7 @@ ${STORE_SELECTION_GUIDANCE}
44
50
  - Optional \`operationGuidance\`: current advisory guidance for apply
45
51
 
46
52
  **Handle states:**
47
- - If \`state: "blocked"\` (missing artifacts): show message, suggest using openspec-continue-change (if it is not installed, run \`openspec status --change "<name>" --json\` to see the next artifact and \`openspec instructions <artifact-id> --change "<name>" --json\` for how to create it)
53
+ - If \`state: "blocked"\` (missing artifacts): show message, suggest using \`/opsx:continue\` (if it is not installed, run \`openspec status --change "<name>" --json\` to see the next artifact and \`openspec instructions <artifact-id> --change "<name>" --json\` for how to create it)
48
54
  - If \`state: "all_done"\`: congratulate, suggest archive
49
55
  - Otherwise: proceed to implementation
50
56
 
@@ -132,7 +138,7 @@ Working on task 4/7: <task description>
132
138
  - [x] Task 2
133
139
  ...
134
140
 
135
- All tasks complete! Ready to archive this change.
141
+ All tasks complete! You can archive this change with \`/opsx:archive\`.
136
142
  \`\`\`
137
143
 
138
144
  **Output On Pause (Issue Encountered)**
@@ -175,7 +181,13 @@ What would you like to do?
175
181
  This skill supports the "actions on a change" model:
176
182
 
177
183
  - **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
178
- - **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly`,
184
+ - **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly`;
185
+ }
186
+ export function getApplyChangeSkillTemplate() {
187
+ return {
188
+ name: 'openspec-apply-change',
189
+ description: 'Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.',
190
+ instructions: getApplyInstructions(),
179
191
  license: 'MIT',
180
192
  compatibility: 'Requires openspec CLI.',
181
193
  metadata: { author: 'openspec', version: '1.0' },
@@ -187,179 +199,7 @@ export function getOpsxApplyCommandTemplate() {
187
199
  description: 'Implement tasks from an OpenSpec change (Experimental)',
188
200
  category: 'Workflow',
189
201
  tags: ['workflow', 'artifacts', 'experimental'],
190
- content: `Implement tasks from an OpenSpec change.
191
-
192
- ${STORE_SELECTION_GUIDANCE}
193
-
194
- **Input**: Optionally specify a change name (e.g., \`/opsx:apply add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
195
-
196
- **Steps**
197
-
198
- 1. **Select the change**
199
-
200
- If a name is provided, use it. Otherwise:
201
- - Infer from conversation context if the user mentioned a change
202
- - Auto-select if only one active change exists
203
- - If ambiguous, run \`openspec list --json\` to get available changes and ask the user to select one
204
-
205
- Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:apply <other>\`).
206
-
207
- 2. **Check status to understand the schema**
208
- \`\`\`bash
209
- openspec status --change "<name>" --json
210
- \`\`\`
211
- Parse the JSON to understand:
212
- - \`schemaName\`: The workflow being used (e.g., "spec-driven")
213
- - \`planningHome\`, \`changeRoot\`, and \`actionContext\`: planning scope and edit constraints
214
- - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
215
-
216
- 3. **Get apply instructions**
217
-
218
- \`\`\`bash
219
- openspec instructions apply --change "<name>" --json
220
- \`\`\`
221
-
222
- This returns:
223
- - \`contextFiles\`: artifact ID -> array of concrete file paths (varies by schema)
224
- - Progress (total, complete, remaining)
225
- - Task list with status
226
- - Dynamic instruction based on current state
227
- - Optional \`context\`: current required project instruction input from the selected root
228
- - Optional \`operationGuidance\`: current advisory guidance for apply
229
-
230
- **Handle states:**
231
- - If \`state: "blocked"\` (missing artifacts): show message, suggest using \`/opsx:continue\` (if it is not installed, run \`openspec status --change "<name>" --json\` to see the next artifact and \`openspec instructions <artifact-id> --change "<name>" --json\` for how to create it)
232
- - If \`state: "all_done"\`: congratulate, suggest archive
233
- - Otherwise: proceed to implementation
234
-
235
- Treat \`context\` as a required prompt-level input. Read and consider it, and
236
- apply relevant project facts, conventions, and constraints while implementing.
237
- Treat \`operationGuidance\` as optional additive advice. Read and consider every
238
- entry, and follow entries that are applicable and compatible with the built-in
239
- workflow.
240
-
241
- Keep both fields separate from CLI-returned state, missing artifacts, tasks,
242
- progress, \`contextFiles\`, and the built-in \`instruction\`. They are not
243
- evidence of task completion, do not replace the built-in instruction, and do
244
- not permit bypassing a blocked state. If context conflicts with the built-in
245
- instruction, an explicit user choice, or a CLI-controlled value, report the
246
- conflict and preserve the controlling value. If guidance is inapplicable or
247
- conflicts with those controlling inputs, do not follow it and explain why.
248
- These are prompt-level behavior contracts, not enforceable checks.
249
-
250
- 4. **Read context files**
251
-
252
- Read every file path listed under \`contextFiles\` from the apply instructions output.
253
- The files depend on the schema being used:
254
- - **spec-driven**: proposal, specs, design, tasks
255
- - Other schemas: follow the contextFiles from CLI output
256
-
257
- Do not copy \`context\` or \`operationGuidance\` verbatim into implementation
258
- files or planning artifacts unless the user separately asks for that content.
259
-
260
- 5. **Show current progress**
261
-
262
- Display:
263
- - Schema being used
264
- - Progress: "N/M tasks complete"
265
- - Remaining tasks overview
266
- - Dynamic instruction from CLI
267
-
268
- 6. **Implement tasks (loop until done or blocked)**
269
-
270
- For each pending task:
271
- - Show which task is being worked on
272
- - Make the code changes required
273
- - Keep changes minimal and focused
274
- - Mark task complete in the tasks file: \`- [ ]\` → \`- [x]\`
275
- - Continue to next task
276
-
277
- **Pause if:**
278
- - Task is unclear → ask for clarification
279
- - Implementation reveals a design issue → suggest updating artifacts
280
- - Error or blocker encountered → report and wait for guidance
281
- - User interrupts
282
-
283
- 7. **On completion or pause, show status**
284
-
285
- Display:
286
- - Tasks completed this session
287
- - Overall progress: "N/M tasks complete"
288
- - If all done: suggest archive
289
- - If paused: explain why and wait for guidance
290
-
291
- **Output During Implementation**
292
-
293
- \`\`\`
294
- ## Implementing: <change-name> (schema: <schema-name>)
295
-
296
- Working on task 3/7: <task description>
297
- [...implementation happening...]
298
- ✓ Task complete
299
-
300
- Working on task 4/7: <task description>
301
- [...implementation happening...]
302
- ✓ Task complete
303
- \`\`\`
304
-
305
- **Output On Completion**
306
-
307
- \`\`\`
308
- ## Implementation Complete
309
-
310
- **Change:** <change-name>
311
- **Schema:** <schema-name>
312
- **Progress:** 7/7 tasks complete ✓
313
-
314
- ### Completed This Session
315
- - [x] Task 1
316
- - [x] Task 2
317
- ...
318
-
319
- All tasks complete! You can archive this change with \`/opsx:archive\`.
320
- \`\`\`
321
-
322
- **Output On Pause (Issue Encountered)**
323
-
324
- \`\`\`
325
- ## Implementation Paused
326
-
327
- **Change:** <change-name>
328
- **Schema:** <schema-name>
329
- **Progress:** 4/7 tasks complete
330
-
331
- ### Issue Encountered
332
- <description of the issue>
333
-
334
- **Options:**
335
- 1. <option 1>
336
- 2. <option 2>
337
- 3. Other approach
338
-
339
- What would you like to do?
340
- \`\`\`
341
-
342
- **Guardrails**
343
- - Keep going through tasks until done or blocked
344
- - Always read context files before starting (from the apply instructions output)
345
- - If task is ambiguous, pause and ask before implementing
346
- - If implementation reveals issues, pause and suggest artifact updates
347
- - Keep code changes minimal and scoped to each task
348
- - Update task checkbox immediately after completing each task
349
- - Pause on errors, blockers, or unclear requirements - don't guess
350
- - Use contextFiles from CLI output, don't assume specific file names
351
- - Do not use context or operation guidance as proof that a task is complete
352
- - Apply relevant project context; report conflicts with controlling workflow inputs
353
- - Consider every guidance entry; explain any inapplicable or conflicting advice
354
- - Do not copy runtime context or operation guidance into implementation files or planning artifacts
355
- - Preserve CLI-controlled blocked/ready/all-done behavior and completion criteria
356
-
357
- **Fluid Workflow Integration**
358
-
359
- This skill supports the "actions on a change" model:
360
-
361
- - **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
362
- - **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly`
202
+ content: getApplyInstructions(),
363
203
  };
364
204
  }
365
205
  //# sourceMappingURL=apply-change.js.map
@@ -7,6 +7,8 @@ export function getArchiveChangeSkillTemplate() {
7
7
 
8
8
  ${STORE_SELECTION_GUIDANCE}
9
9
 
10
+ \`<capability-path>\` is the spec directory relative to \`specs/\` (for example, \`user-auth\` or \`identity/user-auth\`). Preserve the full path from each delta spec when resolving its main spec.
11
+
10
12
  **Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
11
13
 
12
14
  **Steps**
@@ -85,7 +87,7 @@ ${STORE_SELECTION_GUIDANCE}
85
87
  delta specs from other artifacts.
86
88
 
87
89
  **If delta specs exist:**
88
- - Compare each delta spec with its corresponding main spec at \`<planningHome.root>/openspec/specs/<capability>/spec.md\` (use the store-aware \`planningHome.root\` from step 2, not a hardcoded repo path)
90
+ - Compare each delta spec with its corresponding main spec at \`<planningHome.root>/openspec/specs/<capability-path>/spec.md\` (use the store-aware \`planningHome.root\` from step 2, not a hardcoded repo path)
89
91
  - Determine what changes would be applied (adds, modifications, removals, renames)
90
92
  - Show a combined summary before prompting
91
93
 
@@ -113,7 +115,7 @@ ${STORE_SELECTION_GUIDANCE}
113
115
  Then re-run the comparison from the top of this step against every capability that has a delta spec in \`artifactPaths.specs.existingOutputPaths\` — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:
114
116
  - ADDED requirements present
115
117
  - MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact
116
- - REMOVED requirements gone
118
+ - REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving \`## Requirements\` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
117
119
  - RENAMED requirements present under the new name and absent under the old one
118
120
 
119
121
  If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and \`changeRoot\` is intact, so the user can fix the mismatch or re-run the sync and start the archive again.
@@ -186,6 +188,8 @@ export function getOpsxArchiveCommandTemplate() {
186
188
 
187
189
  ${STORE_SELECTION_GUIDANCE}
188
190
 
191
+ \`<capability-path>\` is the spec directory relative to \`specs/\` (for example, \`user-auth\` or \`identity/user-auth\`). Preserve the full path from each delta spec when resolving its main spec.
192
+
189
193
  **Input**: Optionally specify a change name after \`/opsx:archive\` (e.g., \`/opsx:archive add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
190
194
 
191
195
  **Steps**
@@ -264,7 +268,7 @@ ${STORE_SELECTION_GUIDANCE}
264
268
  delta specs from other artifacts.
265
269
 
266
270
  **If delta specs exist:**
267
- - Compare each delta spec with its corresponding main spec at \`<planningHome.root>/openspec/specs/<capability>/spec.md\` (use the store-aware \`planningHome.root\` from step 2, not a hardcoded repo path)
271
+ - Compare each delta spec with its corresponding main spec at \`<planningHome.root>/openspec/specs/<capability-path>/spec.md\` (use the store-aware \`planningHome.root\` from step 2, not a hardcoded repo path)
268
272
  - Determine what changes would be applied (adds, modifications, removals, renames)
269
273
  - Show a combined summary before prompting
270
274
 
@@ -292,7 +296,7 @@ ${STORE_SELECTION_GUIDANCE}
292
296
  Then re-run the comparison from the top of this step against every capability that has a delta spec in \`artifactPaths.specs.existingOutputPaths\` — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:
293
297
  - ADDED requirements present
294
298
  - MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact
295
- - REMOVED requirements gone
299
+ - REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving \`## Requirements\` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
296
300
  - RENAMED requirements present under the new name and absent under the old one
297
301
 
298
302
  If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and \`changeRoot\` is intact, so the user can fix the mismatch or re-run the sync and start the archive again.
@@ -9,6 +9,8 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
9
9
 
10
10
  ${STORE_SELECTION_GUIDANCE}
11
11
 
12
+ \`<capability-path>\` is the spec directory relative to \`specs/\` (for example, \`user-auth\` or \`identity/user-auth\`). Preserve the full path from each delta spec when resolving its main spec.
13
+
12
14
  **Input**: None required (prompts for selection)
13
15
 
14
16
  **Steps**
@@ -75,14 +77,14 @@ ${STORE_SELECTION_GUIDANCE}
75
77
  batches where some schemas have no \`specs\` artifact.
76
78
  4. **Detect spec conflicts**
77
79
 
78
- Build a map of \`capability -> [changes that touch it]\`:
80
+ Build a map keyed by \`<capability-path>\`, the exact path relative to \`specs/\`:
79
81
 
80
82
  \`\`\`text
81
- auth -> [change-a, change-b] <- CONFLICT (2+ changes)
82
- api -> [change-c] <- OK (only 1 change)
83
+ identity/user-auth -> [change-a, change-b] <- CONFLICT (2+ changes)
84
+ billing/user-auth -> [change-c] <- OK (different full path)
83
85
  \`\`\`
84
86
 
85
- A conflict exists when 2+ selected changes have delta specs for the same capability.
87
+ A conflict exists when 2+ selected changes have delta specs for the exact same \`<capability-path>\`.
86
88
 
87
89
  5. **Resolve conflicts agentically**
88
90
 
@@ -100,7 +102,7 @@ ${STORE_SELECTION_GUIDANCE}
100
102
  - If neither implemented -> skip spec sync, warn user
101
103
 
102
104
  d. **Record resolution** for each conflict:
103
- - An inclusion or exclusion decision for every delta spec, keyed by change and capability
105
+ - An inclusion or exclusion decision for every delta spec, keyed by change and \`<capability-path>\`
104
106
  - Which included delta specs to apply and in what order
105
107
  - Which delta specs to exclude from sync because their implementation is missing
106
108
  - Rationale (what was found in codebase)
@@ -114,14 +116,14 @@ ${STORE_SELECTION_GUIDANCE}
114
116
  |---------------------|-----------|-------|---------|-----------|--------|
115
117
  | schema-management | Done | 5/5 | 2 delta | None | Ready |
116
118
  | project-config | Done | 3/3 | 1 delta | None | Ready |
117
- | add-oauth | Done | 4/4 | 1 delta | auth (!) | Ready* |
119
+ | add-oauth | Done | 4/4 | 1 delta | identity/user-auth (!) | Ready* |
118
120
  | add-verify-skill | 1 left | 2/5 | None | None | Warn |
119
121
  \`\`\`
120
122
 
121
123
  For conflicts, show the resolution:
122
124
  \`\`\`text
123
125
  * Conflict resolution:
124
- - auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
126
+ - identity/user-auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
125
127
  \`\`\`
126
128
 
127
129
  For incomplete changes, show warnings:
@@ -180,11 +182,11 @@ ${STORE_SELECTION_GUIDANCE}
180
182
  - If a change has no included delta specs, do not run the sync workflow for it.
181
183
 
182
184
  b. **Verify included delta specs before moving changeRoot**:
183
- - Re-run the comparison only for delta specs in \`includedDeltas\` against main spec at \`<planningHome.root>/openspec/specs/<capability>/spec.md\` (use the store-aware \`planningHome.root\` from step 3 status JSON, not a hardcoded repo path).
185
+ - Re-run the comparison only for delta specs in \`includedDeltas\` against main spec at \`<planningHome.root>/openspec/specs/<capability-path>/spec.md\` (use the store-aware \`planningHome.root\` from step 3 status JSON, not a hardcoded repo path).
184
186
  - Verify that main specs are updated:
185
187
  - ADDED requirements present
186
188
  - MODIFIED requirements carrying scenario and description changes named in the delta, with their other scenarios intact
187
- - REMOVED requirements gone
189
+ - REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving \`## Requirements\` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
188
190
  - RENAMED requirements present under the new name and absent under the old one
189
191
  - Do not verify delta specs in \`excludedDeltas\`; they are intentionally left unsynced.
190
192
  - If sync failed or any capability does not match verification, report what differs and fail/skip moving that change's \`changeRoot\` — do not archive that change. \`changeRoot\` remains intact.
@@ -202,7 +204,7 @@ ${STORE_SELECTION_GUIDANCE}
202
204
  - Success: archived successfully
203
205
  - Failed: error during archive or spec verification (record error)
204
206
  - Skipped: user chose not to archive (if applicable)
205
- - Sync skipped: for every delta in \`excludedDeltas\`, report \`sync skipped\` with the change, capability, and recorded reason. This is distinct from skipping the archive.
207
+ - Sync skipped: for every delta in \`excludedDeltas\`, report \`sync skipped\` with the change, \`<capability-path>\`, and recorded reason. This is distinct from skipping the archive.
206
208
 
207
209
  9. **Display summary**
208
210
 
@@ -221,8 +223,8 @@ ${STORE_SELECTION_GUIDANCE}
221
223
 
222
224
  Spec sync summary:
223
225
  - 4 delta specs synced to main specs
224
- - 1 delta spec sync skipped (add-jwt/auth: implementation not found)
225
- - 1 conflict resolved (auth: synced add-oauth, skipped add-jwt)
226
+ - 1 delta spec sync skipped (add-jwt, identity/user-auth: implementation not found)
227
+ - 1 conflict resolved (identity/user-auth: synced add-oauth, skipped add-jwt)
226
228
  \`\`\`
227
229
 
228
230
  If any failures:
@@ -317,7 +319,7 @@ No active changes found. Create a new change to get started.
317
319
  - If sync is requested, run the \`openspec-sync-specs\` workflow inline (agent-driven) for each change with included delta specs
318
320
  - Carry the per-delta \`includedDeltas\` and \`excludedDeltas\` decisions into execution; sync and verify only included deltas
319
321
  - Report every excluded delta as \`sync skipped\` without treating the archive itself as skipped
320
- - Never archive a change while a spec sync is still in flight — run the sync inline and verify main specs at \`<planningHome.root>/openspec/specs/<capability>/spec.md\` before moving \`changeRoot\`
322
+ - Never archive a change while a spec sync is still in flight — run the sync inline and verify main specs at \`<planningHome.root>/openspec/specs/<capability-path>/spec.md\` before moving \`changeRoot\`
321
323
  - Fetch archive inputs once per selected root before spec inspection or moves
322
324
  - Fetch all required specs-rule snapshots before the batch's first main-spec write or move
323
325
  - A failed archive-inputs lookup never blocks the batch; it proceeds with no context or guidance
@@ -345,6 +347,8 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
345
347
 
346
348
  ${STORE_SELECTION_GUIDANCE}
347
349
 
350
+ \`<capability-path>\` is the spec directory relative to \`specs/\` (for example, \`user-auth\` or \`identity/user-auth\`). Preserve the full path from each delta spec when resolving its main spec.
351
+
348
352
  **Input**: None required (prompts for selection)
349
353
 
350
354
  **Steps**
@@ -412,14 +416,14 @@ ${STORE_SELECTION_GUIDANCE}
412
416
 
413
417
  4. **Detect spec conflicts**
414
418
 
415
- Build a map of \`capability -> [changes that touch it]\`:
419
+ Build a map keyed by \`<capability-path>\`, the exact path relative to \`specs/\`:
416
420
 
417
421
  \`\`\`text
418
- auth -> [change-a, change-b] <- CONFLICT (2+ changes)
419
- api -> [change-c] <- OK (only 1 change)
422
+ identity/user-auth -> [change-a, change-b] <- CONFLICT (2+ changes)
423
+ billing/user-auth -> [change-c] <- OK (different full path)
420
424
  \`\`\`
421
425
 
422
- A conflict exists when 2+ selected changes have delta specs for the same capability.
426
+ A conflict exists when 2+ selected changes have delta specs for the exact same \`<capability-path>\`.
423
427
 
424
428
  5. **Resolve conflicts agentically**
425
429
 
@@ -437,7 +441,7 @@ ${STORE_SELECTION_GUIDANCE}
437
441
  - If neither implemented -> skip spec sync, warn user
438
442
 
439
443
  d. **Record resolution** for each conflict:
440
- - An inclusion or exclusion decision for every delta spec, keyed by change and capability
444
+ - An inclusion or exclusion decision for every delta spec, keyed by change and \`<capability-path>\`
441
445
  - Which included delta specs to apply and in what order
442
446
  - Which delta specs to exclude from sync because their implementation is missing
443
447
  - Rationale (what was found in codebase)
@@ -451,14 +455,14 @@ ${STORE_SELECTION_GUIDANCE}
451
455
  |---------------------|-----------|-------|---------|-----------|--------|
452
456
  | schema-management | Done | 5/5 | 2 delta | None | Ready |
453
457
  | project-config | Done | 3/3 | 1 delta | None | Ready |
454
- | add-oauth | Done | 4/4 | 1 delta | auth (!) | Ready* |
458
+ | add-oauth | Done | 4/4 | 1 delta | identity/user-auth (!) | Ready* |
455
459
  | add-verify-skill | 1 left | 2/5 | None | None | Warn |
456
460
  \`\`\`
457
461
 
458
462
  For conflicts, show the resolution:
459
463
  \`\`\`text
460
464
  * Conflict resolution:
461
- - auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
465
+ - identity/user-auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
462
466
  \`\`\`
463
467
 
464
468
  For incomplete changes, show warnings:
@@ -517,11 +521,11 @@ ${STORE_SELECTION_GUIDANCE}
517
521
  - If a change has no included delta specs, do not run the sync workflow for it.
518
522
 
519
523
  b. **Verify included delta specs before moving changeRoot**:
520
- - Re-run the comparison only for delta specs in \`includedDeltas\` against main spec at \`<planningHome.root>/openspec/specs/<capability>/spec.md\` (use the store-aware \`planningHome.root\` from step 3 status JSON, not a hardcoded repo path).
524
+ - Re-run the comparison only for delta specs in \`includedDeltas\` against main spec at \`<planningHome.root>/openspec/specs/<capability-path>/spec.md\` (use the store-aware \`planningHome.root\` from step 3 status JSON, not a hardcoded repo path).
521
525
  - Verify that main specs are updated:
522
526
  - ADDED requirements present
523
527
  - MODIFIED requirements carrying scenario and description changes named in the delta, with their other scenarios intact
524
- - REMOVED requirements gone
528
+ - REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving \`## Requirements\` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
525
529
  - RENAMED requirements present under the new name and absent under the old one
526
530
  - Do not verify delta specs in \`excludedDeltas\`; they are intentionally left unsynced.
527
531
  - If sync failed or any capability does not match verification, report what differs and fail/skip moving that change's \`changeRoot\` — do not archive that change. \`changeRoot\` remains intact.
@@ -539,7 +543,7 @@ ${STORE_SELECTION_GUIDANCE}
539
543
  - Success: archived successfully
540
544
  - Failed: error during archive or spec verification (record error)
541
545
  - Skipped: user chose not to archive (if applicable)
542
- - Sync skipped: for every delta in \`excludedDeltas\`, report \`sync skipped\` with the change, capability, and recorded reason. This is distinct from skipping the archive.
546
+ - Sync skipped: for every delta in \`excludedDeltas\`, report \`sync skipped\` with the change, \`<capability-path>\`, and recorded reason. This is distinct from skipping the archive.
543
547
 
544
548
  9. **Display summary**
545
549
 
@@ -558,8 +562,8 @@ ${STORE_SELECTION_GUIDANCE}
558
562
 
559
563
  Spec sync summary:
560
564
  - 4 delta specs synced to main specs
561
- - 1 delta spec sync skipped (add-jwt/auth: implementation not found)
562
- - 1 conflict resolved (auth: synced add-oauth, skipped add-jwt)
565
+ - 1 delta spec sync skipped (add-jwt, identity/user-auth: implementation not found)
566
+ - 1 conflict resolved (identity/user-auth: synced add-oauth, skipped add-jwt)
563
567
  \`\`\`
564
568
 
565
569
  If any failures:
@@ -654,7 +658,7 @@ No active changes found. Create a new change to get started.
654
658
  - If sync is requested, run the \`/opsx:sync\` workflow inline (agent-driven) for each change with included delta specs
655
659
  - Carry the per-delta \`includedDeltas\` and \`excludedDeltas\` decisions into execution; sync and verify only included deltas
656
660
  - Report every excluded delta as \`sync skipped\` without treating the archive itself as skipped
657
- - Never archive a change while a spec sync is still in flight — run the sync inline and verify main specs at \`<planningHome.root>/openspec/specs/<capability>/spec.md\` before moving \`changeRoot\`
661
+ - Never archive a change while a spec sync is still in flight — run the sync inline and verify main specs at \`<planningHome.root>/openspec/specs/<capability-path>/spec.md\` before moving \`changeRoot\`
658
662
  - Fetch archive inputs once per selected root before spec inspection or moves
659
663
  - Fetch all required specs-rule snapshots before the batch's first main-spec write or move
660
664
  - A failed archive-inputs lookup never blocks the batch; it proceeds with no context or guidance
@@ -35,17 +35,17 @@ ${STORE_SELECTION_GUIDANCE}
35
35
  Parse the JSON to understand current state. The response includes:
36
36
  - \`schemaName\`: The workflow schema being used (e.g., "spec-driven")
37
37
  - \`artifacts\`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
38
- - \`isComplete\`: Boolean indicating if all artifacts are complete
38
+ - \`isPlanningComplete\`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as \`isComplete\`.
39
39
  - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
40
40
 
41
41
  3. **Act based on status**:
42
42
 
43
43
  ---
44
44
 
45
- **If all artifacts are complete (\`isComplete: true\`)**:
45
+ **If all planning artifacts are complete (\`isPlanningComplete: true\`, or legacy \`isComplete: true\`)**:
46
46
  - Congratulate the user
47
47
  - Show final status including the schema used
48
- - 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."
49
49
  - STOP
50
50
 
51
51
  ---
@@ -152,17 +152,17 @@ ${STORE_SELECTION_GUIDANCE}
152
152
  Parse the JSON to understand current state. The response includes:
153
153
  - \`schemaName\`: The workflow schema being used (e.g., "spec-driven")
154
154
  - \`artifacts\`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
155
- - \`isComplete\`: Boolean indicating if all artifacts are complete
155
+ - \`isPlanningComplete\`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as \`isComplete\`.
156
156
  - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
157
157
 
158
158
  3. **Act based on status**:
159
159
 
160
160
  ---
161
161
 
162
- **If all artifacts are complete (\`isComplete: true\`)**:
162
+ **If all planning artifacts are complete (\`isPlanningComplete: true\`, or legacy \`isComplete: true\`)**:
163
163
  - Congratulate the user
164
164
  - Show final status including the schema used
165
- - 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\`."
166
166
  - STOP
167
167
 
168
168
  ---