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

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 (183) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +5 -1
  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 +6 -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 +185 -56
  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 +34 -13
  19. package/assets/skills/comet-build/SKILL.md +23 -21
  20. package/assets/skills/comet-design/SKILL.md +23 -22
  21. package/assets/skills/comet-hotfix/SKILL.md +35 -34
  22. package/assets/skills/comet-open/SKILL.md +97 -58
  23. package/assets/skills/comet-tweak/SKILL.md +21 -18
  24. package/assets/skills/comet-verify/SKILL.md +35 -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 +6 -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 +34 -13
  37. package/assets/skills-zh/comet-build/SKILL.md +23 -21
  38. package/assets/skills-zh/comet-design/SKILL.md +23 -22
  39. package/assets/skills-zh/comet-hotfix/SKILL.md +34 -33
  40. package/assets/skills-zh/comet-open/SKILL.md +96 -57
  41. package/assets/skills-zh/comet-tweak/SKILL.md +20 -17
  42. package/assets/skills-zh/comet-verify/SKILL.md +35 -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/uninstall.d.ts +3 -0
  51. package/dist/app/commands/uninstall.d.ts.map +1 -1
  52. package/dist/app/commands/uninstall.js +70 -36
  53. package/dist/app/commands/uninstall.js.map +1 -1
  54. package/dist/app/commands/update.d.ts.map +1 -1
  55. package/dist/app/commands/update.js +213 -34
  56. package/dist/app/commands/update.js.map +1 -1
  57. package/dist/domains/bundle/bundle-platform.d.ts +1 -0
  58. package/dist/domains/bundle/bundle-platform.d.ts.map +1 -1
  59. package/dist/domains/bundle/bundle-platform.js +6 -2
  60. package/dist/domains/bundle/bundle-platform.js.map +1 -1
  61. package/dist/domains/comet-classic/classic-guard.d.ts.map +1 -1
  62. package/dist/domains/comet-classic/classic-guard.js +15 -11
  63. package/dist/domains/comet-classic/classic-guard.js.map +1 -1
  64. package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
  65. package/dist/domains/comet-classic/classic-hook-guard.js +113 -19
  66. package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
  67. package/dist/domains/comet-classic/classic-resolver.js +1 -1
  68. package/dist/domains/comet-classic/classic-resolver.js.map +1 -1
  69. package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -1
  70. package/dist/domains/comet-classic/classic-state-command.js +22 -13
  71. package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
  72. package/dist/domains/comet-classic/classic-state.d.ts +3 -2
  73. package/dist/domains/comet-classic/classic-state.d.ts.map +1 -1
  74. package/dist/domains/comet-classic/classic-state.js +13 -1
  75. package/dist/domains/comet-classic/classic-state.js.map +1 -1
  76. package/dist/domains/comet-classic/classic-transitions.d.ts.map +1 -1
  77. package/dist/domains/comet-classic/classic-transitions.js +16 -2
  78. package/dist/domains/comet-classic/classic-transitions.js.map +1 -1
  79. package/dist/domains/comet-classic/classic-validate-command.d.ts.map +1 -1
  80. package/dist/domains/comet-classic/classic-validate-command.js +7 -1
  81. package/dist/domains/comet-classic/classic-validate-command.js.map +1 -1
  82. package/dist/domains/dashboard/web/assets/_commonjsHelpers-CqkleIqs.js +1 -0
  83. package/dist/domains/dashboard/web/assets/arc-TGVUG2WN.js +1 -0
  84. package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-ASHmiHoP.js +36 -0
  85. package/dist/domains/dashboard/web/assets/blockDiagram-GPEHLZMM-CwASxBKe.js +132 -0
  86. package/dist/domains/dashboard/web/assets/c4Diagram-AAUBKEIU-BU8z_WNk.js +10 -0
  87. package/dist/domains/dashboard/web/assets/channel-kp6Ng2JJ.js +1 -0
  88. package/dist/domains/dashboard/web/assets/chunk-2J33WTMH-CBGlUx4_.js +1 -0
  89. package/dist/domains/dashboard/web/assets/chunk-4BX2VUAB-CS-iGcFz.js +1 -0
  90. package/dist/domains/dashboard/web/assets/chunk-55IACEB6-BUtCVJat.js +1 -0
  91. package/dist/domains/dashboard/web/assets/chunk-727SXJPM-C94tj_pf.js +206 -0
  92. package/dist/domains/dashboard/web/assets/chunk-AQP2D5EJ-BFOKcpdG.js +231 -0
  93. package/dist/domains/dashboard/web/assets/chunk-FMBD7UC4-Dmx8B-st.js +15 -0
  94. package/dist/domains/dashboard/web/assets/chunk-ND2GUHAM-DYV00CNn.js +1 -0
  95. package/dist/domains/dashboard/web/assets/chunk-QZHKN3VN-DMJJyQnw.js +1 -0
  96. package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-yBDjgMY_.js +1 -0
  97. package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-yBDjgMY_.js +1 -0
  98. package/dist/domains/dashboard/web/assets/cose-bilkent-S5V4N54A-P4nE2rea.js +1 -0
  99. package/dist/domains/dashboard/web/assets/cynefin-VYW2F7L2-C-R1HXDv.js +166 -0
  100. package/dist/domains/dashboard/web/assets/cytoscape.esm-D3_iZ_3b.js +321 -0
  101. package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-BH8d-C9z.js +4 -0
  102. package/dist/domains/dashboard/web/assets/defaultLocale-DX6XiGOO.js +1 -0
  103. package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-DpXTgQIH.js +43 -0
  104. package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-DSiFJzSw.js +10 -0
  105. package/dist/domains/dashboard/web/assets/diagram-KO2AKTUF-DULMkben.js +3 -0
  106. package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-Pi8m_NO9.js +24 -0
  107. package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-BSe6bCWm.js +24 -0
  108. package/dist/domains/dashboard/web/assets/erDiagram-TEJ5UH35-zb-FEcbq.js +85 -0
  109. package/dist/domains/dashboard/web/assets/flowDiagram-I6XJVG4X-Dr-Gk0z2.js +162 -0
  110. package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-qs6Zb2A6.js +292 -0
  111. package/dist/domains/dashboard/web/assets/gitGraphDiagram-PVQCEYII-BQ314orT.js +106 -0
  112. package/dist/domains/dashboard/web/assets/graph--OzhPTMs.js +1 -0
  113. package/dist/domains/dashboard/web/assets/index-BLAfkNTu.css +1 -0
  114. package/dist/domains/dashboard/web/assets/index-DlSYK56b.js +139 -0
  115. package/dist/domains/dashboard/web/assets/index-DtLUOcAW.js +24 -0
  116. package/dist/domains/dashboard/web/assets/index-QO0z6F4w.js +10 -0
  117. package/dist/domains/dashboard/web/assets/infoDiagram-5YYISTIA-O0bQp98A.js +2 -0
  118. package/dist/domains/dashboard/web/assets/init-Gi6I4Gst.js +1 -0
  119. package/dist/domains/dashboard/web/assets/ishikawaDiagram-YF4QCWOH-BPC7wbKh.js +70 -0
  120. package/dist/domains/dashboard/web/assets/journeyDiagram-JHISSGLW-ohViOd4b.js +139 -0
  121. package/dist/domains/dashboard/web/assets/kanban-definition-UN3LZRKU-CHleNdbG.js +89 -0
  122. package/dist/domains/dashboard/web/assets/katex-HP8lGamR.js +257 -0
  123. package/dist/domains/dashboard/web/assets/layout-SsrduOYp.js +1 -0
  124. package/dist/domains/dashboard/web/assets/linear-CyqiW--Q.js +1 -0
  125. package/dist/domains/dashboard/web/assets/marked.esm-DECB3bxB.js +64 -0
  126. package/dist/domains/dashboard/web/assets/mermaid.core-qS9XvtaK.js +301 -0
  127. package/dist/domains/dashboard/web/assets/mindmap-definition-RKZ34NQL-oaGkqO9l.js +96 -0
  128. package/dist/domains/dashboard/web/assets/ordinal-Cboi1Yqb.js +1 -0
  129. package/dist/domains/dashboard/web/assets/pieDiagram-4H26LBE5-CPcB-AFh.js +30 -0
  130. package/dist/domains/dashboard/web/assets/purify.es-VaSPOPhr.js +3 -0
  131. package/dist/domains/dashboard/web/assets/quadrantDiagram-W4KKPZXB-LFy52Qtj.js +7 -0
  132. package/dist/domains/dashboard/web/assets/requirementDiagram-4Y6WPE33-BdjeaYP_.js +84 -0
  133. package/dist/domains/dashboard/web/assets/sankeyDiagram-5OEKKPKP-DDJ4styL.js +40 -0
  134. package/dist/domains/dashboard/web/assets/sequenceDiagram-3UESZ5HK-BL5bFNoz.js +162 -0
  135. package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-BNUfikui.js +1 -0
  136. package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-DGrsmWts.js +1 -0
  137. package/dist/domains/dashboard/web/assets/timeline-definition-PNZ67QCA--ps2uu6L.js +120 -0
  138. package/dist/domains/dashboard/web/assets/vennDiagram-CIIHVFJN-C2q8q26c.js +34 -0
  139. package/dist/domains/dashboard/web/assets/wardleyDiagram-YWT4CUSO-BUH9gXqd.js +78 -0
  140. package/dist/domains/dashboard/web/assets/xychartDiagram-2RQKCTM6-B-DielEy.js +7 -0
  141. package/dist/domains/dashboard/web/index.html +16 -16
  142. package/dist/domains/factory/package.d.ts.map +1 -1
  143. package/dist/domains/factory/package.js +20 -6
  144. package/dist/domains/factory/package.js.map +1 -1
  145. package/dist/domains/integrations/openspec.d.ts +4 -1
  146. package/dist/domains/integrations/openspec.d.ts.map +1 -1
  147. package/dist/domains/integrations/openspec.js +56 -4
  148. package/dist/domains/integrations/openspec.js.map +1 -1
  149. package/dist/domains/skill/json-object.d.ts +13 -0
  150. package/dist/domains/skill/json-object.d.ts.map +1 -0
  151. package/dist/domains/skill/json-object.js +24 -0
  152. package/dist/domains/skill/json-object.js.map +1 -0
  153. package/dist/domains/skill/platform-inspect.d.ts +9 -0
  154. package/dist/domains/skill/platform-inspect.d.ts.map +1 -0
  155. package/dist/domains/skill/platform-inspect.js +149 -0
  156. package/dist/domains/skill/platform-inspect.js.map +1 -0
  157. package/dist/domains/skill/platform-install.d.ts +16 -6
  158. package/dist/domains/skill/platform-install.d.ts.map +1 -1
  159. package/dist/domains/skill/platform-install.js +277 -144
  160. package/dist/domains/skill/platform-install.js.map +1 -1
  161. package/dist/domains/skill/uninstall.d.ts.map +1 -1
  162. package/dist/domains/skill/uninstall.js +204 -141
  163. package/dist/domains/skill/uninstall.js.map +1 -1
  164. package/dist/platform/fs/file-system.d.ts +3 -3
  165. package/dist/platform/fs/file-system.d.ts.map +1 -1
  166. package/dist/platform/fs/file-system.js +21 -11
  167. package/dist/platform/fs/file-system.js.map +1 -1
  168. package/dist/platform/install/platforms.d.ts +4 -0
  169. package/dist/platform/install/platforms.d.ts.map +1 -1
  170. package/dist/platform/install/platforms.js +2 -0
  171. package/dist/platform/install/platforms.js.map +1 -1
  172. package/dist/platform/install/project-registry.d.ts +1 -0
  173. package/dist/platform/install/project-registry.d.ts.map +1 -1
  174. package/dist/platform/install/project-registry.js +9 -1
  175. package/dist/platform/install/project-registry.js.map +1 -1
  176. package/dist/platform/install/skill-root-owner.d.ts +15 -0
  177. package/dist/platform/install/skill-root-owner.d.ts.map +1 -0
  178. package/dist/platform/install/skill-root-owner.js +68 -0
  179. package/dist/platform/install/skill-root-owner.js.map +1 -0
  180. package/package.json +6 -1
  181. package/dist/domains/dashboard/web/assets/index-CIvN-PL8.js +0 -22
  182. package/dist/domains/dashboard/web/assets/index-DcyRPBnT.css +0 -1
  183. package/eval/.env +0 -28
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 rpamis
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rpamis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -18,7 +18,11 @@
18
18
  <a href="./LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" /></a>
19
19
  </p>
20
20
 
21
- # @rpamis/comet
21
+ <p align="center">
22
+ <a href="https://trendshift.io/repositories/38989?utm_source=repository-badge&amp;utm_medium=badge&amp;utm_campaign=badge-repository-38989" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/repositories/38989" alt="rpamis%2Fcomet | Trendshift" width="250" height="55"/></a>
23
+ </p>
24
+
25
+ ## What is Comet ?
22
26
 
23
27
  ```
24
28
  ██████╗ ██████╗ ███╗ ███╗███████╗████████╗
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.0-beta.4",
2
+ "version": "0.4.0-beta.5",
3
3
  "skills": [
4
4
  "comet/SKILL.md",
5
5
  "comet/reference/auto-transition.md",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: comet
3
- description: "Use when the user wants to start or resume a Comet workflow and route by active change, .comet.yaml, and hotfix/tweak intent."
3
+ description: "Use when the user explicitly invokes /comet, asks to start or resume a Comet-managed workflow, or repository evidence identifies one unambiguous active Comet change; route through the intent runtime and .comet.yaml."
4
4
  ---
5
5
 
6
6
  # Comet — OpenSpec + Superpowers Dual-Star Development Workflow
@@ -22,7 +22,7 @@ Agents need only read this section for decision-making. Refer to the Reference A
22
22
 
23
23
  ### Output Language Rule
24
24
 
25
- Use the configured Comet artifact language as the output language for every OpenSpec and Superpowers artifact. The configured value is a normalized language id, `en` or `zh-CN`. For an existing change, read `language` from `openspec/changes/<name>/.comet.yaml` using `"$COMET_BASH" "$COMET_STATE" get <name> language`. Before `.comet.yaml` exists, read `language` from project `.comet/config.yaml`, then fall back to global `~/.comet/config.yaml`; if neither exists, fall back to the current user request language. Include the resolved language explicitly in every prompt or ARGUMENTS passed to external OpenSpec/Superpowers skills.
25
+ Use the configured Comet artifact language as the output language for every OpenSpec and Superpowers artifact. The configured value is a normalized language id, `en` or `zh-CN`. For an existing change, read `language` from `openspec/changes/<name>/.comet.yaml` using `comet state get <name> language`. Before `.comet.yaml` exists, read `language` from project `.comet/config.yaml`, then fall back to global `~/.comet/config.yaml`; if neither exists, fall back to the current user request language. Include the resolved language explicitly in every prompt or ARGUMENTS passed to external OpenSpec/Superpowers skills.
26
26
 
27
27
  ### Automatic Phase Detection
28
28
 
@@ -126,22 +126,22 @@ Prefer reading `openspec/changes/<name>/.comet.yaml`. If not available, fall bac
126
126
  - On every context resume, rerun Step 0 and Step 1; do not trust conversation history for phase detection
127
127
  - If there is an active change and the worktree has uncommitted changes, handle them through `comet/reference/dirty-worktree.md`. That protocol defines checks, attribution, and prohibitions; this file does not repeat them
128
128
  - If `phase: build`, first check `build_pause`, `plan`, `isolation`, `build_mode`, `tdd_mode`, and `review_mode` (see details below):
129
- - If `build_pause: plan-ready` but `isolation`, `build_mode`, `tdd_mode`, and `review_mode` are all already set, treat as stale pause: first output `[COMET] Detected stale pause (build_pause=plan-ready but isolation/build_mode/tdd_mode/review_mode are set), auto-clearing and continuing`, then run `node "$COMET_STATE" set <name> build_pause null`, then read the next unchecked task from tasks.md and resume execution per `build_mode`
129
+ - If `build_pause: plan-ready` but `isolation`, `build_mode`, `tdd_mode`, and `review_mode` are all already set, treat as stale pause: first output `[COMET] Detected stale pause (build_pause=plan-ready but isolation/build_mode/tdd_mode/review_mode are set), auto-clearing and continuing`, then run `comet state set <name> build_pause null`, then read the next unchecked task from tasks.md and resume execution per `build_mode`
130
130
  - If `build_pause: plan-ready` and the plan file exists, but `isolation`, `build_mode`, `tdd_mode`, or `review_mode` is not yet set, return to the `/comet-build` plan-ready resume point, prompt the user to complete/confirm workspace isolation, execution method, TDD mode, and code review mode, and do not regenerate the plan
131
131
  - If `build_pause: plan-ready` but the plan file is missing, return to `/comet-build` to handle corrupted state or regenerate the plan
132
132
  - If `isolation`, `build_mode`, `tdd_mode`, or `review_mode` is unset, return to the corresponding `/comet-build` step to supplement before executing
133
133
  - If all are set, read the next unchecked task from tasks.md and continue:
134
134
  - If `build_mode: subagent-driven-development`, do not execute tasks directly in the main window; return to `/comet-build`'s background subagent dispatch rules, main window only coordinates
135
135
  - Other execution modes follow `/comet-build`'s corresponding rules
136
- - If `phase: verify` and `verify_result: fail`, enter the verification failure decision blocking point: pause and ask the user to fix or accept deviation; only after the user chooses fix, run `node "$COMET_STATE" transition <name> verify-fail` and invoke `/comet-build`
137
- - If `phase: open` but proposal/design/tasks are complete, first run `node "$COMET_GUARD" <change-name> open --apply` to repair state, then continue detection
138
- - If `phase: archive`, only invoke `/comet-archive`; `/comet-archive` must first wait for final archive confirmation. After archive succeeds, the change moves to the archive directory, so do not run guard against the old active directory
136
+ - If `verify_result: fail`, read `verify_failures`. At 3 or fewer failures, invoke `/comet-build` directly to continue the recorded repair loop without re-asking. Above the automatic limit, return to `/comet-verify` for the exception decision. User input is required only to accept a WARNING/SUGGESTION deviation or choose a strategy after the retry limit
137
+ - If `phase: open` but OpenSpec `applyRequires` is complete, run `comet guard <change-name> open --apply` to repair state, then continue detection
138
+ - If `phase: archive`, only invoke `/comet-archive`; confirm first, archive, commit exact archive paths, then handle the branch and run the archive guard
139
139
 
140
140
  **Step 2: Phase Determination** (check in order, first match wins)
141
141
 
142
142
  1. `archived: true` or change moved to archive → Workflow complete
143
143
  2. `verify_result: pass` and `archived` is not `true` → Invoke `/comet-archive` (first perform final archive confirmation)
144
- 3. `verify_result: fail` → Enter verification failure decision blocking point (pause and ask fix or accept deviation; only after user chooses fix, run `verify-fail` then `/comet-build`)
144
+ 3. `verify_result: fail` → Invoke `/comet-build` automatically to continue repair. If `verify_failures` exceeds the automatic limit, enter `/comet-verify`'s retry-limit strategy decision
145
145
  4. `phase: verify` or tasks.md all checked → Invoke `/comet-verify`
146
146
  5. `phase: build` or has Design Doc but plan/execution incomplete → Route by workflow: `hotfix` → `/comet-hotfix`, `tweak` → `/comet-tweak`, `full` → `/comet-build`
147
147
  6. `phase: design` or has change but no Design Doc → Invoke `/comet-design`
@@ -156,11 +156,11 @@ hotfix/tweak scope assessment uses a three-layer division of labor, avoiding "us
156
156
 
157
157
  1. **Qualitative-change signals** (agent semantic recognition; hitting any one pauses and delegates a two-choice decision to the user): cross-module coordinated change, new capability needed, database schema change, introduces new public API, hits deep architecture issues (each preset reuses this core signal set and may add its own context-specific signal, such as tweak's "needing to split into multiple OpenSpec changes")
158
158
  2. **File-count tripwire** (user decides; not an automatic upgrade): when changed files exceed a hint threshold, pause and let the user decide whether to continue the preset or upgrade to full; do not auto-kick
159
- 3. **Verification weight** (scale script decides): `comet-state scale` only decides `verify_mode` (verification weight); it does not block the flow or trigger an upgrade
159
+ 3. **Verification weight** (scale script decides): `comet state scale` only decides `verify_mode` (verification weight); it does not block the flow or trigger an upgrade
160
160
 
161
161
  **Upgrade decision point (user chooses one of two)**:
162
162
  - Continue the preset lightweight flow (user confirms scope is manageable)
163
- - Upgrade to full `/comet` (use `node "$COMET_STATE" transition <name> preset-escalate` to legally rewind to the design phase, supplementing Design Doc and Superpowers plan)
163
+ - Upgrade to full `/comet` (use `comet state transition <name> preset-escalate` to legally rewind to design and clear preset-only build settings; after the Design Doc, choose the full workflow configuration again in one joint decision)
164
164
 
165
165
  See the "Upgrade Assessment" section of each `comet-hotfix` / `comet-tweak` for detailed rules.
166
166
 
@@ -170,7 +170,8 @@ See the "Upgrade Assessment" section of each `comet-hotfix` / `comet-tweak` for
170
170
  |----------|----------|
171
171
  | `openspec list --json` fails | Check if openspec is installed, prompt user to run `openspec init` |
172
172
  | Sub-skill unavailable | Stop workflow, prompt to install or enable the corresponding skill |
173
- | `.comet.yaml` malformed or missing | Use file state as source of truth, correct with `node "$COMET_STATE" set` then continue |
173
+ | `.comet.yaml` missing | Enter the relevant preset's `/comet-open` initialization, then run `comet state select`; never skip initialization |
174
+ | `.comet.yaml` malformed | Stop and report the parse error; repair from version control, backup, or verifiable artifacts, never overwrite it with `comet state set` |
174
175
  | Build/test fails | Return to build phase for fixes, do not enter verify |
175
176
  | Incomplete change directory structure | Fill missing files according to `comet-open` artifact requirements |
176
177
 
@@ -183,20 +184,21 @@ Flow chain: open → design → build → verify → archive
183
184
 
184
185
  **Continuous execution requirement**: starting from the detected phase, the agent automatically continues through all later phases. But **auto-advancing only applies at transition points without user decisions**. When encountering user decision points, **must use the current platform's available user input/confirmation mechanism to pause and wait for the user's explicit response**. Must not use recommendation rules, defaults, or historical preferences to substitute for user confirmation, and must not just output a text prompt and then continue executing.
185
186
 
186
- **Distinguish phase advancement vs automatic handoff**: each sub-skill runs phase guard `--apply` before exit to advance the `.comet.yaml` `phase` field. This step **always happens** and is not controlled by `auto_transition`. After that, the sub-skill runs `node "$COMET_STATE" next <name>` to resolve the next action: when `auto_transition` is not `false`, output is `NEXT: auto` (auto-invoke next skill); when `auto_transition` is `false`, output is `NEXT: manual` (do not invoke next skill, show a manual run hint). Therefore `auto_transition` **only controls next skill invocation, not phase advancement**. Regardless of `auto_transition`, user decision points below remain blocking.
187
+ **Distinguish phase advancement vs automatic handoff**: each sub-skill runs phase guard `--apply` before exit to advance the `.comet.yaml` `phase` field. This step **always happens** and is not controlled by `auto_transition`. After that, the sub-skill runs `comet state next <name>` to resolve the next action: when `auto_transition` is not `false`, output is `NEXT: auto` (auto-invoke next skill); when `auto_transition` is `false`, output is `NEXT: manual` (do not invoke next skill; return control with `HINT`). `NEXT: manual` is not a user decision point and must not ask whether to continue. Therefore `auto_transition` **only controls next skill invocation, not phase advancement**. Regardless of `auto_transition`, genuine user decision points below remain blocking.
187
188
 
188
189
  **Decision points are blocking points**: whenever reaching any of the following nodes, the current `/comet` invocation must stop, and follow the `comet/reference/decision-point.md` protocol to obtain the user's explicit choice. Only after the user explicitly chooses can the corresponding state fields be written and operations executed, then auto-advance resumes.
189
190
 
190
191
  Nodes requiring user participation (pause only at these nodes):
191
- 1. Open phase proposal/design/tasks review and confirmation
192
- 2. Confirm design approach during brainstorming
193
- 3. Plan-ready pause choice during build phase, followed by workflow configuration selection (workspace isolation + execution method + TDD mode + code review mode)
194
- 4. Decide to fix or accept deviation when verify fails (including Spec drift handling)
195
- 5. Choose branch handling method for finishing-branch
192
+ 1. Workflow target selection: multiple active changes, continue an existing change versus create a new one, or choose which completed batch item starts first
193
+ 2. Open-phase final proposal/design/tasks review, including the change name and scope; clear requests have no pre-artifact summary/name confirmation
194
+ 3. Confirm the design approach during brainstorming
195
+ 4. One joint build decision: plan-ready pause or all available workflow settings (workspace isolation + execution method + TDD mode + code review mode, plus branch name when branch is selected)
196
+ 5. Verify-phase acceptance of WARNING/SUGGESTION deviations, Spec drift handling, or continue/stop after the 4th failure; the first 3 clearly repairable failures close automatically
196
197
  6. Archive phase final confirmation before running the archive script
197
- 7. Encounter an upgrade-assessment signal (hotfix/tweak user chooses one of two: continue preset / upgrade to full workflow)
198
- 8. Build phase scope expansion requiring redesign or new change split
199
- 9. Open phase large PRD requiring confirmation to split into multiple changes
198
+ 7. Choose finishing-branch handling after exact archive changes are committed
199
+ 8. Encounter an upgrade-assessment signal (hotfix/tweak user chooses one of two: continue preset / upgrade to full workflow)
200
+ 9. Build phase scope expansion requiring redesign or new change split
201
+ 10. Open phase large PRD split confirmation
200
202
 
201
203
  Agents should not skip these decision points; other unambiguous phase transitions must proceed automatically, must not exit midway. At decision points, **must not skip user confirmation or choose automatically — must explicitly obtain the user's choice through the current platform's available user input/confirmation mechanism before continuing**.
202
204
 
@@ -220,8 +222,8 @@ Agents should not skip these decision points; other unambiguous phase transition
220
222
  | `/comet-open` | 1. Open | OpenSpec | proposal.md, design.md, tasks.md |
221
223
  | `/comet-design` | 2. Deep Design | Superpowers | Design Doc, delta spec |
222
224
  | `/comet-build` | 3. Plan and Build | Superpowers | Implementation plan, code commits |
223
- | `/comet-verify` | 4. Verify and Close | Both | Verification report, branch handling |
224
- | `/comet-archive` | 5. Archive | OpenSpec | delta→main spec sync, design doc markup, archive |
225
+ | `/comet-verify` | 4. Verify | Both | Verification report |
226
+ | `/comet-archive` | 5. Archive and Close | OpenSpec | delta→main spec sync, design doc markup, archive commit, branch handling |
225
227
  | `/comet-hotfix` | Preset path | Both | Quick fix (skip brainstorming) |
226
228
  | `/comet-tweak` | Preset path | Both | OpenSpec-chained medium change (delta spec is first-class, skip brainstorming and full plan) |
227
229
 
@@ -246,14 +248,14 @@ Agents should not skip these decision points; other unambiguous phase transition
246
248
 
247
249
  ### State Machine Hard Constraints
248
250
 
249
- - Before `build → verify`, `isolation` must be `branch` or `worktree`
251
+ - Before full-workflow `build → verify`, `isolation` must be `branch` or `worktree`; hotfix/tweak may truthfully use `current`
250
252
  - Before `build → verify`, `build_mode` must be selected
251
253
  - `build_mode: subagent-driven-development` must also have `subagent_dispatch: confirmed`
252
254
  - Before full workflow leaves build phase, `tdd_mode` must be selected as `tdd` or `direct`
253
255
  - Before full workflow leaves build phase, `review_mode` must be selected as `off`, `standard`, or `thorough`
254
256
  - `build_mode: direct` is allowed by default only for `hotfix` / `tweak`; full workflow requires `direct_override: true`
255
257
  - `build_pause` is not an execution method and must not be written to `build_mode`
256
- - These constraints are enforced by both `comet-guard.mjs build --apply` and `comet-state.mjs transition <name> build-complete`
258
+ - These constraints are enforced by both `comet guard <name> build --apply` and `comet state transition <name> build-complete`
257
259
 
258
260
  ### .comet.yaml Field Reference
259
261
 
@@ -281,11 +283,11 @@ See `comet/reference/debug-gate.md` for the complete debug gate protocol.
281
283
 
282
284
  ### Script Location
283
285
 
284
- Comet scripts are distributed in `comet/scripts/`. **Do not hardcode paths** — locate once, cache in env vars. The full bootstrap block, command reference (`--apply`, `transition`, `next`, `archive`), and output formats live in `comet/reference/scripts.md`. Run that bootstrap once per session, then reuse `$COMET_GUARD`, `$COMET_STATE`, `$COMET_HANDOFF`, `$COMET_ARCHIVE`, `$COMET_RUNTIME` throughout. Key entry points:
286
+ Use the stable `comet` CLI for workflow state, guards, handoff, and archive. Locate internal launchers through `comet/reference/scripts.md` only for intent/resume probes that do not yet have a public subcommand. Key entry points:
285
287
 
286
288
  ```bash
287
- node "$COMET_GUARD" <change-name> <phase> --apply # phase guard + auto state update
288
- node "$COMET_STATE" transition <change-name> <event> # open-complete | design-complete | build-complete | verify-pass | verify-fail
289
- node "$COMET_STATE" next <change-name> # NEXT: auto|manual|done + SKILL: <skill-name>; auto_transition:false → manual, which pauses only the next skill invocation and does not block phase updates
290
- node "$COMET_ARCHIVE" <change-name> # full archive in one command
289
+ comet guard <change-name> <phase> --apply # phase guard + state update
290
+ comet state transition <change-name> <event> # open-complete | design-complete | build-complete | verify-pass | verify-fail
291
+ comet state next <change-name> # NEXT: auto|manual|done + SKILL: <skill-name>
292
+ comet archive <change-name> # full archive in one command
291
293
  ```
@@ -13,7 +13,7 @@ This protocol is shared by all comet sub-skills. It defines the automatic handof
13
13
  After exit conditions are met and the phase guard has advanced phase, run:
14
14
 
15
15
  ```bash
16
- node "$COMET_STATE" next <change-name>
16
+ comet state next <change-name>
17
17
  ```
18
18
 
19
19
  The script outputs a deterministic next step based on `phase`, `workflow`, and `auto_transition`:
@@ -23,6 +23,7 @@ auto_transition: true
23
23
  isolation: branch
24
24
  verify_mode: light
25
25
  verify_result: pending
26
+ verify_failures: 0
26
27
  verification_report: null
27
28
  branch_status: pending
28
29
  created_at: 2026-05-26
@@ -44,14 +45,15 @@ archived: false
44
45
  | `build_mode` | Selected execution mode; may be empty. Values: `subagent-driven-development` (isolated background subagents implement and review each task), `executing-plans` (main session executes sequentially by plan), `direct` (main session codes directly; allowed by default only for hotfix/tweak, full workflow requires `direct_override: true`) |
45
46
  | `build_pause` | Build phase internal pause point. `null` = no pause, `plan-ready` = plan generated, paused for user model switch |
46
47
  | `subagent_dispatch` | `null` or `confirmed`. Only when the platform's real background subagent/Task/multi-agent dispatch capability is confirmed may `build_mode: subagent-driven-development` be written and used to leave the build phase |
47
- | `tdd_mode` | `tdd` or `direct`. Full workflow must select before leaving build. `tdd` forces write-failing-test-first per task; `direct` skips TDD enforcement. hotfix/tweak default to `direct` |
48
+ | `tdd_mode` | `tdd` or `direct`. Full workflow must select before leaving build. `tdd` forces write-failing-test-first per task; `direct` skips per-task TDD but still requires relevant tests and bug-regression evidence. hotfix/tweak default to `direct` |
48
49
  | `review_mode` | `off`, `standard`, or `thorough`. Full workflow must select before leaving build; hotfix/tweak default to `off` |
49
- | `isolation` | `branch` or `worktree`, workspace isolation mode. Full init may be `null` but only until `/comet-build` Step 3; hotfix/tweak default to `branch` |
50
+ | `isolation` | `current`, `branch`, or `worktree`. Full init may be `null` but must use a real `branch` or `worktree` before leaving build; hotfix/tweak default to `current` and must not claim branch isolation before creating one |
50
51
  | `verify_mode` | `light` or `full`; may be empty |
51
52
  | `auto_transition` | `true` or `false`. Only controls whether to automatically invoke the next skill after phase guard advances phase; `false` outputs `manual` from `comet-state next`, pausing next-skill invocation but not blocking phase field updates |
52
53
  | `verify_result` | `pending`, `pass`, or `fail` |
54
+ | `verify_failures` | Machine-owned consecutive verification failure count. `verify-fail` increments it; `verify-pass` or `archive-reopen` resets it to `0`. At `3`, the next failure requires the retry-limit strategy decision |
53
55
  | `verification_report` | Verification report file path; must point to an existing file before verify passes |
54
- | `branch_status` | `pending` or `handled`; set to `handled` after branch handling completes |
56
+ | `branch_status` | `pending` or `handled`; keep pending through verify/archive, then set handled after the archive commit and selected branch handling complete |
55
57
  | `created_at` | Change creation date (auto-written at init), format `YYYY-MM-DD` |
56
58
  | `verified_at` | Verification pass timestamp; may be empty |
57
59
  | `archive_confirmation` | `null`, `pending`, or `confirmed`. `verify-pass` writes `pending` when entering the archive phase; after the user selects "Confirm archive" in `/comet-archive`, the `archive-confirm` transition writes `confirmed`; `archive-reopen` clears the field so an earlier confirmation cannot be reused |
@@ -65,7 +67,7 @@ archived: false
65
67
 
66
68
  ## State Machine Hard Constraints
67
69
 
68
- - Before `build → verify`, `isolation` must be `branch` or `worktree`
70
+ - Before full-workflow `build → verify`, `isolation` must be `branch` or `worktree`; hotfix/tweak may use `current`
69
71
  - Before `build → verify`, `build_mode` must be selected
70
72
  - `build_mode: subagent-driven-development` requires `subagent_dispatch: confirmed`
71
73
  - Full workflow must select `tdd_mode` as `tdd` or `direct` before leaving build
@@ -9,7 +9,7 @@ This protocol is shared by all comet sub-skills that may trigger context compres
9
9
  The user may resume the workflow directly from `/comet-open`, `/comet-design`, `/comet-build`, `/comet-verify`, `/comet-archive`, `/comet-hotfix`, or `/comet-tweak`. On entry to any sub-skill, first locate scripts via `comet/reference/scripts.md`, then run the entry check or recovery check for that sub-skill's phase. Do not infer phase from conversation history.
10
10
 
11
11
  ```bash
12
- node "$COMET_STATE" check <change-name> <phase> --recover
12
+ comet state check <change-name> <phase> --recover
13
13
  ```
14
14
 
15
15
  If the check shows the actual phase, workflow, or evidence belongs to another skill, switch according to script output and `/comet` routing rules; do not keep writing state in the wrong phase. If the worktree has uncommitted changes, attribute them first via `comet/reference/dirty-worktree.md`.
@@ -27,7 +27,7 @@ Only `auto_resume` should resume automatically; `ask_user` must ask one short qu
27
27
  ## Recovery Steps
28
28
 
29
29
  ```bash
30
- node "$COMET_STATE" check <change-name> <phase> --recover
30
+ comet state check <change-name> <phase> --recover
31
31
  ```
32
32
 
33
33
  The script outputs structured recovery context (phase, completed fields, pending fields, recovery action). Follow the **Recovery action** output for next steps.
@@ -4,6 +4,17 @@ Canonical path: `comet/reference/decision-point.md`
4
4
 
5
5
  This protocol is shared by all comet sub-skills that contain user decision points. Any step labeled as a blocking point or user decision point must follow this protocol.
6
6
 
7
+ ## First Decide Whether User Input Is Actually Required
8
+
9
+ Distinguish user decisions, automatic handling, and stop conditions:
10
+
11
+ - **User decision**: two or more valid options change scope, behavior, accepted risk, or an irreversible outcome; the user must choose
12
+ - **Automatic handling**: exactly one safe next action remains within the request, such as repairing an objective failure, reconciling verifiable state, retrying an idempotent check, or following persisted configuration; execute and report it without manufacturing confirmation
13
+ - **Stop condition**: a missing dependency, corrupt state, path escape, or unavailable external command leaves no valid next action; report the blocker and recovery condition without inventing choices
14
+ - **Manual handoff**: `NEXT: manual` returns control; it is not a new user decision point. Print `HINT`, end the current invocation, and do not ask whether to continue
15
+
16
+ Only the first category uses this protocol. Merge adjacent choices that can be answered together, and do not re-ask persisted choices that remain valid. Preflight platform capabilities and state before presenting options, and show only executable choices. If a field has only one valid value, explain why and apply it without creating a separate pause.
17
+
7
18
  ## Core Rules
8
19
 
9
20
  - Decision points are blocking points. Pause and wait for an explicit user choice before continuing
@@ -11,9 +11,10 @@ This document provides Comet-specific extensions applied **on top of** the Super
11
11
  > Only stop and wait for user input when:
12
12
  > - A task is **BLOCKED** (review-fix rounds exhausted: `review_mode: standard` — 1 round of risk-task review-fix or final lightweight review not passed; `review_mode: thorough` — 2 rounds of task-level/final review-fix not passed)
13
13
  > - There is irreducible ambiguity that cannot be resolved from the repository, plan, or existing context
14
- > - The platform lacks real background agent dispatch capability and the user must choose `executing-plans`
15
14
  > - The user **explicitly** asks to pause
16
15
  >
16
+ > Background dispatch capability disappearing during execution is a runtime stop condition, not automatically a new user decision point. Exit the dispatch loop and return to the same `/comet-build` Step 2 joint decision with `subagent-driven-development` removed. If only one execution method remains, explain why and apply it directly; wait for the user only when multiple valid methods remain.
17
+ >
17
18
  > This rule applies to the ENTIRE dispatch loop, not just individual tasks.
18
19
 
19
20
  ## Before Starting
@@ -34,14 +35,14 @@ The main session is the **coordinator only** and must NOT execute tasks directly
34
35
  - **Claude Code**: Use the `Agent` tool with `run_in_background: true` for each implementer, task reviewer, fix agent, and final reviewer. Never execute tasks inline and do not accidentally enter team mode, which requires a pre-created team.
35
36
  - **Other platforms**: Use the platform's equivalent background agent / Task / multi-agent dispatch mechanism.
36
37
  - **Never** reuse implementers, reviewers, or fix agents across tasks or roles. Each agent gets a fresh, isolated context containing only the single task and role-specific context it needs.
37
- - If the platform has no real background dispatch capability, do not proceed; pause and wait for the user to choose `build_mode: executing-plans`.
38
+ - If real background dispatch capability disappears during execution, stop dispatching and do not let the main session implement the task. Return to the same `/comet-build` Step 2 joint decision with the unavailable mode removed. Do not create a separate "switch to executing-plans" pause; apply the only valid mode directly when just one remains.
38
39
 
39
40
  ### 1. Dispatch Prompt and Return Contract
40
41
 
41
42
  Every implementer or fix-agent prompt must include:
42
43
 
43
44
  - The full text of the single current task, architecture background, and dependency context
44
- - `Language: Use the configured Comet artifact language from "$COMET_BASH" "$COMET_STATE" get <name> language`
45
+ - `Language: Use the configured Comet artifact language from comet state get <name> language`
45
46
  - The allowed file scope and prohibited modification scope
46
47
  - The required test commands and commit requirements
47
48
  - For a fix agent, the corresponding reviewer's complete feedback
@@ -142,8 +143,8 @@ When a reviewer returns an item that cannot be verified from review material alo
142
143
  4. Runs targeted verification:
143
144
 
144
145
  ```bash
145
- node "$COMET_STATE" task-checkoff "$PLAN_FILE" "$PLAN_TASK_TEXT"
146
- node "$COMET_STATE" task-checkoff "openspec/changes/<name>/tasks.md" "$OPENSPEC_TASK_TEXT"
146
+ comet state task-checkoff <plan-file> <plan-task-text>
147
+ comet state task-checkoff openspec/changes/<name>/tasks.md <openspec-task-text>
147
148
  ```
148
149
 
149
150
  Run the second command only when the corresponding mapping exists. The script requires the task text to appear exactly once and be checked; verification failure blocks moving to the next task.
@@ -25,8 +25,8 @@ Ordinary source writes are governed only by the selected change phase. With mult
25
25
  | `open` | Create proposal/design/tasks, run guard | Write source code |
26
26
  | `design` | brainstorming, create Design Doc, run guard | Write source code |
27
27
  | `build` | Write source code, tests, execute plans | Skip user confirmation points |
28
- | `verify` | Verification, branch handling | Skip failure handling |
29
- | `archive` | Confirm archive, run archive script | Write source code |
28
+ | `verify` | Verification, record verification report | Skip failure handling, handle the branch early |
29
+ | `archive` | Confirm archive, run archive script, commit archive changes, handle the branch | Write source code |
30
30
 
31
31
  The hook hard interception allowlist includes workflow and platform workspaces such as `openspec/*`, `docs/superpowers/*`, `.superpowers/*`, `.claude/*`, and `.comet/*`; write access to these paths does not allow skipping the current phase's artifacts or confirmation requirements.
32
32
 
@@ -44,7 +44,8 @@ Reading the `phase` field alone is not enough — you must also confirm **how**
44
44
 
45
45
  Exception: `workflow: hotfix/tweak` intentionally skips design, so an empty `design_doc` is normal and not an illegal jump.
46
46
 
47
- Upgrade state note: after a preset (hotfix/tweak) hits an upgrade signal and the user confirms upgrading, `comet-state transition <name> preset-escalate` legally converts it to `workflow: full` + `phase: design` + `design_doc: null`. At this point `phase: design` with an empty `design_doc` **is a normal upgrade pre-state**, not an illegal jump — the agent should enter `/comet-design` to supplement the Design Doc. This terminal state does not match the "skipped design" row above (that row only detects `phase: build`).
47
+ Upgrade state note: after a preset (hotfix/tweak) hits an upgrade signal and the user confirms upgrading, `comet state transition <name> preset-escalate` legally converts it to `workflow: full` + `phase: design` + `design_doc: null` and clears preset-only build settings. At this point `phase: design` with an empty `design_doc` **is a normal upgrade pre-state**, not an illegal jump — the agent should enter `/comet-design` to supplement the Design Doc, then choose the full workflow configuration again in build. This terminal state does not match the "skipped design" row above (that row only detects `phase: build`).
48
+
48
49
  ### Skill Invocation (Cannot Replace with Normal Conversation)
49
50
 
50
51
  The following operations must be loaded through the Skill tool. When Skill is unavailable, stop the workflow and prompt to install:
@@ -59,50 +60,50 @@ The following operations must be loaded through the Skill tool. When Skill is un
59
60
 
60
61
  ### Script Execution (Cannot Skip)
61
62
 
62
- - **Phase exit**: `comet-guard <name> <phase> --apply` (must see ALL CHECKS PASSED)
63
- - **Compression recovery**: `comet-state check <name> <phase> --recover`
64
- - **State update**: After key operations, update fields through `comet-state set`; manually editing .comet.yaml is prohibited
65
- - **Phase advancement only via guard/transition**: directly running `comet-state set <name> phase <value>` to jump phases is prohibited (it bypasses evidence checks and the script now hard-blocks it); use the `COMET_FORCE_PHASE=1` escape hatch only to repair a malformed state. A preset (hotfix/tweak) upgrade to full must use `comet-state transition <name> preset-escalate` — this is the only channel that can legally rewind phase to design and sync workflow/classic_profile; direct `set phase design` and `set classic_profile` are both hard-blocked
66
- - **handoff generation**: `comet-handoff <name> design --write` (handwriting summaries is prohibited)
63
+ - **Phase exit**: `comet guard <name> <phase> --apply` (must see ALL CHECKS PASSED)
64
+ - **Compression recovery**: `comet state check <name> <phase> --recover`
65
+ - **State update**: After key operations, update fields through `comet state set`; manually editing .comet.yaml is prohibited
66
+ - **Phase advancement only via guard/transition**: directly running `comet state set <name> phase <value>` to jump phases is prohibited. A preset (hotfix/tweak) upgrade to full must use `comet state transition <name> preset-escalate`
67
+ - **handoff generation**: `comet handoff <name> design --write` (handwriting summaries is prohibited)
67
68
 
68
69
  ### User Confirmation (Cannot Auto-Skip)
69
70
 
70
71
  The following decision points must pause to wait for explicit user selection; do not auto-fill based on recommendation rules:
71
72
 
72
- - **open**: Requirements clarification completion confirmation, artifact review confirmation
73
+ - **open**: Final artifact review, which also confirms the change name and scope. Add an earlier decision only for unresolved target/scope alternatives or a large-PRD split
73
74
  - **design**: brainstorming proposal confirmation (Design Doc cannot be created before confirmation)
74
- - **build**: plan-ready pause, four choices: `isolation` / `build_mode` / `tdd_mode` / `review_mode` (workspace isolation, execution method, TDD mode, code review mode), spec large-scale change confirmation, preset (hotfix/tweak) upgrade-assessment two-choice (when a qualitative-change signal or file-count tripwire is hit, let the user decide whether to continue the preset or upgrade to full)
75
- - **verify**: Verification failure handling strategy, branch handling selection
76
- - **archive**: Final confirmation before archiving
75
+ - **build**: After capability preflight, use one joint decision for a plan-ready pause or every executable `isolation` / `build_mode` / `tdd_mode` / `review_mode`; include the branch name when branch is selected, plus large spec-change and preset-upgrade decisions
76
+ - **verify**: Accepting WARNING/SUGGESTION deviations, handling Spec drift, or choosing continue/stop after the automatic repair limit
77
+ - **archive**: Final confirmation before archiving, plus branch-handling selection after the archive commit
77
78
 
78
79
  ## Design Phase Specifics
79
80
 
80
- 1. First script operation = `comet-handoff <name> design --write` (loading brainstorming before generating handoff is prohibited)
81
+ 1. First script operation = `comet handoff <name> design --write` (loading brainstorming before generating handoff is prohibited)
81
82
  2. brainstorming in progress: incrementally update brainstorm-summary.md (update recovery checkpoint after each clarification round or proposal iteration; unconfirmed content marked as pending/candidate)
82
83
  3. After brainstorming completes, next step = brainstorm-summary.md finalization → Design Doc → guard
83
- 4. active compaction gate: after brainstorm-summary.md is finalized and before creating Design Doc, prioritize triggering host platform's native context compression; when programmatic triggering is unavailable, pause to prompt user to manually compress or confirm continuing
84
+ 4. Active context compaction is optional only after the Design Doc, state evidence, and latest handoff are persisted; when programmatic triggering is unavailable, provide a non-blocking suggestion and continue
84
85
  5. **Absolutely cannot start writing implementation code directly** — must first create Design Doc and pass guard
85
86
 
86
87
  ## Build Phase Specifics
87
88
 
88
- 1. After plan creation, must ask user to choose continue or pause (`build_pause` mechanism)
89
+ 1. After plan creation, filter unavailable options, then ask one joint question: pause, or submit workspace/execution/TDD/review settings and any conditional branch name together
89
90
  2. After each task acceptance, must: tasks.md checkmark → git commit (do not accumulate). `subagent-driven-development` must complete acceptance according to the current `review_mode`, then the coordinator performs targeted verification by unique task text; do not use an incomplete task summary table to replace current task verification
90
91
  3. When encountering failures, must load **systematic-debugging** skill; do not propose source code fixes before root cause is located
91
92
  4. spec change grading: small changes edit directly | medium changes load brainstorming | large changes pause and wait for user confirmation to split
92
93
 
93
94
  ## Verify Phase Specifics
94
95
 
95
- 1. First step run `comet-state scale <name>` to determine verification level
96
- 2. After verification fails, list failed items and wait for user selection; CRITICAL must be fixed
97
- 3. After 3 consecutive failures, must let user choose to accept deviation or continue fixing
98
- 4. When the user chooses to fix, run `comet-state transition <name> verify-fail`: this transition rewinds `phase` back to `build` (not staying in verify), then enter `/comet-build` to fix; after fixing, re-run the build→verify guard
96
+ 1. First step run `comet state scale <name>` to determine verification level
97
+ 2. For the first 3 clearly repairable failures, automatically run `comet state transition <name> verify-fail`, return to build, and enter `/comet-build`. CRITICAL/IMPORTANT failures cannot be accepted as deviations
98
+ 3. The state machine owns `verify_failures`. After it reaches `3`, the next failure must ask whether to continue fixing or stop the workflow for an external decision
99
+ 4. Ask whether to fix or accept WARNING/SUGGESTION only when repair introduces a behavior, scope, or risk tradeoff. Safe, local, tradeoff-free repairs close automatically
99
100
 
100
101
  ## Context Compression Recovery
101
102
 
102
103
  If context compression is suspected (previous conversation was summarized, previous discussion cannot be found), immediately run:
103
104
 
104
105
  ```bash
105
- node "$COMET_STATE" check <name> <phase> --recover
106
+ comet state check <name> <phase> --recover
106
107
  ```
107
108
 
108
109
  Decide next step according to the script's **Recovery action** output.
@@ -123,17 +124,11 @@ After recovery, first re-run the "Phase-Entry Self-Consistency Check" table: if
123
124
  After guard `--apply` succeeds, do not hardcode the next skill in this rule. First run:
124
125
 
125
126
  ```bash
126
- comet-state next <change-name>
127
- ```
128
-
129
- If `comet-env.mjs` has already located the scripts, the equivalent command is:
130
-
131
- ```bash
132
- node "$COMET_STATE" next <change-name>
127
+ comet state next <change-name>
133
128
  ```
134
129
 
135
130
  Decide the next step from the script output:
136
131
 
137
132
  - `NEXT: auto` → use the Skill tool to load the skill named by `SKILL`
138
- - `NEXT: manual` → do not load the next skill; show `HINT` so the user can continue manually
133
+ - `NEXT: manual` → do not load the next skill; return control with `HINT`, end the invocation, and do not create another confirmation point
139
134
  - `NEXT: done` → the workflow is complete; no further action is needed
@@ -25,8 +25,8 @@ comet state select <change-name>
25
25
  | `open` | 创建 proposal/design/tasks, 运行 guard | 写源代码 |
26
26
  | `design` | brainstorming, 创建 Design Doc, 运行 guard | 写源代码 |
27
27
  | `build` | 写源代码、测试、执行计划 | 跳过用户确认点 |
28
- | `verify` | 验证、branch handling | 跳过失败处理 |
29
- | `archive` | 确认归档、运行归档脚本 | 写源代码 |
28
+ | `verify` | 验证、记录验证报告 | 跳过失败处理、提前处理分支 |
29
+ | `archive` | 确认归档、运行归档脚本、提交归档改动、分支处理 | 写源代码 |
30
30
 
31
31
  Hook 硬拦截白名单包括 `openspec/*`、`docs/superpowers/*`、`.superpowers/*`、`.claude/*` 和 `.comet/*` 等流程/平台工作区;这些路径可写不代表可以跳过当前阶段的产物和确认要求。
32
32
 
@@ -44,7 +44,7 @@ Hook 硬拦截白名单包括 `openspec/*`、`docs/superpowers/*`、`.superpower
44
44
 
45
45
  预设例外:`workflow: hotfix/tweak` 本就跳过 design,`design_doc` 为空属正常,不算非法。
46
46
 
47
- 升级态说明:预设(hotfix/tweak)命中升级信号并经用户确认升级后,通过 `comet-state transition <name> preset-escalate` 合法地变为 `workflow: full` + `phase: design` + `design_doc: null`。此时 `phase: design` + `design_doc` 为空**属正常升级前置态**,不是非法空跳——agent 应进入 `/comet-design` 补 Design Doc。该终态不命中上表「绕过 design 空跳」行(该行仅检测 `phase: build`)。
47
+ 升级态说明:预设(hotfix/tweak)命中升级信号并经用户确认升级后,通过 `comet state transition <name> preset-escalate` 合法地变为 `workflow: full` + `phase: design` + `design_doc: null`,同时清除预设专属 build 配置。此时 `phase: design` + `design_doc` 为空**属正常升级前置态**,不是非法空跳——agent 应进入 `/comet-design` 补 Design Doc,并在 build 重新完成联合工作方式选择。该终态不命中上表「绕过 design 空跳」行(该行仅检测 `phase: build`)。
48
48
 
49
49
  ### Skill 调用(不可用普通对话替代)
50
50
 
@@ -60,50 +60,50 @@ Hook 硬拦截白名单包括 `openspec/*`、`docs/superpowers/*`、`.superpower
60
60
 
61
61
  ### 脚本执行(不可跳过)
62
62
 
63
- - **阶段退出**: `comet-guard <name> <phase> --apply`(必须看到 ALL CHECKS PASSED)
64
- - **压缩恢复**: `comet-state check <name> <phase> --recover`
65
- - **状态更新**: 关键操作后通过 `comet-state set` 更新字段,禁止手工编辑 .comet.yaml
66
- - **阶段推进只能经 guard/transition**: 禁止用 `comet-state set <name> phase <值>` 手动跳阶段(会绕过证据校验,脚本已硬拦截);确需修复畸形状态时才用 `COMET_FORCE_PHASE=1` 逃生阀。预设(hotfix/tweak)升级到 full 必须用 `comet-state transition <name> preset-escalate`——这是唯一能合法回退 phase 到 design 并同步 workflow/classic_profile 的通道,直接 `set phase design` 和 `set classic_profile` 都会被硬拦截
67
- - **handoff 生成**: `comet-handoff <name> design --write`(禁止手写摘要)
63
+ - **阶段退出**: `comet guard <name> <phase> --apply`(必须看到 ALL CHECKS PASSED)
64
+ - **压缩恢复**: `comet state check <name> <phase> --recover`
65
+ - **状态更新**: 关键操作后通过 `comet state set` 更新字段,禁止手工编辑 .comet.yaml
66
+ - **阶段推进只能经 guard/transition**: 禁止用 `comet state set <name> phase <值>` 手动跳阶段;预设升级到 full 必须用 `comet state transition <name> preset-escalate`
67
+ - **handoff 生成**: `comet handoff <name> design --write`(禁止手写摘要)
68
68
 
69
69
  ### 用户确认(不可自动跳过)
70
70
 
71
71
  以下决策点必须暂停等待用户明确选择,不得根据推荐规则自动填写:
72
72
 
73
- - **open**: 需求澄清完成确认、artifact 评审确认
73
+ - **open**: artifact 最终审视(同时确认 change 名称与范围);只有目标/范围仍有互斥选择或大型 PRD 拆分时增加前置决策
74
74
  - **design**: brainstorming 方案确认(确认前不得创建 Design Doc)
75
- - **build**: plan-ready 暂停、`isolation` / `build_mode` / `tdd_mode` / `review_mode` 四项选择(工作区隔离、执行方式、TDD 模式、代码审查模式)、spec 大规模变更确认、预设(hotfix/tweak)升级判定二选一(命中质变信号或文件数 tripwire 时,交用户决定继续预设流程还是升级 full)
76
- - **verify**: 验证失败处理策略、branch handling 选择
77
- - **archive**: 归档前最终确认
75
+ - **build**: 能力预检后,在一个联合决策中选择 plan-ready 暂停或所有可执行的 `isolation` / `build_mode` / `tdd_mode` / `review_mode`;选择 branch 时同时确认分支名,另含 spec 大规模变更确认、预设升级判定
76
+ - **verify**: 接受 WARNING/SUGGESTION 偏差、Spec 漂移处理,或超过自动修复上限后的继续/停止策略
77
+ - **archive**: 归档前最终确认,以及归档提交后的 branch handling 选择
78
78
 
79
79
  ## Design 阶段专项
80
80
 
81
- 1. 第一个脚本操作 = `comet-handoff <name> design --write`(未生成 handoff 禁止加载 brainstorming)
81
+ 1. 第一个脚本操作 = `comet handoff <name> design --write`(未生成 handoff 禁止加载 brainstorming)
82
82
  2. brainstorming in progress: incrementally update brainstorm-summary.md(每轮澄清或方案迭代后增量更新恢复检查点,未确认内容标注为待确认/候选)
83
83
  3. brainstorming 完成后下一步 = brainstorm-summary.md 定稿 → Design Doc → guard
84
- 4. active compaction gate: brainstorm-summary.md 定稿后、创建 Design Doc 前,优先触发宿主平台原生上下文压缩;无法程序化触发时暂停提示用户手动压缩或确认继续
84
+ 4. 主动式上下文压缩只能在 Design Doc、状态和最新 handoff 落盘后按需执行;无法程序化触发时给出非阻塞建议并继续
85
85
  5. **绝对不能直接开始写实现代码** — 必须先创建 Design Doc 并通过 guard
86
86
 
87
87
  ## Build 阶段专项
88
88
 
89
- 1. plan 创建后必须询问用户选择继续或暂停(`build_pause` 机制)
89
+ 1. plan 创建后先过滤不可执行选项,再只发起一个联合决策:暂停,或一次性提交工作区/执行/TDD/审查配置及条件性的分支名
90
90
  2. 每个 task 验收后必须: tasks.md 打勾 → git commit(不得积攒)。`subagent-driven-development` 必须按当前 `review_mode` 完成验收,再由协调者按任务唯一文本定向勾选和验证;不得用未完成任务总表代替当前任务验证
91
91
  3. 遇到失败必须加载 **systematic-debugging** skill,根因未定位前不得提出源码修复
92
92
  4. spec 变更分级: 小改直接编辑 | 中改加载 brainstorming | 大改暂停等用户确认拆分
93
93
 
94
94
  ## Verify 阶段专项
95
95
 
96
- 1. 第一步运行 `comet-state scale <name>` 确定验证级别
97
- 2. 验证失败后列出失败项等用户选择,CRITICAL 必须修
98
- 3. 连续 3 次失败后必须让用户选择接受偏差或继续修
99
- 4. 用户选择修复时运行 `comet-state transition <name> verify-fail`:该转移会把 `phase` 回退到 `build`(不是停在 verify),随后进入 `/comet-build` 修复,修完重新过 build→verify guard
96
+ 1. 第一步运行 `comet state scale <name>` 确定验证级别
97
+ 2. 前 3 次明确可修复失败自动运行 `comet state transition <name> verify-fail` 回到 build,并进入 `/comet-build`;CRITICAL/IMPORTANT 不得接受偏差
98
+ 3. `verify_failures` 由状态机维护。达到 `3` 后的下一次失败必须让用户选择继续修复或停止 workflow 寻求外部决策
99
+ 4. WARNING/SUGGESTION 只有在修复涉及行为、范围或风险取舍时才询问修复/接受;安全、局部、无取舍的修复自动闭环
100
100
 
101
101
  ## 上下文压缩恢复
102
102
 
103
103
  如果怀疑发生上下文压缩(之前对话被摘要、找不到之前讨论的内容),立即运行:
104
104
 
105
105
  ```bash
106
- node "$COMET_STATE" check <name> <phase> --recover
106
+ comet state check <name> <phase> --recover
107
107
  ```
108
108
 
109
109
  按脚本输出的 **Recovery action** 决定下一步。
@@ -124,17 +124,11 @@ node "$COMET_STATE" check <name> <phase> --recover
124
124
  guard `--apply` 成功后,不得在本规则中硬编码下一阶段 skill。必须先运行:
125
125
 
126
126
  ```bash
127
- comet-state next <change-name>
128
- ```
129
-
130
- 若已通过 `comet-env.mjs` 定位脚本,等价运行:
131
-
132
- ```bash
133
- node "$COMET_STATE" next <change-name>
127
+ comet state next <change-name>
134
128
  ```
135
129
 
136
130
  按脚本输出决定下一步:
137
131
 
138
132
  - `NEXT: auto` → 使用 Skill 工具加载 `SKILL` 指向的 skill
139
- - `NEXT: manual` → 不加载下一 skill,按 `HINT` 提示用户手动继续
133
+ - `NEXT: manual` → 不加载下一 skill,按 `HINT` 交还控制权并结束当前调用;不再创建确认点
140
134
  - `NEXT: done` → 流程已完成,无需继续