@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.
- package/LICENSE +21 -21
- package/README.md +559 -539
- package/assets/manifest.json +41 -34
- package/assets/skills/comet/SKILL.md +282 -329
- package/assets/skills/comet/reference/auto-transition.md +27 -0
- package/assets/skills/comet/reference/comet-yaml-fields.md +68 -0
- package/assets/skills/comet/reference/context-recovery.md +35 -0
- package/assets/skills/comet/reference/debug-gate.md +17 -0
- package/assets/skills/comet/reference/decision-point.md +20 -0
- package/assets/skills/comet/reference/file-structure.md +28 -0
- package/assets/skills/comet/reference/subagent-dispatch.md +113 -0
- package/assets/skills/comet/rules/comet-phase-guard.en.md +99 -0
- package/assets/skills/comet/rules/comet-phase-guard.md +99 -90
- package/assets/skills/comet/scripts/comet-state.sh +62 -0
- package/assets/skills/comet-archive/SKILL.md +100 -106
- package/assets/skills/comet-build/SKILL.md +304 -316
- package/assets/skills/comet-design/SKILL.md +263 -272
- package/assets/skills/comet-hotfix/SKILL.md +204 -211
- package/assets/skills/comet-open/SKILL.md +203 -186
- package/assets/skills/comet-tweak/SKILL.md +180 -179
- package/assets/skills/comet-verify/SKILL.md +234 -240
- package/assets/skills-zh/comet/SKILL.md +269 -332
- package/assets/skills-zh/comet/reference/auto-transition.md +27 -0
- package/assets/skills-zh/comet/reference/comet-yaml-fields.md +68 -0
- package/assets/skills-zh/comet/reference/context-recovery.md +35 -0
- package/assets/skills-zh/comet/reference/debug-gate.md +17 -0
- package/assets/skills-zh/comet/reference/decision-point.md +20 -0
- package/assets/skills-zh/comet/reference/file-structure.md +28 -0
- package/assets/skills-zh/comet/reference/subagent-dispatch.md +113 -0
- package/assets/skills-zh/comet-archive/SKILL.md +100 -106
- package/assets/skills-zh/comet-build/SKILL.md +304 -316
- package/assets/skills-zh/comet-design/SKILL.md +264 -273
- package/assets/skills-zh/comet-hotfix/SKILL.md +200 -207
- package/assets/skills-zh/comet-open/SKILL.md +203 -186
- package/assets/skills-zh/comet-tweak/SKILL.md +176 -175
- package/assets/skills-zh/comet-verify/SKILL.md +232 -238
- package/bin/comet.js +3 -3
- package/dist/cli/index.js +19 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +8 -8
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/uninstall.d.ts +9 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +113 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.d.ts +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +65 -36
- package/dist/commands/update.js.map +1 -1
- package/dist/core/codegraph.d.ts +2 -7
- package/dist/core/codegraph.d.ts.map +1 -1
- package/dist/core/codegraph.js +4 -37
- package/dist/core/codegraph.js.map +1 -1
- package/dist/core/detect.d.ts +8 -1
- package/dist/core/detect.d.ts.map +1 -1
- package/dist/core/detect.js +41 -2
- package/dist/core/detect.js.map +1 -1
- package/dist/core/openspec.d.ts +1 -1
- package/dist/core/openspec.d.ts.map +1 -1
- package/dist/core/openspec.js +40 -17
- package/dist/core/openspec.js.map +1 -1
- package/dist/core/platforms.d.ts.map +1 -1
- package/dist/core/platforms.js +14 -1
- package/dist/core/platforms.js.map +1 -1
- package/dist/core/skills.d.ts +3 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +142 -65
- package/dist/core/skills.js.map +1 -1
- package/dist/core/superpowers.d.ts.map +1 -1
- package/dist/core/superpowers.js +1 -0
- package/dist/core/superpowers.js.map +1 -1
- package/dist/core/uninstall.d.ts +28 -0
- package/dist/core/uninstall.d.ts.map +1 -0
- package/dist/core/uninstall.js +421 -0
- package/dist/core/uninstall.js.map +1 -0
- package/dist/core/version.d.ts +31 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +111 -0
- package/dist/core/version.js.map +1 -0
- package/dist/utils/file-system.d.ts +23 -0
- package/dist/utils/file-system.d.ts.map +1 -1
- package/dist/utils/file-system.js +100 -5
- package/dist/utils/file-system.js.map +1 -1
- package/package.json +69 -64
- package/scripts/postinstall.js +44 -44
|
@@ -1,329 +1,282 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: comet
|
|
3
|
-
description: "Comet — OpenSpec + Superpowers dual-star development workflow. Start with /comet for automatic phase detection and dispatch to subcommands. Five phases: open → design → build → verify → archive."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Comet — OpenSpec + Superpowers Dual-Star Development Workflow
|
|
7
|
-
|
|
8
|
-
OpenSpec and Superpowers orbit the same goal like a binary star system.
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
OpenSpec handles WHAT — outline, proposal, spec lifecycle, archive
|
|
12
|
-
Superpowers handles HOW — technical design, planning, execution, closing
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
**Core principle: brainstorming cannot be skipped. Every change must undergo deep design (except hotfix and tweak presets).**
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Decision Core
|
|
20
|
-
|
|
21
|
-
Agents need only read this section for decision-making. Refer to the Reference Appendix as needed.
|
|
22
|
-
|
|
23
|
-
### Output Language Rule
|
|
24
|
-
|
|
25
|
-
Use the language of the user request that triggered this workflow as the default output language. When resuming an existing change with a clear dominant artifact language, preserve that language unless the user explicitly asks to switch.
|
|
26
|
-
|
|
27
|
-
### Automatic Phase Detection
|
|
28
|
-
|
|
29
|
-
**Step 0: Active Change Discovery and Intent Detection**
|
|
30
|
-
|
|
31
|
-
1. Detect presets first; if hotfix/tweak matches, invoke the corresponding preset skill directly and do not enter the normal open branch
|
|
32
|
-
2. When no preset matches, run `openspec list --json` to get all active changes
|
|
33
|
-
|
|
34
|
-
**Preset detection has highest priority**:
|
|
35
|
-
- User explicitly describes a bug fix / hotfix + meets hotfix conditions → directly invoke `/comet-hotfix`
|
|
36
|
-
- User explicitly describes copy/config/docs/prompt small adjustment + meets tweak conditions → directly invoke `/comet-tweak`
|
|
37
|
-
- No preset match → follow the table below
|
|
38
|
-
|
|
39
|
-
| Active changes | User input | Behavior |
|
|
40
|
-
|----------------|------------|----------|
|
|
41
|
-
| None | non-preset input | → Invoke `/comet-open` |
|
|
42
|
-
| Exactly 1 | `/comet <description>` | → **Ask**: continue this change or create a new change |
|
|
43
|
-
| Multiple | `/comet <description>` | → **Ask**: continue existing or create new; if continuing, list changes for selection |
|
|
44
|
-
| Exactly 1 | `/comet` with no description | → Auto-select, enter Step 1 |
|
|
45
|
-
| Multiple | `/comet` with no description | → List changes for user selection |
|
|
46
|
-
|
|
47
|
-
<IMPORTANT>
|
|
48
|
-
When the user chooses "create a new change", **must invoke `/comet-open`**. Do not call `/opsx:new` directly.
|
|
49
|
-
`/comet-open` performs dual initialization: OpenSpec artifacts (created by internal `/opsx:new`) plus `.comet.yaml` state file.
|
|
50
|
-
Calling `/opsx:new` directly leaves `.comet.yaml` missing and breaks later phase detection.
|
|
51
|
-
</IMPORTANT>
|
|
52
|
-
|
|
53
|
-
**Step 1: Read `.comet.yaml` state metadata**
|
|
54
|
-
|
|
55
|
-
Prefer reading `openspec/changes/<name>/.comet.yaml`. If not available, fall back to `openspec status --change "<name>" --json`, `tasks.md`, and `docs/superpowers/` file checks.
|
|
56
|
-
|
|
57
|
-
**Resume rules**:
|
|
58
|
-
- On every context resume, rerun Step 0 and Step 1; do not trust conversation history for phase detection
|
|
59
|
-
- If there is an active change and the worktree has uncommitted changes, handle them through `comet/reference/dirty-worktree.md`. That protocol defines checks, attribution, and prohibitions; this file does not repeat them
|
|
60
|
-
- If `phase: build`, first check `build_pause`, `plan`, `build_mode`, and `isolation` (see details below):
|
|
61
|
-
- If `build_pause: plan-ready` but `isolation` and `build_mode` are already set, treat as stale pause: first output `[COMET] Detected stale pause (build_pause=plan-ready but isolation/build_mode already set), auto-clearing and continuing`, then run `"$COMET_BASH" "$COMET_STATE" set <name> build_pause null`, then read the next unchecked task from tasks.md and resume execution per `build_mode`
|
|
62
|
-
- If `build_pause: plan-ready` and the plan file exists, but `isolation` or `build_mode` is not yet set, return to the `/comet-build` plan-ready resume point, prompt the user to choose isolation and execution method, and do not regenerate the plan
|
|
63
|
-
- If `build_pause: plan-ready` but the plan file is missing, return to `/comet-build` to handle corrupted state or regenerate the plan
|
|
64
|
-
- If `build_mode`, `isolation`, or `tdd_mode` is unset, return to the corresponding `/comet-build` step to supplement before executing
|
|
65
|
-
- If all are set, read the next unchecked task from tasks.md and continue:
|
|
66
|
-
- If `build_mode: subagent-driven-development`, do not execute tasks directly in the main window; return to `/comet-build`'s background subagent dispatch rules, main window only coordinates
|
|
67
|
-
- Other execution modes follow `/comet-build`'s corresponding rules
|
|
68
|
-
- If `phase: verify` and `verify_result: fail`, enter the verification failure decision blocking point: pause and ask the user to fix or accept deviation; only after the user chooses fix, run `"$COMET_BASH" "$COMET_STATE" transition <name> verify-fail` and invoke `/comet-build`
|
|
69
|
-
- If `phase: open` but proposal/design/tasks are complete, first run `"$COMET_BASH" "$COMET_GUARD" <change-name> open --apply` to repair state, then continue detection
|
|
70
|
-
- If `phase: archive`, only invoke `/comet-archive`; `/comet-archive` must first wait for final archive confirmation. After archive succeeds, the change moves to the archive directory, so do not run guard against the old active directory
|
|
71
|
-
|
|
72
|
-
**Step 2: Phase Determination** (check in order, first match wins)
|
|
73
|
-
|
|
74
|
-
1. `archived: true` or change moved to archive → Workflow complete
|
|
75
|
-
2. `verify_result: pass` and `archived` is not `true` → Invoke `/comet-archive` (first perform final archive confirmation)
|
|
76
|
-
3. `verify_result: fail` → Enter verification failure decision blocking point (pause and ask fix or accept deviation; only after user chooses fix, run `verify-fail` then `/comet-build`)
|
|
77
|
-
4. `phase: verify` or tasks.md all checked → Invoke `/comet-verify`
|
|
78
|
-
5. `phase: build` or has Design Doc but plan/execution incomplete → Route by workflow: `hotfix` → `/comet-hotfix`, `tweak` → `/comet-tweak`, `full` → `/comet-build`
|
|
79
|
-
6. `phase: design` or has change but no Design Doc → Invoke `/comet-design`
|
|
80
|
-
7. `phase: open` or active change exists but `.comet.yaml` is missing → Invoke `/comet-open`
|
|
81
|
-
8. No active change → Invoke `/comet-open`
|
|
82
|
-
|
|
83
|
-
If metadata conflicts with file state, use verifiable file state as source of truth and correct `.comet.yaml` before continuing.
|
|
84
|
-
|
|
85
|
-
### Preset Upgrade Criteria
|
|
86
|
-
|
|
87
|
-
**hotfix → full** (upgrade if any condition met):
|
|
88
|
-
- Change involves **3+ files**
|
|
89
|
-
- Architecture changes (new modules, new interfaces, new dependencies)
|
|
90
|
-
- Database schema changes
|
|
91
|
-
- Fix introduces new public API
|
|
92
|
-
- Fix scope exceeds a single function/module
|
|
93
|
-
|
|
94
|
-
**tweak → full** (upgrade if any condition met):
|
|
95
|
-
- Change involves **5+ files**
|
|
96
|
-
- Cross-module coordination required
|
|
97
|
-
- **5+** new test cases needed
|
|
98
|
-
- Config item additions or deletions (not value changes)
|
|
99
|
-
- New capability needed
|
|
100
|
-
- Delta spec needed (existing spec affected)
|
|
101
|
-
|
|
102
|
-
### Error Handling Quick Reference
|
|
103
|
-
|
|
104
|
-
| Scenario | Handling |
|
|
105
|
-
|----------|----------|
|
|
106
|
-
| `openspec list --json` fails | Check if openspec is installed, prompt user to run `openspec init` |
|
|
107
|
-
| Sub-skill unavailable | Stop workflow, prompt to install or enable the corresponding skill |
|
|
108
|
-
| `.comet.yaml` malformed or missing | Use file state as source of truth, correct with `"$COMET_BASH" "$COMET_STATE" set` then continue |
|
|
109
|
-
| Build/test fails | Return to build phase for fixes, do not enter verify |
|
|
110
|
-
| Incomplete change directory structure | Fill missing files according to `comet-open` artifact requirements |
|
|
111
|
-
|
|
112
|
-
### Phase Transitions
|
|
113
|
-
|
|
114
|
-
<IMPORTANT>
|
|
115
|
-
A single `/comet` invocation starts from the detected phase and advances to the next phase when exit conditions are met.
|
|
116
|
-
|
|
117
|
-
Flow chain: open → design → build → verify → archive
|
|
118
|
-
|
|
119
|
-
**Continuous execution requirement**: starting from the detected phase, the agent automatically continues through all later phases. But **auto-advancing only applies at transition points without user decisions**. When encountering user decision points, **must use the current platform's available user input/confirmation mechanism to pause and wait for the user's explicit response**. Must not use recommendation rules, defaults, or historical preferences to substitute for user confirmation, and must not just output a text prompt and then continue executing.
|
|
120
|
-
|
|
121
|
-
**Distinguish phase advancement vs automatic handoff**: each sub-skill runs phase guard `--apply` before exit to advance the `.comet.yaml` `phase` field. This step **always happens** and is not controlled by `auto_transition`. After that, the sub-skill runs `"$COMET_BASH" "$COMET_STATE" next <name>` to resolve the next action: when `auto_transition` is not `false`, output is `NEXT: auto` (auto-invoke next skill); when `auto_transition` is `false`, output is `NEXT: manual` (do not invoke next skill, show a manual run hint). Therefore `auto_transition` **only controls next skill invocation, not phase advancement**. Regardless of `auto_transition`, user decision points below remain blocking.
|
|
122
|
-
|
|
123
|
-
**Decision points are blocking points**: whenever reaching any of the following nodes, the current `/comet` invocation must stop,
|
|
124
|
-
|
|
125
|
-
Nodes requiring user participation (pause only at these nodes):
|
|
126
|
-
1. Open phase proposal/design/tasks review and confirmation
|
|
127
|
-
2. Confirm design approach during brainstorming
|
|
128
|
-
3. Plan-ready pause choice during build phase, followed by workflow configuration selection (isolation + execution method + TDD mode)
|
|
129
|
-
4. Decide to fix or accept deviation when verify fails (including Spec drift handling)
|
|
130
|
-
5. Choose branch handling method for finishing-branch
|
|
131
|
-
6. Archive phase final confirmation before running the archive script
|
|
132
|
-
7. Encounter upgrade conditions (hotfix/tweak → full workflow)
|
|
133
|
-
8. Build phase scope expansion requiring redesign or new change split
|
|
134
|
-
9. Open phase large PRD requiring confirmation to split into multiple changes
|
|
135
|
-
|
|
136
|
-
Agents should not skip these decision points; other unambiguous phase transitions must proceed automatically, must not exit midway. At decision points, **must not skip user confirmation or choose automatically — must explicitly obtain the user's choice through the current platform's available user input/confirmation mechanism before continuing**.
|
|
137
|
-
|
|
138
|
-
**Red Flags** — when these thoughts appear, STOP and check:
|
|
139
|
-
|
|
140
|
-
| Agent Thought | Actual Risk |
|
|
141
|
-
|--------------|-------------|
|
|
142
|
-
| "The user would probably agree with this approach" | Cannot decide for the user — use the current platform's user input/confirmation mechanism |
|
|
143
|
-
| "This is a small change, confirmation isn't needed" | Decision points have no size exception — blocking points must wait |
|
|
144
|
-
| "The user chose A last time, so A again" | Historical preference cannot substitute for current confirmation |
|
|
145
|
-
| "I explained the plan and the user didn't object" | No objection ≠ consent — must use tool to get explicit choice |
|
|
146
|
-
| "The flow has reached this point, should be fine" | Verification not passed ≠ passed — check verify_result |
|
|
147
|
-
</IMPORTANT>
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Subcommand Quick Reference
|
|
152
|
-
|
|
153
|
-
| Command | Phase | Owner | Artifacts |
|
|
154
|
-
|---------|-------|-------|-----------|
|
|
155
|
-
| `/comet-open` | 1. Open | OpenSpec | proposal.md, design.md, tasks.md |
|
|
156
|
-
| `/comet-design` | 2. Deep Design | Superpowers | Design Doc, delta spec |
|
|
157
|
-
| `/comet-build` | 3. Plan and Build | Superpowers | Implementation plan, code commits |
|
|
158
|
-
| `/comet-verify` | 4. Verify and Close | Both | Verification report, branch handling |
|
|
159
|
-
| `/comet-archive` | 5. Archive | OpenSpec | delta→main spec sync, design doc markup, archive |
|
|
160
|
-
| `/comet-hotfix` | Preset path | Both | Quick fix (skip brainstorming) |
|
|
161
|
-
| `/comet-tweak` | Preset path | Both | Small change (skip brainstorming and full plan) |
|
|
162
|
-
|
|
163
|
-
```
|
|
164
|
-
/comet
|
|
165
|
-
↓ Auto-detect
|
|
166
|
-
/comet-open ──→ /comet-design ──→ /comet-build ──→ /comet-verify ──→ /comet-archive
|
|
167
|
-
(OpenSpec) (Superpowers) (Superpowers) (Both) (OpenSpec)
|
|
168
|
-
|
|
169
|
-
/comet-hotfix (preset, skip brainstorming)
|
|
170
|
-
open ──→ build ──→ verify ──→ archive
|
|
171
|
-
↑ If upgrade triggered → block for confirmation → supplement Design Doc → return to full workflow
|
|
172
|
-
|
|
173
|
-
/comet-tweak (preset, skip brainstorming and full plan)
|
|
174
|
-
open ──→ lightweight build ──→ light verify ──→ archive
|
|
175
|
-
↑ If upgrade triggered → block for confirmation → supplement Design Doc → return to full workflow
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
|
-
## Reference Appendix
|
|
181
|
-
|
|
182
|
-
###
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
**
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
Output format: `NEXT: auto|manual|done` + `SKILL: <skill-name>` (omitted for `done`) + `HINT` (for `manual` only). With `auto_transition: false`, output is `manual`, which pauses only the next skill invocation and does not affect the already-applied phase advancement.
|
|
286
|
-
|
|
287
|
-
**Archive script**: Complete all archive steps in one command:
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
"$COMET_BASH" "$COMET_ARCHIVE" <change-name>
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
After loading comet, agents should run the variable assignments above once, then reuse `$COMET_GUARD`, `$COMET_STATE`, `$COMET_HANDOFF`, `$COMET_ARCHIVE` throughout the session.
|
|
294
|
-
|
|
295
|
-
### File Structure
|
|
296
|
-
|
|
297
|
-
```
|
|
298
|
-
openspec/ # OpenSpec — WHAT
|
|
299
|
-
├── config.yaml
|
|
300
|
-
├── changes/
|
|
301
|
-
│ ├── <name>/ # Active change
|
|
302
|
-
│ │ ├── .openspec.yaml
|
|
303
|
-
│ │ ├── .comet.yaml
|
|
304
|
-
│ │ ├── proposal.md # Why + What
|
|
305
|
-
│ │ ├── design.md # High-level architecture decisions
|
|
306
|
-
│ │ ├── specs/<capability>/spec.md # Delta capability spec
|
|
307
|
-
│ │ ├── .comet/handoff/ # Script-generated phase handoff packages
|
|
308
|
-
│ │ └── tasks.md # Task checklist
|
|
309
|
-
│ └── archive/YYYY-MM-DD-<name>/ # Archived
|
|
310
|
-
└── specs/<capability>/spec.md # Main specs (merged from delta semantics at archive)
|
|
311
|
-
|
|
312
|
-
docs/superpowers/ # Superpowers — HOW
|
|
313
|
-
├── specs/YYYY-MM-DD-<topic>-design.md # Design doc (technical RFC, mark status at archive)
|
|
314
|
-
└── plans/YYYY-MM-DD-<feature>.md # Implementation plan (file header contains change association metadata)
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
### Best Practices
|
|
318
|
-
|
|
319
|
-
1. **brainstorming cannot be skipped** — Every change must undergo deep design (except hotfix and tweak)
|
|
320
|
-
2. **delta spec is a living document** — Freely modify during phase 3, sync at archive
|
|
321
|
-
3. **Handoff packages are generated by scripts** — OpenSpec → Superpowers context must be generated through `comet-handoff.sh` as compact traceable excerpts (use `--full` when needed), and validated by guard for source/hash/mode
|
|
322
|
-
4. **Keep tasks.md in sync** — Check off each completed task
|
|
323
|
-
5. **Commit frequently** — One commit per task, message reflects design intent
|
|
324
|
-
6. **Verify before archive confirmation** — Enter `/comet-archive` only after `/comet-verify` passes, but wait for final user confirmation before running the archive script
|
|
325
|
-
7. **Classify incremental updates** — Small edits, medium brainstorming, large new changes
|
|
326
|
-
8. **Plan must associate with change** — File header contains `change:` and `design-doc:` metadata
|
|
327
|
-
9. **Archive closure** — design doc and plan must mark `archived-with` status
|
|
328
|
-
10. **Modifying existing features** — Just open a new change
|
|
329
|
-
11. **Preset has limits** — Switch to full workflow promptly when hotfix/tweak meet upgrade conditions
|
|
1
|
+
---
|
|
2
|
+
name: comet
|
|
3
|
+
description: "Comet — OpenSpec + Superpowers dual-star development workflow. Start with /comet for automatic phase detection and dispatch to subcommands. Five phases: open → design → build → verify → archive."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Comet — OpenSpec + Superpowers Dual-Star Development Workflow
|
|
7
|
+
|
|
8
|
+
OpenSpec and Superpowers orbit the same goal like a binary star system.
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
OpenSpec handles WHAT — outline, proposal, spec lifecycle, archive
|
|
12
|
+
Superpowers handles HOW — technical design, planning, execution, closing
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Core principle: brainstorming cannot be skipped. Every change must undergo deep design (except hotfix and tweak presets).**
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Decision Core
|
|
20
|
+
|
|
21
|
+
Agents need only read this section for decision-making. Refer to the Reference Appendix as needed.
|
|
22
|
+
|
|
23
|
+
### Output Language Rule
|
|
24
|
+
|
|
25
|
+
Use the language of the user request that triggered this workflow as the default output language. When resuming an existing change with a clear dominant artifact language, preserve that language unless the user explicitly asks to switch.
|
|
26
|
+
|
|
27
|
+
### Automatic Phase Detection
|
|
28
|
+
|
|
29
|
+
**Step 0: Active Change Discovery and Intent Detection**
|
|
30
|
+
|
|
31
|
+
1. Detect presets first; if hotfix/tweak matches, invoke the corresponding preset skill directly and do not enter the normal open branch
|
|
32
|
+
2. When no preset matches, run `openspec list --json` to get all active changes
|
|
33
|
+
|
|
34
|
+
**Preset detection has highest priority**:
|
|
35
|
+
- User explicitly describes a bug fix / hotfix + meets hotfix conditions → directly invoke `/comet-hotfix`
|
|
36
|
+
- User explicitly describes copy/config/docs/prompt small adjustment + meets tweak conditions → directly invoke `/comet-tweak`
|
|
37
|
+
- No preset match → follow the table below
|
|
38
|
+
|
|
39
|
+
| Active changes | User input | Behavior |
|
|
40
|
+
|----------------|------------|----------|
|
|
41
|
+
| None | non-preset input | → Invoke `/comet-open` |
|
|
42
|
+
| Exactly 1 | `/comet <description>` | → **Ask**: continue this change or create a new change |
|
|
43
|
+
| Multiple | `/comet <description>` | → **Ask**: continue existing or create new; if continuing, list changes for selection |
|
|
44
|
+
| Exactly 1 | `/comet` with no description | → Auto-select, enter Step 1 |
|
|
45
|
+
| Multiple | `/comet` with no description | → List changes for user selection |
|
|
46
|
+
|
|
47
|
+
<IMPORTANT>
|
|
48
|
+
When the user chooses "create a new change", **must invoke `/comet-open`**. Do not call `/opsx:new` directly.
|
|
49
|
+
`/comet-open` performs dual initialization: OpenSpec artifacts (created by internal `/opsx:new`) plus `.comet.yaml` state file.
|
|
50
|
+
Calling `/opsx:new` directly leaves `.comet.yaml` missing and breaks later phase detection.
|
|
51
|
+
</IMPORTANT>
|
|
52
|
+
|
|
53
|
+
**Step 1: Read `.comet.yaml` state metadata**
|
|
54
|
+
|
|
55
|
+
Prefer reading `openspec/changes/<name>/.comet.yaml`. If not available, fall back to `openspec status --change "<name>" --json`, `tasks.md`, and `docs/superpowers/` file checks.
|
|
56
|
+
|
|
57
|
+
**Resume rules**:
|
|
58
|
+
- On every context resume, rerun Step 0 and Step 1; do not trust conversation history for phase detection
|
|
59
|
+
- If there is an active change and the worktree has uncommitted changes, handle them through `comet/reference/dirty-worktree.md`. That protocol defines checks, attribution, and prohibitions; this file does not repeat them
|
|
60
|
+
- If `phase: build`, first check `build_pause`, `plan`, `build_mode`, and `isolation` (see details below):
|
|
61
|
+
- If `build_pause: plan-ready` but `isolation` and `build_mode` are already set, treat as stale pause: first output `[COMET] Detected stale pause (build_pause=plan-ready but isolation/build_mode already set), auto-clearing and continuing`, then run `"$COMET_BASH" "$COMET_STATE" set <name> build_pause null`, then read the next unchecked task from tasks.md and resume execution per `build_mode`
|
|
62
|
+
- If `build_pause: plan-ready` and the plan file exists, but `isolation` or `build_mode` is not yet set, return to the `/comet-build` plan-ready resume point, prompt the user to choose isolation and execution method, and do not regenerate the plan
|
|
63
|
+
- If `build_pause: plan-ready` but the plan file is missing, return to `/comet-build` to handle corrupted state or regenerate the plan
|
|
64
|
+
- If `build_mode`, `isolation`, or `tdd_mode` is unset, return to the corresponding `/comet-build` step to supplement before executing
|
|
65
|
+
- If all are set, read the next unchecked task from tasks.md and continue:
|
|
66
|
+
- If `build_mode: subagent-driven-development`, do not execute tasks directly in the main window; return to `/comet-build`'s background subagent dispatch rules, main window only coordinates
|
|
67
|
+
- Other execution modes follow `/comet-build`'s corresponding rules
|
|
68
|
+
- If `phase: verify` and `verify_result: fail`, enter the verification failure decision blocking point: pause and ask the user to fix or accept deviation; only after the user chooses fix, run `"$COMET_BASH" "$COMET_STATE" transition <name> verify-fail` and invoke `/comet-build`
|
|
69
|
+
- If `phase: open` but proposal/design/tasks are complete, first run `"$COMET_BASH" "$COMET_GUARD" <change-name> open --apply` to repair state, then continue detection
|
|
70
|
+
- If `phase: archive`, only invoke `/comet-archive`; `/comet-archive` must first wait for final archive confirmation. After archive succeeds, the change moves to the archive directory, so do not run guard against the old active directory
|
|
71
|
+
|
|
72
|
+
**Step 2: Phase Determination** (check in order, first match wins)
|
|
73
|
+
|
|
74
|
+
1. `archived: true` or change moved to archive → Workflow complete
|
|
75
|
+
2. `verify_result: pass` and `archived` is not `true` → Invoke `/comet-archive` (first perform final archive confirmation)
|
|
76
|
+
3. `verify_result: fail` → Enter verification failure decision blocking point (pause and ask fix or accept deviation; only after user chooses fix, run `verify-fail` then `/comet-build`)
|
|
77
|
+
4. `phase: verify` or tasks.md all checked → Invoke `/comet-verify`
|
|
78
|
+
5. `phase: build` or has Design Doc but plan/execution incomplete → Route by workflow: `hotfix` → `/comet-hotfix`, `tweak` → `/comet-tweak`, `full` → `/comet-build`
|
|
79
|
+
6. `phase: design` or has change but no Design Doc → Invoke `/comet-design`
|
|
80
|
+
7. `phase: open` or active change exists but `.comet.yaml` is missing → Invoke `/comet-open`
|
|
81
|
+
8. No active change → Invoke `/comet-open`
|
|
82
|
+
|
|
83
|
+
If metadata conflicts with file state, use verifiable file state as source of truth and correct `.comet.yaml` before continuing.
|
|
84
|
+
|
|
85
|
+
### Preset Upgrade Criteria
|
|
86
|
+
|
|
87
|
+
**hotfix → full** (upgrade if any condition met):
|
|
88
|
+
- Change involves **3+ files**
|
|
89
|
+
- Architecture changes (new modules, new interfaces, new dependencies)
|
|
90
|
+
- Database schema changes
|
|
91
|
+
- Fix introduces new public API
|
|
92
|
+
- Fix scope exceeds a single function/module
|
|
93
|
+
|
|
94
|
+
**tweak → full** (upgrade if any condition met):
|
|
95
|
+
- Change involves **5+ files**
|
|
96
|
+
- Cross-module coordination required
|
|
97
|
+
- **5+** new test cases needed
|
|
98
|
+
- Config item additions or deletions (not value changes)
|
|
99
|
+
- New capability needed
|
|
100
|
+
- Delta spec needed (existing spec affected)
|
|
101
|
+
|
|
102
|
+
### Error Handling Quick Reference
|
|
103
|
+
|
|
104
|
+
| Scenario | Handling |
|
|
105
|
+
|----------|----------|
|
|
106
|
+
| `openspec list --json` fails | Check if openspec is installed, prompt user to run `openspec init` |
|
|
107
|
+
| Sub-skill unavailable | Stop workflow, prompt to install or enable the corresponding skill |
|
|
108
|
+
| `.comet.yaml` malformed or missing | Use file state as source of truth, correct with `"$COMET_BASH" "$COMET_STATE" set` then continue |
|
|
109
|
+
| Build/test fails | Return to build phase for fixes, do not enter verify |
|
|
110
|
+
| Incomplete change directory structure | Fill missing files according to `comet-open` artifact requirements |
|
|
111
|
+
|
|
112
|
+
### Phase Transitions
|
|
113
|
+
|
|
114
|
+
<IMPORTANT>
|
|
115
|
+
A single `/comet` invocation starts from the detected phase and advances to the next phase when exit conditions are met.
|
|
116
|
+
|
|
117
|
+
Flow chain: open → design → build → verify → archive
|
|
118
|
+
|
|
119
|
+
**Continuous execution requirement**: starting from the detected phase, the agent automatically continues through all later phases. But **auto-advancing only applies at transition points without user decisions**. When encountering user decision points, **must use the current platform's available user input/confirmation mechanism to pause and wait for the user's explicit response**. Must not use recommendation rules, defaults, or historical preferences to substitute for user confirmation, and must not just output a text prompt and then continue executing.
|
|
120
|
+
|
|
121
|
+
**Distinguish phase advancement vs automatic handoff**: each sub-skill runs phase guard `--apply` before exit to advance the `.comet.yaml` `phase` field. This step **always happens** and is not controlled by `auto_transition`. After that, the sub-skill runs `"$COMET_BASH" "$COMET_STATE" next <name>` to resolve the next action: when `auto_transition` is not `false`, output is `NEXT: auto` (auto-invoke next skill); when `auto_transition` is `false`, output is `NEXT: manual` (do not invoke next skill, show a manual run hint). Therefore `auto_transition` **only controls next skill invocation, not phase advancement**. Regardless of `auto_transition`, user decision points below remain blocking.
|
|
122
|
+
|
|
123
|
+
**Decision points are blocking points**: whenever reaching any of the following nodes, the current `/comet` invocation must stop, and follow the `comet/reference/decision-point.md` protocol to obtain the user's explicit choice. Only after the user explicitly chooses can the corresponding state fields be written and operations executed, then auto-advance resumes.
|
|
124
|
+
|
|
125
|
+
Nodes requiring user participation (pause only at these nodes):
|
|
126
|
+
1. Open phase proposal/design/tasks review and confirmation
|
|
127
|
+
2. Confirm design approach during brainstorming
|
|
128
|
+
3. Plan-ready pause choice during build phase, followed by workflow configuration selection (isolation + execution method + TDD mode)
|
|
129
|
+
4. Decide to fix or accept deviation when verify fails (including Spec drift handling)
|
|
130
|
+
5. Choose branch handling method for finishing-branch
|
|
131
|
+
6. Archive phase final confirmation before running the archive script
|
|
132
|
+
7. Encounter upgrade conditions (hotfix/tweak → full workflow)
|
|
133
|
+
8. Build phase scope expansion requiring redesign or new change split
|
|
134
|
+
9. Open phase large PRD requiring confirmation to split into multiple changes
|
|
135
|
+
|
|
136
|
+
Agents should not skip these decision points; other unambiguous phase transitions must proceed automatically, must not exit midway. At decision points, **must not skip user confirmation or choose automatically — must explicitly obtain the user's choice through the current platform's available user input/confirmation mechanism before continuing**.
|
|
137
|
+
|
|
138
|
+
**Red Flags** — when these thoughts appear, STOP and check:
|
|
139
|
+
|
|
140
|
+
| Agent Thought | Actual Risk |
|
|
141
|
+
|--------------|-------------|
|
|
142
|
+
| "The user would probably agree with this approach" | Cannot decide for the user — use the current platform's user input/confirmation mechanism |
|
|
143
|
+
| "This is a small change, confirmation isn't needed" | Decision points have no size exception — blocking points must wait |
|
|
144
|
+
| "The user chose A last time, so A again" | Historical preference cannot substitute for current confirmation |
|
|
145
|
+
| "I explained the plan and the user didn't object" | No objection ≠ consent — must use tool to get explicit choice |
|
|
146
|
+
| "The flow has reached this point, should be fine" | Verification not passed ≠ passed — check verify_result |
|
|
147
|
+
</IMPORTANT>
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Subcommand Quick Reference
|
|
152
|
+
|
|
153
|
+
| Command | Phase | Owner | Artifacts |
|
|
154
|
+
|---------|-------|-------|-----------|
|
|
155
|
+
| `/comet-open` | 1. Open | OpenSpec | proposal.md, design.md, tasks.md |
|
|
156
|
+
| `/comet-design` | 2. Deep Design | Superpowers | Design Doc, delta spec |
|
|
157
|
+
| `/comet-build` | 3. Plan and Build | Superpowers | Implementation plan, code commits |
|
|
158
|
+
| `/comet-verify` | 4. Verify and Close | Both | Verification report, branch handling |
|
|
159
|
+
| `/comet-archive` | 5. Archive | OpenSpec | delta→main spec sync, design doc markup, archive |
|
|
160
|
+
| `/comet-hotfix` | Preset path | Both | Quick fix (skip brainstorming) |
|
|
161
|
+
| `/comet-tweak` | Preset path | Both | Small change (skip brainstorming and full plan) |
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
/comet
|
|
165
|
+
↓ Auto-detect
|
|
166
|
+
/comet-open ──→ /comet-design ──→ /comet-build ──→ /comet-verify ──→ /comet-archive
|
|
167
|
+
(OpenSpec) (Superpowers) (Superpowers) (Both) (OpenSpec)
|
|
168
|
+
|
|
169
|
+
/comet-hotfix (preset, skip brainstorming)
|
|
170
|
+
open ──→ build ──→ verify ──→ archive
|
|
171
|
+
↑ If upgrade triggered → block for confirmation → supplement Design Doc → return to full workflow
|
|
172
|
+
|
|
173
|
+
/comet-tweak (preset, skip brainstorming and full plan)
|
|
174
|
+
open ──→ lightweight build ──→ light verify ──→ archive
|
|
175
|
+
↑ If upgrade triggered → block for confirmation → supplement Design Doc → return to full workflow
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Reference Appendix
|
|
181
|
+
|
|
182
|
+
### State Machine Hard Constraints
|
|
183
|
+
|
|
184
|
+
- Before `build → verify`, `isolation` must be `branch` or `worktree`
|
|
185
|
+
- Before `build → verify`, `build_mode` must be selected
|
|
186
|
+
- `build_mode: subagent-driven-development` must also have `subagent_dispatch: confirmed`
|
|
187
|
+
- Before full workflow leaves build phase, `tdd_mode` must be selected as `tdd` or `direct`
|
|
188
|
+
- `build_mode: direct` is allowed by default only for `hotfix` / `tweak`; full workflow requires `direct_override: true`
|
|
189
|
+
- `build_pause` is not an execution method and must not be written to `build_mode`
|
|
190
|
+
- These constraints are enforced by both `comet-guard.sh build --apply` and `comet-state.sh transition <name> build-complete`
|
|
191
|
+
|
|
192
|
+
### .comet.yaml Field Reference
|
|
193
|
+
|
|
194
|
+
See `comet/reference/comet-yaml-fields.md` for complete field reference with examples and descriptions.
|
|
195
|
+
|
|
196
|
+
### File Structure
|
|
197
|
+
|
|
198
|
+
See `comet/reference/file-structure.md` for the complete directory layout and artifact organization.
|
|
199
|
+
|
|
200
|
+
### Auto-Transition Protocol
|
|
201
|
+
|
|
202
|
+
See `comet/reference/auto-transition.md` for the complete automatic handoff workflow.
|
|
203
|
+
|
|
204
|
+
### Context Recovery
|
|
205
|
+
|
|
206
|
+
See `comet/reference/context-recovery.md` for structured recovery after context compression.
|
|
207
|
+
|
|
208
|
+
### Decision Point Protocol
|
|
209
|
+
|
|
210
|
+
See `comet/reference/decision-point.md` for the complete user decision point protocol.
|
|
211
|
+
|
|
212
|
+
### Debug Gate Protocol
|
|
213
|
+
|
|
214
|
+
See `comet/reference/debug-gate.md` for the complete debug gate protocol.
|
|
215
|
+
|
|
216
|
+
### Script Location
|
|
217
|
+
|
|
218
|
+
Comet scripts are distributed in `comet/scripts/`. **Do not hardcode paths** — locate once, cache in env vars. This block is a standard boilerplate repeated in every sub-skill for independent loadability; changes must be kept in sync across all files (boilerplate version: `v2`, update this version when changing to help locate files needing sync):
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
222
|
+
if [ -z "$COMET_ENV" ]; then
|
|
223
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
224
|
+
return 1
|
|
225
|
+
fi
|
|
226
|
+
. "$COMET_ENV"
|
|
227
|
+
|
|
228
|
+
# Stop workflow when script location fails
|
|
229
|
+
if [ -z "$COMET_GUARD" ] || [ -z "$COMET_STATE" ] || [ -z "$COMET_HANDOFF" ] || [ -z "$COMET_ARCHIVE" ]; then
|
|
230
|
+
echo "ERROR: Comet scripts not found. Ensure the comet skill is installed." >&2
|
|
231
|
+
echo "Expected path pattern: */comet/scripts/comet-*.sh under project or platform skill directories" >&2
|
|
232
|
+
return 1
|
|
233
|
+
fi
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Auto state update**: Guard supports `--apply` flag, automatically updating `.comet.yaml` state fields after checks pass:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> <phase> --apply
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
`--apply` delegates to `comet-state transition`. Use these semantic events when state changes need to be expressed directly:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> open-complete
|
|
246
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> design-complete
|
|
247
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> build-complete
|
|
248
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-pass
|
|
249
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
|
|
250
|
+
"$COMET_BASH" "$COMET_STATE" transition <archive-name> archived
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Resolve next action**: after guard-based phase advancement, use the `next` subcommand to determine whether to auto-invoke the next skill:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
"$COMET_BASH" "$COMET_STATE" next <change-name>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Output format: `NEXT: auto|manual|done` + `SKILL: <skill-name>` (omitted for `done`) + `HINT` (for `manual` only). With `auto_transition: false`, output is `manual`, which pauses only the next skill invocation and does not block phase updates.
|
|
260
|
+
|
|
261
|
+
**Archive script**: Complete all archive steps in one command:
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
"$COMET_BASH" "$COMET_ARCHIVE" <change-name>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
After loading comet, agents should run the variable assignments above once, then reuse `$COMET_GUARD`, `$COMET_STATE`, `$COMET_HANDOFF`, `$COMET_ARCHIVE` throughout the session.
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
### Best Practices
|
|
271
|
+
|
|
272
|
+
1. **brainstorming cannot be skipped** — Every change must undergo deep design (except hotfix and tweak)
|
|
273
|
+
2. **delta spec is a living document** — Freely modify during phase 3, sync at archive
|
|
274
|
+
3. **Handoff packages are generated by scripts** — OpenSpec → Superpowers context must be generated through `comet-handoff.sh` as compact traceable excerpts (use `--full` when needed), and validated by guard for source/hash/mode
|
|
275
|
+
4. **Keep tasks.md in sync** — Check off each completed task
|
|
276
|
+
5. **Commit frequently** — One commit per task, message reflects design intent
|
|
277
|
+
6. **Verify before archive confirmation** — Enter `/comet-archive` only after `/comet-verify` passes, but wait for final user confirmation before running the archive script
|
|
278
|
+
7. **Classify incremental updates** — Small edits, medium brainstorming, large new changes
|
|
279
|
+
8. **Plan must associate with change** — File header contains `change:` and `design-doc:` metadata
|
|
280
|
+
9. **Archive closure** — design doc and plan must mark `archived-with` status
|
|
281
|
+
10. **Modifying existing features** — Just open a new change
|
|
282
|
+
11. **Preset has limits** — Switch to full workflow promptly when hotfix/tweak meet upgrade conditions
|