@rpamis/comet 0.3.5 → 0.3.7
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.
- package/LICENSE +21 -21
- package/README.md +180 -56
- package/assets/manifest.json +11 -1
- package/assets/skills/comet/SKILL.md +59 -24
- package/assets/skills/comet/reference/dirty-worktree.md +1 -0
- package/assets/skills/comet/rules/comet-phase-guard.md +90 -0
- package/assets/skills/comet/scripts/comet-archive.sh +75 -57
- package/assets/skills/comet/scripts/comet-env.sh +57 -2
- package/assets/skills/comet/scripts/comet-guard.sh +187 -29
- package/assets/skills/comet/scripts/comet-handoff.sh +137 -8
- package/assets/skills/comet/scripts/comet-hook-guard.sh +260 -0
- package/assets/skills/comet/scripts/comet-state.sh +312 -25
- package/assets/skills/comet/scripts/comet-yaml-validate.sh +26 -1
- package/assets/skills/comet-archive/SKILL.md +45 -12
- package/assets/skills/comet-build/SKILL.md +159 -33
- package/assets/skills/comet-design/SKILL.md +129 -23
- package/assets/skills/comet-hotfix/SKILL.md +57 -15
- package/assets/skills/comet-open/SKILL.md +90 -17
- package/assets/skills/comet-tweak/SKILL.md +40 -15
- package/assets/skills/comet-verify/SKILL.md +64 -25
- package/assets/skills-zh/comet/SKILL.md +63 -25
- package/assets/skills-zh/comet/reference/dirty-worktree.md +2 -1
- package/assets/skills-zh/comet-archive/SKILL.md +46 -13
- package/assets/skills-zh/comet-build/SKILL.md +161 -35
- package/assets/skills-zh/comet-design/SKILL.md +132 -25
- package/assets/skills-zh/comet-hotfix/SKILL.md +53 -15
- package/assets/skills-zh/comet-open/SKILL.md +90 -17
- package/assets/skills-zh/comet-tweak/SKILL.md +36 -15
- package/assets/skills-zh/comet-verify/SKILL.md +64 -27
- package/bin/comet.js +3 -3
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +22 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +5 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +64 -9
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +60 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/core/codegraph.d.ts +9 -0
- package/dist/core/codegraph.d.ts.map +1 -0
- package/dist/core/codegraph.js +96 -0
- package/dist/core/codegraph.js.map +1 -0
- package/dist/core/platforms.d.ts +10 -0
- package/dist/core/platforms.d.ts.map +1 -1
- package/dist/core/platforms.js +163 -15
- package/dist/core/platforms.js.map +1 -1
- package/dist/core/skills.d.ts +34 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +360 -1
- package/dist/core/skills.js.map +1 -1
- package/package.json +3 -1
- package/scripts/postinstall.js +44 -44
|
@@ -23,7 +23,7 @@ if [ -z "$COMET_ENV" ]; then
|
|
|
23
23
|
return 1
|
|
24
24
|
fi
|
|
25
25
|
. "$COMET_ENV"
|
|
26
|
-
|
|
26
|
+
"$COMET_BASH" "$COMET_STATE" check <name> design
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
|
|
@@ -35,16 +35,25 @@ Proceed to Step 1 after verification passes. The script outputs specific failure
|
|
|
35
35
|
**Must be generated by script. Agent writing summaries on the fly is not allowed.**
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
|
|
38
|
+
"$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
The script generates and records
|
|
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:
|
|
42
44
|
|
|
43
45
|
```
|
|
44
46
|
openspec/changes/<name>/.comet/handoff/design-context.json
|
|
45
47
|
openspec/changes/<name>/.comet/handoff/design-context.md
|
|
46
48
|
```
|
|
47
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
|
+
|
|
48
57
|
And writes to `.comet.yaml`:
|
|
49
58
|
|
|
50
59
|
```yaml
|
|
@@ -57,10 +66,15 @@ The default handoff package is a **compact traceable excerpt**, not an agent sum
|
|
|
57
66
|
- `design-context.md`: context for Superpowers to read, containing script markers, source path, line range, sha256, deterministic excerpts
|
|
58
67
|
- When exceeding excerpt budget, marks `[TRUNCATED]` and retains Full source path
|
|
59
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
|
+
|
|
60
74
|
If full context is genuinely needed, explicitly run:
|
|
61
75
|
|
|
62
76
|
```bash
|
|
63
|
-
|
|
77
|
+
"$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write --full
|
|
64
78
|
```
|
|
65
79
|
|
|
66
80
|
Handoff package sources come from OpenSpec open phase artifacts:
|
|
@@ -71,16 +85,29 @@ Handoff package sources come from OpenSpec open phase artifacts:
|
|
|
71
85
|
|
|
72
86
|
### 1b. Execute Brainstorming (with Context)
|
|
73
87
|
|
|
74
|
-
**Immediately execute:** Use the Skill tool to load the `
|
|
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:
|
|
75
97
|
|
|
76
98
|
```
|
|
77
99
|
Change: <change-name>
|
|
78
100
|
OpenSpec Context Pack: openspec/changes/<name>/.comet/handoff/design-context.md
|
|
79
101
|
Machine handoff: openspec/changes/<name>/.comet/handoff/design-context.json
|
|
80
102
|
|
|
81
|
-
|
|
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".
|
|
82
108
|
Your task is to perform deep technical design based on the handoff package: implementation approach, technical risks, testing strategy, boundary conditions.
|
|
83
|
-
If
|
|
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.
|
|
84
111
|
|
|
85
112
|
Design Doc frontmatter must be minimal, containing only:
|
|
86
113
|
---
|
|
@@ -89,23 +116,26 @@ role: technical-design
|
|
|
89
116
|
canonical_spec: openspec
|
|
90
117
|
---
|
|
91
118
|
|
|
92
|
-
|
|
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.
|
|
93
120
|
```
|
|
94
121
|
|
|
95
|
-
|
|
122
|
+
Proceeding without loading this skill is prohibited.
|
|
96
123
|
|
|
97
|
-
If `
|
|
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.
|
|
98
125
|
|
|
99
126
|
After the skill loads, follow its guidance to produce design proposals (presented as conversation):
|
|
100
127
|
- Technical approach: architecture, data flow, key technology choices and risks
|
|
101
128
|
- Testing strategy
|
|
129
|
+
- Requirement/scope gaps and Spec Patches to be written back
|
|
102
130
|
- If acceptance scenarios need supplementing, indicate delta spec changes to be written back
|
|
103
131
|
|
|
104
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.
|
|
105
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
|
+
|
|
106
136
|
### 1c. User Confirms Design Proposal (Blocking Point)
|
|
107
137
|
|
|
108
|
-
After brainstorming produces a design proposal, **must use the
|
|
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.
|
|
109
139
|
|
|
110
140
|
When pausing, only present essential summary:
|
|
111
141
|
- Technical approach adopted
|
|
@@ -115,19 +145,85 @@ When pausing, only present essential summary:
|
|
|
115
145
|
|
|
116
146
|
Only after the user explicitly confirms, proceed to Step 2. If the user requests adjustments, continue brainstorming iteration until the user confirms.
|
|
117
147
|
|
|
118
|
-
###
|
|
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>
|
|
119
175
|
|
|
120
|
-
|
|
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:
|
|
121
217
|
|
|
122
218
|
```bash
|
|
123
219
|
# Record design_doc path
|
|
124
|
-
|
|
220
|
+
"$COMET_BASH" "$COMET_STATE" set <name> design_doc docs/superpowers/specs/YYYY-MM-DD-topic-design.md
|
|
125
221
|
|
|
126
222
|
# If delta spec changes exist, regenerate handoff (update hash)
|
|
127
|
-
|
|
223
|
+
"$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write
|
|
128
224
|
|
|
129
225
|
# Auto-transition to next phase
|
|
130
|
-
|
|
226
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> design --apply
|
|
131
227
|
```
|
|
132
228
|
|
|
133
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.
|
|
@@ -138,15 +234,16 @@ If there are no delta spec changes, skip the handoff regeneration step. The stat
|
|
|
138
234
|
- Design Doc frontmatter contains `comet_change`, `role: technical-design`, `canonical_spec: openspec`
|
|
139
235
|
- `handoff_context` and `handoff_hash` written to `.comet.yaml` (enforced by guard)
|
|
140
236
|
- `handoff_hash` matches current OpenSpec open phase artifacts (enforced by guard)
|
|
141
|
-
- `design-context.md` must be script-generated and contain source path, mode, sha256 traceability markers (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)
|
|
142
239
|
- If new capabilities or supplementary acceptance scenarios exist, OpenSpec delta spec has been created/updated
|
|
143
240
|
- `design_doc` written to `.comet.yaml`
|
|
144
|
-
- **Phase guard**: Run `
|
|
241
|
+
- **Phase guard**: Run `"$COMET_BASH" "$COMET_GUARD" <change-name> design --apply`; after all PASS, auto-transitions to `phase: build`
|
|
145
242
|
|
|
146
243
|
Must use `--apply` before exit:
|
|
147
244
|
|
|
148
245
|
```bash
|
|
149
|
-
|
|
246
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> design --apply
|
|
150
247
|
```
|
|
151
248
|
|
|
152
249
|
## Context Compaction Recovery
|
|
@@ -154,13 +251,22 @@ bash "$COMET_GUARD" <change-name> design --apply
|
|
|
154
251
|
The design phase may trigger context compaction during brainstorming. To recover, first run:
|
|
155
252
|
|
|
156
253
|
```bash
|
|
157
|
-
|
|
254
|
+
"$COMET_BASH" "$COMET_STATE" check <change-name> design --recover
|
|
158
255
|
```
|
|
159
256
|
|
|
160
257
|
The script outputs structured recovery context (phase, completed fields, pending fields, recovery action). Follow the Recovery action to determine next step.
|
|
161
258
|
|
|
162
|
-
## Automatic
|
|
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.
|
|
163
262
|
|
|
164
|
-
After
|
|
263
|
+
After guard-based phase advancement, run:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
"$COMET_BASH" "$COMET_STATE" next <change-name>
|
|
267
|
+
```
|
|
165
268
|
|
|
166
|
-
|
|
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
|
|
@@ -16,9 +16,13 @@ Quick bug fix workflow: open → build → verify → archive. Skip brainstormin
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
## Process (preset workflow,
|
|
19
|
+
## Process (preset workflow, 6 steps)
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
### 0. Output Language Constraint
|
|
22
|
+
|
|
23
|
+
Streamlined OpenSpec artifacts must use the language of the user request that triggered this workflow.
|
|
24
|
+
|
|
25
|
+
Execution chain: open → build → root cause check → verify → archive. Hotfix provides default decisions for each phase: streamlined open, direct build, root cause confirmation, scale-based verification, and final archive confirmation after verification passes.
|
|
22
26
|
|
|
23
27
|
Locate Comet scripts before starting:
|
|
24
28
|
|
|
@@ -46,24 +50,33 @@ After the skill loads, follow its guidance to create streamlined artifacts:
|
|
|
46
50
|
Initialize Comet state file:
|
|
47
51
|
|
|
48
52
|
```bash
|
|
49
|
-
|
|
53
|
+
"$COMET_BASH" "$COMET_STATE" init <name> hotfix
|
|
50
54
|
```
|
|
51
55
|
|
|
52
56
|
Verify initialized state:
|
|
53
57
|
|
|
54
58
|
```bash
|
|
55
|
-
|
|
59
|
+
"$COMET_BASH" "$COMET_STATE" check <name> open
|
|
56
60
|
```
|
|
57
61
|
|
|
58
62
|
Run phase guard to transition open → build:
|
|
59
63
|
|
|
60
64
|
```bash
|
|
61
|
-
|
|
65
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> open --apply
|
|
62
66
|
```
|
|
63
67
|
|
|
68
|
+
Check `auto_transition` to decide whether to continue:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
"$COMET_BASH" "$COMET_STATE" next <name>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- `NEXT: auto` → continue to Step 2
|
|
75
|
+
- `NEXT: manual` → pause, follow `HINT` to prompt user to run `/<SKILL>` manually
|
|
76
|
+
|
|
64
77
|
### 2. Direct Build (preset build)
|
|
65
78
|
|
|
66
|
-
Use hotfix defaults: `build_mode: direct`. Skip `
|
|
79
|
+
Use hotfix defaults: `build_mode: direct`. Skip Superpowers `brainstorming` and `writing-plans` (unless tasks > 3; if exceeds 3 tasks, transfer to `/comet-build`'s plan and execution method selection — note this does NOT trigger full workflow upgrade, only switches execution method).
|
|
67
80
|
|
|
68
81
|
Before continuing or starting changes, handle uncommitted changes through `comet/reference/dirty-worktree.md`. If attribution shows the fix scope exceeds hotfix, handle it through this file's "Upgrade Conditions".
|
|
69
82
|
|
|
@@ -82,6 +95,14 @@ Before continuing or starting changes, handle uncommitted changes through `comet
|
|
|
82
95
|
- Create delta spec in `openspec/changes/<name>/specs/<capability>/spec.md`
|
|
83
96
|
- Only include `## MODIFIED Requirements` section
|
|
84
97
|
|
|
98
|
+
During hotfix execution, whenever a crash, unexpected behavior, test failure, or build failure appears while running the program, tests, build, or manual verification, must use the Skill tool to load the Superpowers `systematic-debugging` skill. Before root-cause investigation is complete, must not propose or implement source-code fixes.
|
|
99
|
+
|
|
100
|
+
Handle it using the four-phase `systematic-debugging` flow:
|
|
101
|
+
- First reproduce and locate the root cause, read full errors, check recent changes, and trace data flow
|
|
102
|
+
- If root cause points to a source bug, first add a minimal failing test that reproduces the crash or unexpected behavior, then modify source code
|
|
103
|
+
- After the fix, run that failing test, related tests, and project build/verification commands to confirm all pass
|
|
104
|
+
- Keep the test, source fix, and tasks.md checkoff inside the current change; must not replace the current change verification loop by starting a separate "write test cases" change
|
|
105
|
+
|
|
85
106
|
### 3. Root Cause Elimination Check
|
|
86
107
|
|
|
87
108
|
**Execute before running build guard**, ensuring the fix actually eliminates the root cause:
|
|
@@ -97,7 +118,7 @@ Before continuing or starting changes, handle uncommitted changes through `comet
|
|
|
97
118
|
After root cause is confirmed eliminated, run phase guard to transition build → verify:
|
|
98
119
|
|
|
99
120
|
```bash
|
|
100
|
-
|
|
121
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> build --apply
|
|
101
122
|
```
|
|
102
123
|
|
|
103
124
|
State automatically updates to `phase: verify`, `verify_result: pending`, then enter verification.
|
|
@@ -110,11 +131,11 @@ Reuse `/comet-verify`, with comet-verify's scale assessment deciding lightweight
|
|
|
110
131
|
|
|
111
132
|
Small-scale hotfixes without delta spec usually meet lightweight verification conditions (≤ 3 tasks, ≤ 2 files), comet-verify's scale assessment will select lightweight verification path (5 quick checks). If hotfix created delta spec, enter full verification path according to comet-verify's scale assessment rules.
|
|
112
133
|
|
|
113
|
-
After verification passes, record `.comet.yaml` `verify_result` as `pass` according to `/comet-verify` rules, must not skip this status before archiving.
|
|
134
|
+
After verification passes, record `.comet.yaml` `verify_result` as `pass` according to `/comet-verify` rules, must not skip this status before archiving. After verification passes, still enter `/comet-archive`'s final archive confirmation; do not automatically run the archive script.
|
|
114
135
|
|
|
115
136
|
### 5. Archive (preset archive)
|
|
116
137
|
|
|
117
|
-
Reuse `/comet-archive`. Must satisfy `verify_result: pass` in `.comet.yaml` before archiving.
|
|
138
|
+
Reuse `/comet-archive`. Must satisfy `verify_result: pass` in `.comet.yaml` before archiving, and wait for `/comet-archive`'s final archive confirmation.
|
|
118
139
|
|
|
119
140
|
**Immediately execute:** Use the Skill tool to load the `comet-archive` skill to archive. Skipping this step is prohibited.
|
|
120
141
|
If there is delta spec, sync to main spec according to comet-archive rules, and handle associated Design Doc and Plan archiving annotations.
|
|
@@ -124,11 +145,16 @@ If there is delta spec, sync to main spec according to comet-archive rules, and
|
|
|
124
145
|
## Continuous Execution Mode
|
|
125
146
|
|
|
126
147
|
<IMPORTANT>
|
|
127
|
-
Hotfix workflow is **one-time continuous execution**. After invoking `/comet-hotfix`, agent must automatically advance through hotfix steps, without pausing to wait for user input mid-way.
|
|
148
|
+
Hotfix workflow is **one-time continuous execution**. After invoking `/comet-hotfix`, agent must automatically advance through hotfix steps, without pausing to wait for user input mid-way.
|
|
128
149
|
|
|
129
|
-
|
|
150
|
+
Exception: when `.comet.yaml` has `auto_transition: false`, after each phase guard advances `phase`, do not auto-invoke the next skill. In this case, use `"$COMET_BASH" "$COMET_STATE" next <name>` output and pause for manual continuation as instructed.
|
|
151
|
+
|
|
152
|
+
The following situations must also pause and wait for user confirmation:
|
|
153
|
+
|
|
154
|
+
1. Encountering upgrade conditions (see "Upgrade Conditions" section). **Must use the current platform's available user input/confirmation mechanism to pause and wait for the user to explicitly confirm** upgrading to full workflow
|
|
130
155
|
2. workspace isolation and execution-method selection when tasks exceed 3 and transfer to `/comet-build`
|
|
131
156
|
3. verify phase (comet-verify) verification-failure and branch-handling decisions
|
|
157
|
+
4. Final archive confirmation (before comet-archive runs the archive script)
|
|
132
158
|
|
|
133
159
|
Execution order: quick open → direct build → root cause check → verification → archive → complete
|
|
134
160
|
|
|
@@ -149,12 +175,13 @@ Upgrade to full `/comet` when **any** of the following conditions are met:
|
|
|
149
175
|
| Introduces new public API | Fix creates new external interface |
|
|
150
176
|
| Fix scope exceeds single function/module | Requires coordinated changes |
|
|
151
177
|
|
|
152
|
-
When upgrade conditions are met, **must use the
|
|
178
|
+
When upgrade conditions are met, **must use the current platform's available user input/confirmation mechanism to pause and wait for the user to explicitly confirm** upgrading to the full `/comet` workflow. Do not directly enter `/comet-design`, and do not automatically supplement Design Doc. If the current platform has no structured question tool, ask an upgrade confirmation question in the conversation, stop the workflow, and wait for the user's reply before continuing.
|
|
153
179
|
|
|
154
|
-
After user confirms upgrade, **must first update the workflow
|
|
180
|
+
After user confirms upgrade, **must first update the workflow and phase fields** before entering full flow:
|
|
155
181
|
|
|
156
182
|
```bash
|
|
157
|
-
|
|
183
|
+
"$COMET_BASH" "$COMET_STATE" set <name> workflow full
|
|
184
|
+
"$COMET_BASH" "$COMET_STATE" set <name> phase design
|
|
158
185
|
```
|
|
159
186
|
|
|
160
187
|
Then on current change basis, supplement Design Doc: **Immediately use the Skill tool to load the `comet-design` skill**, proceed normally with full workflow. If user does not confirm upgrade, stop hotfix and report that current change has exceeded hotfix scope.
|
|
@@ -166,4 +193,19 @@ Then on current change basis, supplement Design Doc: **Immediately use the Skill
|
|
|
166
193
|
- Bug fixed, tests pass
|
|
167
194
|
- Change archived
|
|
168
195
|
- If spec changes, synced to main spec
|
|
169
|
-
- **Phase guard**: Before build → verify run `
|
|
196
|
+
- **Phase guard**: Before build → verify run `"$COMET_BASH" "$COMET_GUARD" <change-name> build --apply`; before verify → archive follow `/comet-verify` and run `"$COMET_BASH" "$COMET_GUARD" <change-name> verify --apply`
|
|
197
|
+
|
|
198
|
+
## Automatic Handoff to Next Phase
|
|
199
|
+
|
|
200
|
+
> **Terminology distinction**: phase guard `--apply` advances 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.
|
|
201
|
+
|
|
202
|
+
After each phase guard or state transition advances phase, run:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
"$COMET_BASH" "$COMET_STATE" next <name>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
The script determines the next action from `phase`, `workflow`, and `auto_transition`:
|
|
209
|
+
- `NEXT: auto` -> invoke the `SKILL` target to continue the hotfix flow (`phase: build` returns `comet-hotfix`, `verify` returns `comet-verify`, `archive` returns `comet-archive`)
|
|
210
|
+
- `NEXT: manual` -> do not invoke the next skill; follow `HINT` and ask the user to run `/<SKILL>` manually
|
|
211
|
+
- `NEXT: done` -> workflow is complete; no further action needed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: comet-open
|
|
3
|
-
description: "Comet Phase 1: Open. Invoke with /comet-open. Explore ideas through OpenSpec, create change structure (proposal + design + tasks)."
|
|
3
|
+
description: "Comet Phase 1: Open. Invoke with /comet-open. Explore ideas through OpenSpec, confirm requirements clarification, then create change structure (proposal + design + tasks)."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Comet Phase 1: Open
|
|
@@ -11,17 +11,81 @@ description: "Comet Phase 1: Open. Invoke with /comet-open. Explore ideas throug
|
|
|
11
11
|
|
|
12
12
|
## Steps
|
|
13
13
|
|
|
14
|
-
###
|
|
14
|
+
### 0. Output Language Constraint
|
|
15
|
+
|
|
16
|
+
Every prompt and artifact request passed to OpenSpec must include the output-language constraint: use the language of the user request that triggered this workflow. When resuming an existing change with a clear dominant artifact language, preserve that language unless the user explicitly asks to switch.
|
|
17
|
+
|
|
18
|
+
### 1. Explore Ideas and Clarify Requirements
|
|
15
19
|
|
|
16
20
|
**Immediately execute:** Use the Skill tool to load the `openspec-explore` skill. Skipping this step is prohibited.
|
|
17
21
|
|
|
18
|
-
After the skill loads,
|
|
22
|
+
After the skill loads, explore the problem space following its guidance, but do not treat one Q&A turn as sufficient clarification. You must continue asking, align with the user, and form a clarification summary covering:
|
|
23
|
+
- Goals: the problem the user truly wants to solve and the expected outcome
|
|
24
|
+
- Non-goals: what is explicitly out of scope for this change
|
|
25
|
+
- Scope boundaries: included/excluded modules, users, platforms, or data
|
|
26
|
+
- Key unknowns: unresolved assumptions, risks, or dependencies
|
|
27
|
+
- Draft acceptance scenarios: at least the core success scenario and important boundary scenarios
|
|
28
|
+
|
|
29
|
+
The clarification summary must include: goals, non-goals, scope boundaries, key unknowns, and draft acceptance scenarios.
|
|
30
|
+
|
|
31
|
+
### 1a. PRD Split Preflight (Blocking Point)
|
|
32
|
+
|
|
33
|
+
When the user input is a large PRD, roadmap, complete product plan, or the clarification summary shows multiple independent capabilities, modules, user journeys, or milestones, must evaluate whether it should be split into multiple changes before creating OpenSpec artifacts.
|
|
34
|
+
|
|
35
|
+
The split preflight must be based on clarified information and output a proposed split list. Each proposed split item must include:
|
|
36
|
+
- Suggested change name
|
|
37
|
+
- Goals and scope boundaries
|
|
38
|
+
- Explicit non-goals
|
|
39
|
+
- Dependencies or recommended execution order
|
|
40
|
+
- Core acceptance scenarios
|
|
41
|
+
|
|
42
|
+
Recommend splitting when any condition applies:
|
|
43
|
+
- The PRD contains multiple capabilities that can be independently designed, built, verified, and archived
|
|
44
|
+
- Multiple modules or user journeys are involved, and part of them can be delivered independently
|
|
45
|
+
- Clear phased milestones exist
|
|
46
|
+
- The work is expected to produce multiple delta specs or more than 3 large tasks
|
|
47
|
+
- Failure or delay in one part should not block other parts from entering later phases
|
|
48
|
+
|
|
49
|
+
When splitting is recommended, must use the current platform's available user input/confirmation mechanism to pause and wait for the user's choice. If the current platform has no structured question tool, ask an equivalent single-select question in the conversation, stop the workflow, and wait for the user's reply before continuing.
|
|
50
|
+
|
|
51
|
+
The user choices must include:
|
|
52
|
+
- "Create multiple OpenSpec changes" — create independent changes from the proposed split
|
|
53
|
+
- "Keep everything as one change" — continue the single-change flow and record the reason for not splitting in proposal/design/tasks
|
|
54
|
+
- "Adjust the split plan before continuing" — after the user describes the adjustment, output the revised proposed split list and ask for confirmation again
|
|
55
|
+
|
|
56
|
+
Every accepted split item must be created as an independent change through `/comet-open`, not by calling `/opsx:new` directly. `/comet-open` creates both OpenSpec artifacts and `.comet.yaml`, ensuring each change enters the Comet state machine.
|
|
57
|
+
|
|
58
|
+
Must not create proposal.md, design.md, or tasks.md before the user completes the PRD split choice. If the user chooses to create multiple changes, the current `/comet-open` invocation only completes split confirmation and coordination, then enters `/comet-open` for each split item in the user-confirmed order.
|
|
59
|
+
|
|
60
|
+
In batch split mode, entering `/comet-open` for each split item must explicitly mark it as a "confirmed split item" and carry that split item's goals, scope, non-goals, and acceptance scenarios. Confirmed split items skip the PRD split preflight by default, unless the split item itself still clearly contains multiple independent capabilities.
|
|
61
|
+
|
|
62
|
+
In batch split mode, a single split item must not auto-advance to `/comet-design` after completing the open phase. After splitting is complete, must pause and ask the user which change to start; after the user chooses, advance only that change into `/comet-design`, while other changes remain active and can be resumed later through `/comet`.
|
|
63
|
+
|
|
64
|
+
Minimal resume rule: do not add a dedicated batch state file. On resume, first check already-created active changes; split items that already exist and contain `.comet.yaml` must not be created again, while uncreated split items continue through `/comet-open` according to the user-confirmed split list. If the confirmed split list cannot be recovered from the conversation, must ask the user to confirm the split list again before continuing.
|
|
65
|
+
|
|
66
|
+
### 1b. Requirements Clarification Completion Confirmation (Blocking Point)
|
|
67
|
+
|
|
68
|
+
Before creating OpenSpec artifacts, must use the current platform's available user input/confirmation mechanism to pause and wait for the user to confirm requirements clarification is complete. If the current platform has no structured question tool, present the clarification summary in the conversation, ask a confirmation question, stop the workflow, and wait for the user's reply before continuing.
|
|
69
|
+
|
|
70
|
+
When pausing, present the clarification summary: goals, non-goals, scope boundaries, key unknowns, and draft acceptance scenarios.
|
|
71
|
+
|
|
72
|
+
Must not create proposal.md, design.md, or tasks.md before the user confirms requirements clarification is complete, and must not use the Skill tool to load the `openspec-propose` skill to generate all artifacts in one pass.
|
|
19
73
|
|
|
20
74
|
### 2. Create Change Structure + Initialize State
|
|
21
75
|
|
|
22
|
-
**Immediately execute:** Use the Skill tool to load the `openspec-new-change` skill.
|
|
76
|
+
**Immediately execute:** Use the Skill tool to load the `openspec-new-change` skill. Skipping this step is prohibited.
|
|
77
|
+
|
|
78
|
+
Full `/comet` workflow must not use the Skill tool to load the `openspec-propose` skill by default; only load it when the user explicitly requests generating the proposal and artifacts in one pass.
|
|
79
|
+
|
|
80
|
+
After the skill loads, follow its guidance to create the change skeleton, but override its "STOP and wait for user direction" behavior when a confirmed clarification summary from Step 1b is already available in the conversation context. Specifically:
|
|
81
|
+
|
|
82
|
+
1. Run `openspec new change`, `openspec status`, and `openspec instructions` as the skill directs
|
|
83
|
+
2. If the user has already confirmed a clarification summary (Step 1b), use that summary directly to draft proposal.md — do NOT ask the user to describe the change again
|
|
84
|
+
3. If no clarification summary exists (edge case), fall back to the skill's default behavior of asking the user
|
|
23
85
|
|
|
24
|
-
|
|
86
|
+
Then fill in design.md and tasks.md one by one; every document must be based on the confirmed clarification summary.
|
|
87
|
+
|
|
88
|
+
**Naming and scope guard**: Change name must use a user-specified name or a name confirmed through the current platform's available user input/confirmation mechanism — must not auto-generate or infer. Change scope must match the user's description — must not expand or narrow it independently.
|
|
25
89
|
|
|
26
90
|
Confirm the following artifacts have been created:
|
|
27
91
|
|
|
@@ -49,7 +113,7 @@ if [ -z "$COMET_STATE" ] || [ -z "$COMET_GUARD" ]; then
|
|
|
49
113
|
return 1
|
|
50
114
|
fi
|
|
51
115
|
|
|
52
|
-
|
|
116
|
+
"$COMET_BASH" "$COMET_STATE" init <name> full
|
|
53
117
|
```
|
|
54
118
|
|
|
55
119
|
### 3. Entry State Verification
|
|
@@ -57,7 +121,7 @@ bash "$COMET_STATE" init <name> full
|
|
|
57
121
|
Verify state machine has been correctly initialized:
|
|
58
122
|
|
|
59
123
|
```bash
|
|
60
|
-
|
|
124
|
+
"$COMET_BASH" "$COMET_STATE" check <name> open
|
|
61
125
|
```
|
|
62
126
|
|
|
63
127
|
Proceed to Step 4 after verification passes. The script outputs specific failure reasons when verification fails.
|
|
@@ -75,9 +139,9 @@ Confirm the three documents have complete content:
|
|
|
75
139
|
|
|
76
140
|
### 5. User Review and Confirmation (Blocking Point)
|
|
77
141
|
|
|
78
|
-
After the three documents are created and content completeness check passes, **must use the
|
|
142
|
+
After the three documents are created and content completeness check passes, **must use the current platform's available user input/confirmation mechanism to pause and wait for user confirmation**. Must not execute phase guard or auto-transition before user confirmation. If the current platform has no structured question tool, ask an equivalent single-select question in the conversation, stop the workflow, and wait for the user's reply before continuing.
|
|
79
143
|
|
|
80
|
-
|
|
144
|
+
The user confirmation question must be presented as a single-select question with the following summary and options:
|
|
81
145
|
|
|
82
146
|
**Summary content**:
|
|
83
147
|
- **proposal.md**: problem background, goals, scope
|
|
@@ -88,26 +152,35 @@ AskUserQuestion must be presented as a single-select question with the following
|
|
|
88
152
|
- "Confirm, proceed to next phase" — artifacts meet expectations, execute phase guard transition
|
|
89
153
|
- "Needs adjustment" — include adjustment notes, modify and re-request confirmation
|
|
90
154
|
|
|
91
|
-
After user selects "Confirm", proceed to exit conditions. When user selects "Needs adjustment", modify the corresponding files per their notes, then
|
|
155
|
+
After user selects "Confirm", proceed to exit conditions. When user selects "Needs adjustment", modify the corresponding files per their notes, then request confirmation again.
|
|
92
156
|
|
|
93
157
|
## Exit Conditions
|
|
94
158
|
|
|
95
159
|
- proposal.md, design.md, tasks.md all created with complete content
|
|
96
160
|
- **User has confirmed** proposal, design, tasks content meets expectations
|
|
97
|
-
- **Phase guard**: Run `
|
|
161
|
+
- **Phase guard**: Run `"$COMET_BASH" "$COMET_GUARD" <change-name> open --apply`; after all PASS, auto-transitions to next phase
|
|
98
162
|
|
|
99
163
|
Must use `--apply` before exit, otherwise `.comet.yaml` remains at `phase: open` and the next phase entry check will fail.
|
|
100
164
|
|
|
101
165
|
```bash
|
|
102
|
-
|
|
166
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> open --apply
|
|
103
167
|
```
|
|
104
168
|
|
|
105
169
|
Full workflow auto-transitions to `phase: design`; hotfix/tweak presets auto-transition to `phase: build`.
|
|
106
170
|
|
|
107
|
-
## Automatic
|
|
171
|
+
## Automatic Handoff to Next Phase
|
|
172
|
+
|
|
173
|
+
> **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.
|
|
174
|
+
|
|
175
|
+
After user confirmation and guard-based phase advancement, run:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
"$COMET_BASH" "$COMET_STATE" next <change-name>
|
|
179
|
+
```
|
|
108
180
|
|
|
109
|
-
|
|
181
|
+
The script determines the next action from `phase`, `workflow`, and `auto_transition`:
|
|
182
|
+
- `NEXT: auto` -> invoke the `SKILL` target to continue to the next phase
|
|
183
|
+
- `NEXT: manual` -> do not invoke the next skill; follow `HINT` and ask the user to run `/<SKILL>` manually
|
|
184
|
+
- `NEXT: done` -> workflow is complete; no further action needed
|
|
110
185
|
|
|
111
|
-
|
|
112
|
-
>
|
|
113
|
-
> Hotfix/tweak presets are controlled by their corresponding preset skill for subsequent transitions (phase goes directly to build), and do not go through this section.
|
|
186
|
+
Hotfix/tweak presets are controlled by their preset skills (phase goes directly to build), and their `next` output points to the preset path.
|