@leocm/flowcraft 0.0.0-stage → 2.0.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 (269) hide show
  1. package/README.md +846 -3
  2. package/bin/cli.js +102 -0
  3. package/flowcraft.yaml +30 -0
  4. package/install.sh +24 -0
  5. package/lib/args.js +34 -0
  6. package/lib/config.js +20 -0
  7. package/lib/copy.js +131 -0
  8. package/lib/fix.js +110 -0
  9. package/lib/fsutil.js +104 -0
  10. package/lib/global.js +229 -0
  11. package/lib/init.js +43 -0
  12. package/lib/runtime.js +84 -0
  13. package/lib/version.js +55 -0
  14. package/lib/wizard.js +125 -0
  15. package/package.json +31 -4
  16. package/presets/backend.yaml +20 -0
  17. package/presets/default.yaml +15 -0
  18. package/presets/frontend.yaml +20 -0
  19. package/presets/quick-fix.yaml +15 -0
  20. package/setup/.claude/commands/P0.5.md +1 -0
  21. package/setup/.claude/commands/P0.md +1 -0
  22. package/setup/.claude/commands/P1.md +1 -0
  23. package/setup/.claude/commands/P2.md +1 -0
  24. package/setup/.claude/commands/P3.md +1 -0
  25. package/setup/.claude/commands/P4.md +1 -0
  26. package/setup/.claude/commands/P5.md +1 -0
  27. package/setup/.claude/commands/code-analysis-init.md +1 -0
  28. package/setup/.claude/commands/code-analysis-rebuild.md +1 -0
  29. package/setup/.claude/commands/code-analysis-show-memory.md +1 -0
  30. package/setup/.claude/commands/code-analysis-update.md +1 -0
  31. package/setup/.claude/hooks/check-phase-advancement.py +180 -0
  32. package/setup/.claude/hooks/check-phase-test.py +152 -0
  33. package/setup/.claude/hooks/check-phase-write.py +232 -0
  34. package/setup/.claude/hooks/dispatch.py +64 -0
  35. package/setup/.claude/hooks/file-suggestion.py +45 -0
  36. package/setup/.claude/hooks/flowcraft_env.py +99 -0
  37. package/setup/.claude/hooks/log_session.py +91 -0
  38. package/setup/.claude/hooks/permission-request.py +125 -0
  39. package/setup/.claude/hooks/post-tool-failure.py +34 -0
  40. package/setup/.claude/hooks/pre-compact.py +64 -0
  41. package/setup/.claude/hooks/review-runner.py +844 -0
  42. package/setup/.claude/hooks/session-end.py +182 -0
  43. package/setup/.claude/hooks/session-start.py +188 -0
  44. package/setup/.claude/hooks/settings.json +0 -0
  45. package/setup/.claude/hooks/setup-keys.py +280 -0
  46. package/setup/.claude/hooks/statusline.py +61 -0
  47. package/setup/.claude/hooks/stop-check.py +169 -0
  48. package/setup/.claude/hooks/subagent-start.py +48 -0
  49. package/setup/.claude/hooks/subagent-stop.py +61 -0
  50. package/setup/.claude/hooks/task-completed.py +55 -0
  51. package/setup/.claude/hooks/task_manager.py +592 -0
  52. package/setup/.claude/hooks/user-prompt-submit.py +85 -0
  53. package/setup/.claude/project-state.md +109 -0
  54. package/setup/.claude/settings.json +237 -0
  55. package/setup/.claude/settings.local.json +13 -0
  56. package/setup/.claude/skills/P5report/SKILL.md +77 -0
  57. package/setup/.claude/skills/Pstatus/SKILL.md +68 -0
  58. package/setup/.claude/skills/archive/SKILL.md +196 -0
  59. package/setup/.claude/skills/brainstorming/SKILL.md +155 -0
  60. package/setup/.claude/skills/brainstorming/scripts/frame-template.html +213 -0
  61. package/setup/.claude/skills/brainstorming/scripts/helper.js +167 -0
  62. package/setup/.claude/skills/brainstorming/scripts/server.cjs +723 -0
  63. package/setup/.claude/skills/brainstorming/scripts/start-server.py +245 -0
  64. package/setup/.claude/skills/brainstorming/scripts/stop-server.py +178 -0
  65. package/setup/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  66. package/setup/.claude/skills/brainstorming/visual-companion.md +298 -0
  67. package/setup/.claude/skills/checkpoint/SKILL.md +42 -0
  68. package/setup/.claude/skills/chrome-integration/SKILL.md +67 -0
  69. package/setup/.claude/skills/code-analysis/SKILL.md +1243 -0
  70. package/setup/.claude/skills/code-review/SKILL.md +265 -0
  71. package/setup/.claude/skills/cross-review/SKILL.md +41 -0
  72. package/setup/.claude/skills/executing-plans/SKILL.md +64 -0
  73. package/setup/.claude/skills/git-prep/SKILL.md +50 -0
  74. package/setup/.claude/skills/gitnexus/gitnexus-cli/SKILL.md +67 -0
  75. package/setup/.claude/skills/gitnexus/gitnexus-debugging/SKILL.md +89 -0
  76. package/setup/.claude/skills/gitnexus/gitnexus-exploring/SKILL.md +78 -0
  77. package/setup/.claude/skills/gitnexus/gitnexus-guide/SKILL.md +66 -0
  78. package/setup/.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +97 -0
  79. package/setup/.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md +121 -0
  80. package/setup/.claude/skills/graphify/SKILL.md +49 -0
  81. package/setup/.claude/skills/openspec-apply-change/SKILL.md +185 -0
  82. package/setup/.claude/skills/openspec-archive-change/SKILL.md +182 -0
  83. package/setup/.claude/skills/openspec-bulk-archive-change/SKILL.md +339 -0
  84. package/setup/.claude/skills/openspec-continue-change/SKILL.md +118 -0
  85. package/setup/.claude/skills/openspec-explore/SKILL.md +311 -0
  86. package/setup/.claude/skills/openspec-ff-change/SKILL.md +113 -0
  87. package/setup/.claude/skills/openspec-new-change/SKILL.md +77 -0
  88. package/setup/.claude/skills/openspec-onboard/SKILL.md +573 -0
  89. package/setup/.claude/skills/openspec-propose/SKILL.md +149 -0
  90. package/setup/.claude/skills/openspec-sync-specs/SKILL.md +262 -0
  91. package/setup/.claude/skills/openspec-update-change/SKILL.md +91 -0
  92. package/setup/.claude/skills/openspec-verify-change/SKILL.md +175 -0
  93. package/setup/.claude/skills/oss-version-check/SKILL.md +71 -0
  94. package/setup/.claude/skills/oss-version-check/check_oss_version.py +205 -0
  95. package/setup/.claude/skills/phase/SKILL.md +63 -0
  96. package/setup/.claude/skills/playwright/SKILL.md +86 -0
  97. package/setup/.claude/skills/playwright-cli/SKILL.md +420 -0
  98. package/setup/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
  99. package/setup/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
  100. package/setup/.claude/skills/playwright-cli/references/references/element-attributes.md +23 -0
  101. package/setup/.claude/skills/playwright-cli/references/references/playwright-tests.md +39 -0
  102. package/setup/.claude/skills/playwright-cli/references/references/request-mocking.md +87 -0
  103. package/setup/.claude/skills/playwright-cli/references/references/running-code.md +241 -0
  104. package/setup/.claude/skills/playwright-cli/references/references/session-management.md +225 -0
  105. package/setup/.claude/skills/playwright-cli/references/references/storage-state.md +275 -0
  106. package/setup/.claude/skills/playwright-cli/references/references/test-generation.md +433 -0
  107. package/setup/.claude/skills/playwright-cli/references/references/tracing.md +139 -0
  108. package/setup/.claude/skills/playwright-cli/references/references/video-recording.md +143 -0
  109. package/setup/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
  110. package/setup/.claude/skills/playwright-cli/references/running-code.md +241 -0
  111. package/setup/.claude/skills/playwright-cli/references/session-management.md +225 -0
  112. package/setup/.claude/skills/playwright-cli/references/storage-state.md +275 -0
  113. package/setup/.claude/skills/playwright-cli/references/test-generation.md +433 -0
  114. package/setup/.claude/skills/playwright-cli/references/tracing.md +139 -0
  115. package/setup/.claude/skills/playwright-cli/references/video-recording.md +143 -0
  116. package/setup/.claude/skills/review/SKILL.md +98 -0
  117. package/setup/.claude/skills/review-tools/SKILL.md +76 -0
  118. package/setup/.claude/skills/subagent-driven-development/SKILL.md +94 -0
  119. package/setup/.claude/skills/task/SKILL.md +26 -0
  120. package/setup/.claude/skills/test-driven-development/SKILL.md +320 -0
  121. package/setup/.claude/skills/test-driven-development/writing-good-tests.md +198 -0
  122. package/setup/.claude/skills/ui-ux-pro-max/SKILL.md +377 -0
  123. package/setup/.claude/skills/ui-ux-pro-max/data/charts.csv +26 -0
  124. package/setup/.claude/skills/ui-ux-pro-max/data/colors.csv +97 -0
  125. package/setup/.claude/skills/ui-ux-pro-max/data/icons.csv +101 -0
  126. package/setup/.claude/skills/ui-ux-pro-max/data/landing.csv +31 -0
  127. package/setup/.claude/skills/ui-ux-pro-max/data/products.csv +97 -0
  128. package/setup/.claude/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  129. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  130. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  131. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  132. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  133. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  134. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  135. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  136. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  137. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  138. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  139. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  140. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  141. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  142. package/setup/.claude/skills/ui-ux-pro-max/data/styles.csv +68 -0
  143. package/setup/.claude/skills/ui-ux-pro-max/data/typography.csv +58 -0
  144. package/setup/.claude/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  145. package/setup/.claude/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  146. package/setup/.claude/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  147. package/setup/.claude/skills/ui-ux-pro-max/scripts/core.py +253 -0
  148. package/setup/.claude/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  149. package/setup/.claude/skills/ui-ux-pro-max/scripts/search.py +114 -0
  150. package/setup/.claude/skills/ui-ux-standards/SKILL.md +154 -0
  151. package/setup/.claude/skills/verification-before-completion/SKILL.md +120 -0
  152. package/setup/.claude/skills/wiki-read/SKILL.md +190 -0
  153. package/setup/.claude/skills/writing-plans/SKILL.md +168 -0
  154. package/setup/.claude/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  155. package/setup/.claude/tasks/.last-session +1 -0
  156. package/setup/.codex/.agents/skills/P5report/SKILL.md +77 -0
  157. package/setup/.codex/.agents/skills/Pstatus/SKILL.md +30 -0
  158. package/setup/.codex/.agents/skills/archive/SKILL.md +196 -0
  159. package/setup/.codex/.agents/skills/brainstorming/SKILL.md +155 -0
  160. package/setup/.codex/.agents/skills/brainstorming/scripts/frame-template.html +213 -0
  161. package/setup/.codex/.agents/skills/brainstorming/scripts/helper.js +167 -0
  162. package/setup/.codex/.agents/skills/brainstorming/scripts/server.cjs +723 -0
  163. package/setup/.codex/.agents/skills/brainstorming/scripts/start-server.py +245 -0
  164. package/setup/.codex/.agents/skills/brainstorming/scripts/stop-server.py +178 -0
  165. package/setup/.codex/.agents/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  166. package/setup/.codex/.agents/skills/brainstorming/visual-companion.md +298 -0
  167. package/setup/.codex/.agents/skills/checkpoint/SKILL.md +42 -0
  168. package/setup/.codex/.agents/skills/chrome-integration/SKILL.md +67 -0
  169. package/setup/.codex/.agents/skills/code-analysis/SKILL.md +1243 -0
  170. package/setup/.codex/.agents/skills/code-review/SKILL.md +265 -0
  171. package/setup/.codex/.agents/skills/cross-review/SKILL.md +42 -0
  172. package/setup/.codex/.agents/skills/executing-plans/SKILL.md +64 -0
  173. package/setup/.codex/.agents/skills/git-prep/SKILL.md +50 -0
  174. package/setup/.codex/.agents/skills/gitnexus/gitnexus-cli/SKILL.md +67 -0
  175. package/setup/.codex/.agents/skills/gitnexus/gitnexus-debugging/SKILL.md +89 -0
  176. package/setup/.codex/.agents/skills/gitnexus/gitnexus-exploring/SKILL.md +78 -0
  177. package/setup/.codex/.agents/skills/gitnexus/gitnexus-guide/SKILL.md +66 -0
  178. package/setup/.codex/.agents/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +97 -0
  179. package/setup/.codex/.agents/skills/gitnexus/gitnexus-refactoring/SKILL.md +121 -0
  180. package/setup/.codex/.agents/skills/graphify/SKILL.md +49 -0
  181. package/setup/.codex/.agents/skills/openspec-apply-change/SKILL.md +185 -0
  182. package/setup/.codex/.agents/skills/openspec-archive-change/SKILL.md +182 -0
  183. package/setup/.codex/.agents/skills/openspec-bulk-archive-change/SKILL.md +339 -0
  184. package/setup/.codex/.agents/skills/openspec-continue-change/SKILL.md +118 -0
  185. package/setup/.codex/.agents/skills/openspec-explore/SKILL.md +311 -0
  186. package/setup/.codex/.agents/skills/openspec-ff-change/SKILL.md +113 -0
  187. package/setup/.codex/.agents/skills/openspec-new-change/SKILL.md +77 -0
  188. package/setup/.codex/.agents/skills/openspec-onboard/SKILL.md +573 -0
  189. package/setup/.codex/.agents/skills/openspec-propose/SKILL.md +149 -0
  190. package/setup/.codex/.agents/skills/openspec-sync-specs/SKILL.md +262 -0
  191. package/setup/.codex/.agents/skills/openspec-update-change/SKILL.md +91 -0
  192. package/setup/.codex/.agents/skills/openspec-verify-change/SKILL.md +175 -0
  193. package/setup/.codex/.agents/skills/oss-version-check/SKILL.md +71 -0
  194. package/setup/.codex/.agents/skills/oss-version-check/check_oss_version.py +205 -0
  195. package/setup/.codex/.agents/skills/phase/SKILL.md +63 -0
  196. package/setup/.codex/.agents/skills/playwright/SKILL.md +86 -0
  197. package/setup/.codex/.agents/skills/playwright-cli/SKILL.md +420 -0
  198. package/setup/.codex/.agents/skills/playwright-cli/references/element-attributes.md +23 -0
  199. package/setup/.codex/.agents/skills/playwright-cli/references/playwright-tests.md +39 -0
  200. package/setup/.codex/.agents/skills/playwright-cli/references/references/element-attributes.md +23 -0
  201. package/setup/.codex/.agents/skills/playwright-cli/references/references/playwright-tests.md +39 -0
  202. package/setup/.codex/.agents/skills/playwright-cli/references/references/request-mocking.md +87 -0
  203. package/setup/.codex/.agents/skills/playwright-cli/references/references/running-code.md +241 -0
  204. package/setup/.codex/.agents/skills/playwright-cli/references/references/session-management.md +225 -0
  205. package/setup/.codex/.agents/skills/playwright-cli/references/references/storage-state.md +275 -0
  206. package/setup/.codex/.agents/skills/playwright-cli/references/references/test-generation.md +433 -0
  207. package/setup/.codex/.agents/skills/playwright-cli/references/references/tracing.md +139 -0
  208. package/setup/.codex/.agents/skills/playwright-cli/references/references/video-recording.md +143 -0
  209. package/setup/.codex/.agents/skills/playwright-cli/references/request-mocking.md +87 -0
  210. package/setup/.codex/.agents/skills/playwright-cli/references/running-code.md +241 -0
  211. package/setup/.codex/.agents/skills/playwright-cli/references/session-management.md +225 -0
  212. package/setup/.codex/.agents/skills/playwright-cli/references/storage-state.md +275 -0
  213. package/setup/.codex/.agents/skills/playwright-cli/references/test-generation.md +433 -0
  214. package/setup/.codex/.agents/skills/playwright-cli/references/tracing.md +139 -0
  215. package/setup/.codex/.agents/skills/playwright-cli/references/video-recording.md +143 -0
  216. package/setup/.codex/.agents/skills/review/SKILL.md +98 -0
  217. package/setup/.codex/.agents/skills/review-tools/SKILL.md +76 -0
  218. package/setup/.codex/.agents/skills/subagent-driven-development/SKILL.md +94 -0
  219. package/setup/.codex/.agents/skills/task/SKILL.md +27 -0
  220. package/setup/.codex/.agents/skills/test-driven-development/SKILL.md +320 -0
  221. package/setup/.codex/.agents/skills/test-driven-development/writing-good-tests.md +198 -0
  222. package/setup/.codex/.agents/skills/ui-ux-pro-max/SKILL.md +377 -0
  223. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/charts.csv +26 -0
  224. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/colors.csv +97 -0
  225. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/icons.csv +101 -0
  226. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/landing.csv +31 -0
  227. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/products.csv +97 -0
  228. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  229. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  230. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  231. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  232. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  233. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  234. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  235. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  236. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  237. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  238. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  239. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  240. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  241. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  242. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/styles.csv +68 -0
  243. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/typography.csv +58 -0
  244. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  245. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  246. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  247. package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/core.py +253 -0
  248. package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  249. package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/search.py +114 -0
  250. package/setup/.codex/.agents/skills/ui-ux-standards/SKILL.md +154 -0
  251. package/setup/.codex/.agents/skills/verification-before-completion/SKILL.md +120 -0
  252. package/setup/.codex/.agents/skills/wiki-read/SKILL.md +190 -0
  253. package/setup/.codex/.agents/skills/writing-plans/SKILL.md +168 -0
  254. package/setup/.codex/.agents/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  255. package/setup/.codex/config.toml +10 -0
  256. package/setup/.codex/hooks/log_session.py +85 -0
  257. package/setup/.codex/hooks/review-runner.py +844 -0
  258. package/setup/.codex/hooks/sdlc-codex-hook.cjs +1020 -0
  259. package/setup/.codex/hooks/setup-keys.py +280 -0
  260. package/setup/.codex/hooks.json +121 -0
  261. package/setup/.codex/model-catalog.json +154 -0
  262. package/setup/.codex/project-state.md +103 -0
  263. package/setup/AGENTS.md +722 -0
  264. package/setup/CLAUDE.md +717 -0
  265. package/setup/install.sh +24 -0
  266. package/setup/tests/test_decision_timeout.py +241 -0
  267. package/setup/tests/test_hook_guards.py +341 -0
  268. package/setup/tests/test_sdlc_bootstrap.py +167 -0
  269. package/setup/tests/test_task_manager.py +148 -0
@@ -0,0 +1,182 @@
1
+ ---
2
+ name: openspec-archive-change
3
+ description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
4
+ allowed-tools: Bash(openspec:*)
5
+ license: MIT
6
+ compatibility: Requires openspec CLI.
7
+ metadata:
8
+ author: openspec
9
+ version: "1.0"
10
+ ---
11
+ > **Auto-install (懒加载自动安装)**: 仅当本技能被调用且 `openspec` 命令缺失时执行:`npm i -g @fission-ai/openspec`,或改用 `npx @fission-ai/openspec {cmd}`(按需下载)。
12
+
13
+ Archive a completed change in the experimental workflow.
14
+
15
+ **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
16
+
17
+ `<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.
18
+
19
+ **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.
20
+
21
+ **Steps**
22
+
23
+ 1. **Select the change**
24
+
25
+ If a name is provided, use it. Otherwise:
26
+ - Infer from conversation context if the user mentioned a change
27
+ - Auto-select if only one active change exists
28
+ - If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
29
+
30
+ When prompting, show only active changes (not already archived).
31
+ Include the schema used for each change if available.
32
+
33
+ Always announce: "Using change: <name>" and how to override (e.g., `/openspec-archive-change <other>`).
34
+
35
+ **Load current archive inputs before the existing archive checks:**
36
+
37
+ After resolving the selected change and planning root, run:
38
+ ```bash
39
+ openspec instructions archive --change "<name>" --json
40
+ ```
41
+ Keep the same selected-root flags on this command. This lookup is advisory and
42
+ optional: it only supplies extra prompt inputs, so it must never block archiving.
43
+ If it exits non-zero or returns invalid JSON — for example on an older CLI that
44
+ does not support this command yet — continue the archive workflow with no
45
+ context and no operation guidance. Do not report an error and do not stop.
46
+
47
+ A successful response may omit both optional fields. Treat `context` as a
48
+ required prompt-level input: read and consider it, and apply relevant project
49
+ facts, conventions, and constraints. Treat `operationGuidance` as optional
50
+ additive advice: read and consider every entry, and follow entries that are
51
+ applicable and compatible with the built-in archive workflow.
52
+
53
+ Keep both fields separate from built-in steps, explicit user choices, resolved
54
+ paths, CLI checks, and command contracts. If context conflicts with one of those
55
+ controlling inputs, report the conflict and preserve the controlling value. If
56
+ guidance is inapplicable or conflicts with a controlling input, do not follow it
57
+ and explain why. Do not infer replacement paths, skipped prompts, or flags from
58
+ either field, and do not copy their text verbatim into specs, change artifacts,
59
+ or archive summaries unless the user separately asks for it. These are
60
+ prompt-level behavior contracts, not enforceable checks.
61
+
62
+ 2. **Check artifact completion status**
63
+
64
+ Run `openspec status --change "<name>" --json` to check artifact completion.
65
+
66
+ Parse the JSON to understand:
67
+ - `schemaName`: The workflow being used
68
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
69
+ - `artifacts`: List of artifacts with their status (`done`, `skipped`, or other)
70
+
71
+ **If any artifacts are neither `done` nor `skipped`** (skipped artifacts satisfy the requirement - the change declares skip_specs):
72
+ - Display warning listing incomplete artifacts
73
+ - Ask the user to confirm they want to proceed
74
+ - Proceed if user confirms
75
+
76
+ 3. **Check task completion status**
77
+
78
+ Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
79
+
80
+ Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
81
+
82
+ **If incomplete tasks found:**
83
+ - Display warning showing count of incomplete tasks
84
+ - Ask the user to confirm they want to proceed
85
+ - Proceed if user confirms
86
+
87
+ **If no tasks file exists:** Proceed without task-related warning.
88
+
89
+ 4. **Assess delta spec sync state**
90
+
91
+ Use `artifactPaths.specs.existingOutputPaths` from status JSON as the only
92
+ delta-spec source. If the `specs` entry is missing or
93
+ `existingOutputPaths` is empty, proceed without a sync prompt and do not infer
94
+ delta specs from other artifacts.
95
+
96
+ **If delta specs exist:**
97
+ - 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)
98
+ - Determine what changes would be applied (adds, modifications, removals, renames)
99
+ - Show a combined summary before prompting
100
+
101
+ **Prompt options:**
102
+ - If changes needed: "Sync now (recommended)", "Archive without syncing"
103
+ - If already synced: "Archive now", "Sync anyway", "Cancel"
104
+
105
+ Route on the answer:
106
+ - "Cancel" — stop, do not archive
107
+ - "Archive without syncing" or "Archive now" — proceed to archive
108
+ - "Sync now" or "Sync anyway" — sync, then verify (below)
109
+ - Anything else — ask again rather than archiving
110
+
111
+ Before a selected sync writes any main spec, run
112
+ `openspec instructions specs --change "<name>" --json` once with the same
113
+ selected-root flags. Require a zero exit status and valid artifact-instruction
114
+ JSON. If the lookup fails or returns invalid JSON, report the error and stop
115
+ before writing any main spec or moving the change. A valid response with omitted
116
+ `rules` is the no-rules case. Apply returned `rules` only to the content and
117
+ form of main specs produced by this merge; do not use them as archive guidance,
118
+ change CLI behavior, or copy the rule text into any output file.
119
+
120
+ Then run the `openspec-sync-specs` workflow inline (agent-driven intelligent merge) for change '<name>', passing the delta spec analysis and the fetched specs-rule snapshot from above, and wait for it to finish. The inline sync must reuse that snapshot without fetching `specs` instructions again. Do not delegate it to a background task — step 5 would move `changeRoot` out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.
121
+
122
+ 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:
123
+ - ADDED requirements present
124
+ - MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact
125
+ - 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
126
+ - RENAMED requirements present under the new name and absent under the old one
127
+
128
+ 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.
129
+
130
+ 5. **Perform the archive**
131
+
132
+ Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
133
+ ```bash
134
+ mkdir -p "<planningHome.changesDir>/archive"
135
+ ```
136
+
137
+ Generate the target name: use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<change-name>`. Never stack a second date (same rule as `openspec archive`).
138
+
139
+ **Check if target already exists:**
140
+ - If yes: Fail with error, suggest renaming existing archive or using different date
141
+ - If no: Move `changeRoot` to the archive directory
142
+
143
+ ```bash
144
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
145
+ ```
146
+
147
+ 6. **Display summary**
148
+
149
+ Show archive completion summary including:
150
+ - Change name
151
+ - Schema that was used
152
+ - Archive location
153
+ - Whether specs were synced (if applicable)
154
+ - Note about any warnings (incomplete artifacts/tasks)
155
+
156
+ **Output On Success**
157
+
158
+ ```markdown
159
+ ## Archive Complete
160
+
161
+ **Change:** <change-name>
162
+ **Schema:** <schema-name>
163
+ **Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
164
+ **Specs:** <"✓ Synced to main specs" only if the step 4 verification passed; otherwise "No delta specs" or "Sync skipped">
165
+
166
+ <"All artifacts complete. All tasks complete." — or, if archived with warnings, list them instead (e.g. "Archived with 2 incomplete tasks")>
167
+ ```
168
+
169
+ **Guardrails**
170
+ - Announce the selected change; prompt for selection when it is ambiguous
171
+ - Use artifact graph (openspec status --json) for completion checking
172
+ - Don't block archive on warnings - just inform and confirm
173
+ - Preserve .openspec.yaml when moving to archive (it moves with the directory)
174
+ - Show clear summary of what happened
175
+ - If sync is requested, run the `openspec-sync-specs` workflow inline (agent-driven)
176
+ - Never archive while a spec sync is still in flight — run the sync inline and verify the main specs before moving `changeRoot`
177
+ - If delta specs exist, always run the sync assessment and show the combined summary before prompting
178
+ - Apply relevant runtime context and report conflicts; operation guidance remains advisory
179
+ - Consider every guidance entry and explain any inapplicable or conflicting advice
180
+ - Existing CLI checks, resolved paths, prompts, and command contracts are unchanged
181
+ - Artifact rules constrain only the specs being written and are never operation guidance
182
+ - Never copy runtime context, operation guidance, or artifact-rule text verbatim into output files
@@ -0,0 +1,339 @@
1
+ ---
2
+ name: openspec-bulk-archive-change
3
+ description: Archive multiple completed changes at once. Use when archiving several parallel changes.
4
+ allowed-tools: Bash(openspec:*)
5
+ license: MIT
6
+ compatibility: Requires openspec CLI.
7
+ metadata:
8
+ author: openspec
9
+ version: "1.0"
10
+ ---
11
+ > **Auto-install (懒加载自动安装)**: 仅当本技能被调用且 `openspec` 命令缺失时执行:`npm i -g @fission-ai/openspec`,或改用 `npx @fission-ai/openspec {cmd}`(按需下载)。
12
+
13
+ Archive multiple completed changes in a single operation.
14
+
15
+ This skill allows you to batch-archive changes, handling spec conflicts intelligently by checking the codebase to determine what's actually implemented.
16
+
17
+ **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
18
+
19
+ `<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.
20
+
21
+ **Input**: None required (prompts for selection)
22
+
23
+ **Steps**
24
+
25
+ 1. **Get active changes**
26
+
27
+ Run `openspec list --json` to get all active changes.
28
+
29
+ If no active changes exist, inform user and stop.
30
+
31
+ 2. **Prompt for change selection**
32
+
33
+ Ask the user to choose changes (multi-select):
34
+ - Show each change with its schema
35
+ - Include an option for "All changes"
36
+ - Allow any number of selections (1+ works, 2+ is the typical use case)
37
+
38
+ **IMPORTANT**: Do NOT auto-select. Always let the user choose.
39
+
40
+ **Load current archive inputs once for the selected root before batch validation:**
41
+
42
+ Choose one selected change from this root and run
43
+ `openspec instructions archive --change "<selected-change>" --json` with the
44
+ same selected-root flags. This lookup is advisory and optional: it only supplies
45
+ extra prompt inputs, so it must never block the batch. If it fails or returns
46
+ invalid JSON — for example on an older CLI that does not support this command
47
+ yet — continue the batch with no context and no operation guidance. Do not
48
+ report an error and do not stop.
49
+
50
+ A valid response may omit `context` and `operationGuidance`. Treat
51
+ `context` as a required prompt-level input across the batch: read and consider
52
+ it, and apply relevant project facts, conventions, and constraints. Treat
53
+ `operationGuidance` as optional additive advice: read and consider every
54
+ entry, and follow entries that are applicable and compatible with the built-in
55
+ batch workflow.
56
+
57
+ Keep both fields separate from conflict analysis, explicit user choices,
58
+ resolved paths, CLI checks, and command contracts. If context conflicts with one
59
+ of those controlling inputs, report the conflict and preserve the controlling
60
+ value. If guidance is inapplicable or conflicts with a controlling input, do not
61
+ follow it and explain why. Do not infer skipped prompts, replacement paths, or
62
+ flags from either field, and do not copy their text verbatim into specs, changes,
63
+ or summaries. These are prompt-level behavior contracts, not enforceable checks.
64
+
65
+ 3. **Batch validation - gather status for all selected changes**
66
+
67
+ For each selected change, collect:
68
+
69
+ a. **Artifact status** - Run `openspec status --change "<name>" --json`
70
+ - Parse `schemaName`, `artifacts`, `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`
71
+ - Note which artifacts are `done` vs other states
72
+
73
+ b. **Task completion** - Read `artifactPaths.tasks.existingOutputPaths` from status JSON
74
+ - Count `- [ ]` (incomplete) vs `- [x]` (complete)
75
+ - If no tasks file exists, note as "No tasks"
76
+
77
+ c. **Delta specs** - Check `artifactPaths.specs.existingOutputPaths` from status JSON
78
+ - List which capability specs exist
79
+ - For each, extract requirement names (lines matching `### Requirement: <name>`)
80
+ - Treat this list as the only delta-spec source. If the `specs` entry is
81
+ missing or the list is empty, perform no spec sync or specs-instruction
82
+ lookup for that change; do not infer deltas from unrelated artifacts.
83
+ - Evaluate this independently for every change, including mixed-schema
84
+ batches where some schemas have no `specs` artifact.
85
+ 4. **Detect spec conflicts**
86
+
87
+ Build a map keyed by `<capability-path>`, the exact path relative to `specs/`:
88
+
89
+ ```text
90
+ identity/user-auth -> [change-a, change-b] <- CONFLICT (2+ changes)
91
+ billing/user-auth -> [change-c] <- OK (different full path)
92
+ ```
93
+
94
+ A conflict exists when 2+ selected changes have delta specs for the exact same `<capability-path>`.
95
+
96
+ 5. **Resolve conflicts agentically**
97
+
98
+ **For each conflict**, investigate the codebase:
99
+
100
+ a. **Read the delta specs** from each conflicting change to understand what each claims to add/modify
101
+
102
+ b. **Search the codebase** for implementation evidence:
103
+ - Look for code implementing requirements from each delta spec
104
+ - Check for related files, functions, or tests
105
+
106
+ c. **Determine resolution**:
107
+ - If only one change is actually implemented -> sync that one's specs
108
+ - If both implemented -> apply in chronological order (older first, newer overwrites)
109
+ - If neither implemented -> skip spec sync, warn user
110
+
111
+ d. **Record resolution** for each conflict:
112
+ - An inclusion or exclusion decision for every delta spec, keyed by change and `<capability-path>`
113
+ - Which included delta specs to apply and in what order
114
+ - Which delta specs to exclude from sync because their implementation is missing
115
+ - Rationale (what was found in codebase)
116
+
117
+ 6. **Show consolidated status table**
118
+
119
+ Display a table summarizing all changes:
120
+
121
+ ```markdown
122
+ | Change | Artifacts | Tasks | Specs | Conflicts | Status |
123
+ |---------------------|-----------|-------|---------|-----------|--------|
124
+ | schema-management | Done | 5/5 | 2 delta | None | Ready |
125
+ | project-config | Done | 3/3 | 1 delta | None | Ready |
126
+ | add-oauth | Done | 4/4 | 1 delta | identity/user-auth (!) | Ready* |
127
+ | add-verify-skill | 1 left | 2/5 | None | None | Warn |
128
+ ```
129
+
130
+ For conflicts, show the resolution:
131
+ ```text
132
+ * Conflict resolution:
133
+ - identity/user-auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
134
+ ```
135
+
136
+ For incomplete changes, show warnings:
137
+ ```text
138
+ Warnings:
139
+ - add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
140
+ ```
141
+
142
+ 7. **Confirm batch operation**
143
+
144
+ Ask the user a single confirmation question:
145
+
146
+ - "Archive N changes?" with options based on status
147
+ - Options might include:
148
+ - "Archive all N changes"
149
+ - "Archive only N ready changes (skip incomplete)"
150
+ - "Cancel"
151
+
152
+ If there are incomplete changes, make clear they'll be archived with warnings.
153
+
154
+ Route on the answer by intent, not by exact label — you wrote these labels,
155
+ so match what the user picked rather than the wording above:
156
+ - "Cancel" — stop, do not archive. Report that nothing was archived and skip the remaining steps.
157
+ - The archive-everything option — proceed with every selected change
158
+ - The ready-only option — proceed with only the changes the step 6 table marks `Ready` or `Ready*`, and record the rest as Skipped in step 8d. If a `Ready*` change's conflict partner is skipped, re-derive that conflict's resolution using only the changes being archived.
159
+ - Anything else — ask again rather than archiving
160
+
161
+ Before step 8 writes the first main spec or moves any change, fetch every
162
+ required specs-rule snapshot for the confirmed batch. For each change that will
163
+ sync concrete `artifactPaths.specs.existingOutputPaths`, run
164
+ `openspec instructions specs --change "<name>" --json` exactly once with the
165
+ same selected-root flags. Obtain all snapshots before the first write or move.
166
+ If any lookup exits non-zero or returns invalid artifact-instruction JSON,
167
+ identify the affected change, report the error, and stop the whole batch before
168
+ any main-spec write or change move. Do not treat lookup failure as omitted
169
+ rules. A valid response without `rules` is the no-rules case.
170
+
171
+ 8. **Execute archive for each confirmed change**
172
+
173
+ Before processing, carry the recorded decisions from step 5 (after any step 7 re-derivation) into two per-delta sets:
174
+ - `includedDeltas`: all non-conflicting delta specs from confirmed changes plus conflict deltas selected for sync
175
+ - `excludedDeltas`: conflict deltas from confirmed changes excluded because their implementation is missing
176
+ - A single change can have both included and excluded delta specs. Keep the decision per delta; do not collapse it into a per-change sync flag.
177
+
178
+ Process changes in the determined order (respecting conflict resolution):
179
+
180
+ a. **Sync included delta specs**:
181
+ - Run the `openspec-sync-specs` workflow inline (agent-driven intelligent merge) only for changes with entries in `includedDeltas`, passing only the included delta paths and explicitly instructing it to ignore that change's `excludedDeltas`. Wait for it to finish.
182
+ - For conflicts, apply in resolved order.
183
+ - Pass that change's fetched specs-rule snapshot into inline sync; inline
184
+ sync must reuse it without fetching instructions again
185
+ - Apply artifact rules only to main specs produced by that change. They do
186
+ not change conflict resolution, archive behavior, or CLI contracts, and
187
+ their text is not copied into an output file
188
+ - Do not delegate to a background task — step 8c would move `changeRoot` out from under a sync that is still reading it.
189
+ - If a change has no included delta specs, do not run the sync workflow for it.
190
+
191
+ b. **Verify included delta specs before moving changeRoot**:
192
+ - 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).
193
+ - Verify that main specs are updated:
194
+ - ADDED requirements present
195
+ - MODIFIED requirements carrying scenario and description changes named in the delta, with their other scenarios intact
196
+ - 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
197
+ - RENAMED requirements present under the new name and absent under the old one
198
+ - Do not verify delta specs in `excludedDeltas`; they are intentionally left unsynced.
199
+ - 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.
200
+
201
+ c. **Perform the archive**:
202
+
203
+ Target name: use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<name>` (same rule as `openspec archive`).
204
+
205
+ ```bash
206
+ mkdir -p "<planningHome.changesDir>/archive"
207
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
208
+ ```
209
+
210
+ d. **Track outcome** for each change:
211
+ - Success: archived successfully
212
+ - Failed: error during archive or spec verification (record error)
213
+ - Skipped: user chose not to archive (if applicable)
214
+ - 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.
215
+
216
+ 9. **Display summary**
217
+
218
+ Show final results:
219
+
220
+ ```markdown
221
+ ## Bulk Archive Complete
222
+
223
+ Archived 3 changes:
224
+ - schema-management-cli -> archive/2026-01-19-schema-management-cli/
225
+ - project-config -> archive/2026-01-19-project-config/
226
+ - add-oauth -> archive/2026-01-19-add-oauth/
227
+
228
+ Skipped 1 change:
229
+ - add-verify-skill (user chose not to archive incomplete)
230
+
231
+ Spec sync summary:
232
+ - 4 delta specs synced to main specs
233
+ - 1 delta spec sync skipped (add-jwt, identity/user-auth: implementation not found)
234
+ - 1 conflict resolved (identity/user-auth: synced add-oauth, skipped add-jwt)
235
+ ```
236
+
237
+ If any failures:
238
+ ```text
239
+ Failed 1 change:
240
+ - some-change: Archive directory already exists
241
+ ```
242
+
243
+ **Conflict Resolution Examples**
244
+
245
+ Example 1: Only one implemented
246
+ ```text
247
+ Conflict: <planningHome.root>/openspec/specs/auth/spec.md touched by [add-oauth, add-jwt]
248
+
249
+ Checking add-oauth:
250
+ - Delta adds "OAuth Provider Integration" requirement
251
+ - Searching codebase... found src/auth/oauth.ts implementing OAuth flow
252
+
253
+ Checking add-jwt:
254
+ - Delta adds "JWT Token Handling" requirement
255
+ - Searching codebase... no JWT implementation found
256
+
257
+ Resolution: Only add-oauth is implemented. Will sync add-oauth specs only.
258
+ ```
259
+
260
+ Example 2: Both implemented
261
+ ```text
262
+ Conflict: <planningHome.root>/openspec/specs/api/spec.md touched by [add-rest-api, add-graphql]
263
+
264
+ Checking add-rest-api (created 2026-01-10):
265
+ - Delta adds "REST Endpoints" requirement
266
+ - Searching codebase... found src/api/rest.ts
267
+
268
+ Checking add-graphql (created 2026-01-15):
269
+ - Delta adds "GraphQL Schema" requirement
270
+ - Searching codebase... found src/api/graphql.ts
271
+
272
+ Resolution: Both implemented. Will apply add-rest-api specs first,
273
+ then add-graphql specs (chronological order, newer takes precedence).
274
+ ```
275
+
276
+ **Output On Success**
277
+
278
+ ```markdown
279
+ ## Bulk Archive Complete
280
+
281
+ Archived N changes:
282
+ - <change-1> -> archive/<target-name-1>/
283
+ - <change-2> -> archive/<target-name-2>/
284
+
285
+ Spec sync summary:
286
+ - N delta specs synced to main specs
287
+ - No conflicts (or: M conflicts resolved)
288
+ ```
289
+
290
+ **Output On Partial Success**
291
+
292
+ ```markdown
293
+ ## Bulk Archive Complete (partial)
294
+
295
+ Archived N changes:
296
+ - <change-1> -> archive/<target-name-1>/
297
+
298
+ Skipped M changes:
299
+ - <change-2> (user chose not to archive incomplete)
300
+
301
+ Failed K changes:
302
+ - <change-3>: Archive directory already exists
303
+ ```
304
+
305
+ **Output When No Changes**
306
+
307
+ ```markdown
308
+ ## No Changes to Archive
309
+
310
+ No active changes found. Create a new change to get started.
311
+ ```
312
+
313
+ **Guardrails**
314
+ - Allow any number of changes (1+ is fine, 2+ is the typical use case)
315
+ - Always prompt for selection, never auto-select
316
+ - Detect spec conflicts early and resolve by checking codebase
317
+ - When both changes are implemented, apply specs in chronological order
318
+ - Skip spec sync only when implementation is missing (warn user)
319
+ - Show clear per-change status before confirming
320
+ - Use single confirmation for entire batch
321
+ - Never archive after the user cancels the confirmation — a cancelled batch archives nothing
322
+ - Track and report all outcomes (success/skip/fail)
323
+ - Preserve .openspec.yaml when moving to archive
324
+ - Archive directory target uses current date: YYYY-MM-DD-<name>; a name that already starts with a `YYYY-MM-DD-` prefix is used as-is (never stack a second date)
325
+ - If archive target exists, fail that change but continue with others
326
+ - If sync is requested, run the `openspec-sync-specs` workflow inline (agent-driven) for each change with included delta specs
327
+ - Carry the per-delta `includedDeltas` and `excludedDeltas` decisions into execution; sync and verify only included deltas
328
+ - Report every excluded delta as `sync skipped` without treating the archive itself as skipped
329
+ - 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`
330
+ - Fetch archive inputs once per selected root before spec inspection or moves
331
+ - Fetch all required specs-rule snapshots before the batch's first main-spec write or move
332
+ - A failed archive-inputs lookup never blocks the batch; it proceeds with no context or guidance
333
+ - A failed specs instruction lookup stops the whole batch atomically
334
+ - Changes without concrete `artifactPaths.specs.existingOutputPaths` continue without spec sync
335
+ - Apply relevant runtime context across the batch and report conflicts
336
+ - Operation guidance remains advisory; consider every entry and explain rejected advice
337
+ - Keep runtime inputs, conflict analysis, CLI-derived values, and artifact rules separate
338
+ - Artifact rules constrain only written specs
339
+ - Never copy runtime input or artifact-rule text verbatim into output files
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: openspec-continue-change
3
+ description: Continue working on an OpenSpec change by creating the next artifact. Use when the user wants to progress their change, create the next artifact, or continue their workflow.
4
+ allowed-tools: Bash(openspec:*)
5
+ license: MIT
6
+ compatibility: Requires openspec CLI.
7
+ metadata:
8
+ author: openspec
9
+ version: "1.0"
10
+ ---
11
+ > **Auto-install (懒加载自动安装)**: 仅当本技能被调用且 `openspec` 命令缺失时执行:`npm i -g @fission-ai/openspec`,或改用 `npx @fission-ai/openspec {cmd}`(按需下载)。
12
+
13
+ Continue working on a change by creating the next artifact.
14
+
15
+ **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
16
+
17
+ **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.
18
+
19
+ **Steps**
20
+
21
+ 1. **Select the change**
22
+
23
+ If a name is provided, use it. Otherwise:
24
+ - Infer from conversation context if the user mentioned a change
25
+ - Auto-select if only one active change exists
26
+ - If ambiguous, run `openspec list --json` to get available changes sorted by most recently modified, and ask the user to select one
27
+
28
+ When prompting, present the top 3-4 most recently modified changes as options, showing:
29
+ - Change name
30
+ - Schema (from `schema` field if present, otherwise "spec-driven")
31
+ - Status (e.g., "0/5 tasks", "complete", "no tasks")
32
+ - How recently it was modified (from `lastModified` field)
33
+
34
+ Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to continue.
35
+
36
+ Always announce: "Using change: <name>" and how to override (e.g., `/openspec-continue-change <other>`).
37
+
38
+ 2. **Check current status**
39
+ ```bash
40
+ openspec status --change "<name>" --json
41
+ ```
42
+ Parse the JSON to understand current state. The response includes:
43
+ - `schemaName`: The workflow schema being used (e.g., "spec-driven")
44
+ - `artifacts`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
45
+ - `isPlanningComplete`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as `isComplete`.
46
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
47
+
48
+ 3. **Act based on status**:
49
+
50
+ ---
51
+
52
+ **If all planning artifacts are complete (`isPlanningComplete: true`, or legacy `isComplete: true`)**:
53
+ - Congratulate the user
54
+ - Show final status including the schema used
55
+ - Suggest: "Planning is complete! You can now implement this change. Once implementation and any tracked work are complete, archive it."
56
+ - STOP
57
+
58
+ ---
59
+
60
+ **If artifacts are ready to create** (status shows artifacts with `status: "ready"`):
61
+ - Pick the FIRST artifact with `status: "ready"` from the status output
62
+ - Get its instructions:
63
+ ```bash
64
+ openspec instructions <artifact-id> --change "<name>" --json
65
+ ```
66
+ - Parse the JSON. The key fields are:
67
+ - `context`: Project background (constraints for you - do NOT include in output)
68
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
69
+ - `template`: The structure to use for your output file
70
+ - `instruction`: Schema-specific guidance
71
+ - `resolvedOutputPath`: Resolved path or pattern to write the artifact
72
+ - `dependencies`: Completed artifacts to read for context (entries with `skipped: true` have no files - do not look for them)
73
+ - `skipped`/`warning`: present when the change declares skip_specs and this artifact must NOT be created - pick another artifact
74
+ - **Create the artifact file**:
75
+ - 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)
76
+ - 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`
77
+ - Otherwise use `template` as the structure - fill in its sections
78
+ - Apply `context` and `rules` as constraints when writing - but do NOT copy them into the file
79
+ - 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
80
+ - Show what was created and what's now unlocked
81
+ - STOP after creating ONE artifact
82
+
83
+ ---
84
+
85
+ **If no artifacts are ready (all blocked)**:
86
+ - This shouldn't happen with a valid schema
87
+ - Show status and suggest checking for issues
88
+
89
+ 4. **After creating an artifact, show progress**
90
+ ```bash
91
+ openspec status --change "<name>"
92
+ ```
93
+
94
+ **Output**
95
+
96
+ After each invocation, show:
97
+ - Which artifact was created
98
+ - Schema workflow being used
99
+ - Current progress (N/M complete)
100
+ - What artifacts are now unlocked
101
+ - Prompt: "Want to continue? Just ask me to continue or tell me what to do next."
102
+
103
+ **Artifact Creation Guidelines**
104
+
105
+ 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.
106
+
107
+ 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.
108
+
109
+ **Guardrails**
110
+ - Create ONE artifact per invocation
111
+ - 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)
112
+ - Never skip artifacts or create out of order
113
+ - If context is unclear, ask the user before creating
114
+ - Verify the artifact file exists after writing before marking progress
115
+ - Use the schema's artifact sequence, don't assume specific artifact names
116
+ - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
117
+ - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
118
+ - These guide what you write, but should never appear in the output