@rpamis/comet 0.4.0-beta.4 → 0.4.0-beta.6

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 (199) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +11 -4
  3. package/assets/manifest.json +1 -1
  4. package/assets/skills/comet/SKILL.md +30 -28
  5. package/assets/skills/comet/reference/auto-transition.md +1 -1
  6. package/assets/skills/comet/reference/comet-yaml-fields.md +8 -4
  7. package/assets/skills/comet/reference/context-recovery.md +2 -2
  8. package/assets/skills/comet/reference/decision-point.md +11 -0
  9. package/assets/skills/comet/reference/subagent-dispatch.md +6 -5
  10. package/assets/skills/comet/rules/comet-phase-guard.en.md +23 -28
  11. package/assets/skills/comet/rules/comet-phase-guard.md +22 -28
  12. package/assets/skills/comet/scripts/comet-runtime.mjs +682 -309
  13. package/assets/skills/comet-any/SKILL.md +1 -1
  14. package/assets/skills/comet-any/reference/authored-zone-example.md +10 -5
  15. package/assets/skills/comet-any/reference/subagents/pause-points-author.md +14 -11
  16. package/assets/skills/comet-any/reference/subagents/skill-reviewer.md +2 -0
  17. package/assets/skills/comet-any/reference/subagents/workflow-entry-author.md +5 -4
  18. package/assets/skills/comet-archive/SKILL.md +33 -13
  19. package/assets/skills/comet-build/SKILL.md +37 -29
  20. package/assets/skills/comet-design/SKILL.md +23 -22
  21. package/assets/skills/comet-hotfix/SKILL.md +46 -31
  22. package/assets/skills/comet-open/SKILL.md +97 -58
  23. package/assets/skills/comet-tweak/SKILL.md +34 -19
  24. package/assets/skills/comet-verify/SKILL.md +37 -59
  25. package/assets/skills-zh/comet/SKILL.md +30 -28
  26. package/assets/skills-zh/comet/reference/auto-transition.md +1 -1
  27. package/assets/skills-zh/comet/reference/comet-yaml-fields.md +8 -4
  28. package/assets/skills-zh/comet/reference/context-recovery.md +2 -2
  29. package/assets/skills-zh/comet/reference/decision-point.md +11 -0
  30. package/assets/skills-zh/comet/reference/subagent-dispatch.md +6 -5
  31. package/assets/skills-zh/comet-any/SKILL.md +1 -1
  32. package/assets/skills-zh/comet-any/reference/authored-zone-example.md +10 -5
  33. package/assets/skills-zh/comet-any/reference/subagents/pause-points-author.md +14 -12
  34. package/assets/skills-zh/comet-any/reference/subagents/skill-reviewer.md +2 -0
  35. package/assets/skills-zh/comet-any/reference/subagents/workflow-entry-author.md +5 -4
  36. package/assets/skills-zh/comet-archive/SKILL.md +33 -13
  37. package/assets/skills-zh/comet-build/SKILL.md +37 -29
  38. package/assets/skills-zh/comet-design/SKILL.md +23 -22
  39. package/assets/skills-zh/comet-hotfix/SKILL.md +45 -30
  40. package/assets/skills-zh/comet-open/SKILL.md +96 -57
  41. package/assets/skills-zh/comet-tweak/SKILL.md +33 -18
  42. package/assets/skills-zh/comet-verify/SKILL.md +37 -59
  43. package/dist/app/commands/doctor.d.ts.map +1 -1
  44. package/dist/app/commands/doctor.js +62 -15
  45. package/dist/app/commands/doctor.js.map +1 -1
  46. package/dist/app/commands/init.d.ts +1 -1
  47. package/dist/app/commands/init.d.ts.map +1 -1
  48. package/dist/app/commands/init.js +58 -14
  49. package/dist/app/commands/init.js.map +1 -1
  50. package/dist/app/commands/status.d.ts +1 -0
  51. package/dist/app/commands/status.d.ts.map +1 -1
  52. package/dist/app/commands/status.js +10 -0
  53. package/dist/app/commands/status.js.map +1 -1
  54. package/dist/app/commands/uninstall.d.ts +3 -0
  55. package/dist/app/commands/uninstall.d.ts.map +1 -1
  56. package/dist/app/commands/uninstall.js +70 -36
  57. package/dist/app/commands/uninstall.js.map +1 -1
  58. package/dist/app/commands/update.d.ts.map +1 -1
  59. package/dist/app/commands/update.js +213 -34
  60. package/dist/app/commands/update.js.map +1 -1
  61. package/dist/domains/bundle/bundle-platform.d.ts +1 -0
  62. package/dist/domains/bundle/bundle-platform.d.ts.map +1 -1
  63. package/dist/domains/bundle/bundle-platform.js +6 -2
  64. package/dist/domains/bundle/bundle-platform.js.map +1 -1
  65. package/dist/domains/comet-classic/classic-branch-binding.d.ts +51 -0
  66. package/dist/domains/comet-classic/classic-branch-binding.d.ts.map +1 -0
  67. package/dist/domains/comet-classic/classic-branch-binding.js +107 -0
  68. package/dist/domains/comet-classic/classic-branch-binding.js.map +1 -0
  69. package/dist/domains/comet-classic/classic-current-change.d.ts.map +1 -1
  70. package/dist/domains/comet-classic/classic-current-change.js +37 -20
  71. package/dist/domains/comet-classic/classic-current-change.js.map +1 -1
  72. package/dist/domains/comet-classic/classic-guard.d.ts.map +1 -1
  73. package/dist/domains/comet-classic/classic-guard.js +50 -16
  74. package/dist/domains/comet-classic/classic-guard.js.map +1 -1
  75. package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
  76. package/dist/domains/comet-classic/classic-hook-guard.js +138 -21
  77. package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
  78. package/dist/domains/comet-classic/classic-resolver.js +1 -1
  79. package/dist/domains/comet-classic/classic-resolver.js.map +1 -1
  80. package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -1
  81. package/dist/domains/comet-classic/classic-state-command.js +113 -14
  82. package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
  83. package/dist/domains/comet-classic/classic-state-events.d.ts +1 -1
  84. package/dist/domains/comet-classic/classic-state-events.d.ts.map +1 -1
  85. package/dist/domains/comet-classic/classic-state.d.ts +4 -2
  86. package/dist/domains/comet-classic/classic-state.d.ts.map +1 -1
  87. package/dist/domains/comet-classic/classic-state.js +16 -1
  88. package/dist/domains/comet-classic/classic-state.js.map +1 -1
  89. package/dist/domains/comet-classic/classic-transitions.d.ts.map +1 -1
  90. package/dist/domains/comet-classic/classic-transitions.js +17 -2
  91. package/dist/domains/comet-classic/classic-transitions.js.map +1 -1
  92. package/dist/domains/comet-classic/classic-validate-command.d.ts.map +1 -1
  93. package/dist/domains/comet-classic/classic-validate-command.js +13 -1
  94. package/dist/domains/comet-classic/classic-validate-command.js.map +1 -1
  95. package/dist/domains/dashboard/web/assets/_commonjsHelpers-CqkleIqs.js +1 -0
  96. package/dist/domains/dashboard/web/assets/arc-TGVUG2WN.js +1 -0
  97. package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-ASHmiHoP.js +36 -0
  98. package/dist/domains/dashboard/web/assets/blockDiagram-GPEHLZMM-CwASxBKe.js +132 -0
  99. package/dist/domains/dashboard/web/assets/c4Diagram-AAUBKEIU-BU8z_WNk.js +10 -0
  100. package/dist/domains/dashboard/web/assets/channel-kp6Ng2JJ.js +1 -0
  101. package/dist/domains/dashboard/web/assets/chunk-2J33WTMH-CBGlUx4_.js +1 -0
  102. package/dist/domains/dashboard/web/assets/chunk-4BX2VUAB-CS-iGcFz.js +1 -0
  103. package/dist/domains/dashboard/web/assets/chunk-55IACEB6-BUtCVJat.js +1 -0
  104. package/dist/domains/dashboard/web/assets/chunk-727SXJPM-C94tj_pf.js +206 -0
  105. package/dist/domains/dashboard/web/assets/chunk-AQP2D5EJ-BFOKcpdG.js +231 -0
  106. package/dist/domains/dashboard/web/assets/chunk-FMBD7UC4-Dmx8B-st.js +15 -0
  107. package/dist/domains/dashboard/web/assets/chunk-ND2GUHAM-DYV00CNn.js +1 -0
  108. package/dist/domains/dashboard/web/assets/chunk-QZHKN3VN-DMJJyQnw.js +1 -0
  109. package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-yBDjgMY_.js +1 -0
  110. package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-yBDjgMY_.js +1 -0
  111. package/dist/domains/dashboard/web/assets/cose-bilkent-S5V4N54A-P4nE2rea.js +1 -0
  112. package/dist/domains/dashboard/web/assets/cynefin-VYW2F7L2-C-R1HXDv.js +166 -0
  113. package/dist/domains/dashboard/web/assets/cytoscape.esm-D3_iZ_3b.js +321 -0
  114. package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-BH8d-C9z.js +4 -0
  115. package/dist/domains/dashboard/web/assets/defaultLocale-DX6XiGOO.js +1 -0
  116. package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-DpXTgQIH.js +43 -0
  117. package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-DSiFJzSw.js +10 -0
  118. package/dist/domains/dashboard/web/assets/diagram-KO2AKTUF-DULMkben.js +3 -0
  119. package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-Pi8m_NO9.js +24 -0
  120. package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-BSe6bCWm.js +24 -0
  121. package/dist/domains/dashboard/web/assets/erDiagram-TEJ5UH35-zb-FEcbq.js +85 -0
  122. package/dist/domains/dashboard/web/assets/flowDiagram-I6XJVG4X-Dr-Gk0z2.js +162 -0
  123. package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-qs6Zb2A6.js +292 -0
  124. package/dist/domains/dashboard/web/assets/gitGraphDiagram-PVQCEYII-BQ314orT.js +106 -0
  125. package/dist/domains/dashboard/web/assets/graph--OzhPTMs.js +1 -0
  126. package/dist/domains/dashboard/web/assets/index-BLAfkNTu.css +1 -0
  127. package/dist/domains/dashboard/web/assets/index-DlSYK56b.js +139 -0
  128. package/dist/domains/dashboard/web/assets/index-DtLUOcAW.js +24 -0
  129. package/dist/domains/dashboard/web/assets/index-QO0z6F4w.js +10 -0
  130. package/dist/domains/dashboard/web/assets/infoDiagram-5YYISTIA-O0bQp98A.js +2 -0
  131. package/dist/domains/dashboard/web/assets/init-Gi6I4Gst.js +1 -0
  132. package/dist/domains/dashboard/web/assets/ishikawaDiagram-YF4QCWOH-BPC7wbKh.js +70 -0
  133. package/dist/domains/dashboard/web/assets/journeyDiagram-JHISSGLW-ohViOd4b.js +139 -0
  134. package/dist/domains/dashboard/web/assets/kanban-definition-UN3LZRKU-CHleNdbG.js +89 -0
  135. package/dist/domains/dashboard/web/assets/katex-HP8lGamR.js +257 -0
  136. package/dist/domains/dashboard/web/assets/layout-SsrduOYp.js +1 -0
  137. package/dist/domains/dashboard/web/assets/linear-CyqiW--Q.js +1 -0
  138. package/dist/domains/dashboard/web/assets/marked.esm-DECB3bxB.js +64 -0
  139. package/dist/domains/dashboard/web/assets/mermaid.core-qS9XvtaK.js +301 -0
  140. package/dist/domains/dashboard/web/assets/mindmap-definition-RKZ34NQL-oaGkqO9l.js +96 -0
  141. package/dist/domains/dashboard/web/assets/ordinal-Cboi1Yqb.js +1 -0
  142. package/dist/domains/dashboard/web/assets/pieDiagram-4H26LBE5-CPcB-AFh.js +30 -0
  143. package/dist/domains/dashboard/web/assets/purify.es-VaSPOPhr.js +3 -0
  144. package/dist/domains/dashboard/web/assets/quadrantDiagram-W4KKPZXB-LFy52Qtj.js +7 -0
  145. package/dist/domains/dashboard/web/assets/requirementDiagram-4Y6WPE33-BdjeaYP_.js +84 -0
  146. package/dist/domains/dashboard/web/assets/sankeyDiagram-5OEKKPKP-DDJ4styL.js +40 -0
  147. package/dist/domains/dashboard/web/assets/sequenceDiagram-3UESZ5HK-BL5bFNoz.js +162 -0
  148. package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-BNUfikui.js +1 -0
  149. package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-DGrsmWts.js +1 -0
  150. package/dist/domains/dashboard/web/assets/timeline-definition-PNZ67QCA--ps2uu6L.js +120 -0
  151. package/dist/domains/dashboard/web/assets/vennDiagram-CIIHVFJN-C2q8q26c.js +34 -0
  152. package/dist/domains/dashboard/web/assets/wardleyDiagram-YWT4CUSO-BUH9gXqd.js +78 -0
  153. package/dist/domains/dashboard/web/assets/xychartDiagram-2RQKCTM6-B-DielEy.js +7 -0
  154. package/dist/domains/dashboard/web/index.html +16 -16
  155. package/dist/domains/factory/package.d.ts.map +1 -1
  156. package/dist/domains/factory/package.js +20 -6
  157. package/dist/domains/factory/package.js.map +1 -1
  158. package/dist/domains/integrations/openspec.d.ts +4 -1
  159. package/dist/domains/integrations/openspec.d.ts.map +1 -1
  160. package/dist/domains/integrations/openspec.js +56 -4
  161. package/dist/domains/integrations/openspec.js.map +1 -1
  162. package/dist/domains/skill/find.d.ts.map +1 -1
  163. package/dist/domains/skill/find.js +7 -1
  164. package/dist/domains/skill/find.js.map +1 -1
  165. package/dist/domains/skill/json-object.d.ts +13 -0
  166. package/dist/domains/skill/json-object.d.ts.map +1 -0
  167. package/dist/domains/skill/json-object.js +24 -0
  168. package/dist/domains/skill/json-object.js.map +1 -0
  169. package/dist/domains/skill/platform-inspect.d.ts +9 -0
  170. package/dist/domains/skill/platform-inspect.d.ts.map +1 -0
  171. package/dist/domains/skill/platform-inspect.js +149 -0
  172. package/dist/domains/skill/platform-inspect.js.map +1 -0
  173. package/dist/domains/skill/platform-install.d.ts +16 -6
  174. package/dist/domains/skill/platform-install.d.ts.map +1 -1
  175. package/dist/domains/skill/platform-install.js +277 -144
  176. package/dist/domains/skill/platform-install.js.map +1 -1
  177. package/dist/domains/skill/uninstall.d.ts.map +1 -1
  178. package/dist/domains/skill/uninstall.js +204 -141
  179. package/dist/domains/skill/uninstall.js.map +1 -1
  180. package/dist/platform/fs/file-system.d.ts +3 -3
  181. package/dist/platform/fs/file-system.d.ts.map +1 -1
  182. package/dist/platform/fs/file-system.js +21 -11
  183. package/dist/platform/fs/file-system.js.map +1 -1
  184. package/dist/platform/install/platforms.d.ts +4 -0
  185. package/dist/platform/install/platforms.d.ts.map +1 -1
  186. package/dist/platform/install/platforms.js +2 -0
  187. package/dist/platform/install/platforms.js.map +1 -1
  188. package/dist/platform/install/project-registry.d.ts +1 -0
  189. package/dist/platform/install/project-registry.d.ts.map +1 -1
  190. package/dist/platform/install/project-registry.js +9 -1
  191. package/dist/platform/install/project-registry.js.map +1 -1
  192. package/dist/platform/install/skill-root-owner.d.ts +15 -0
  193. package/dist/platform/install/skill-root-owner.d.ts.map +1 -0
  194. package/dist/platform/install/skill-root-owner.js +68 -0
  195. package/dist/platform/install/skill-root-owner.js.map +1 -0
  196. package/package.json +6 -1
  197. package/dist/domains/dashboard/web/assets/index-CIvN-PL8.js +0 -22
  198. package/dist/domains/dashboard/web/assets/index-DcyRPBnT.css +0 -1
  199. package/eval/.env +0 -28
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: comet-design
3
- description: "Use when a full Comet change has completed open but lacks a Superpowers Design Doc, or design must resume from an OpenSpec handoff package."
3
+ description: "Use only when explicitly invoked as /comet-design or routed by the root Comet skill/runtime to a full workflow design phase; create or recover the deep technical Design Doc."
4
4
  ---
5
5
 
6
6
  # Comet Phase 2: Deep Design (Design)
@@ -20,7 +20,7 @@ Locate scripts via `comet/reference/scripts.md`, then run entry verification. Wh
20
20
 
21
21
  ```bash
22
22
  comet state select <change-name>
23
- node "$COMET_STATE" check <name> design
23
+ comet state check <name> design
24
24
  ```
25
25
 
26
26
  Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
@@ -32,7 +32,7 @@ Proceed to Step 1 after verification passes. The script outputs specific failure
32
32
  **Must be generated by script. Agent writing summaries on the fly is not allowed.**
33
33
 
34
34
  ```bash
35
- node "$COMET_HANDOFF" <change-name> design --write
35
+ comet handoff <change-name> design --write
36
36
  ```
37
37
 
38
38
  The script reads the change `.comet.yaml` `context_compression` snapshot, then generates and records the matching handoff package.
@@ -71,7 +71,7 @@ The beta handoff package is a **structured spec projection** that reduces OpenSp
71
71
  If full context is genuinely needed, explicitly run:
72
72
 
73
73
  ```bash
74
- node "$COMET_HANDOFF" <change-name> design --write --full
74
+ comet handoff <change-name> design --write --full
75
75
  ```
76
76
 
77
77
  Handoff package sources come from OpenSpec open phase artifacts:
@@ -87,7 +87,7 @@ Handoff package sources come from OpenSpec open phase artifacts:
87
87
  When loading the skill, ARGUMENTS must include:
88
88
 
89
89
  ```text
90
- Language: Use the configured Comet artifact language from `"$COMET_BASH" "$COMET_STATE" get <name> language`
90
+ Language: Use the configured Comet artifact language from `comet state get <name> language`
91
91
  ```
92
92
 
93
93
  After the skill loads, follow its guidance and use the following context:
@@ -146,9 +146,7 @@ Only after the user explicitly confirms, proceed to Step 2. If the user requests
146
146
 
147
147
  After the user confirms the design proposal, before creating the Design Doc, create or update the incrementally maintained checkpoint file and finalize it as the confirmed design summary:
148
148
 
149
- ```bash
150
- mkdir -p openspec/changes/<name>/.comet/handoff
151
- ```
149
+ Use the current platform's file API to ensure `openspec/changes/<name>/.comet/handoff/` exists; do not rely on a POSIX-only directory command.
152
150
 
153
151
  `openspec/changes/<name>/.comet/handoff/brainstorm-summary.md` structure:
154
152
 
@@ -180,14 +178,9 @@ mkdir -p openspec/changes/<name>/.comet/handoff
180
178
  - `openspec/changes/<name>/.comet/handoff/design-context.md` (or `spec-context.md` in beta mode)
181
179
  - `openspec/changes/<name>/.comet/handoff/design-context.json` (or `spec-context.json` in beta mode)
182
180
 
183
- ### 1e. Active Context Compaction Gate
184
-
185
- After Step 1d completes and `brainstorm-summary.md` is written, enter the active compaction gate before creating the Design Doc. At this point the OpenSpec handoff, brainstorming decisions, and pending items are durable, so the agent should proactively release the earlier Spec and brainstorming context to preserve window space for Step 2 and the later Build phase.
181
+ ### 1e. Compaction Policy (Non-blocking Here)
186
182
 
187
- Rules:
188
- - If the current platform provides a native context compaction/cleanup mechanism (for example, the host agent's compact/compaction command, tool, or UI action), trigger active compaction here once; do not try to fake compaction through a shell script.
189
- - The compaction resume prompt must include the change name, current step (Design Step 2), and the three handoff file categories listed above.
190
- - If the current platform cannot be compacted programmatically by the agent, pause and tell the user to run the host platform's manual compaction action; continue to Step 2 only after the user confirms compaction is unavailable or asks to continue.
183
+ `brainstorm-summary.md` is a recovery checkpoint, but do not discard live design context before the Design Doc is persisted. Continue directly to Step 2. Active compaction moves until after the Design Doc, state, and latest handoff are all durable.
191
184
 
192
185
  ### 2. Create Design Doc
193
186
 
@@ -214,17 +207,25 @@ First record the design_doc path. If Spec Patches wrote back delta spec (added o
214
207
 
215
208
  ```bash
216
209
  # Record design_doc path
217
- node "$COMET_STATE" set <name> design_doc docs/superpowers/specs/YYYY-MM-DD-topic-design.md
210
+ comet state set <name> design_doc docs/superpowers/specs/YYYY-MM-DD-topic-design.md
218
211
 
219
212
  # If delta spec changes exist, regenerate handoff (update hash)
220
- node "$COMET_HANDOFF" <change-name> design --write
213
+ comet handoff <change-name> design --write
221
214
 
222
215
  # Auto-transition to next phase
223
- node "$COMET_GUARD" <change-name> design --apply
216
+ comet guard <change-name> design --apply
224
217
  ```
225
218
 
226
219
  If there are no delta spec changes, skip the handoff regeneration step. The state file updates automatically; no manual editing of other fields needed.
227
220
 
221
+ ### 3a. Optional Active Context Compaction
222
+
223
+ Consider active compaction only **after the Design Doc and state evidence are persisted** and before Build. First confirm `design_doc`, the latest handoff, `handoff_hash`, and the design guard are durable so recovery never depends on an unwritten design judgment.
224
+
225
+ - If the host exposes a programmatically callable native compaction mechanism and the context window is under pressure, invoke it once and include the change, next step, Design Doc, and handoff files in the resume prompt
226
+ - If only the user can trigger compaction, give one non-blocking suggestion and continue; it **must not block when programmatic compaction is unavailable** and must not create another confirmation point
227
+ - Never fake host compaction with a shell command or an agent summary
228
+
228
229
  ## Exit Conditions
229
230
 
230
231
  - Design Doc created and saved
@@ -235,12 +236,12 @@ If there are no delta spec changes, skip the handoff regeneration step. The stat
235
236
  - In beta mode, `spec-context.json` must be structurally valid and reference the current source files (enforced by guard)
236
237
  - If new capabilities or supplementary acceptance scenarios exist, OpenSpec delta spec has been created/updated
237
238
  - `design_doc` written to `.comet.yaml`
238
- - **Phase guard**: Run `node "$COMET_GUARD" <change-name> design --apply`; after all PASS, auto-transitions to `phase: build`
239
+ - **Phase guard**: Run `comet guard <change-name> design --apply`; after all PASS, auto-transitions to `phase: build`
239
240
 
240
241
  Must use `--apply` before exit:
241
242
 
242
243
  ```bash
243
- node "$COMET_GUARD" <change-name> design --apply
244
+ comet guard <change-name> design --apply
244
245
  ```
245
246
 
246
247
  ## Context Compression Recovery
@@ -252,9 +253,9 @@ Follow `comet/reference/context-recovery.md` with phase set to `design`.
252
253
  Follow `comet/reference/auto-transition.md`. Key command:
253
254
 
254
255
  ```bash
255
- node "$COMET_STATE" next <change-name>
256
+ comet state next <change-name>
256
257
  ```
257
258
 
258
259
  - `NEXT: auto` → invoke the skill pointed to by `SKILL` to enter the next phase
259
- - `NEXT: manual` → do not invoke the next skill; prompt user to run `/<SKILL>` manually
260
+ - `NEXT: manual` → do not invoke the next skill; return control with `HINT`, end the invocation, and do not create another confirmation point
260
261
  - `NEXT: done` → workflow is complete, no further action needed
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: comet-hotfix
3
- description: "Use when the user wants to fix an existing behavior bug without adding capability or needing full design; also use when resuming hotfix workflow."
3
+ description: "Use only when explicitly invoked as /comet-hotfix or routed by the root Comet skill/runtime to the hotfix preset; fix an existing behavior bug, not an ordinary unmanaged bugfix."
4
4
  ---
5
5
 
6
6
  # Comet Preset Path: Hotfix
@@ -20,7 +20,7 @@ Quick bug fix workflow: open → build → verify → archive. Skip brainstormin
20
20
 
21
21
  ### 0. Output Language Constraint
22
22
 
23
- Streamlined OpenSpec artifacts must use the configured Comet artifact language. Before `.comet.yaml` exists, read `language` from project `.comet/config.yaml`, then fall back to global `~/.comet/config.yaml`; after initialization, use `"$COMET_BASH" "$COMET_STATE" get <name> language`.
23
+ Streamlined OpenSpec artifacts must use the configured Comet artifact language. Before `.comet.yaml` exists, read `language` from project `.comet/config.yaml`, then fall back to global `~/.comet/config.yaml`; after initialization, use `comet state get <name> language`.
24
24
 
25
25
  Execution chain: open → build → root cause check → verify → archive. Hotfix provides default decisions for each phase: streamlined open, direct build, root cause confirmation, scale-based verification, and final archive confirmation after verification passes.
26
26
 
@@ -34,52 +34,68 @@ Reuse Comet open capability to create change, but use hotfix defaults: do not ex
34
34
 
35
35
  **Immediately execute:** Use the Skill tool to load the `openspec-new-change` skill. Skipping this step is prohibited.
36
36
 
37
- After the skill loads, follow its guidance to create streamlined artifacts:
38
- - `proposal.md` — problem description + root cause analysis + fix goal (no solution comparison needed)
39
- - `design.md` — fix solution (one is enough, no multi-solution comparison needed)
40
- - `tasks.md` — fix task list
41
- - **No delta spec needed** (unless fix changes existing spec acceptance scenarios)
42
-
43
- Initialize Comet state file:
37
+ After the skill loads, create the change skeleton first, then immediately initialize recoverable state and bind the current change:
44
38
 
45
39
  ```bash
46
- node "$COMET_STATE" init <name> hotfix
40
+ comet state init <name> hotfix
41
+ comet state select <name>
42
+ comet state check <name> open
47
43
  ```
48
44
 
49
- Verify initialized state:
45
+ If the `select` / `check` output is `BLOCKED` because `bound_branch` does not match the current branch, immediately pause under `comet/reference/decision-point.md` and let the user choose one option: switch back to the bound branch and rerun entry verification, or run `comet state rebind <change-name>` after the user explicitly confirms the current branch should take over this change, then rerun entry verification. Do not switch branches or rebind on your own.
46
+
47
+ Entry workspace isolation is a user decision point; do not use `current` as the default isolation mode. Pause under `comet/reference/decision-point.md` and let the user choose one option:
48
+
49
+ - A. Work directly on the current branch: run `comet state set <name> isolation current` to truthfully bind the current branch
50
+ - B. Create a branch: create and switch to `hotfix/YYYYMMDD/<change-name>`, then run `comet state set <name> isolation branch`
51
+ - C. Create a worktree: first use the Skill tool to load Superpowers `using-git-worktrees`; let that skill create the isolated workspace, then run `comet state set <name> isolation worktree` inside the worktree
52
+
53
+ After B/C, rerun this in the actual execution branch or worktree:
50
54
 
51
55
  ```bash
52
- node "$COMET_STATE" check <name> open
56
+ comet state select <name>
53
57
  ```
54
58
 
59
+ Then create the streamlined artifacts:
60
+ - `proposal.md` — problem description + root cause analysis + fix goal (no solution comparison needed)
61
+ - `design.md` — fix solution (one is enough, no multi-solution comparison needed)
62
+ - `tasks.md` — fix task list
63
+ - **No delta spec needed** (unless fix changes existing spec acceptance scenarios)
64
+
55
65
  Run phase guard to transition open → build:
56
66
 
57
67
  ```bash
58
- node "$COMET_GUARD" <change-name> open --apply
68
+ comet guard <change-name> open --apply
59
69
  ```
60
70
 
61
71
  Check `auto_transition` to decide whether to continue:
62
72
 
63
73
  ```bash
64
- node "$COMET_STATE" next <name>
74
+ comet state next <name>
65
75
  ```
66
76
 
67
77
  - `NEXT: auto` → continue to Step 2
68
- - `NEXT: manual` → pause, follow `HINT` to prompt user to run `/<SKILL>` manually
78
+ - `NEXT: manual` → return control with `HINT` and end the current invocation; do not ask whether to continue
69
79
 
70
80
  ### 2. Direct Build (preset build)
71
81
 
72
- Use hotfix defaults: `build_mode: direct`, `review_mode: off` (hotfix/tweak skip review_mode selection the guard does not require it for preset workflows). Skip Superpowers `brainstorming` and `writing-plans` (unless tasks > 3; if exceeds 3 tasks, transfer to `/comet-build`'s plan and execution method selection note this does NOT trigger full workflow upgrade, only switches execution method).
82
+ Use hotfix defaults: `build_mode: direct`, `tdd_mode: direct`, and `review_mode: off`. `isolation` must keep the entry workspace isolation the user confirmed in Step 1; do not change it back to `current` on your own. Here `direct` skips full planning/TDD orchestration; it never skips reproduction, regression coverage, or verification. Skip Superpowers `brainstorming` and `writing-plans`; **task count alone does not route to `/comet-build`**. Keep larger task lists ordered in the current hotfix and ask about upgrading only when a qualitative-change signal or scope tripwire is hit.
73
83
 
74
84
  Before continuing or starting changes, handle uncommitted changes through `comet/reference/dirty-worktree.md`. If attribution shows a qualitative-change signal or file-count tripwire is hit, handle it through this file's "Upgrade Assessment".
75
85
 
76
- **Immediately execute:** Execute tasks one by one according to tasks.md:
86
+ Before implementation, **reproduce the bug and record failing evidence first**:
87
+
88
+ 1. Confirm the reported old behavior with minimal repeatable steps and record the command, input, and actual result
89
+ 2. When automatable, add and run a regression test that fails for this bug; confirm the failure is caused by the bug rather than the environment or test itself
90
+ 3. If automation is temporarily impossible, record why plus repeatable manual failing evidence in the proposal/verification report; never edit code without evidence
91
+
92
+ After RED evidence exists, execute tasks one by one according to tasks.md:
77
93
 
78
94
  1. Read `openspec/changes/<name>/tasks.md`, get incomplete task list
79
95
  2. For each incomplete task:
80
96
  - Modify code according to task description
81
97
  - Run project formatter (e.g., `mvn spotless:apply`, `npm run format`)
82
- - Run related tests to confirm pass
98
+ - First rerun the new failing regression test and confirm it turns green, then run related tests
83
99
  - Check corresponding `- [ ]` to `- [x]` in tasks.md
84
100
  - Commit code, commit message format: `fix: <brief fix description>`
85
101
  3. After all tasks complete, explicitly run relevant project tests and build commands
@@ -107,7 +123,7 @@ For specific investigation, minimal failing test, fix verification, and keeping
107
123
  After root cause is confirmed eliminated, run phase guard to transition build → verify:
108
124
 
109
125
  ```bash
110
- node "$COMET_GUARD" <change-name> build --apply
126
+ comet guard <change-name> build --apply
111
127
  ```
112
128
 
113
129
  State automatically updates to `phase: verify`, `verify_result: pending`, then enter verification.
@@ -118,7 +134,7 @@ Reuse `/comet-verify`, with comet-verify's scale assessment deciding lightweight
118
134
 
119
135
  **Immediately execute:** Use the Skill tool to load the `comet-verify` skill. Skipping this step is prohibited.
120
136
 
121
- Small-scale hotfixes without delta spec usually meet lightweight verification conditions (≤ 3 tasks, changed files below the scale threshold), comet-verify's scale assessment will select the lightweight verification path (6 quick checks; default `review_mode: off` does not dispatch automatic code review). If the user wants to increase review, they can run `node "$COMET_STATE" set <name> review_mode standard` or `thorough` before verification. If hotfix created delta spec, enter full verification path according to comet-verify's scale assessment rules.
137
+ Small-scale hotfixes without delta spec usually meet lightweight verification conditions (≤ 3 tasks, changed files below the scale threshold), comet-verify's scale assessment will select the lightweight verification path (6 quick checks; default `review_mode: off` does not dispatch automatic code review). If the user wants to increase review, they can run `comet state set <name> review_mode standard` or `thorough` before verification. If hotfix created delta spec, enter full verification path according to comet-verify's scale assessment rules.
122
138
 
123
139
  After verification passes, record `.comet.yaml` `verify_result` as `pass` according to `/comet-verify` rules, must not skip this status before archiving. After verification passes, still enter `/comet-archive`'s final archive confirmation; do not automatically run the archive script.
124
140
 
@@ -136,14 +152,13 @@ If there is delta spec, sync to main spec according to comet-archive rules, and
136
152
  <IMPORTANT>
137
153
  Hotfix workflow is **one-time continuous execution**. After invoking `/comet-hotfix`, agent must automatically advance through hotfix steps, without pausing to wait for user input mid-way.
138
154
 
139
- Exception: when `.comet.yaml` has `auto_transition: false`, after each phase guard advances `phase`, do not auto-invoke the next skill. In this case, use `node "$COMET_STATE" next <name>` output and pause for manual continuation as instructed.
155
+ Exception: when `.comet.yaml` has `auto_transition: false`, end the current invocation at each phase boundary and return control with `HINT`; the user may run the next phase later. This is a manual handoff, not a new confirmation point.
140
156
 
141
- The following situations must also pause and wait for user confirmation:
157
+ The following genuine user decisions still pause:
142
158
 
143
159
  1. Encountering an upgrade-assessment signal (see "Upgrade Assessment" section). **Must use the current platform's available user input/confirmation mechanism to pause and wait for the user to explicitly choose**: continue the hotfix flow, or upgrade to the full `/comet` workflow
144
- 2. workspace isolation and execution-method selection when tasks exceed 3 and transfer to `/comet-build`
145
- 3. verify phase (comet-verify) verification-failure and branch-handling decisions
146
- 4. Final archive confirmation (before comet-archive runs the archive script)
160
+ 2. Verify-phase acceptance of WARNING/SUGGESTION deviations, Spec drift handling, or strategy after the automatic repair limit; the first 3 clearly repairable failures close automatically
161
+ 3. Final archive confirmation and the branch-handling decision after the archive commit
147
162
 
148
163
  Execution order: quick open → direct build → root cause check → verification → archive → complete
149
164
 
@@ -154,7 +169,7 @@ After each step completes, immediately enter next step. Within each phase, must
154
169
 
155
170
  ## Upgrade Assessment
156
171
 
157
- Hotfix upgrade assessment only decides whether to move from the preset workflow to full; file count never upgrades automatically, and `comet-state scale` only decides verification weight.
172
+ Hotfix upgrade assessment only decides whether to move from the preset workflow to full; file count never upgrades automatically, and `comet state scale` only decides verification weight.
158
173
 
159
174
  If `/comet` passes an intent frame from the entry, hotfix must recheck `risk_signal` and escalation signals only before build: new capability, public API, schema change, cross-module coordination, or deep architecture work. When any signal matches, enter the existing escalation decision point; do not reimplement entry intent recognition.
160
175
 
@@ -167,10 +182,10 @@ When a qualitative-change signal or file-count tripwire is hit, **must pause und
167
182
  After the user chooses upgrade (option B), use the legal state-machine upgrade channel, a single command that converts the preset workflow to full and rolls back to design:
168
183
 
169
184
  ```bash
170
- node "$COMET_STATE" transition <name> preset-escalate
185
+ comet state transition <name> preset-escalate
171
186
  ```
172
187
 
173
- This command atomically sets `workflow`/`classic_profile` to `full`, rolls `phase` back to `design`, and clears `design_doc` (satisfying comet-design entry requirements). Then add the Design Doc on the current change: **immediately use the Skill tool to load the `comet-design` skill**, then proceed through the normal full workflow.
188
+ This command atomically sets `workflow`/`classic_profile` to `full`, rolls `phase` back to `design`, clears `design_doc`, and clears preset-only `build_mode`, `tdd_mode`, `review_mode`, `isolation`, and `verify_mode`. Then add the Design Doc on the current change: **immediately use the Skill tool to load the `comet-design` skill**. On entering build, run the full joint workflow-configuration decision again.
174
189
 
175
190
  When the user chooses continue (option A), continue the hotfix workflow and record the user's reason for continuing.
176
191
 
@@ -181,16 +196,16 @@ When the user chooses continue (option A), continue the hotfix workflow and reco
181
196
  - Bug fixed, tests pass
182
197
  - Change archived
183
198
  - If spec changes, synced to main spec
184
- - **Phase guard**: Before build → verify run `node "$COMET_GUARD" <change-name> build --apply`; before verify → archive follow `/comet-verify` and run `node "$COMET_GUARD" <change-name> verify --apply`
199
+ - **Phase guard**: Before build → verify run `comet guard <change-name> build --apply`; before verify → archive follow `/comet-verify` and run `comet guard <change-name> verify --apply`
185
200
 
186
201
  ## Automatic Handoff to Next Phase
187
202
 
188
203
  Follow `comet/reference/auto-transition.md`. Key command:
189
204
 
190
205
  ```bash
191
- node "$COMET_STATE" next <name>
206
+ comet state next <name>
192
207
  ```
193
208
 
194
209
  - `NEXT: auto` → invoke the skill pointed to by `SKILL` to continue hotfix workflow (`phase: build` returns `comet-hotfix`, `verify` returns `comet-verify`, `archive` returns `comet-archive`)
195
- - `NEXT: manual` → do not invoke the next skill; prompt user to manually run `/<SKILL>` per `HINT`
210
+ - `NEXT: manual` → do not invoke the next skill; return control with `HINT`, end the invocation, and do not create another confirmation point
196
211
  - `NEXT: done` → workflow is complete, no further action needed
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: comet-open
3
- description: "Use when Comet needs to create a new OpenSpec change, or an active change is missing proposal/design/tasks/.comet.yaml initialization artifacts."
3
+ description: "Use only when explicitly invoked as /comet-open or routed by the root Comet skill/runtime to the open phase; create or recover an OpenSpec change and its proposal/design/tasks/.comet.yaml artifacts."
4
4
  ---
5
5
 
6
6
  # Comet Phase 1: Open
@@ -13,11 +13,15 @@ description: "Use when Comet needs to create a new OpenSpec change, or an active
13
13
 
14
14
  ### 0. Output Language Constraint
15
15
 
16
- Every prompt and artifact request passed to OpenSpec must include the resolved Comet artifact language, using normalized ids such as `en` or `zh-CN`. Before `.comet.yaml` exists, read `language` from project `.comet/config.yaml`, then fall back to global `~/.comet/config.yaml`; after the change is initialized, use `"$COMET_BASH" "$COMET_STATE" get <name> language`. If no configured language exists, fall back to the current user request language. The generated `proposal.md`, `design.md`, and `tasks.md` must use that language as their main language.
16
+ Every prompt and artifact request passed to OpenSpec must include the resolved Comet artifact language, using normalized ids such as `en` or `zh-CN`. Before `.comet.yaml` exists, read `language` from project `.comet/config.yaml`, then fall back to global `~/.comet/config.yaml`; after the change is initialized, use `comet state get <name> language`. If no configured language exists, fall back to the current user request language. The generated `proposal.md`, `design.md`, and `tasks.md` must use that language as their main language.
17
17
 
18
18
  ### 0a. Current Change Binding
19
19
 
20
- When resuming an existing change, the first state operation must be:
20
+ When resuming an existing change, inspect `openspec/changes/<change-name>/.comet.yaml` first:
21
+
22
+ - If it exists and parses, select the change as the first state operation
23
+ - If it is missing but the change directory is valid, run `comet state init <change-name> full`, then select the change
24
+ - If it is malformed, stop and report the parse error; repair it manually from version control, a backup, or verifiable artifacts before continuing, and never overwrite a damaged file with `state set`
21
25
 
22
26
  ```bash
23
27
  comet state select <change-name>
@@ -25,6 +29,16 @@ comet state select <change-name>
25
29
 
26
30
  When creating a new change, initialize `.comet.yaml` first, then immediately run the same command; never fabricate a selection before state exists.
27
31
 
32
+ ### 0b. OpenSpec Compatibility Check
33
+
34
+ Before any OpenSpec status or instructions command, run:
35
+
36
+ ```bash
37
+ openspec --version
38
+ ```
39
+
40
+ This flow requires **OpenSpec >= 1.5.0**. Stop immediately if the version is older than 1.5.0, cannot be parsed, the command is unavailable, or it exits non-zero. Ask the user to run `npm install -g @fission-ai/openspec@latest` and retry. Never continue with an older CLI that lacks the `applyRequires`, `artifactPaths`, `changeRoot`, or `resolvedOutputPath` contracts.
41
+
28
42
  ### 1. Explore Ideas and Clarify Requirements
29
43
 
30
44
  **Immediately execute:** Use the Skill tool to load the `openspec-explore` skill. Skipping this step is prohibited.
@@ -67,36 +81,44 @@ Every accepted split item must be created as an independent change through `/com
67
81
 
68
82
  Must not create proposal.md, design.md, or tasks.md before the user completes the PRD split choice. If the user chooses to create multiple changes, the current `/comet-open` invocation only completes split confirmation and coordination, then enters `/comet-open` for each split item in the user-confirmed order.
69
83
 
84
+ Immediately after the user confirms multiple changes, persist the accepted split to `.comet/batches/<batch-id>.json`. Use a stable kebab-case `batch-id`. The file must record at least `version`, the original goal summary, creation time, the ordered change names, and each item's goals, scope, non-goals, acceptance scenarios, and `pending|open-complete|selected` status. Atomically update it after each item is created or completed. This is a batch orchestration manifest, not a replacement for each change's `.comet.yaml`.
85
+
70
86
  In batch split mode, entering `/comet-open` for each split item must explicitly mark it as a "confirmed split item" and carry that split item's goals, scope, non-goals, and acceptance scenarios. Confirmed split items skip the PRD split preflight by default, unless the split item itself still clearly contains multiple independent capabilities.
71
87
 
72
- In batch split mode, a single split item must not auto-advance to `/comet-design` after completing the open phase. After splitting is complete, must pause and ask the user which change to start; after the user chooses, advance only that change into `/comet-design`, while other changes remain active and can be resumed later through `/comet`.
88
+ In batch split mode, a single split item must not auto-advance to `/comet-design` after completing the open phase.
73
89
 
74
- Minimal resume rule: do not add a dedicated batch state file. On resume, first check already-created active changes; split items that already exist and contain `.comet.yaml` must not be created again, while uncreated split items continue through `/comet-open` according to the user-confirmed split list. If the confirmed split list cannot be recovered from the conversation, must ask the user to confirm the split list again before continuing.
90
+ **Batch completion hard check (must not be skipped)**: after every split item completes its own open phase, run the following for each `<name>` in the user-confirmed list:
75
91
 
76
- ### 1b. Requirements Clarification Completion Confirmation (Blocking Point)
92
+ ```bash
93
+ openspec status --change "<name>" --json
94
+ comet state check <name> design
95
+ ```
77
96
 
78
- Before creating OpenSpec artifacts, must follow the `comet/reference/decision-point.md` protocol to pause and wait for the user to confirm requirements clarification is complete.
97
+ The OpenSpec JSON must satisfy all of these conditions:
98
+ - Resolved `changeRoot` must equal repository-local `openspec/changes/<name>`; stop if it does not, because Classic runtime does not support an external change root
99
+ - The schema must include core artifact ids `proposal`, `design`, and `tasks`; extra artifacts are allowed, but a missing core id is an incompatible schema
100
+ - Every artifact listed in `applyRequires` must be `done` in `artifacts`
101
+ - Concrete outputs in `artifactPaths.<artifact-id>.existingOutputPaths` (or `resolvedOutputPath` from instructions) must exist and be non-empty
102
+ - Treat `isComplete` as diagnostic only; it neither replaces the `applyRequires` implementation-readiness check nor lets optional artifacts block phase advancement
79
103
 
80
- When pausing, present the clarification summary: goals, non-goals, scope boundaries, key unknowns, and draft acceptance scenarios.
104
+ If any split item fails these checks, must not report splitting complete or ask which change to start. Stop and resume `/comet-open` from that change's first `ready` or `blocked` artifact. If OpenSpec passes but Comet state fails, repair `.comet.yaml` initialization or phase, then rerun the checks for the entire batch.
81
105
 
82
- Must not create proposal.md, design.md, or tasks.md before the user confirms requirements clarification is complete, and must not use the Skill tool to load the `openspec-propose` skill to generate all artifacts in one pass.
106
+ Only after every split item passes both CLI checks may you pause and ask which change to start. Mark the chosen item `selected` in the batch manifest, then advance only that change into `/comet-design`; other changes remain active and can be resumed later through `/comet`.
83
107
 
84
- ### 1c. Change Name Confirmation (Blocking Point)
108
+ On resume, read `.comet/batches/<batch-id>.json` first, then run the CLI checks above for already-created active changes. Do not recreate items that fully pass; resume incomplete items from the first `ready` artifact returned by OpenSpec. Create missing items from the persisted manifest. If the manifest is missing or damaged, stop and ask the user to rebuild/confirm it instead of inferring the original batch boundary from directory names.
85
109
 
86
- Before creating the change directory (`openspec new change`), must follow the `comet/reference/decision-point.md` protocol to pause and let the user decide the change name. Must not auto-generate or silently infer the change name.
110
+ ### 1b. Resolve Requirements and Change Name (Non-blocking by Default)
87
111
 
88
- OpenSpec change names must be **kebab-case English** (lowercase letters, digits, hyphens; e.g. `refine-requirements-doc`). Chinese or other non-conforming names are invalid.
112
+ Before creating OpenSpec artifacts, turn Step 1 clarification into a resolved brief containing the goal, non-goals, scope boundaries, key unknowns, and draft acceptance scenarios. Derive one kebab-case English change name that accurately represents that scope.
89
113
 
90
- When pausing, present:
91
- - **2-3 recommended kebab-case English names** derived from the confirmed clarification summary, each with a one-line description of the scope it implies
92
- - An explicit option for the user to **enter their own name**
93
- - A note that **if the user enters Chinese (or any non-kebab-case text), it will be converted into a compliant kebab-case English name**, and the converted result must be shown back to the user for confirmation before use
114
+ - **Continue directly when scope and naming are both unambiguous**. Do not pause merely to approve a summary or name; final review confirms the change name, scope, and artifacts together
115
+ - If the user supplied a name, normalize it to kebab-case and echo it in the progress update. Do not re-confirm when normalization preserves meaning
116
+ - Reuse a confirmed batch item's persisted summary and name. Re-clarify only when scope drift or missing manifest data is detected
117
+ - Use `comet/reference/decision-point.md` for one joint question only when mutually exclusive choices still change scope or the target change identity. Naming preference alone is not a blocking point
94
118
 
95
- The decision options must include:
96
- - Pick one of the recommended names
97
- - "Enter a custom name" — accept the user's input; if it is already valid kebab-case English, use it directly; if it is Chinese or otherwise non-conforming, convert it to compliant kebab-case English and show the converted name for confirmation before continuing
119
+ OpenSpec names must be kebab-case English using lowercase letters, digits, and single hyphens. When a collision exists but the target remains clear, derive a stable non-conflicting name and continue. Ask only when Comet cannot determine whether to reuse the existing change or create a new one.
98
120
 
99
- Must not run `openspec new change` or create `.comet.yaml` before the user confirms the final change name. If the chosen/converted name collides with an existing change, report the collision and ask the user to choose another name.
121
+ Do not run `openspec new change` or create proposal/design/tasks while the resolved brief or name remains ambiguous. Continue clarification or resolve the genuine user decision before Step 2.
100
122
 
101
123
  ### 2. Create Change Structure + Initialize State
102
124
 
@@ -104,35 +126,50 @@ Must not run `openspec new change` or create `.comet.yaml` before the user confi
104
126
 
105
127
  Full `/comet` workflow must not use the Skill tool to load the `openspec-propose` skill by default; only load it when the user explicitly requests generating the proposal and artifacts in one pass.
106
128
 
107
- After the skill loads, follow its guidance to create the change skeleton, but override its "STOP and wait for user direction" behavior when a confirmed clarification summary from Step 1b is already available in the conversation context.
129
+ After the skill loads, follow its guidance to create the change skeleton. When Step 1b has produced an unambiguous resolved brief, override its "STOP and wait for user direction" behavior to avoid a duplicate question.
130
+
131
+ Use the Step 1b resolved brief directly to populate artifact content. Fall back to the skill's question flow only when ambiguity remains that would change scope.
132
+
133
+ Immediately after creating the change skeleton, initialize recoverable state instead of waiting until every artifact is generated:
108
134
 
109
- If the user has already confirmed a clarification summary (Step 1b), use that summary directly to populate artifact content. If no clarification summary exists (edge case), fall back to the skill's default behavior of asking the user.
135
+ ```bash
136
+ comet state init <name> full
137
+ comet state select <name>
138
+ comet state check <name> open
139
+ ```
140
+
141
+ Stop if any command fails. Then run `openspec status --change "<name>" --json` once and perform compatibility preflight:
110
142
 
111
- After the change skeleton is created, generate `proposal`, `design`, and `tasks` one by one using the standard artifact loop:
143
+ - Resolved `changeRoot` must equal repository-local `openspec/changes/<name>`, and `planningHome` (when present) must remain inside the current repository
144
+ - `artifacts` must contain core ids `proposal`, `design`, and `tasks`; extra artifacts are allowed
145
+ - `applyRequires` must be a parseable list of artifact ids and every id must exist in `artifacts`
146
+ - Stop on missing fields, escaping paths, or missing core ids; never fall back to a guessed fixed template
112
147
 
113
- **Standard Artifact Loop** (for each `artifact-id`: `proposal` `design` `tasks`):
148
+ After preflight, generate the implementation-required artifacts from the OpenSpec schema and dependency graph:
114
149
 
115
- 1. Refresh status: `openspec status --change "<name>" --json`
116
- 2. Fetch artifact instructions:
150
+ **OpenSpec status-driven artifact loop**:
151
+
152
+ 1. Run `openspec status --change "<name>" --json` and parse the complete JSON.
153
+ 2. Exit when every item in `applyRequires` is `done`; record `isComplete` as diagnostic only and do not use it as a phase blocker.
154
+ 3. From unfinished `ready` artifacts, prioritize items that advance the `applyRequires` dependency closure and process them in CLI-returned order. Must not hard-code generation order or assume the schema contains only proposal/design/tasks.
155
+ 4. Fetch current instructions for each ready `<artifact-id>`:
117
156
 
118
157
  ```bash
119
- openspec instructions proposal --change "<name>" --json
120
- openspec instructions design --change "<name>" --json
121
- openspec instructions tasks --change "<name>" --json
158
+ openspec instructions <artifact-id> --change "<name>" --json
122
159
  ```
123
160
 
124
- 3. For the returned JSON instruction payload, you must:
161
+ 5. For the returned JSON instruction payload, you must:
125
162
  - Read every completed dependency artifact listed in `dependencies`
126
163
  - Use `template` as the artifact structure
127
164
  - Follow `instruction` guidance
128
- - Apply `context` and `rules` as constraints — **must not copy them into the artifact content**
129
- - Write to `resolvedOutputPath`
130
- - Verify the output file exists and is non-empty
131
- 4. After creating each artifact, re-run `openspec status --change "<name>" --json` to confirm status before continuing to the next artifact
165
+ - Apply `context` and `rules` as constraints — **must not copy them into artifact content**
166
+ - Write to `resolvedOutputPath`; for wildcard outputs, create each concrete file required by the instruction
167
+ - Verify the concrete output files returned by the CLI exist and are non-empty
168
+ 6. Re-run status after creating each artifact and revalidate `changeRoot`, core ids, and `applyRequires`. Do not regenerate items that become `done`; process newly `ready` items in the next loop.
132
169
 
133
- **Failure handling**: If `openspec instructions` fails, returns invalid JSON, reports unmet `dependencies`, or does not provide a usable `resolvedOutputPath`, must immediately stop artifact creation and report the OpenSpec error. Must not fall back to hard-coded artifact prose because that would silently bypass project rules.
170
+ **Blocking and failure handling**: if `applyRequires` is incomplete and no ready artifact can advance its dependency closure, report `missingDeps` for the relevant `blocked` artifacts and stop. Do not guess order or skip dependencies. Also stop if status/instructions fails, returns invalid JSON, escapes the repository, or provides no usable `resolvedOutputPath`. Must not fall back to hard-coded artifact prose.
134
171
 
135
- **Naming and scope guard**: Change name must be the kebab-case English name confirmed by the user in Step 1c must not auto-generate, infer, or use a non-kebab-case (e.g. Chinese) name. Change scope must match the user's description must not expand or narrow it independently.
172
+ **Naming and scope guard**: Use the kebab-case English name resolved in Step 1b; never use a non-kebab-case name. Change scope must match the resolved brief and user request; do not expand or narrow it independently.
136
173
 
137
174
  Confirm the following artifacts have been created:
138
175
 
@@ -145,43 +182,45 @@ openspec/changes/<name>/
145
182
  └── tasks.md # Task checklist (checkboxes)
146
183
  ```
147
184
 
148
- Create `.comet.yaml` state file:
149
-
150
- First locate scripts via `comet/reference/scripts.md`, then initialize state:
151
-
152
- ```bash
153
- node "$COMET_STATE" init <name> full
154
- ```
155
-
156
185
  ### 3. Entry State Verification
157
186
 
158
187
  Verify state machine has been correctly initialized:
159
188
 
160
189
  ```bash
161
- node "$COMET_STATE" check <name> open
190
+ comet state check <name> open
162
191
  ```
163
192
 
164
193
  Proceed to Step 4 after verification passes. The script outputs specific failure reasons when verification fails.
165
194
 
166
- **Idempotency**: All open phase operations can be safely re-executed. If `.comet.yaml` is already at `phase: open` and all three artifact files exist, skip completed steps and continue from the first missing step.
195
+ **Idempotent recovery algorithm**: all open phase operations can be safely re-executed. On recovery, process the status in this order:
196
+
197
+ 1. If state is missing, run `comet state init <name> full`; if malformed, stop and repair it instead of overwriting it. Then select the change and run `comet state check <name> open`.
198
+ 2. Run status and revalidate `changeRoot`, core ids, `applyRequires`, `artifacts`, and `missingDeps`.
199
+ 3. `done`: keep the artifact unchanged and do not regenerate it.
200
+ 4. `ready`: fetch its instructions, write the returned output, and immediately rerun status.
201
+ 5. `blocked`: follow `missingDeps` and first complete dependencies in the `applyRequires` closure; never generate a blocked artifact directly.
202
+ 6. Repeat until every item in `applyRequires` is `done`.
203
+
204
+ If the required dependency graph cannot advance, list the relevant blocked artifacts and `missingDeps`, then stop. Directory or fixed-file presence cannot replace the CLI decision; conversely, an optional artifact outside `applyRequires` must not block implementation solely because `isComplete` is false.
167
205
 
168
206
  ### 4. Content Completeness Check
169
207
 
170
- Confirm the three documents have complete content:
171
- - **proposal.md**: problem background, goals, scope, non-goals
172
- - **design.md**: high-level architecture decisions, approach selection, data flow
173
- - **tasks.md**: task list, each task has a clear description
208
+ Run status again. Confirm core ids exist, every item in `applyRequires` is `done`, and concrete files in `artifactPaths.<id>.existingOutputPaths` for required artifacts exist and are non-empty. If any condition fails, do not enter Step 5 or execute the phase guard.
174
209
 
175
- **File existence verification**: Confirm all three file paths exist and are non-empty. If any file is missing or empty, must not enter Step 5 or execute phase guard return to creation step to fill the gap.
210
+ Then check key artifact content: proposal covers problem, goals, scope, and non-goals; design covers high-level decisions and data flow; tasks contains clear work items. If the schema returns specs or other artifacts, check their content against their instructions as well; the fixed three documents must not hide an incomplete schema artifact.
176
211
 
177
212
  ### 5. User Review and Confirmation (Blocking Point)
178
213
 
179
- After the three documents are created and content completeness check passes, **must follow the `comet/reference/decision-point.md` protocol to pause and wait for user confirmation**. Must not execute phase guard or auto-transition before user confirmation.
214
+ After all OpenSpec artifacts are complete and the content check passes, **must follow the `comet/reference/decision-point.md` protocol to pause and wait for user confirmation**. Must not execute the phase guard or auto-transition before user confirmation.
215
+
216
+ The final review confirms the change name, scope, and artifact content together. Do not skip it because Step 1b resolved the brief, and do not add another routine summary/name confirmation before it.
180
217
 
181
218
  The user confirmation question must be presented as a single-select question with the following summary and options:
182
219
 
183
220
  **Summary content**:
221
+ - **Change name and resolved brief**: final name, goal, non-goals, scope boundaries, and key unknowns
184
222
  - **proposal.md**: problem background, goals, scope
223
+ - **specs and other schema artifacts**: capabilities, requirements, and key acceptance scenarios
185
224
  - **design.md**: high-level architecture decisions, approach selection
186
225
  - **tasks.md**: task count and key task descriptions
187
226
 
@@ -193,14 +232,14 @@ After user selects "Confirm", proceed to exit conditions. When user selects "Nee
193
232
 
194
233
  ## Exit Conditions
195
234
 
196
- - proposal.md, design.md, tasks.md all created with complete content
197
- - **User has confirmed** proposal, design, tasks content meets expectations
198
- - **Phase guard**: Run `node "$COMET_GUARD" <change-name> open --apply`; after all PASS, auto-transitions to next phase
235
+ - OpenSpec compatibility preflight passes, every `applyRequires` item is `done`, and required outputs are non-empty
236
+ - **User has confirmed** all OpenSpec artifact content meets expectations
237
+ - **Phase guard**: Run `comet guard <change-name> open --apply`; after all PASS, auto-transitions to next phase
199
238
 
200
239
  Must use `--apply` before exit, otherwise `.comet.yaml` remains at `phase: open` and the next phase entry check will fail.
201
240
 
202
241
  ```bash
203
- node "$COMET_GUARD" <change-name> open --apply
242
+ comet guard <change-name> open --apply
204
243
  ```
205
244
 
206
245
  Full workflow auto-transitions to `phase: design`; hotfix/tweak presets auto-transition to `phase: build`.
@@ -210,11 +249,11 @@ Full workflow auto-transitions to `phase: design`; hotfix/tweak presets auto-tra
210
249
  Follow `comet/reference/auto-transition.md`. Key command:
211
250
 
212
251
  ```bash
213
- node "$COMET_STATE" next <change-name>
252
+ comet state next <change-name>
214
253
  ```
215
254
 
216
255
  - `NEXT: auto` → invoke the skill pointed to by `SKILL` to enter the next phase
217
- - `NEXT: manual` → do not invoke the next skill; prompt user to run `/<SKILL>` manually
256
+ - `NEXT: manual` → do not invoke the next skill; return control with `HINT`, end the invocation, and do not create another confirmation point
218
257
  - `NEXT: done` → workflow is complete, no further action needed
219
258
 
220
259
  hotfix/tweak presets are controlled by their corresponding preset skill (phase goes directly to build); their `next` returns the corresponding preset skill.