@fission-ai/openspec 1.3.1 → 1.4.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 (165) hide show
  1. package/README.md +9 -2
  2. package/bin/openspec.js +3 -1
  3. package/dist/cli/index.d.ts +4 -1
  4. package/dist/cli/index.js +46 -2
  5. package/dist/commands/completion.js +7 -0
  6. package/dist/commands/config.js +64 -5
  7. package/dist/commands/context-store.d.ts +3 -0
  8. package/dist/commands/context-store.js +475 -0
  9. package/dist/commands/initiative.d.ts +13 -0
  10. package/dist/commands/initiative.js +318 -0
  11. package/dist/commands/workflow/index.d.ts +2 -0
  12. package/dist/commands/workflow/index.js +1 -0
  13. package/dist/commands/workflow/initiative-link.d.ts +24 -0
  14. package/dist/commands/workflow/initiative-link.js +47 -0
  15. package/dist/commands/workflow/instructions.d.ts +1 -1
  16. package/dist/commands/workflow/instructions.js +28 -11
  17. package/dist/commands/workflow/new-change.d.ts +6 -0
  18. package/dist/commands/workflow/new-change.js +114 -17
  19. package/dist/commands/workflow/set-change.d.ts +13 -0
  20. package/dist/commands/workflow/set-change.js +87 -0
  21. package/dist/commands/workflow/shared.d.ts +4 -2
  22. package/dist/commands/workflow/shared.js +6 -6
  23. package/dist/commands/workflow/status.js +19 -4
  24. package/dist/commands/workspace/context-status.d.ts +4 -0
  25. package/dist/commands/workspace/context-status.js +59 -0
  26. package/dist/commands/workspace/open-target-selection.d.ts +13 -0
  27. package/dist/commands/workspace/open-target-selection.js +146 -0
  28. package/dist/commands/workspace/open-view.d.ts +62 -0
  29. package/dist/commands/workspace/open-view.js +249 -0
  30. package/dist/commands/workspace/open.d.ts +37 -0
  31. package/dist/commands/workspace/open.js +110 -0
  32. package/dist/commands/workspace/opener-selection.d.ts +11 -0
  33. package/dist/commands/workspace/opener-selection.js +98 -0
  34. package/dist/commands/workspace/operations.d.ts +29 -0
  35. package/dist/commands/workspace/operations.js +543 -0
  36. package/dist/commands/workspace/prompt-theme.d.ts +29 -0
  37. package/dist/commands/workspace/prompt-theme.js +24 -0
  38. package/dist/commands/workspace/registration.d.ts +13 -0
  39. package/dist/commands/workspace/registration.js +84 -0
  40. package/dist/commands/workspace/selection.d.ts +9 -0
  41. package/dist/commands/workspace/selection.js +115 -0
  42. package/dist/commands/workspace/setup-prompts.d.ts +13 -0
  43. package/dist/commands/workspace/setup-prompts.js +121 -0
  44. package/dist/commands/workspace/types.d.ts +103 -0
  45. package/dist/commands/workspace/types.js +36 -0
  46. package/dist/commands/workspace.d.ts +6 -0
  47. package/dist/commands/workspace.js +587 -0
  48. package/dist/core/artifact-graph/index.d.ts +2 -1
  49. package/dist/core/artifact-graph/instruction-loader.d.ts +41 -1
  50. package/dist/core/artifact-graph/instruction-loader.js +46 -6
  51. package/dist/core/artifact-graph/types.d.ts +0 -5
  52. package/dist/core/artifact-graph/types.js +0 -14
  53. package/dist/core/change-metadata/index.d.ts +2 -0
  54. package/dist/core/change-metadata/index.js +2 -0
  55. package/dist/core/change-metadata/schema.d.ts +18 -0
  56. package/dist/core/change-metadata/schema.js +28 -0
  57. package/dist/core/change-status-policy.d.ts +50 -0
  58. package/dist/core/change-status-policy.js +70 -0
  59. package/dist/core/collections/index.d.ts +3 -0
  60. package/dist/core/collections/index.js +3 -0
  61. package/dist/core/collections/initiatives/collection.d.ts +4 -0
  62. package/dist/core/collections/initiatives/collection.js +17 -0
  63. package/dist/core/collections/initiatives/index.d.ts +6 -0
  64. package/dist/core/collections/initiatives/index.js +6 -0
  65. package/dist/core/collections/initiatives/operations.d.ts +49 -0
  66. package/dist/core/collections/initiatives/operations.js +175 -0
  67. package/dist/core/collections/initiatives/resolution.d.ts +87 -0
  68. package/dist/core/collections/initiatives/resolution.js +374 -0
  69. package/dist/core/collections/initiatives/schema.d.ts +41 -0
  70. package/dist/core/collections/initiatives/schema.js +134 -0
  71. package/dist/core/collections/initiatives/templates.d.ts +12 -0
  72. package/dist/core/collections/initiatives/templates.js +90 -0
  73. package/dist/core/collections/runtime.d.ts +46 -0
  74. package/dist/core/collections/runtime.js +194 -0
  75. package/dist/core/completions/command-registry.d.ts +1 -5
  76. package/dist/core/completions/command-registry.js +532 -32
  77. package/dist/core/completions/completion-provider.d.ts +11 -0
  78. package/dist/core/completions/completion-provider.js +27 -0
  79. package/dist/core/completions/generators/bash-generator.d.ts +3 -0
  80. package/dist/core/completions/generators/bash-generator.js +60 -4
  81. package/dist/core/completions/generators/fish-generator.js +3 -0
  82. package/dist/core/completions/generators/powershell-generator.d.ts +3 -0
  83. package/dist/core/completions/generators/powershell-generator.js +63 -4
  84. package/dist/core/completions/generators/zsh-generator.d.ts +3 -0
  85. package/dist/core/completions/generators/zsh-generator.js +46 -22
  86. package/dist/core/completions/installers/zsh-installer.d.ts +0 -8
  87. package/dist/core/completions/installers/zsh-installer.js +3 -31
  88. package/dist/core/completions/shared-flags.d.ts +12 -0
  89. package/dist/core/completions/shared-flags.js +28 -0
  90. package/dist/core/completions/templates/bash-templates.d.ts +1 -1
  91. package/dist/core/completions/templates/bash-templates.js +6 -0
  92. package/dist/core/completions/templates/fish-templates.d.ts +1 -1
  93. package/dist/core/completions/templates/fish-templates.js +6 -0
  94. package/dist/core/completions/templates/powershell-templates.d.ts +1 -1
  95. package/dist/core/completions/templates/powershell-templates.js +9 -0
  96. package/dist/core/completions/templates/zsh-templates.d.ts +1 -1
  97. package/dist/core/completions/templates/zsh-templates.js +9 -0
  98. package/dist/core/completions/types.d.ts +23 -1
  99. package/dist/core/config.js +3 -1
  100. package/dist/core/context-store/binding.d.ts +53 -0
  101. package/dist/core/context-store/binding.js +197 -0
  102. package/dist/core/context-store/errors.d.ts +20 -0
  103. package/dist/core/context-store/errors.js +22 -0
  104. package/dist/core/context-store/foundation.d.ts +55 -0
  105. package/dist/core/context-store/foundation.js +321 -0
  106. package/dist/core/context-store/index.d.ts +6 -0
  107. package/dist/core/context-store/index.js +6 -0
  108. package/dist/core/context-store/operations.d.ts +85 -0
  109. package/dist/core/context-store/operations.js +528 -0
  110. package/dist/core/context-store/registry.d.ts +45 -0
  111. package/dist/core/context-store/registry.js +229 -0
  112. package/dist/core/global-config.d.ts +6 -1
  113. package/dist/core/global-config.js +15 -16
  114. package/dist/core/index.d.ts +5 -1
  115. package/dist/core/index.js +4 -0
  116. package/dist/core/parsers/requirement-blocks.js +5 -5
  117. package/dist/core/parsers/spec-structure.js +1 -1
  118. package/dist/core/planning-home.d.ts +21 -0
  119. package/dist/core/planning-home.js +108 -0
  120. package/dist/core/profiles.d.ts +1 -1
  121. package/dist/core/profiles.js +1 -1
  122. package/dist/core/specs-apply.js +1 -1
  123. package/dist/core/templates/workflows/apply-change.js +6 -0
  124. package/dist/core/templates/workflows/archive-change.js +21 -15
  125. package/dist/core/templates/workflows/bulk-archive-change.js +14 -10
  126. package/dist/core/templates/workflows/continue-change.js +6 -4
  127. package/dist/core/templates/workflows/explore.js +8 -10
  128. package/dist/core/templates/workflows/ff-change.js +8 -6
  129. package/dist/core/templates/workflows/new-change.js +6 -6
  130. package/dist/core/templates/workflows/onboard.js +13 -15
  131. package/dist/core/templates/workflows/propose.js +8 -6
  132. package/dist/core/templates/workflows/sync-specs.js +28 -10
  133. package/dist/core/templates/workflows/verify-change.js +10 -4
  134. package/dist/core/update.d.ts +5 -0
  135. package/dist/core/update.js +20 -0
  136. package/dist/core/validation/validator.d.ts +11 -0
  137. package/dist/core/validation/validator.js +19 -2
  138. package/dist/core/workspace/foundation.d.ts +67 -0
  139. package/dist/core/workspace/foundation.js +295 -0
  140. package/dist/core/workspace/index.d.ts +8 -0
  141. package/dist/core/workspace/index.js +8 -0
  142. package/dist/core/workspace/legacy-state.d.ts +28 -0
  143. package/dist/core/workspace/legacy-state.js +200 -0
  144. package/dist/core/workspace/link-input.d.ts +9 -0
  145. package/dist/core/workspace/link-input.js +32 -0
  146. package/dist/core/workspace/open-surface.d.ts +45 -0
  147. package/dist/core/workspace/open-surface.js +215 -0
  148. package/dist/core/workspace/openers.d.ts +21 -0
  149. package/dist/core/workspace/openers.js +124 -0
  150. package/dist/core/workspace/registry.d.ts +24 -0
  151. package/dist/core/workspace/registry.js +146 -0
  152. package/dist/core/workspace/skills.d.ts +57 -0
  153. package/dist/core/workspace/skills.js +334 -0
  154. package/dist/core/workspace/state-io.d.ts +10 -0
  155. package/dist/core/workspace/state-io.js +119 -0
  156. package/dist/utils/change-metadata.d.ts +5 -2
  157. package/dist/utils/change-metadata.js +7 -13
  158. package/dist/utils/change-utils.d.ts +9 -0
  159. package/dist/utils/change-utils.js +7 -5
  160. package/package.json +2 -1
  161. package/schemas/workspace-planning/schema.yaml +72 -0
  162. package/schemas/workspace-planning/templates/design.md +33 -0
  163. package/schemas/workspace-planning/templates/proposal.md +28 -0
  164. package/schemas/workspace-planning/templates/spec.md +9 -0
  165. package/schemas/workspace-planning/templates/tasks.md +15 -0
@@ -23,8 +23,11 @@ export function getArchiveChangeSkillTemplate() {
23
23
 
24
24
  Parse the JSON to understand:
25
25
  - \`schemaName\`: The workflow being used
26
+ - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context
26
27
  - \`artifacts\`: List of artifacts with their status (\`done\` or other)
27
28
 
29
+ If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace archive is not supported in this slice and STOP. Do not move workspace changes into repo-local archives or edit linked repos.
30
+
28
31
  **If any artifacts are not \`done\`:**
29
32
  - Display warning listing incomplete artifacts
30
33
  - Use **AskUserQuestion tool** to confirm user wants to proceed
@@ -45,7 +48,7 @@ export function getArchiveChangeSkillTemplate() {
45
48
 
46
49
  4. **Assess delta spec sync state**
47
50
 
48
- Check for delta specs at \`openspec/changes/<name>/specs/\`. If none exist, proceed without sync prompt.
51
+ Use \`artifactPaths.specs.existingOutputPaths\` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
49
52
 
50
53
  **If delta specs exist:**
51
54
  - Compare each delta spec with its corresponding main spec at \`openspec/specs/<capability>/spec.md\`
@@ -60,19 +63,19 @@ export function getArchiveChangeSkillTemplate() {
60
63
 
61
64
  5. **Perform the archive**
62
65
 
63
- Create the archive directory if it doesn't exist:
66
+ Create an \`archive\` directory under \`planningHome.changesDir\` if it doesn't exist:
64
67
  \`\`\`bash
65
- mkdir -p openspec/changes/archive
68
+ mkdir -p "<planningHome.changesDir>/archive"
66
69
  \`\`\`
67
70
 
68
71
  Generate target name using current date: \`YYYY-MM-DD-<change-name>\`
69
72
 
70
73
  **Check if target already exists:**
71
74
  - If yes: Fail with error, suggest renaming existing archive or using different date
72
- - If no: Move the change directory to archive
75
+ - If no: Move \`changeRoot\` to the archive directory
73
76
 
74
77
  \`\`\`bash
75
- mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
78
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
76
79
  \`\`\`
77
80
 
78
81
  6. **Display summary**
@@ -91,7 +94,7 @@ export function getArchiveChangeSkillTemplate() {
91
94
 
92
95
  **Change:** <change-name>
93
96
  **Schema:** <schema-name>
94
- **Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
97
+ **Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
95
98
  **Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")
96
99
 
97
100
  All artifacts complete. All tasks complete.
@@ -137,8 +140,11 @@ export function getOpsxArchiveCommandTemplate() {
137
140
 
138
141
  Parse the JSON to understand:
139
142
  - \`schemaName\`: The workflow being used
143
+ - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context
140
144
  - \`artifacts\`: List of artifacts with their status (\`done\` or other)
141
145
 
146
+ If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace archive is not supported in this slice and STOP. Do not move workspace changes into repo-local archives or edit linked repos.
147
+
142
148
  **If any artifacts are not \`done\`:**
143
149
  - Display warning listing incomplete artifacts
144
150
  - Prompt user for confirmation to continue
@@ -159,7 +165,7 @@ export function getOpsxArchiveCommandTemplate() {
159
165
 
160
166
  4. **Assess delta spec sync state**
161
167
 
162
- Check for delta specs at \`openspec/changes/<name>/specs/\`. If none exist, proceed without sync prompt.
168
+ Use \`artifactPaths.specs.existingOutputPaths\` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
163
169
 
164
170
  **If delta specs exist:**
165
171
  - Compare each delta spec with its corresponding main spec at \`openspec/specs/<capability>/spec.md\`
@@ -174,19 +180,19 @@ export function getOpsxArchiveCommandTemplate() {
174
180
 
175
181
  5. **Perform the archive**
176
182
 
177
- Create the archive directory if it doesn't exist:
183
+ Create an \`archive\` directory under \`planningHome.changesDir\` if it doesn't exist:
178
184
  \`\`\`bash
179
- mkdir -p openspec/changes/archive
185
+ mkdir -p "<planningHome.changesDir>/archive"
180
186
  \`\`\`
181
187
 
182
188
  Generate target name using current date: \`YYYY-MM-DD-<change-name>\`
183
189
 
184
190
  **Check if target already exists:**
185
191
  - If yes: Fail with error, suggest renaming existing archive or using different date
186
- - If no: Move the change directory to archive
192
+ - If no: Move \`changeRoot\` to the archive directory
187
193
 
188
194
  \`\`\`bash
189
- mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
195
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
190
196
  \`\`\`
191
197
 
192
198
  6. **Display summary**
@@ -205,7 +211,7 @@ export function getOpsxArchiveCommandTemplate() {
205
211
 
206
212
  **Change:** <change-name>
207
213
  **Schema:** <schema-name>
208
- **Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
214
+ **Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
209
215
  **Specs:** ✓ Synced to main specs
210
216
 
211
217
  All artifacts complete. All tasks complete.
@@ -218,7 +224,7 @@ All artifacts complete. All tasks complete.
218
224
 
219
225
  **Change:** <change-name>
220
226
  **Schema:** <schema-name>
221
- **Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
227
+ **Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
222
228
  **Specs:** No delta specs
223
229
 
224
230
  All artifacts complete. All tasks complete.
@@ -231,7 +237,7 @@ All artifacts complete. All tasks complete.
231
237
 
232
238
  **Change:** <change-name>
233
239
  **Schema:** <schema-name>
234
- **Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
240
+ **Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
235
241
  **Specs:** Sync skipped (user chose to skip)
236
242
 
237
243
  **Warnings:**
@@ -248,7 +254,7 @@ Review the archive if this was not intentional.
248
254
  ## Archive Failed
249
255
 
250
256
  **Change:** <change-name>
251
- **Target:** openspec/changes/archive/YYYY-MM-DD-<name>/
257
+ **Target:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
252
258
 
253
259
  Target archive directory already exists.
254
260
 
@@ -30,14 +30,16 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
30
30
  For each selected change, collect:
31
31
 
32
32
  a. **Artifact status** - Run \`openspec status --change "<name>" --json\`
33
- - Parse \`schemaName\` and \`artifacts\` list
33
+ - Parse \`schemaName\`, \`artifacts\`, \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`
34
34
  - Note which artifacts are \`done\` vs other states
35
35
 
36
- b. **Task completion** - Read \`openspec/changes/<name>/tasks.md\`
36
+ If any selected change reports \`actionContext.mode: "workspace-planning"\`, explain that workspace bulk archive is not supported in this slice and STOP before syncing specs or moving changes. Do not fall back to repo-local paths or edit linked repos.
37
+
38
+ b. **Task completion** - Read \`artifactPaths.tasks.existingOutputPaths\` from status JSON
37
39
  - Count \`- [ ]\` (incomplete) vs \`- [x]\` (complete)
38
40
  - If no tasks file exists, note as "No tasks"
39
41
 
40
- c. **Delta specs** - Check \`openspec/changes/<name>/specs/\` directory
42
+ c. **Delta specs** - Check \`artifactPaths.specs.existingOutputPaths\` from status JSON
41
43
  - List which capability specs exist
42
44
  - For each, extract requirement names (lines matching \`### Requirement: <name>\`)
43
45
 
@@ -120,8 +122,8 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
120
122
 
121
123
  b. **Perform the archive**:
122
124
  \`\`\`bash
123
- mkdir -p openspec/changes/archive
124
- mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
125
+ mkdir -p "<planningHome.changesDir>/archive"
126
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
125
127
  \`\`\`
126
128
 
127
129
  c. **Track outcome** for each change:
@@ -276,14 +278,16 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
276
278
  For each selected change, collect:
277
279
 
278
280
  a. **Artifact status** - Run \`openspec status --change "<name>" --json\`
279
- - Parse \`schemaName\` and \`artifacts\` list
281
+ - Parse \`schemaName\`, \`artifacts\`, \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`
280
282
  - Note which artifacts are \`done\` vs other states
281
283
 
282
- b. **Task completion** - Read \`openspec/changes/<name>/tasks.md\`
284
+ If any selected change reports \`actionContext.mode: "workspace-planning"\`, explain that workspace bulk archive is not supported in this slice and STOP before syncing specs or moving changes. Do not fall back to repo-local paths or edit linked repos.
285
+
286
+ b. **Task completion** - Read \`artifactPaths.tasks.existingOutputPaths\` from status JSON
283
287
  - Count \`- [ ]\` (incomplete) vs \`- [x]\` (complete)
284
288
  - If no tasks file exists, note as "No tasks"
285
289
 
286
- c. **Delta specs** - Check \`openspec/changes/<name>/specs/\` directory
290
+ c. **Delta specs** - Check \`artifactPaths.specs.existingOutputPaths\` from status JSON
287
291
  - List which capability specs exist
288
292
  - For each, extract requirement names (lines matching \`### Requirement: <name>\`)
289
293
 
@@ -366,8 +370,8 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
366
370
 
367
371
  b. **Perform the archive**:
368
372
  \`\`\`bash
369
- mkdir -p openspec/changes/archive
370
- mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
373
+ mkdir -p "<planningHome.changesDir>/archive"
374
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
371
375
  \`\`\`
372
376
 
373
377
  c. **Track outcome** for each change:
@@ -30,6 +30,7 @@ export function getContinueChangeSkillTemplate() {
30
30
  - \`schemaName\`: The workflow schema being used (e.g., "spec-driven")
31
31
  - \`artifacts\`: Array of artifacts with their status ("done", "ready", "blocked")
32
32
  - \`isComplete\`: Boolean indicating if all artifacts are complete
33
+ - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
33
34
 
34
35
  3. **Act based on status**:
35
36
 
@@ -54,13 +55,13 @@ export function getContinueChangeSkillTemplate() {
54
55
  - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
55
56
  - \`template\`: The structure to use for your output file
56
57
  - \`instruction\`: Schema-specific guidance
57
- - \`outputPath\`: Where to write the artifact
58
+ - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
58
59
  - \`dependencies\`: Completed artifacts to read for context
59
60
  - **Create the artifact file**:
60
61
  - Read any completed dependency files for context
61
62
  - Use \`template\` as the structure - fill in its sections
62
63
  - Apply \`context\` and \`rules\` as constraints when writing - but do NOT copy them into the file
63
- - Write to the output path specified in instructions
64
+ - Write to the \`resolvedOutputPath\` specified in instructions. If it is a glob pattern, choose the concrete file path using the schema instruction and workspace planning context
64
65
  - Show what was created and what's now unlocked
65
66
  - STOP after creating ONE artifact
66
67
 
@@ -148,6 +149,7 @@ export function getOpsxContinueCommandTemplate() {
148
149
  - \`schemaName\`: The workflow schema being used (e.g., "spec-driven")
149
150
  - \`artifacts\`: Array of artifacts with their status ("done", "ready", "blocked")
150
151
  - \`isComplete\`: Boolean indicating if all artifacts are complete
152
+ - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
151
153
 
152
154
  3. **Act based on status**:
153
155
 
@@ -172,13 +174,13 @@ export function getOpsxContinueCommandTemplate() {
172
174
  - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
173
175
  - \`template\`: The structure to use for your output file
174
176
  - \`instruction\`: Schema-specific guidance
175
- - \`outputPath\`: Where to write the artifact
177
+ - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
176
178
  - \`dependencies\`: Completed artifacts to read for context
177
179
  - **Create the artifact file**:
178
180
  - Read any completed dependency files for context
179
181
  - Use \`template\` as the structure - fill in its sections
180
182
  - Apply \`context\` and \`rules\` as constraints when writing - but do NOT copy them into the file
181
- - Write to the output path specified in instructions
183
+ - Write to the \`resolvedOutputPath\` specified in instructions. If it is a glob pattern, choose the concrete file path using the schema instruction and workspace planning context
182
184
  - Show what was created and what's now unlocked
183
185
  - STOP after creating ONE artifact
184
186
 
@@ -95,11 +95,10 @@ Think freely. When insights crystallize, you might offer:
95
95
 
96
96
  If the user mentions a change or you detect one is relevant:
97
97
 
98
- 1. **Read existing artifacts for context**
99
- - \`openspec/changes/<name>/proposal.md\`
100
- - \`openspec/changes/<name>/design.md\`
101
- - \`openspec/changes/<name>/tasks.md\`
102
- - etc.
98
+ 1. **Resolve and read existing artifacts for context**
99
+ - Run \`openspec status --change "<name>" --json\`.
100
+ - Use \`changeRoot\`, \`artifactPaths\`, and \`actionContext\` from the status JSON.
101
+ - Read existing files from \`artifactPaths.<artifact>.existingOutputPaths\`.
103
102
 
104
103
  2. **Reference them naturally in conversation**
105
104
  - "Your design mentions using Redis, but we just realized SQLite fits better..."
@@ -392,11 +391,10 @@ Think freely. When insights crystallize, you might offer:
392
391
 
393
392
  If the user mentions a change or you detect one is relevant:
394
393
 
395
- 1. **Read existing artifacts for context**
396
- - \`openspec/changes/<name>/proposal.md\`
397
- - \`openspec/changes/<name>/design.md\`
398
- - \`openspec/changes/<name>/tasks.md\`
399
- - etc.
394
+ 1. **Resolve and read existing artifacts for context**
395
+ - Run \`openspec status --change "<name>" --json\`.
396
+ - Use \`changeRoot\`, \`artifactPaths\`, and \`actionContext\` from the status JSON.
397
+ - Read existing files from \`artifactPaths.<artifact>.existingOutputPaths\`.
400
398
 
401
399
  2. **Reference them naturally in conversation**
402
400
  - "Your design mentions using Redis, but we just realized SQLite fits better..."
@@ -21,7 +21,7 @@ export function getFfChangeSkillTemplate() {
21
21
  \`\`\`bash
22
22
  openspec new change "<name>"
23
23
  \`\`\`
24
- This creates a scaffolded change at \`openspec/changes/<name>/\`.
24
+ This creates a scaffolded change in the planning home resolved by the CLI.
25
25
 
26
26
  3. **Get the artifact build order**
27
27
  \`\`\`bash
@@ -30,6 +30,7 @@ export function getFfChangeSkillTemplate() {
30
30
  Parse the JSON to get:
31
31
  - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
32
32
  - \`artifacts\`: list of all artifacts with their status and dependencies
33
+ - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
33
34
 
34
35
  4. **Create artifacts in sequence until apply-ready**
35
36
 
@@ -47,10 +48,10 @@ export function getFfChangeSkillTemplate() {
47
48
  - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
48
49
  - \`template\`: The structure to use for your output file
49
50
  - \`instruction\`: Schema-specific guidance for this artifact type
50
- - \`outputPath\`: Where to write the artifact
51
+ - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
51
52
  - \`dependencies\`: Completed artifacts to read for context
52
53
  - Read any completed dependency files for context
53
- - Create the artifact file using \`template\` as the structure
54
+ - Create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`
54
55
  - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
55
56
  - Show brief progress: "✓ Created <artifact-id>"
56
57
 
@@ -122,7 +123,7 @@ export function getOpsxFfCommandTemplate() {
122
123
  \`\`\`bash
123
124
  openspec new change "<name>"
124
125
  \`\`\`
125
- This creates a scaffolded change at \`openspec/changes/<name>/\`.
126
+ This creates a scaffolded change in the planning home resolved by the CLI.
126
127
 
127
128
  3. **Get the artifact build order**
128
129
  \`\`\`bash
@@ -131,6 +132,7 @@ export function getOpsxFfCommandTemplate() {
131
132
  Parse the JSON to get:
132
133
  - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
133
134
  - \`artifacts\`: list of all artifacts with their status and dependencies
135
+ - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
134
136
 
135
137
  4. **Create artifacts in sequence until apply-ready**
136
138
 
@@ -148,10 +150,10 @@ export function getOpsxFfCommandTemplate() {
148
150
  - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
149
151
  - \`template\`: The structure to use for your output file
150
152
  - \`instruction\`: Schema-specific guidance for this artifact type
151
- - \`outputPath\`: Where to write the artifact
153
+ - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
152
154
  - \`dependencies\`: Completed artifacts to read for context
153
155
  - Read any completed dependency files for context
154
- - Create the artifact file using \`template\` as the structure
156
+ - Create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`
155
157
  - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
156
158
  - Show brief progress: "✓ Created <artifact-id>"
157
159
 
@@ -32,13 +32,13 @@ export function getNewChangeSkillTemplate() {
32
32
  openspec new change "<name>"
33
33
  \`\`\`
34
34
  Add \`--schema <name>\` only if the user requested a specific workflow.
35
- This creates a scaffolded change at \`openspec/changes/<name>/\` with the selected schema.
35
+ This creates a scaffolded change in the planning home resolved by the CLI.
36
36
 
37
37
  4. **Show the artifact status**
38
38
  \`\`\`bash
39
- openspec status --change "<name>"
39
+ openspec status --change "<name>" --json
40
40
  \`\`\`
41
- This shows which artifacts need to be created and which are ready (dependencies satisfied).
41
+ Use the returned \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`nextSteps\` instead of assuming repo-local paths.
42
42
 
43
43
  5. **Get instructions for the first artifact**
44
44
  The first artifact depends on the schema (e.g., \`proposal\` for spec-driven).
@@ -106,13 +106,13 @@ export function getOpsxNewCommandTemplate() {
106
106
  openspec new change "<name>"
107
107
  \`\`\`
108
108
  Add \`--schema <name>\` only if the user requested a specific workflow.
109
- This creates a scaffolded change at \`openspec/changes/<name>/\` with the selected schema.
109
+ This creates a scaffolded change in the planning home resolved by the CLI.
110
110
 
111
111
  4. **Show the artifact status**
112
112
  \`\`\`bash
113
- openspec status --change "<name>"
113
+ openspec status --change "<name>" --json
114
114
  \`\`\`
115
- This shows which artifacts need to be created and which are ready (dependencies satisfied).
115
+ Use the returned \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`nextSteps\` instead of assuming repo-local paths.
116
116
 
117
117
  5. **Get instructions for the first artifact**
118
118
  The first artifact depends on the schema. Check the status output to find the first artifact with status "ready".
@@ -167,7 +167,7 @@ Now let's create a change to hold our work.
167
167
  \`\`\`
168
168
  ## Creating a Change
169
169
 
170
- A "change" in OpenSpec is a container for all the thinking and planning around a piece of work. It lives in \`openspec/changes/<name>/\` and holds your artifacts—proposal, specs, design, tasks.
170
+ A "change" in OpenSpec is a container for all the thinking and planning around a piece of work. It lives at the \`changeRoot\` reported by \`openspec status --change "<name>" --json\` and holds your artifacts—proposal, specs, design, tasks.
171
171
 
172
172
  Let me create one for our task.
173
173
  \`\`\`
@@ -179,11 +179,11 @@ openspec new change "<derived-name>"
179
179
 
180
180
  **SHOW:**
181
181
  \`\`\`
182
- Created: \`openspec/changes/<name>/\`
182
+ Created: <changeRoot from status JSON>
183
183
 
184
184
  The folder structure:
185
185
  \`\`\`
186
- openspec/changes/<name>/
186
+ <changeRoot>/
187
187
  ├── proposal.md ← Why we're doing this (empty, we'll fill it)
188
188
  ├── design.md ← How we'll build it (empty)
189
189
  ├── specs/ ← Detailed requirements (empty)
@@ -245,7 +245,7 @@ After approval, save the proposal:
245
245
  \`\`\`bash
246
246
  openspec instructions proposal --change "<name>" --json
247
247
  \`\`\`
248
- Then write the content to \`openspec/changes/<name>/proposal.md\`.
248
+ Then write the content to the \`resolvedOutputPath\` from \`openspec instructions proposal --change "<name>" --json\`.
249
249
 
250
250
  \`\`\`
251
251
  Proposal saved. This is your "why" document—you can always come back and refine it as understanding evolves.
@@ -266,12 +266,10 @@ Specs define **what** we're building in precise, testable terms. They use a requ
266
266
  For a small task like this, we might only need one spec file.
267
267
  \`\`\`
268
268
 
269
- **DO:** Create the spec file:
269
+ **DO:** Resolve where the spec file should be created:
270
270
  \`\`\`bash
271
- # Unix/macOS
272
- mkdir -p openspec/changes/<name>/specs/<capability-name>
273
- # Windows (PowerShell)
274
- # New-Item -ItemType Directory -Force -Path "openspec/changes/<name>/specs/<capability-name>"
271
+ openspec instructions specs --change "<name>" --json
272
+ # Use resolvedOutputPath from the JSON. If it is a glob, choose the concrete file path using the schema instruction and workspace planning context.
275
273
  \`\`\`
276
274
 
277
275
  Draft the spec content:
@@ -298,7 +296,7 @@ Here's the spec:
298
296
  This format—WHEN/THEN/AND—makes requirements testable. You can literally read them as test cases.
299
297
  \`\`\`
300
298
 
301
- Save to \`openspec/changes/<name>/specs/<capability>/spec.md\`.
299
+ Save to the concrete file path chosen from \`resolvedOutputPath\`.
302
300
 
303
301
  ---
304
302
 
@@ -343,7 +341,7 @@ Here's the design:
343
341
  For a small task, this captures the key decisions without over-engineering.
344
342
  \`\`\`
345
343
 
346
- Save to \`openspec/changes/<name>/design.md\`.
344
+ Save to the \`resolvedOutputPath\` from \`openspec instructions design --change "<name>" --json\`.
347
345
 
348
346
  ---
349
347
 
@@ -381,7 +379,7 @@ Each checkbox becomes a unit of work in the apply phase. Ready to implement?
381
379
 
382
380
  **PAUSE** - Wait for user to confirm they're ready to implement.
383
381
 
384
- Save to \`openspec/changes/<name>/tasks.md\`.
382
+ Save to the \`resolvedOutputPath\` from \`openspec instructions tasks --change "<name>" --json\`.
385
383
 
386
384
  ---
387
385
 
@@ -425,7 +423,7 @@ The change is implemented! One more step—let's archive it.
425
423
  \`\`\`
426
424
  ## Archiving
427
425
 
428
- When a change is complete, we archive it. This moves it from \`openspec/changes/\` to \`openspec/changes/archive/YYYY-MM-DD-<name>/\`.
426
+ When a change is complete, we archive it. The archive path is derived from \`planningHome.changesDir\` and the date.
429
427
 
430
428
  Archived changes become your project's decision history—you can always find them later to understand why something was built a certain way.
431
429
  \`\`\`
@@ -437,7 +435,7 @@ openspec archive "<name>"
437
435
 
438
436
  **SHOW:**
439
437
  \`\`\`
440
- Archived to: \`openspec/changes/archive/YYYY-MM-DD-<name>/\`
438
+ Archived to: \`<planningHome.changesDir>/archive/YYYY-MM-DD-<name>/\`
441
439
 
442
440
  The change is now part of your project's history. The code is in your codebase, the decision record is preserved.
443
441
  \`\`\`
@@ -500,7 +498,7 @@ Try \`/opsx:propose\` on something you actually want to build. You've got the rh
500
498
  If the user says they need to stop, want to pause, or seem disengaged:
501
499
 
502
500
  \`\`\`
503
- No problem! Your change is saved at \`openspec/changes/<name>/\`.
501
+ No problem! Your change is saved at the \`changeRoot\` reported by \`openspec status --change "<name>" --json\`.
504
502
 
505
503
  To pick up where we left off later:
506
504
  - \`/opsx:continue <name>\` - Resume artifact creation
@@ -30,7 +30,7 @@ When ready to implement, run /opsx:apply
30
30
  \`\`\`bash
31
31
  openspec new change "<name>"
32
32
  \`\`\`
33
- This creates a scaffolded change at \`openspec/changes/<name>/\` with \`.openspec.yaml\`.
33
+ This creates a scaffolded change in the planning home resolved by the CLI with \`.openspec.yaml\`.
34
34
 
35
35
  3. **Get the artifact build order**
36
36
  \`\`\`bash
@@ -39,6 +39,7 @@ When ready to implement, run /opsx:apply
39
39
  Parse the JSON to get:
40
40
  - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
41
41
  - \`artifacts\`: list of all artifacts with their status and dependencies
42
+ - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
42
43
 
43
44
  4. **Create artifacts in sequence until apply-ready**
44
45
 
@@ -56,10 +57,10 @@ When ready to implement, run /opsx:apply
56
57
  - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
57
58
  - \`template\`: The structure to use for your output file
58
59
  - \`instruction\`: Schema-specific guidance for this artifact type
59
- - \`outputPath\`: Where to write the artifact
60
+ - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
60
61
  - \`dependencies\`: Completed artifacts to read for context
61
62
  - Read any completed dependency files for context
62
- - Create the artifact file using \`template\` as the structure
63
+ - Create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`
63
64
  - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
64
65
  - Show brief progress: "Created <artifact-id>"
65
66
 
@@ -140,7 +141,7 @@ When ready to implement, run /opsx:apply
140
141
  \`\`\`bash
141
142
  openspec new change "<name>"
142
143
  \`\`\`
143
- This creates a scaffolded change at \`openspec/changes/<name>/\` with \`.openspec.yaml\`.
144
+ This creates a scaffolded change in the planning home resolved by the CLI with \`.openspec.yaml\`.
144
145
 
145
146
  3. **Get the artifact build order**
146
147
  \`\`\`bash
@@ -149,6 +150,7 @@ When ready to implement, run /opsx:apply
149
150
  Parse the JSON to get:
150
151
  - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
151
152
  - \`artifacts\`: list of all artifacts with their status and dependencies
153
+ - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
152
154
 
153
155
  4. **Create artifacts in sequence until apply-ready**
154
156
 
@@ -166,10 +168,10 @@ When ready to implement, run /opsx:apply
166
168
  - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
167
169
  - \`template\`: The structure to use for your output file
168
170
  - \`instruction\`: Schema-specific guidance for this artifact type
169
- - \`outputPath\`: Where to write the artifact
171
+ - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
170
172
  - \`dependencies\`: Completed artifacts to read for context
171
173
  - Read any completed dependency files for context
172
- - Create the artifact file using \`template\` as the structure
174
+ - Create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`
173
175
  - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
174
176
  - Show brief progress: "Created <artifact-id>"
175
177
 
@@ -18,9 +18,18 @@ This is an **agent-driven** operation - you will read delta specs and directly e
18
18
 
19
19
  **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
20
20
 
21
- 2. **Find delta specs**
21
+ 2. **Resolve change context**
22
22
 
23
- Look for delta spec files in \`openspec/changes/<name>/specs/*/spec.md\`.
23
+ Run:
24
+ \`\`\`bash
25
+ openspec status --change "<name>" --json
26
+ \`\`\`
27
+
28
+ If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace spec sync is not supported in this slice and STOP. Do not fall back to repo-local paths or edit linked repos.
29
+
30
+ 3. **Find delta specs**
31
+
32
+ Use \`artifactPaths.specs.existingOutputPaths\` from the status JSON as the list of delta spec files.
24
33
 
25
34
  Each delta spec file contains sections like:
26
35
  - \`## ADDED Requirements\` - New requirements to add
@@ -30,9 +39,9 @@ This is an **agent-driven** operation - you will read delta specs and directly e
30
39
 
31
40
  If no delta specs found, inform user and stop.
32
41
 
33
- 3. **For each delta spec, apply changes to main specs**
42
+ 4. **For each delta spec, apply changes to main specs**
34
43
 
35
- For each capability with a delta spec at \`openspec/changes/<name>/specs/<capability>/spec.md\`:
44
+ For each repo-local capability delta spec path returned by the CLI:
36
45
 
37
46
  a. **Read the delta spec** to understand the intended changes
38
47
 
@@ -63,7 +72,7 @@ This is an **agent-driven** operation - you will read delta specs and directly e
63
72
  - Add Purpose section (can be brief, mark as TBD)
64
73
  - Add Requirements section with the ADDED requirements
65
74
 
66
- 4. **Show summary**
75
+ 5. **Show summary**
67
76
 
68
77
  After applying all changes, summarize:
69
78
  - Which capabilities were updated
@@ -156,9 +165,18 @@ This is an **agent-driven** operation - you will read delta specs and directly e
156
165
 
157
166
  **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
158
167
 
159
- 2. **Find delta specs**
168
+ 2. **Resolve change context**
169
+
170
+ Run:
171
+ \`\`\`bash
172
+ openspec status --change "<name>" --json
173
+ \`\`\`
174
+
175
+ If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace spec sync is not supported in this slice and STOP. Do not fall back to repo-local paths or edit linked repos.
176
+
177
+ 3. **Find delta specs**
160
178
 
161
- Look for delta spec files in \`openspec/changes/<name>/specs/*/spec.md\`.
179
+ Use \`artifactPaths.specs.existingOutputPaths\` from the status JSON as the list of delta spec files.
162
180
 
163
181
  Each delta spec file contains sections like:
164
182
  - \`## ADDED Requirements\` - New requirements to add
@@ -168,9 +186,9 @@ This is an **agent-driven** operation - you will read delta specs and directly e
168
186
 
169
187
  If no delta specs found, inform user and stop.
170
188
 
171
- 3. **For each delta spec, apply changes to main specs**
189
+ 4. **For each delta spec, apply changes to main specs**
172
190
 
173
- For each capability with a delta spec at \`openspec/changes/<name>/specs/<capability>/spec.md\`:
191
+ For each repo-local capability delta spec path returned by the CLI:
174
192
 
175
193
  a. **Read the delta spec** to understand the intended changes
176
194
 
@@ -201,7 +219,7 @@ This is an **agent-driven** operation - you will read delta specs and directly e
201
219
  - Add Purpose section (can be brief, mark as TBD)
202
220
  - Add Requirements section with the ADDED requirements
203
221
 
204
- 4. **Show summary**
222
+ 5. **Show summary**
205
223
 
206
224
  After applying all changes, summarize:
207
225
  - Which capabilities were updated