@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
@@ -62,21 +62,26 @@ Run `node "$WORKFLOW_STATE" status` to confirm the detected Node. If the script'
62
62
  - If workflow state shows a Node as complete but its expected artifacts are missing, treat the Node as incomplete and re-enter it.
63
63
  - If the user resumes mid-Node with a different topic, confirm whether to continue the current Node or start a new one.
64
64
 
65
- ### Decision Points (must pause)
65
+ ### Decision Classification And Decision Points
66
+
67
+ Classify before acting: a user decision has two or more valid options that change scope, behavior, accepted risk, or an irreversible outcome; a sole safe next action is automatic handling; a missing dependency, corrupt state, or guard failure with no valid continuation is a stop condition; `NEXT: manual` only returns control. Only the first category must pause.
66
68
 
67
69
  | Situation | Action |
68
70
  |-----------|--------|
69
- | First invocation, no workflow state exists | Initialize state, confirm the topic/scope with the user before starting the first Node |
70
- | User input is ambiguous between two Nodes | Ask the user which Node they mean; do not guess |
71
+ | First invocation with an unambiguous topic and scope | Initialize state automatically and enter the first Node; do not pause to approve known information |
72
+ | Topic, scope, or target Node has two or more mutually exclusive valid interpretations | Merge them into one question and let the user choose; do not guess |
71
73
  | Node requires user approval of output before advancing | Stop after recording evidence; wait for explicit confirmation |
72
- | Node fails its guard and the cause is unclear | Present the guard output and ask the user how to proceed |
74
+ | Accepting a WARNING/deviation or performing an irreversible publish has a real tradeoff | Show only currently executable options and persist the choice |
75
+
76
+ When a Node guard fails, inspect evidence and perform the sole safe repair first. If a missing dependency or corrupt state prevents progress, report the stop condition and recovery requirement. Escalate to the decision table only when multiple valid recovery options would change scope or risk.
73
77
 
74
78
  ### Red Flags
75
79
 
76
80
  | Agent Thought | Actual Risk |
77
81
  |--------------|-------------|
78
- | "The user mentioned the topic, so research is implicitly confirmed" | Mentioning confirming. Pause at the first Node boundary and confirm scope. |
82
+ | "Every first invocation needs another confirmation" | Clear input does not need duplicate approval; ask only when mutually exclusive interpretations still change scope. |
79
83
  | "The script returned NEXT: auto, so I should immediately load the next Skill" | `NEXT: auto` means the Node is done, not that you should skip confirmation. Check if the next Node has a decision point. |
84
+ | "The guard failed, so ask the user what to do" | Diagnose automatically and apply the sole safe repair first; if no valid action exists, report a stop condition instead of inventing options. |
80
85
  | "This looks like the same topic as last time, resume from where we left off" | Always re-read state. Conversation memory is unreliable after context compaction. |
81
86
  | "The exit check passed, so the work is good enough" | Exit checks are mechanical. Your job is to judge quality beyond the check — sparse notes, shallow analysis, or missing perspectives are not caught by scripts. |
82
87
  ```
@@ -4,7 +4,7 @@ This file is a portable lane brief, not a platform-native custom agent. If you n
4
4
 
5
5
  ## Responsibilities
6
6
 
7
- Design the places where the user must pause and choose, plus cross-device recovery. Pause points must be explicit user choices that cannot be bypassed by default recommendations, historical preferences, or automatic advancement.
7
+ Design only the places where the user genuinely must choose, plus cross-device recovery. First distinguish four categories: user decision, automatic handling, stop condition, and manual handoff. Create a user pause only when two or more valid options change scope, behavior, accepted risk, or an irreversible outcome. Execute a sole safe action directly, report a missing dependency or corrupt state as a stop condition, and return control for a manual handoff. Genuine user decisions cannot be bypassed by defaults, historical preferences, or automatic advancement.
8
8
 
9
9
  Must cover:
10
10
 
@@ -15,11 +15,10 @@ Must cover:
15
15
 
16
16
  Read the common input from the main session, especially:
17
17
 
18
- - `confirm-generate`, `revise-proposal`, and `cancel` from the Skill Creator confirmation page.
19
- - Eval workload choice: `skip / quick / full eval`.
20
- - Human approval before installation.
21
- - Blockers such as unresolved candidates, ambiguity, capability gaps, and executable disclosures.
22
- - Runner recovery state and cross-device recovery entry.
18
+ - `confirm-generate`, `revise-proposal`, and `cancel` from the Skill Creator confirmation page: these are user decisions that change the generated result.
19
+ - Eval workload (`skip / quick / full eval`) and human approval before installation: treat them as decisions only when multiple valid options actually remain.
20
+ - Missing or stale eval evidence, unresolved candidates, ambiguity, capability gaps, and executable disclosures: classify each as automatically repairable, a no-path stop condition, or a real decision with multiple recovery choices. Do not turn all blockers into pause points.
21
+ - Runner recovery state and cross-device recovery entry: reuse persisted choices that remain valid instead of asking again on resume.
23
22
 
24
23
  Use file handoff: the main session provides paths instead of pasting large bodies of text. Do not inherit main-session history; use only this brief, common input, workflow protocol, and existing drafts.
25
24
 
@@ -33,21 +32,23 @@ model: <must explicitly specify model>
33
32
  prompt:
34
33
  You are the pause point author subagent.
35
34
  First read this brief, the common input path, workflow protocol path, Skill draft path, and report file path.
36
- Start by asking questions: if user choices, blocker recovery, or cross-device state are unclear, return NEEDS_CONTEXT.
37
- Do not guess or fill in missing pause points.
35
+ First classify each candidate as a user decision, automatic handling, stop condition, or manual handoff. If facts needed for classification are missing, return NEEDS_CONTEXT.
36
+ Do not guess missing choices, and do not disguise automatic repair, guard failure, capability gaps, a sole valid action, or manual handoff as a user pause.
38
37
  Only produce decision-points and recovery drafts; do not write Bundle state and do not execute candidate scripts.
39
38
  Write the full pause point draft to the report file path and return only a status summary of 15 lines or fewer.
40
39
  ```
41
40
 
42
41
  ## Output Requirements
43
42
 
44
- Return a pause point draft that explains:
43
+ Return a classification table first, then describe genuine user pause points:
45
44
 
45
+ - Which category each candidate belongs to and the evidence for that classification.
46
46
  - The trigger condition for every pause point.
47
47
  - The choices available to the user.
48
48
  - Which Node each choice enters.
49
49
  - Where pause point evidence is written.
50
- - During recovery, how to show current Node, blocking reason, suggested next step, and options.
50
+ - How automatic handling advances directly, and how stop conditions report recovery requirements without inventing options.
51
+ - During recovery, how to show the current Node, blocking reason, suggested next step, and real options while reusing persisted choices.
51
52
 
52
53
  Pause points must fit the current workflow protocol, not merely list original Comet pause points.
53
54
 
@@ -56,8 +57,10 @@ Pause points must fit the current workflow protocol, not merely list original Co
56
57
  Before returning, check:
57
58
 
58
59
  - Every user pause point has trigger condition, options, next Node, and evidence location.
60
+ - Every pause has at least two currently executable valid options; adjacent choices that can be answered together are merged, and a sole valid value creates no pause.
61
+ - Guard failures, deterministic retries, state reconciliation, capability gaps, and `NEXT: manual` are classified according to their actual semantics instead of defaulting to user questions.
59
62
  - Default recommendations, historical preferences, and automatic advancement cannot bypass required pause points.
60
- - The recovery summary can show current Node, blocking reason, suggested next step, and options.
63
+ - The recovery summary can show the current Node, blocking reason, suggested next step, and real options without re-asking choices that remain valid.
61
64
  - Cross-device recovery does not rely on current-session memory.
62
65
  - Pause points fit the current composed Skill instead of copying original Comet pause points.
63
66
 
@@ -62,6 +62,8 @@ Any of these must produce blocking findings:
62
62
  Node Skill, or a subagent handoff Node does not require the implementation subagent prompt to load that
63
63
  Skill.
64
64
  - User pause points are missing, or can be bypassed by defaults.
65
+ - Deterministic repair, guard failure, state reconciliation, a capability gap, a sole valid action, or `NEXT: manual` is treated as a user pause by default; or adjacent choices that can be answered together are split into serial confirmations.
66
+ - The entry Skill frontmatter description does not identify it as the managed workflow entry/resume router, or an internal Node Skill description allows ordinary tasks to trigger it without explicit invocation or entry/runtime routing.
65
67
  - English Skills mix in Chinese process sentences.
66
68
  - Nested Skill calls use provider prefixes.
67
69
  - User-visible `SKILL.md` leaks generated audit sections, source hashes, or internal metadata.
@@ -20,7 +20,7 @@ Quality bar: the `comet/SKILL.md` Decision Core (see `reference/authored-zone-ex
20
20
 
21
21
  - **Semantic current-Node detection** — how to determine which Node the user is in, beyond just running the script. Model comet's Step 0 (detect intent from user message, check Node order, handle "belongs to earlier/later Node" conflicts) + Step 1 (read state, trust files over stale state).
22
22
  - **Resume and drift rules** — what to do when context resumes (re-detect from scratch, never trust conversation history), when state says DONE but artifacts are missing, when the user's topic shifts mid-Node.
23
- - **Decision points** — explicit table of situations that MUST pause for user confirmation (first invocation scope, ambiguous Node, user approval required, guard failure).
23
+ - **Decision classification and decision points** — first distinguish user decisions, automatic handling, stop conditions, and manual handoffs, then tabulate only genuine user choices. A clear first invocation, an objectively repairable guard failure, a sole valid next action, and `NEXT: manual` must not manufacture confirmation.
24
24
  - **Red flags** — the "agent thought → actual risk" pattern that catches self-deception (e.g., "user mentioned the topic so research is confirmed" → mentioning ≠ confirming).
25
25
 
26
26
  A Decision Core without these four sections is a stub, not a Decision Core. The entry is the most-loaded file — it is what makes the Skill feel intelligent or mechanical.
@@ -49,10 +49,10 @@ model: <must explicitly specify model>
49
49
  prompt:
50
50
  You are the workflow entry author subagent.
51
51
  First read this brief, the common input path, script contract path, workflow protocol path, and report file path.
52
- Start by asking questions: if startup routing, recovery paths, current-Node detection, or user pause points are unclear, return NEEDS_CONTEXT.
52
+ First classify user decisions, automatic handling, stop conditions, and manual handoffs. If startup routing, recovery paths, current-Node detection, or genuine user choices are unclear, return NEEDS_CONTEXT.
53
53
  Do not guess or fill in missing flow details.
54
54
  Only write the entry SKILL.md draft; do not write internal Node Skills, Bundle state, or execute candidate scripts.
55
- The Decision Core MUST include four subsections: ### Automatic Node Detection (Step 0 intent detection + Step 1 state read + resume rules), ### Decision Points (explicit pause table), ### Red Flags (agent thought → actual risk table). A Decision Core without these is a stub.
55
+ The Decision Core MUST include four subsections: ### Automatic Node Detection (Step 0 intent detection + Step 1 state read + resume rules), ### Decision Classification And Decision Points (genuine user choices only), ### Red Flags (agent thought → actual risk table). Do not list guard failures, deterministic repair, a sole valid action, or manual handoff as a user decision. A Decision Core without these is a stub.
56
56
  Write the full entry draft to the report file path and return only a status summary of 15 lines or fewer.
57
57
  ```
58
58
 
@@ -66,7 +66,7 @@ The entry draft must show:
66
66
  - The Node route table is reference only; it must not use "immediately execute" or "must load" execution directives.
67
67
  - When users customize existing Comet Skills, the entry must list Required Skill Calls as Node-local obligations,
68
68
  not as an immediate execution checklist.
69
- - User pause points, recovery paths, and reference files are visible.
69
+ - User decisions, automatic handling, stop conditions, manual handoffs, recovery paths, and reference files are visible. Pause only when at least two real valid options remain, and merge adjacent choices.
70
70
  - When users customize existing Comet Skills, preserve the open / design / build / verify / archive main path and Guardrails.
71
71
 
72
72
  Forbidden:
@@ -85,6 +85,7 @@ Before returning, check:
85
85
  - The entry has no immediate-load checklist for Node Skills.
86
86
  - The Node route is reference, not execution steps.
87
87
  - Automatic advancement references script outputs `NEXT:` and `SKILL:`.
88
+ - A clear first invocation initializes directly, guard failures are diagnosed automatically or reported as stop conditions, and `NEXT: manual` only returns control; none is presented as a fabricated user decision.
88
89
  - User-visible English prose is consistent and does not mix in Chinese process sentences.
89
90
 
90
91
  ## Required Claim
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: comet-archive
3
- description: "Use when a Comet change has passed verification and needs archive confirmation, delta spec merge, or archive-phase recovery."
3
+ description: "Use only when explicitly invoked as /comet-archive or routed by the root Comet skill/runtime to the archive phase; confirm archive, merge delta specs, and finish the branch."
4
4
  ---
5
5
 
6
6
  # Comet Phase 5: Archive (Archive)
@@ -8,7 +8,7 @@ description: "Use when a Comet change has passed verification and needs archive
8
8
  ## Prerequisites
9
9
 
10
10
  - Verification passed (Phase 4 complete)
11
- - Branch handled
11
+ - Archive commit and branch handling are still pending (`branch_status: pending`)
12
12
  - `verify_result: pass` in `openspec/changes/<name>/.comet.yaml`
13
13
 
14
14
  ## Steps
@@ -35,7 +35,7 @@ After entry verification passes, **must follow the `comet/reference/decision-poi
35
35
  Before confirmation, show the user a brief summary:
36
36
  - Change name
37
37
  - Verification report path and result
38
- - Branch handling status
38
+ - Current branch/workspace and attribution summary for pre-existing dirty changes
39
39
  - Irreversible actions this archive will perform: merge main specs with OpenSpec delta semantics, annotate design doc / plan, and move the change to the archive directory
40
40
 
41
41
  The user confirmation question must be presented as a single-select question with these options:
@@ -70,11 +70,6 @@ The script automatically executes:
70
70
  If script returns non-zero exit code, report error and stop.
71
71
  If script returns zero exit code, archive is complete.
72
72
 
73
- After a successful archive, clear the current execution context; this command is idempotent:
74
-
75
- ```bash
76
- comet state clear-selection
77
- ```
78
73
  The summary `X/Y steps succeeded` counts real executed steps and does not double-count delta spec sync or document annotation.
79
74
 
80
75
  The script calls OpenSpec archive to merge `ADDED/MODIFIED/REMOVED/RENAMED` delta semantics into main specs, then verifies main specs do not contain delta-only section headings.
@@ -88,31 +83,57 @@ Spec lifecycle completes here:
88
83
  brainstorming → delta spec → implementation → verification → main spec merge → design doc annotation → archive
89
84
  ```
90
85
 
91
- ### 4. Commit the Archive Changes
86
+ ### 4. Commit Archive Changes with Exact Paths
92
87
 
93
88
  The archive script only moves files and merges the spec; it does not commit. After archiving, the worktree holds these uncommitted changes:
94
89
  - The change directory moved from `openspec/changes/<name>/` to `openspec/changes/archive/YYYY-MM-DD-<name>/`
95
90
  - The main spec content merged via delta semantics
96
91
  - Archive metadata annotations on the design doc / plan
97
92
 
98
- **You must prompt the user to commit these archive changes**, otherwise the archived result stays in the worktree. After showing the pending files, suggest:
93
+ After archive, read `git status --short` and compare it with the pre-archive dirty-worktree attribution baseline. Stage only paths attributable to this change: the original active path, actual archive path printed by the command, main specs changed by this delta, and archive metadata on this Design Doc/Plan. Stop if any path cannot be attributed.
94
+
95
+ Use explicit pathspecs, then inspect the staged diff. Never stage the whole repository or mix the user's pre-existing changes into the archive commit:
99
96
 
100
97
  ```bash
101
- git add -A
98
+ git add -- <individually verified archive paths...>
99
+ git diff --cached --stat
102
100
  git commit -m "chore: archive <change-name>"
103
101
  ```
104
102
 
105
- If branch handling (phase 4) chose not to merge into the main branch yet, finish up via the selected option (merge / PR / keep branch) together with this commit.
103
+ Stop if the commit fails or the staged diff contains unrelated paths.
104
+
105
+ ### 5. Handle the Branch After the Archive Commit
106
+
107
+ After the archive commit succeeds, **immediately execute:** use the Skill tool to load Superpowers `finishing-a-development-branch`. This ordering ensures the final branch or PR contains the main-spec merge and archive metadata.
108
+
109
+ If the skill is unavailable, stop and prompt the user to enable/install it; do not mark `branch_status` handled. After loading it, pause under `comet/reference/decision-point.md` and let the user choose:
110
+
111
+ 1. Merge locally into the main branch
112
+ 2. Push and create a PR
113
+ 3. Keep the current branch for later
114
+
115
+ Archive is already complete, so do not offer "discard work". Only after the selected operation succeeds (or the user explicitly keeps the branch), run:
116
+
117
+ ```bash
118
+ comet state set <change-name> branch_status handled
119
+ comet guard <change-name> archive
120
+ comet state clear-selection
121
+ ```
122
+
123
+ The archive guard must verify both archive completeness and `branch_status: handled`; a failure means the workflow is still incomplete.
106
124
 
107
125
  ## Exit Conditions
108
126
 
109
127
  - Archive script executed successfully (exit code 0)
110
128
  - Archive directory `openspec/changes/archive/YYYY-MM-DD-<change-name>/` exists
111
129
  - Archived `.comet.yaml` contains `archived: true`
130
+ - Archive changes were committed with exact pathspecs
131
+ - The user's branch decision completed and archived state has `branch_status: handled`
132
+ - `comet guard <change-name> archive` passes
112
133
 
113
134
  The archive script moves `openspec/changes/<name>/` to `openspec/changes/archive/YYYY-MM-DD-<name>/`.
114
135
 
115
- > **WARNING**: After successful archive, **do not run** `comet guard <change-name> archive` against the old active change name; the active directory no longer exists. Doing so will cause the guard to error with "change directory not found". Archive completeness is determined by script exit code and archived directory state.
136
+ `comet guard <change-name> archive` resolves the actual archive directory from the original change name; do not construct a dated archive path manually.
116
137
 
117
138
  ## Complete
118
139
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: comet-build
3
- description: "Use when a full Comet change has completed design and needs an implementation plan, execution-mode selection, or resumed build tasks."
3
+ description: "Use only when explicitly invoked as /comet-build or routed by the root Comet skill/runtime to a full workflow build phase; create or recover the implementation plan and execute tasks."
4
4
  ---
5
5
 
6
6
  # Comet Phase 3: Plan and Build (Build)
@@ -23,7 +23,7 @@ comet state check <name> build
23
23
 
24
24
  Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
25
25
 
26
- **Idempotency**: All build phase operations can be safely re-executed. Read `.comet.yaml` `phase` field to confirm still in build, read plan header `base-ref`, then use `grep -n '\- \[ \]' tasks.md | head -1` to find the first unchecked task. Already-committed tasks must not be re-committed.
26
+ **Idempotency**: All build phase operations can be safely re-executed. Read `.comet.yaml` `phase` to confirm build, read the plan header `base-ref`, then parse tasks.md checkboxes in document order and resume from the first unchecked task. Already-committed tasks must not be re-committed.
27
27
 
28
28
  ### 1. Create Plan (Subagent Offload)
29
29
 
@@ -65,7 +65,7 @@ After the subagent completes:
65
65
  - If a valid file path is returned and the file exists, record it as the plan
66
66
  - If the subagent fails or returns an invalid path, fall back to loading the Superpowers `writing-plans` skill inline in the main session (degraded fallback)
67
67
 
68
- ### 2. Update Plan Status and Provide Plan-Ready Pause Point
68
+ ### 2. Update Plan Status and Jointly Confirm Workflow Configuration
69
69
 
70
70
  Record plan path:
71
71
 
@@ -75,16 +75,18 @@ comet state set <name> plan docs/superpowers/plans/YYYY-MM-DD-feature.md
75
75
 
76
76
  No manual phase update needed — guard auto-transitions when exit conditions are met.
77
77
 
78
- After the plan is recorded, immediately provide a new user decision point:
78
+ Check current platform capabilities before presenting the joint decision: verify whether `using-git-worktrees` is available, whether a real background subagent/Task/multi-agent dispatcher exists, and whether the repository can safely create a branch. Show only isolation and execution options that are currently executable. If a field has only one valid value, explain why and apply it without manufacturing another pause.
79
+
80
+ After recording the plan, provide exactly **one joint decision point** that collects whether to continue now, available workspace isolation, available execution method, TDD mode, and code review mode. The branch name must be confirmed in the same Step 2 joint decision when `branch` is selected. Do not ask continue/pause first and then create another configuration or naming blocker.
79
81
 
80
82
  | Option | Behavior | Description |
81
83
  |--------|----------|-------------|
82
- | A | Continue execution | Stay in the current model and proceed to Step 3 to choose workspace isolation, execution method, TDD mode, and code review mode |
84
+ | A | Continue with configuration | Provide all Step 3 isolation, execution, TDD, and review choices in the same response; include the branch name when branch is selected |
83
85
  | B | Pause to switch model | Record `build_pause: plan-ready`, stop this `/comet-build` invocation, and allow the user to resume later from `/comet` or `/comet-build` |
84
86
 
85
- This is a user decision point. **Must follow the `comet/reference/decision-point.md` protocol to pause and wait for the user to explicitly choose**. Must not auto-continue and must not write the pause into `build_mode`.
87
+ This is a user decision point. **Follow `comet/reference/decision-point.md` once and show the plan summary, pause option, and every executable Step 3 setting together**. Continuing requires all settings and any conditional branch name in the same response. Do not auto-select or write the pause into `build_mode`.
86
88
 
87
- When the user chooses to continue:
89
+ When the user chooses to continue and supplies complete configuration:
88
90
 
89
91
  ```bash
90
92
  comet state set <name> build_pause null
@@ -98,17 +100,17 @@ comet state set <name> build_pause plan-ready
98
100
 
99
101
  After setting `build_pause: plan-ready`, stop the current invocation. Do not choose `isolation` or `build_mode`, and do not load an execution skill.
100
102
 
101
- ### 3. Select Workflow Configuration
103
+ ### 3. Apply the Confirmed Workflow Configuration
102
104
 
103
- If resuming with `build_pause: plan-ready` and the `plan` file exists, do not rerun `writing-plans`. First tell the user the workflow is stopped at the plan-ready pause point; after the user confirms continuing, set:
105
+ If resuming with `build_pause: plan-ready` and the `plan` file exists, do not rerun `writing-plans`. Reissue the same joint Step 2 decision and clear the pause only after the user supplies complete configuration:
104
106
 
105
107
  ```bash
106
108
  comet state set <name> build_pause null
107
109
  ```
108
110
 
109
- Then continue this step to choose workspace isolation, execution method, TDD mode, and code review mode.
111
+ Then apply the workspace isolation, execution method, TDD mode, and code review mode below.
110
112
 
111
- Plan has been written to the current branch. Before starting execution, **ask the user to choose workspace isolation, execution method, TDD mode, and code review mode in a single interaction**:
113
+ The plan is on the current branch. These settings are all part of the single Step 2 decision:
112
114
 
113
115
  **Workspace Isolation**:
114
116
 
@@ -133,7 +135,7 @@ Plan has been written to the current branch. Before starting execution, **ask th
133
135
  - Task count ≤ 2 and no cross-module dependencies → Recommend B
134
136
  - From hotfix path → Recommend B
135
137
 
136
- This is a user decision point. **Must follow the `comet/reference/decision-point.md` protocol to pause and wait for the user to explicitly choose isolation method, execution method, TDD mode, and code review mode**. Must not choose `branch` or `worktree` based on recommendation rules, and must not choose the execution method, TDD mode, or code review mode based on recommendation rules. Recommendation rules are for suggestion only, not a substitute for user confirmation.
138
+ These tables are part of the Step 2 joint decision and do not create another pause. First remove options that capability preflight found unavailable. When multiple valid options remain, do not choose `branch` or `worktree`, execution method, TDD mode, or review mode from recommendations. Recommendations explain a preference; they never replace user confirmation.
137
139
 
138
140
  After user selection, update `isolation`, execution method, TDD mode, and code review mode fields:
139
141
 
@@ -143,14 +145,14 @@ comet state set <name> isolation <branch|worktree>
143
145
 
144
146
  - If the user chooses `executing-plans`: run `comet state set <name> subagent_dispatch null`, then run `comet state set <name> build_mode executing-plans`
145
147
  - If the user chooses `subagent-driven-development`: first confirm the current platform has real background subagent / Task / multi-agent dispatch capability; after confirming, run `comet state set <name> subagent_dispatch confirmed`, then run `comet state set <name> build_mode subagent-driven-development`
146
- - If real background dispatch capability cannot be confirmed, must not write `build_mode: subagent-driven-development`; must pause and wait for the user to choose `executing-plans` instead
148
+ - If real background dispatch capability cannot be confirmed, do not show or write `build_mode: subagent-driven-development`. If recovered state already records that mode but capability is unavailable, return to the same Step 2 joint decision with only executable modes; do not create a separate "switch to executing-plans" pause
147
149
 
148
150
  **TDD Mode**:
149
151
 
150
152
  | Option | Meaning | Applicable Scenario |
151
153
  |--------|---------|---------------------|
152
154
  | `tdd` | Write a failing test first for each task, then implement | Recommended. Changes involving business logic, new features, APIs |
153
- | `direct` | Implement directly, no enforced TDD flow | Changes that don't need test coverage, or user chooses to skip tests and write code directly. hotfix/tweak presets default to `direct` |
155
+ | `direct` | Implementation-first, no per-task Red-Green-Refactor requirement | Still requires relevant tests and bug-regression evidence; hotfix/tweak presets default to `direct` |
154
156
 
155
157
  Run `comet state set <name> tdd_mode <tdd|direct>`
156
158
 
@@ -183,18 +185,18 @@ Without `direct_override: true`, `build_mode=direct` in full workflow is blocked
183
185
 
184
186
  **Execute isolation**:
185
187
 
186
- - **branch**: Recommend a branch name based on the workflow type and current date, then let the user confirm or input a custom name. This is a user decision point — **must use the current platform's available user input/confirmation mechanism to pause and wait for the user to explicitly confirm or override the branch name**. Must not skip this step and create the branch directly.
188
+ - **branch**: Use the branch name already confirmed in Step 2; do not pause again. If legacy recovery no longer has the branch name from that joint decision, re-enter the same Step 2 decision instead of creating a separate branch-naming decision.
187
189
 
188
190
  Branch naming convention:
189
191
  - Read the `workflow` field from `.comet.yaml` to determine the prefix
190
192
  - `workflow: full` → recommend `feature/YYYYMMDD/<change-name>`
191
193
  - `workflow: hotfix` → recommend `hotfix/YYYYMMDD/<change-name>`
192
194
  - `workflow: tweak` → recommend `tweak/YYYYMMDD/<change-name>`
193
- - Date is derived from `date +%Y%m%d` at runtime
195
+ - Format the current runtime date as `YYYYMMDD`; do not depend on one shell's date command
194
196
 
195
197
  Example: if change name is `fix-login-bug` and today is 2026-06-09, recommend `feature/20260609/fix-login-bug`
196
198
 
197
- After the user confirms or provides a custom branch name, run `git checkout -b <branch-name>`, subsequent work on the new branch.
199
+ Immediately after Step 2 confirms the branch name, run `git checkout -b <branch-name>` and continue on the new branch.
198
200
 
199
201
  - **worktree**: Must use the Skill tool to load the Superpowers `using-git-worktrees` skill to create isolated workspace. Do not bypass this skill with plain shell commands or native tools; if the skill is unavailable, stop the process and prompt to install or enable Superpowers skills.
200
202
 
@@ -217,7 +219,7 @@ Do not begin source writes until this binding succeeds.
217
219
 
218
220
  - `build_mode: executing-plans`: **Immediately execute:** Use the Skill tool to load the Superpowers `executing-plans` skill. Skipping this step is prohibited. If the skill is unavailable, stop the process and prompt to install or enable the corresponding skill; do not substitute with normal conversation. After the skill loads, ARGUMENTS must include the same Language constraint as Step 1: `Language: Use the configured Comet artifact language from comet state get <name> language`. Execute according to plan.
219
221
  - `build_mode: subagent-driven-development`: The main session only coordinates and must not write implementation code directly. **Immediately execute:** Use the Skill tool to load the Superpowers `subagent-driven-development` skill. After the skill loads, read `comet/reference/subagent-dispatch.md` for Comet-specific extensions (real background dispatch, task isolation, checkoff verification, TDD constraints, continuous execution, context recovery) and apply them alongside the skill's workflow. If they conflict, the more specific Comet extensions take precedence.
220
- - If the current platform has no real background agent dispatch capability, must pause and wait for the user to choose main window execution instead. After the user chooses, must run `comet state set <name> build_mode executing-plans`, then follow the `build_mode: executing-plans` branch to load the Superpowers `executing-plans` skill. Must not continue executing tasks before the user explicitly chooses.
222
+ - If the execution preflight finds that background dispatch capability has disappeared, do not execute directly in the main window and do not create a new second decision. Return to the same Step 2 joint decision with the unavailable mode removed. After the user selects main-window execution there, run `comet state set <name> build_mode executing-plans`, then continue through that branch.
221
223
 
222
224
  **TDD Mode Execution Constraints**:
223
225
 
@@ -237,7 +239,7 @@ Under `executing-plans`, the main session executes tasks directly (no isolated i
237
239
 
238
240
  Requirements (apply to `standard` and `thorough`):
239
241
  - the `requesting-code-review` skill must be loaded before `comet guard <change-name> build --apply`
240
- - if `requesting-code-review` skill is unavailable, skip the review gate but must record `<!-- review skipped: skill unavailable -->` in tasks.md, then continue guard transition
242
+ - if `requesting-code-review` is unavailable under `standard` or `thorough`, stop and ask the user to install/enable it and retry, or explicitly switch to `review_mode: off` with a recorded reason; never skip the gate or continue guard before that explicit switch
241
243
  - CRITICAL review findings (security vulnerabilities, data loss risk, build/test failures) must be fixed first and must not be carried into verify
242
244
  - if non-CRITICAL review findings are accepted, record the acceptance reason and impact scope in tasks.md, the commit body, a verification report draft, or another durable artifact
243
245
 
@@ -275,7 +277,7 @@ When creating an independent change, must invoke `/comet-open`, not `/opsx:new`
275
277
 
276
278
  Build is the longest phase and may span many tasks. To support resume after context compaction:
277
279
 
278
- - **After each task**: complete acceptance per the current execution branch and `review_mode` before checking off and committing. `subagent-driven-development` dispatches no per-task reviewer under `off`; under `standard`, a per-task reviewer fires only when the task hits a risk signal; under `thorough`, every task gets a per-task reviewer. All modes must perform targeted verification by unique task text. Use `grep -c '\- \[ \]' tasks.md` to check remaining unchecked count; no need to re-read the entire file
280
+ - **After each task**: complete acceptance per the current execution branch and `review_mode` before checking off and committing. `subagent-driven-development` dispatches no per-task reviewer under `off`; under `standard`, a per-task reviewer fires only when the task hits a risk signal; under `thorough`, every task gets a per-task reviewer. All modes must perform targeted verification by unique task text. Parse tasks.md checkboxes to count remaining work without rereading unrelated task bodies
279
281
  - **Context compression recovery**: Follow `comet/reference/context-recovery.md` with phase set to `build`.
280
282
  - **User manual-change resume**: handle uncommitted changes through `comet/reference/dirty-worktree.md`. That protocol defines checks, attribution, and prohibitions. Build-specific handling:
281
283
  1. After attribution, if the diff implies plan or spec changes, handle it through Step 4 "Spec Incremental Updates"
@@ -320,5 +322,5 @@ comet state next <change-name>
320
322
  ```
321
323
 
322
324
  - `NEXT: auto` → invoke the skill pointed to by `SKILL` to enter the next phase
323
- - `NEXT: manual` → do not invoke the next skill; prompt user to run `/<SKILL>` manually
325
+ - `NEXT: manual` → do not invoke the next skill; return control with `HINT`, end the invocation, and do not create another confirmation point
324
326
  - `NEXT: done` → workflow is complete, no further action needed
@@ -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