@rpamis/comet 0.3.7 → 0.3.8

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 (86) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +559 -539
  3. package/assets/manifest.json +41 -34
  4. package/assets/skills/comet/SKILL.md +282 -329
  5. package/assets/skills/comet/reference/auto-transition.md +27 -0
  6. package/assets/skills/comet/reference/comet-yaml-fields.md +68 -0
  7. package/assets/skills/comet/reference/context-recovery.md +35 -0
  8. package/assets/skills/comet/reference/debug-gate.md +17 -0
  9. package/assets/skills/comet/reference/decision-point.md +20 -0
  10. package/assets/skills/comet/reference/file-structure.md +28 -0
  11. package/assets/skills/comet/reference/subagent-dispatch.md +113 -0
  12. package/assets/skills/comet/rules/comet-phase-guard.en.md +99 -0
  13. package/assets/skills/comet/rules/comet-phase-guard.md +99 -90
  14. package/assets/skills/comet/scripts/comet-state.sh +62 -0
  15. package/assets/skills/comet-archive/SKILL.md +100 -106
  16. package/assets/skills/comet-build/SKILL.md +304 -316
  17. package/assets/skills/comet-design/SKILL.md +263 -272
  18. package/assets/skills/comet-hotfix/SKILL.md +204 -211
  19. package/assets/skills/comet-open/SKILL.md +203 -186
  20. package/assets/skills/comet-tweak/SKILL.md +180 -179
  21. package/assets/skills/comet-verify/SKILL.md +234 -240
  22. package/assets/skills-zh/comet/SKILL.md +269 -332
  23. package/assets/skills-zh/comet/reference/auto-transition.md +27 -0
  24. package/assets/skills-zh/comet/reference/comet-yaml-fields.md +68 -0
  25. package/assets/skills-zh/comet/reference/context-recovery.md +35 -0
  26. package/assets/skills-zh/comet/reference/debug-gate.md +17 -0
  27. package/assets/skills-zh/comet/reference/decision-point.md +20 -0
  28. package/assets/skills-zh/comet/reference/file-structure.md +28 -0
  29. package/assets/skills-zh/comet/reference/subagent-dispatch.md +113 -0
  30. package/assets/skills-zh/comet-archive/SKILL.md +100 -106
  31. package/assets/skills-zh/comet-build/SKILL.md +304 -316
  32. package/assets/skills-zh/comet-design/SKILL.md +264 -273
  33. package/assets/skills-zh/comet-hotfix/SKILL.md +200 -207
  34. package/assets/skills-zh/comet-open/SKILL.md +203 -186
  35. package/assets/skills-zh/comet-tweak/SKILL.md +176 -175
  36. package/assets/skills-zh/comet-verify/SKILL.md +232 -238
  37. package/bin/comet.js +3 -3
  38. package/dist/cli/index.js +19 -0
  39. package/dist/cli/index.js.map +1 -1
  40. package/dist/commands/init.d.ts.map +1 -1
  41. package/dist/commands/init.js +8 -8
  42. package/dist/commands/init.js.map +1 -1
  43. package/dist/commands/uninstall.d.ts +9 -0
  44. package/dist/commands/uninstall.d.ts.map +1 -0
  45. package/dist/commands/uninstall.js +113 -0
  46. package/dist/commands/uninstall.js.map +1 -0
  47. package/dist/commands/update.d.ts +1 -1
  48. package/dist/commands/update.d.ts.map +1 -1
  49. package/dist/commands/update.js +65 -36
  50. package/dist/commands/update.js.map +1 -1
  51. package/dist/core/codegraph.d.ts +2 -7
  52. package/dist/core/codegraph.d.ts.map +1 -1
  53. package/dist/core/codegraph.js +4 -37
  54. package/dist/core/codegraph.js.map +1 -1
  55. package/dist/core/detect.d.ts +8 -1
  56. package/dist/core/detect.d.ts.map +1 -1
  57. package/dist/core/detect.js +41 -2
  58. package/dist/core/detect.js.map +1 -1
  59. package/dist/core/openspec.d.ts +1 -1
  60. package/dist/core/openspec.d.ts.map +1 -1
  61. package/dist/core/openspec.js +40 -17
  62. package/dist/core/openspec.js.map +1 -1
  63. package/dist/core/platforms.d.ts.map +1 -1
  64. package/dist/core/platforms.js +14 -1
  65. package/dist/core/platforms.js.map +1 -1
  66. package/dist/core/skills.d.ts +3 -1
  67. package/dist/core/skills.d.ts.map +1 -1
  68. package/dist/core/skills.js +142 -65
  69. package/dist/core/skills.js.map +1 -1
  70. package/dist/core/superpowers.d.ts.map +1 -1
  71. package/dist/core/superpowers.js +1 -0
  72. package/dist/core/superpowers.js.map +1 -1
  73. package/dist/core/uninstall.d.ts +28 -0
  74. package/dist/core/uninstall.d.ts.map +1 -0
  75. package/dist/core/uninstall.js +421 -0
  76. package/dist/core/uninstall.js.map +1 -0
  77. package/dist/core/version.d.ts +31 -0
  78. package/dist/core/version.d.ts.map +1 -0
  79. package/dist/core/version.js +111 -0
  80. package/dist/core/version.js.map +1 -0
  81. package/dist/utils/file-system.d.ts +23 -0
  82. package/dist/utils/file-system.d.ts.map +1 -1
  83. package/dist/utils/file-system.js +100 -5
  84. package/dist/utils/file-system.js.map +1 -1
  85. package/package.json +69 -64
  86. package/scripts/postinstall.js +44 -44
@@ -1,272 +1,263 @@
1
- ---
2
- name: comet-design
3
- description: "Comet Phase 2: Deep Design. Invoke with /comet-design. Produce Design Doc and delta spec through brainstorming."
4
- ---
5
-
6
- # Comet Phase 2: Deep Design (Design)
7
-
8
- ## Prerequisites
9
-
10
- - Active change exists (proposal.md, design.md, tasks.md)
11
- - No Design Doc (no corresponding file under `docs/superpowers/specs/`)
12
-
13
- ## Steps
14
-
15
- ### 0. Entry State Verification (Entry Check)
16
-
17
- Execute entry verification:
18
-
19
- ```bash
20
- COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
21
- if [ -z "$COMET_ENV" ]; then
22
- echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
23
- return 1
24
- fi
25
- . "$COMET_ENV"
26
- "$COMET_BASH" "$COMET_STATE" check <name> design
27
- ```
28
-
29
- Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
30
-
31
- **Idempotency**: All design phase operations can be safely re-executed. If `handoff_context` and `handoff_hash` already exist, confirm they match current artifacts before deciding whether to regenerate.
32
-
33
- ### 1a. Generate OpenSpec → Superpowers Handoff Package
34
-
35
- **Must be generated by script. Agent writing summaries on the fly is not allowed.**
36
-
37
- ```bash
38
- "$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write
39
- ```
40
-
41
- The script reads the change `.comet.yaml` `context_compression` snapshot, then generates and records the matching handoff package.
42
-
43
- Default `context_compression: off` generates:
44
-
45
- ```
46
- openspec/changes/<name>/.comet/handoff/design-context.json
47
- openspec/changes/<name>/.comet/handoff/design-context.md
48
- ```
49
-
50
- Beta mode (`context_compression: beta` in project `.comet/config.yaml`, snapshotted into `.comet.yaml` when the change is created) generates:
51
-
52
- ```
53
- openspec/changes/<name>/.comet/handoff/spec-context.json
54
- openspec/changes/<name>/.comet/handoff/spec-context.md
55
- ```
56
-
57
- And writes to `.comet.yaml`:
58
-
59
- ```yaml
60
- handoff_context: openspec/changes/<name>/.comet/handoff/design-context.json
61
- handoff_hash: <sha256>
62
- ```
63
-
64
- The default handoff package is a **compact traceable excerpt**, not an agent summary:
65
- - `design-context.json`: machine index containing change, phase, canonical spec, source paths, hash
66
- - `design-context.md`: context for Superpowers to read, containing script markers, source path, line range, sha256, deterministic excerpts
67
- - When exceeding excerpt budget, marks `[TRUNCATED]` and retains Full source path
68
-
69
- The beta handoff package is a **structured spec projection** that reduces OpenSpec token load without replacing the canonical spec:
70
- - `spec-context.json`: machine index containing change, phase, canonical spec, source paths, hash, and file roles
71
- - `spec-context.md`: context for Superpowers to read, verbatim-projecting delta spec files and referencing supporting artifacts by hash
72
- - OpenSpec delta specs remain canonical; if the projection is missing, stale, or unclear, regenerate the handoff or read the source spec directly instead of writing an agent summary
73
-
74
- If full context is genuinely needed, explicitly run:
75
-
76
- ```bash
77
- "$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write --full
78
- ```
79
-
80
- Handoff package sources come from OpenSpec open phase artifacts:
81
- - `proposal.md`: goals, motivation, scope, non-goals
82
- - `design.md`: high-level architecture decisions, approach constraints
83
- - `tasks.md`: initial task boundaries
84
- - `specs/*/spec.md`: delta capability specs
85
-
86
- ### 1b. Execute Brainstorming (with Context)
87
-
88
- **Immediately execute:** Use the Skill tool to load the Superpowers `brainstorming` skill. Skipping this step is prohibited.
89
-
90
- When loading the skill, ARGUMENTS must include:
91
-
92
- ```text
93
- Language: Use the language of the user request that triggered this workflow
94
- ```
95
-
96
- After the skill loads, follow its guidance and use the following context:
97
-
98
- ```
99
- Change: <change-name>
100
- OpenSpec Context Pack: openspec/changes/<name>/.comet/handoff/design-context.md
101
- Machine handoff: openspec/changes/<name>/.comet/handoff/design-context.json
102
-
103
- If context_compression is beta, use:
104
- OpenSpec Context Pack: openspec/changes/<name>/.comet/handoff/spec-context.md
105
- Machine handoff: openspec/changes/<name>/.comet/handoff/spec-context.json
106
-
107
- OpenSpec artifacts are the upstream source of truth, but you must not weaken the Superpowers `brainstorming` clarification flow by "skipping redundant context exploration".
108
- Your task is to perform deep technical design based on the handoff package: implementation approach, technical risks, testing strategy, boundary conditions.
109
- If goals, scope, non-goals, acceptance scenarios, or key constraints remain unclear, you must continue asking questions and form the design proposal first; must not create the Design Doc after only one Q&A turn.
110
- Do not rewrite proposal/spec; if you find OpenSpec delta spec missing acceptance scenarios, you may only propose Spec Patches and write them back to OpenSpec delta spec; do not create a second requirements spec in the Design Doc. Spec Patches are limited to supplementing acceptance scenarios, correcting ambiguous descriptions, or adding boundary conditions — they must not substantially rewrite the delta spec's structure or scope. If major changes are needed, flag them as design findings and return to brainstorming for confirmation.
111
-
112
- Design Doc frontmatter must be minimal, containing only:
113
- ---
114
- comet_change: <change-name>
115
- role: technical-design
116
- canonical_spec: openspec
117
- ---
118
-
119
- Proceed through the original `brainstorming` skill flow: clarifying questions, 2-3 approaches, and step-by-step design confirmation. Do not write the Design Doc early.
120
- ```
121
-
122
- Proceeding without loading this skill is prohibited.
123
-
124
- If the Superpowers `brainstorming` skill is unavailable, stop the process and prompt to install or enable Superpowers skills. Do not substitute this step with normal conversation.
125
-
126
- After the skill loads, follow its guidance to produce design proposals (presented as conversation):
127
- - Technical approach: architecture, data flow, key technology choices and risks
128
- - Testing strategy
129
- - Requirement/scope gaps and Spec Patches to be written back
130
- - If acceptance scenarios need supplementing, indicate delta spec changes to be written back
131
-
132
- The brainstorming phase does not write to the Design Doc file; it only produces design proposals for Step 1c user confirmation. Only after confirmation should `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` be created and delta spec written back.
133
-
134
- For context compaction recovery, the agent must incrementally update `brainstorm-summary.md` during brainstorming. After each clarification round or proposal iteration, update the file whenever new confirmed facts, key constraints, candidate approaches, trade-offs/risks, testing strategy, or Spec Patch candidates emerge; mark unconfirmed items as "pending" or "candidate". This file is a recovery checkpoint, not the Design Doc, and must not replace the Step 1c user confirmation.
135
-
136
- ### 1c. User Confirms Design Proposal (Blocking Point)
137
-
138
- After brainstorming produces a design proposal, **must use the current platform's available user input/confirmation mechanism to pause and wait for the user to explicitly confirm the design proposal**. Must not create the final Design Doc, write `design_doc`, run design guard, or enter `/comet-build` before user confirmation. If the current platform has no structured question tool, ask a confirmation question in the conversation, stop the workflow, and wait for the user's reply before continuing.
139
-
140
- When pausing, only present essential summary:
141
- - Technical approach adopted
142
- - Key trade-offs and risks
143
- - Testing strategy
144
- - If there are Spec Patches, list the delta spec changes to be written back
145
-
146
- Only after the user explicitly confirms, proceed to Step 2. If the user requests adjustments, continue brainstorming iteration until the user confirms.
147
-
148
- ### 1d. Brainstorming Checkpoint Finalization
149
-
150
- 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:
151
-
152
- ```bash
153
- mkdir -p openspec/changes/<name>/.comet/handoff
154
- ```
155
-
156
- `openspec/changes/<name>/.comet/handoff/brainstorm-summary.md` structure:
157
-
158
- ```markdown
159
- # Brainstorm Summary
160
-
161
- - Change: <change-name>
162
- - Date: <YYYY-MM-DD>
163
-
164
- ## Confirmed Technical Approach
165
-
166
- <summary of the user-confirmed approach>
167
-
168
- ## Key Trade-offs and Risks
169
-
170
- <major trade-offs and risks>
171
-
172
- ## Testing Strategy
173
-
174
- <testing method overview>
175
-
176
- ## Spec Patches
177
-
178
- <delta spec changes to write back, or "None" if none>
179
- ```
180
-
181
- **Context compaction note**: Each incremental update to `brainstorm-summary.md` is a relatively safe recovery point. After brainstorming completes, if the context window is tight, prefer compacting here. After compaction, reload the following files to continue Step 2:
182
- - `openspec/changes/<name>/.comet/handoff/brainstorm-summary.md`
183
- - `openspec/changes/<name>/.comet/handoff/design-context.md` (or `spec-context.md` in beta mode)
184
- - `openspec/changes/<name>/.comet/handoff/design-context.json` (or `spec-context.json` in beta mode)
185
-
186
- ### 1e. Active Context Compaction Gate
187
-
188
- 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.
189
-
190
- Rules:
191
- - 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.
192
- - The compaction resume prompt must include the change name, current step (Design Step 2), and the three handoff file categories listed above.
193
- - 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.
194
-
195
- ### 2. Create Design Doc
196
-
197
- Create the Design Doc based on the full brainstorming conversation context (still in the main session).
198
-
199
- Design Doc frontmatter must be minimal:
200
-
201
- ```yaml
202
- ---
203
- comet_change: <change-name>
204
- role: technical-design
205
- canonical_spec: openspec
206
- ---
207
- ```
208
-
209
- Write the Design Doc to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`.
210
- If Spec Patches need to be written back, also edit the corresponding `specs/*/spec.md`.
211
-
212
- **Context compaction recovery**: If context has been compacted, resume from `brainstorm-summary.md` + handoff context. If the user has not confirmed the design proposal yet, return to Step 1b/1c and continue brainstorming; if the user has confirmed it, continue creating the Design Doc. brainstorm-summary.md is the compaction checkpoint, not the sole input for the Design Doc — when creating, leverage the full recovered context as much as possible.
213
-
214
- ### 3. Update Comet State
215
-
216
- First record the design_doc path. If Spec Patches wrote back delta spec (added or modified `specs/*/spec.md`), must regenerate handoff to update hash:
217
-
218
- ```bash
219
- # Record design_doc path
220
- "$COMET_BASH" "$COMET_STATE" set <name> design_doc docs/superpowers/specs/YYYY-MM-DD-topic-design.md
221
-
222
- # If delta spec changes exist, regenerate handoff (update hash)
223
- "$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write
224
-
225
- # Auto-transition to next phase
226
- "$COMET_BASH" "$COMET_GUARD" <change-name> design --apply
227
- ```
228
-
229
- If there are no delta spec changes, skip the handoff regeneration step. The state file updates automatically; no manual editing of other fields needed.
230
-
231
- ## Exit Conditions
232
-
233
- - Design Doc created and saved
234
- - Design Doc frontmatter contains `comet_change`, `role: technical-design`, `canonical_spec: openspec`
235
- - `handoff_context` and `handoff_hash` written to `.comet.yaml` (enforced by guard)
236
- - `handoff_hash` matches current OpenSpec open phase artifacts (enforced by guard)
237
- - `design-context.md` or beta `spec-context.md` must be script-generated and contain source path, mode, sha256 traceability markers (enforced by guard)
238
- - In beta mode, `spec-context.json` must be structurally valid and reference the current source files (enforced by guard)
239
- - If new capabilities or supplementary acceptance scenarios exist, OpenSpec delta spec has been created/updated
240
- - `design_doc` written to `.comet.yaml`
241
- - **Phase guard**: Run `"$COMET_BASH" "$COMET_GUARD" <change-name> design --apply`; after all PASS, auto-transitions to `phase: build`
242
-
243
- Must use `--apply` before exit:
244
-
245
- ```bash
246
- "$COMET_BASH" "$COMET_GUARD" <change-name> design --apply
247
- ```
248
-
249
- ## Context Compaction Recovery
250
-
251
- The design phase may trigger context compaction during brainstorming. To recover, first run:
252
-
253
- ```bash
254
- "$COMET_BASH" "$COMET_STATE" check <change-name> design --recover
255
- ```
256
-
257
- The script outputs structured recovery context (phase, completed fields, pending fields, recovery action). Follow the Recovery action to determine next step.
258
-
259
- ## Automatic Handoff to Next Phase
260
-
261
- > **Terminology distinction**: the "phase advancement" above is performed by guard `--apply`, which updates the `.comet.yaml` `phase` field. This step **always happens** and is not controlled by `auto_transition`. This section's "automatic handoff" only controls whether to automatically invoke the next skill.
262
-
263
- After guard-based phase advancement, run:
264
-
265
- ```bash
266
- "$COMET_BASH" "$COMET_STATE" next <change-name>
267
- ```
268
-
269
- The script determines the next action from `phase`, `workflow`, and `auto_transition`:
270
- - `NEXT: auto` -> invoke the `SKILL` target to continue to the next phase
271
- - `NEXT: manual` -> do not invoke the next skill; follow `HINT` and ask the user to run `/<SKILL>` manually
272
- - `NEXT: done` -> workflow is complete; no further action needed
1
+ ---
2
+ name: comet-design
3
+ description: "Comet Phase 2: Deep Design. Invoke with /comet-design. Produce Design Doc and delta spec through brainstorming."
4
+ ---
5
+
6
+ # Comet Phase 2: Deep Design (Design)
7
+
8
+ ## Prerequisites
9
+
10
+ - Active change exists (proposal.md, design.md, tasks.md)
11
+ - No Design Doc (no corresponding file under `docs/superpowers/specs/`)
12
+
13
+ ## Steps
14
+
15
+ ### 0. Entry State Verification (Entry Check)
16
+
17
+ Execute entry verification:
18
+
19
+ ```bash
20
+ COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
21
+ if [ -z "$COMET_ENV" ]; then
22
+ echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
23
+ return 1
24
+ fi
25
+ . "$COMET_ENV"
26
+ "$COMET_BASH" "$COMET_STATE" check <name> design
27
+ ```
28
+
29
+ Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
30
+
31
+ **Idempotency**: All design phase operations can be safely re-executed. If `handoff_context` and `handoff_hash` already exist, confirm they match current artifacts before deciding whether to regenerate.
32
+
33
+ ### 1a. Generate OpenSpec → Superpowers Handoff Package
34
+
35
+ **Must be generated by script. Agent writing summaries on the fly is not allowed.**
36
+
37
+ ```bash
38
+ "$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write
39
+ ```
40
+
41
+ The script reads the change `.comet.yaml` `context_compression` snapshot, then generates and records the matching handoff package.
42
+
43
+ Default `context_compression: off` generates:
44
+
45
+ ```
46
+ openspec/changes/<name>/.comet/handoff/design-context.json
47
+ openspec/changes/<name>/.comet/handoff/design-context.md
48
+ ```
49
+
50
+ Beta mode (`context_compression: beta` in project `.comet/config.yaml`, snapshotted into `.comet.yaml` when the change is created) generates:
51
+
52
+ ```
53
+ openspec/changes/<name>/.comet/handoff/spec-context.json
54
+ openspec/changes/<name>/.comet/handoff/spec-context.md
55
+ ```
56
+
57
+ And writes to `.comet.yaml`:
58
+
59
+ ```yaml
60
+ handoff_context: openspec/changes/<name>/.comet/handoff/design-context.json
61
+ handoff_hash: <sha256>
62
+ ```
63
+
64
+ The default handoff package is a **compact traceable excerpt**, not an agent summary:
65
+ - `design-context.json`: machine index containing change, phase, canonical spec, source paths, hash
66
+ - `design-context.md`: context for Superpowers to read, containing script markers, source path, line range, sha256, deterministic excerpts
67
+ - When exceeding excerpt budget, marks `[TRUNCATED]` and retains Full source path
68
+
69
+ The beta handoff package is a **structured spec projection** that reduces OpenSpec token load without replacing the canonical spec:
70
+ - `spec-context.json`: machine index containing change, phase, canonical spec, source paths, hash, and file roles
71
+ - `spec-context.md`: context for Superpowers to read, verbatim-projecting delta spec files and referencing supporting artifacts by hash
72
+ - OpenSpec delta specs remain canonical; if the projection is missing, stale, or unclear, regenerate the handoff or read the source spec directly instead of writing an agent summary
73
+
74
+ If full context is genuinely needed, explicitly run:
75
+
76
+ ```bash
77
+ "$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write --full
78
+ ```
79
+
80
+ Handoff package sources come from OpenSpec open phase artifacts:
81
+ - `proposal.md`: goals, motivation, scope, non-goals
82
+ - `design.md`: high-level architecture decisions, approach constraints
83
+ - `tasks.md`: initial task boundaries
84
+ - `specs/*/spec.md`: delta capability specs
85
+
86
+ ### 1b. Execute Brainstorming (with Context)
87
+
88
+ **Immediately execute:** Use the Skill tool to load the Superpowers `brainstorming` skill. Skipping this step is prohibited.
89
+
90
+ When loading the skill, ARGUMENTS must include:
91
+
92
+ ```text
93
+ Language: Use the language of the user request that triggered this workflow
94
+ ```
95
+
96
+ After the skill loads, follow its guidance and use the following context:
97
+
98
+ ```
99
+ Change: <change-name>
100
+ OpenSpec Context Pack: openspec/changes/<name>/.comet/handoff/design-context.md
101
+ Machine handoff: openspec/changes/<name>/.comet/handoff/design-context.json
102
+
103
+ If context_compression is beta, use:
104
+ OpenSpec Context Pack: openspec/changes/<name>/.comet/handoff/spec-context.md
105
+ Machine handoff: openspec/changes/<name>/.comet/handoff/spec-context.json
106
+
107
+ OpenSpec artifacts are the upstream source of truth, but you must not weaken the Superpowers `brainstorming` clarification flow by "skipping redundant context exploration".
108
+ Your task is to perform deep technical design based on the handoff package: implementation approach, technical risks, testing strategy, boundary conditions.
109
+ If goals, scope, non-goals, acceptance scenarios, or key constraints remain unclear, you must continue asking questions and form the design proposal first; must not create the Design Doc after only one Q&A turn.
110
+ Do not rewrite proposal/spec; if you find OpenSpec delta spec missing acceptance scenarios, you may only propose Spec Patches and write them back to OpenSpec delta spec; do not create a second requirements spec in the Design Doc. Spec Patches are limited to supplementing acceptance scenarios, correcting ambiguous descriptions, or adding boundary conditions — they must not substantially rewrite the delta spec's structure or scope. If major changes are needed, flag them as design findings and return to brainstorming for confirmation.
111
+
112
+ Design Doc frontmatter must be minimal, containing only:
113
+ ---
114
+ comet_change: <change-name>
115
+ role: technical-design
116
+ canonical_spec: openspec
117
+ ---
118
+
119
+ Proceed through the original `brainstorming` skill flow: clarifying questions, 2-3 approaches, and step-by-step design confirmation. Do not write the Design Doc early.
120
+ ```
121
+
122
+ Proceeding without loading this skill is prohibited.
123
+
124
+ If the Superpowers `brainstorming` skill is unavailable, stop the process and prompt to install or enable Superpowers skills. Do not substitute this step with normal conversation.
125
+
126
+ After the skill loads, follow its guidance to produce design proposals (presented as conversation):
127
+ - Technical approach: architecture, data flow, key technology choices and risks
128
+ - Testing strategy
129
+ - Requirement/scope gaps and Spec Patches to be written back
130
+ - If acceptance scenarios need supplementing, indicate delta spec changes to be written back
131
+
132
+ The brainstorming phase does not write to the Design Doc file; it only produces design proposals for Step 1c user confirmation. Only after confirmation should `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` be created and delta spec written back.
133
+
134
+ For context compaction recovery, the agent must incrementally update `brainstorm-summary.md` during brainstorming. After each clarification round or proposal iteration, update the file whenever new confirmed facts, key constraints, candidate approaches, trade-offs/risks, testing strategy, or Spec Patch candidates emerge; mark unconfirmed items as "pending" or "candidate". This file is a recovery checkpoint, not the Design Doc, and must not replace the Step 1c user confirmation.
135
+
136
+ ### 1c. User Confirms Design Proposal (Blocking Point)
137
+
138
+ After brainstorming produces a design proposal, **must follow the `comet/reference/decision-point.md` protocol to pause and wait for the user to explicitly confirm the design proposal**. Must not create the final Design Doc, write `design_doc`, run design guard, or enter `/comet-build` before user confirmation.
139
+
140
+ When pausing, only present essential summary:
141
+ - Technical approach adopted
142
+ - Key trade-offs and risks
143
+ - Testing strategy
144
+ - If there are Spec Patches, list the delta spec changes to be written back
145
+
146
+ Only after the user explicitly confirms, proceed to Step 2. If the user requests adjustments, continue brainstorming iteration until the user confirms.
147
+
148
+ ### 1d. Brainstorming Checkpoint Finalization
149
+
150
+ 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:
151
+
152
+ ```bash
153
+ mkdir -p openspec/changes/<name>/.comet/handoff
154
+ ```
155
+
156
+ `openspec/changes/<name>/.comet/handoff/brainstorm-summary.md` structure:
157
+
158
+ ```markdown
159
+ # Brainstorm Summary
160
+
161
+ - Change: <change-name>
162
+ - Date: <YYYY-MM-DD>
163
+
164
+ ## Confirmed Technical Approach
165
+
166
+ <summary of the user-confirmed approach>
167
+
168
+ ## Key Trade-offs and Risks
169
+
170
+ <major trade-offs and risks>
171
+
172
+ ## Testing Strategy
173
+
174
+ <testing method overview>
175
+
176
+ ## Spec Patches
177
+
178
+ <delta spec changes to write back, or "None" if none>
179
+ ```
180
+
181
+ **Context compaction note**: Each incremental update to `brainstorm-summary.md` is a relatively safe recovery point. After brainstorming completes, if the context window is tight, prefer compacting here. After compaction, reload the following files to continue Step 2:
182
+ - `openspec/changes/<name>/.comet/handoff/brainstorm-summary.md`
183
+ - `openspec/changes/<name>/.comet/handoff/design-context.md` (or `spec-context.md` in beta mode)
184
+ - `openspec/changes/<name>/.comet/handoff/design-context.json` (or `spec-context.json` in beta mode)
185
+
186
+ ### 1e. Active Context Compaction Gate
187
+
188
+ 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.
189
+
190
+ Rules:
191
+ - 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.
192
+ - The compaction resume prompt must include the change name, current step (Design Step 2), and the three handoff file categories listed above.
193
+ - 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.
194
+
195
+ ### 2. Create Design Doc
196
+
197
+ Create the Design Doc based on the full brainstorming conversation context (still in the main session).
198
+
199
+ Design Doc frontmatter must be minimal:
200
+
201
+ ```yaml
202
+ ---
203
+ comet_change: <change-name>
204
+ role: technical-design
205
+ canonical_spec: openspec
206
+ ---
207
+ ```
208
+
209
+ Write the Design Doc to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`.
210
+ If Spec Patches need to be written back, also edit the corresponding `specs/*/spec.md`.
211
+
212
+ **Context compaction recovery**: If context has been compacted, resume from `brainstorm-summary.md` + handoff context. If the user has not confirmed the design proposal yet, return to Step 1b/1c and continue brainstorming; if the user has confirmed it, continue creating the Design Doc. brainstorm-summary.md is the compaction checkpoint, not the sole input for the Design Doc — when creating, leverage the full recovered context as much as possible.
213
+
214
+ ### 3. Update Comet State
215
+
216
+ First record the design_doc path. If Spec Patches wrote back delta spec (added or modified `specs/*/spec.md`), must regenerate handoff to update hash:
217
+
218
+ ```bash
219
+ # Record design_doc path
220
+ "$COMET_BASH" "$COMET_STATE" set <name> design_doc docs/superpowers/specs/YYYY-MM-DD-topic-design.md
221
+
222
+ # If delta spec changes exist, regenerate handoff (update hash)
223
+ "$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write
224
+
225
+ # Auto-transition to next phase
226
+ "$COMET_BASH" "$COMET_GUARD" <change-name> design --apply
227
+ ```
228
+
229
+ If there are no delta spec changes, skip the handoff regeneration step. The state file updates automatically; no manual editing of other fields needed.
230
+
231
+ ## Exit Conditions
232
+
233
+ - Design Doc created and saved
234
+ - Design Doc frontmatter contains `comet_change`, `role: technical-design`, `canonical_spec: openspec`
235
+ - `handoff_context` and `handoff_hash` written to `.comet.yaml` (enforced by guard)
236
+ - `handoff_hash` matches current OpenSpec open phase artifacts (enforced by guard)
237
+ - `design-context.md` or beta `spec-context.md` must be script-generated and contain source path, mode, sha256 traceability markers (enforced by guard)
238
+ - In beta mode, `spec-context.json` must be structurally valid and reference the current source files (enforced by guard)
239
+ - If new capabilities or supplementary acceptance scenarios exist, OpenSpec delta spec has been created/updated
240
+ - `design_doc` written to `.comet.yaml`
241
+ - **Phase guard**: Run `"$COMET_BASH" "$COMET_GUARD" <change-name> design --apply`; after all PASS, auto-transitions to `phase: build`
242
+
243
+ Must use `--apply` before exit:
244
+
245
+ ```bash
246
+ "$COMET_BASH" "$COMET_GUARD" <change-name> design --apply
247
+ ```
248
+
249
+ ## Context Compression Recovery
250
+
251
+ Follow `comet/reference/context-recovery.md` with phase set to `design`.
252
+
253
+ ## Automatic Handoff to Next Phase
254
+
255
+ Follow `comet/reference/auto-transition.md`. Key command:
256
+
257
+ ```bash
258
+ "$COMET_BASH" "$COMET_STATE" next <change-name>
259
+ ```
260
+
261
+ - `NEXT: auto` invoke the skill pointed to by `SKILL` to enter the next phase
262
+ - `NEXT: manual` → do not invoke the next skill; prompt user to run `/<SKILL>` manually
263
+ - `NEXT: done` → workflow is complete, no further action needed