@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
package/README.md CHANGED
@@ -1,538 +1,558 @@
1
- <p align="center">
2
- <a href="https://github.com/rpamis/comet/blob/master/img/title-log.png">
3
- <picture>
4
- <source srcset="https://github.com/rpamis/comet/blob/master/img/title-log.png">
5
- <img src="https://github.com/rpamis/comet/blob/master/img/title-log.png" alt="Comet logo">
6
- </picture>
7
- </a>
8
- </p>
9
-
10
- <p align="center">
11
- <a href="https://github.com/rpamis/comet/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/rpamis/comet/ci.yml?branch=master&style=flat-square&label=CI" /></a>
12
- <a href="https://deepwiki.com/rpamis/comet"><img alt="DeepWiki" src="https://img.shields.io/badge/DeepWiki-rpamis%2Fcomet-blue?style=flat-square" /></a>
13
- <a href="https://www.npmjs.com/package/@rpamis/comet"><img alt="npm version" src="https://img.shields.io/npm/v/@rpamis/comet?style=flat-square" /></a>
14
- <a href="https://www.npmjs.com/package/@rpamis/comet"><img alt="npm download count" src="https://img.shields.io/npm/dm/@rpamis/comet?style=flat-square&label=Downloads/mo" /></a>
15
- <a href="https://www.npmjs.com/package/@rpamis/comet"><img alt="npm weekly download count" src="https://img.shields.io/npm/dw/@rpamis/comet?style=flat-square&label=Downloads/wk" /></a>
16
- <a href="./LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" /></a>
17
- </p>
18
-
19
- # @rpamis/comet
20
-
21
- ```
22
- ██████╗ ██████╗ ███╗ ███╗███████╗████████╗
23
- ██╔════╝██╔═══██╗████╗ ████║██╔════╝╚══██╔══╝
24
- ██║ ██║ ██║██╔████╔██║█████╗ ██║
25
- ██║ ██║ ██║██║╚██╔╝██║██╔══╝ ██║
26
- ╚██████╗╚██████╔╝██║ ╚═╝ ██║███████╗ ██║
27
- ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝
28
- ```
29
-
30
- > 中文版:[README-zh.md](README-zh.md)
31
- > [Bilibili video](https://www.bilibili.com/video/BV1y4Gi6CEo1/?spm_id_from=333.1387.homepage.video_card.click&vd_source=d22726fe6b108647dbebf1c5d8817377)
32
- > [DouYin](https://www.douyin.com/search/comet?aid=cd8fcc82-498b-4d59-8860-617deb719412&modal_id=7646429015808936293&type=general)
33
-
34
- **OpenSpec + Superpowers dual-star development workflow** — one command from idea to archive.
35
-
36
- OpenSpec handles **WHAT** (outlines, proposals, spec lifecycle, archiving).
37
-
38
- Superpowers handles **HOW** (technical design, planning, execution, wrap-up).
39
-
40
- Comet chains both into a five-phase automated pipeline.
41
-
42
- > [!IMPORTANT]
43
- > **0.3.7 Highlights** — One-step [CodeGraph](https://github.com/colbymchenry/codegraph) semantic code indexing (official: cost **↓16%**, tool calls **↓58%**);
44
- >
45
- > New **Beta context compression** cutting Build-phase input tokens by **25–30%**;
46
- > New active context compression mechanism to release context consumed by reading specs and brainstorming, preserving window space for the subsequent Build phase.
47
- > 6 default-on workflow token optimizations; New `auto_transition` config for automatic or manual phase handoff;
48
- > Hook+Rule anti-drift phase guard; Optional TDD mode and subagent dispatch confirmation;
49
- > Large PRD split into multiple changes; Pre-archive confirmation with reopen, verify retry limit, systematic debugging interception, and verification completion check.
50
- >
51
- > See [NEWS.md](NEWS.md) for details.
52
-
53
- ## Why Comet
54
-
55
- OpenSpec excels at managing requirements, creating proposals, managing Spec lifecycles, and archiving, but its proposals
56
- and tasks lack the detail of Superpowers brainstorming.
57
-
58
- Superpowers generates Spec documents after brainstorming, but these documents typically lack stateful design — after
59
- completing requirements, Specs only have tasks checked off in the document, and Agents even forget to check them off.
60
- This causes the Agent to re-examine documents and project code to verify on resumption, wasting many tokens.
61
-
62
- **Comet combines the strengths of both**, integrating the core workflow into 5 phases
63
-
64
- The main entry `/comet` supports current Spec state detection, suitable for long tasks — after closing your AI coding
65
- session midway, just `/comet` and Comet will automatically read the active Spec (lists multiple for selection),
66
- dynamically identify which phase is currently executing, and continue.
67
-
68
- At the same time, Comet provides full Spec lifecycle management. During execution, it links OpenSpec change/spec
69
- artifacts with Superpowers design and planning documents, then automates handoff, state updates, validation, and archive
70
- sync so users do not have to repeatedly remind the Agent to keep documents synchronized and connected.
71
-
72
- ## What You'll Learn
73
-
74
- Many excellent Skill projects exist in the current Skill market, but they generally have preference issues — users may
75
- only like some features. For example, when using both OpenSpec and Superpowers, one might only use OpenSpec's Spec
76
- management capabilities, but prefer Superpowers' TDD-driven approach for coding.
77
-
78
- Long-term Skill users know these capabilities can be freely combined, but exactly how to do so still requires real
79
- practice. The Comet project can serve as a reference:
80
-
81
- - **How to reliably trigger nested Skills** — Not letting the Agent rely on document descriptions to perform "look-alike
82
- Skill trigger" operations (like writing files based on Skill descriptions), but truly triggering Skills (key feature:
83
- Skill trigger prints on CC). Comet triggers many capabilities from OpenSpec and Superpowers. How is this Prompt
84
- written?
85
-
86
- - **How to make combined Skills flow automatically across phases** — Not relying on manual intervention. Comet's 5-phase
87
- flow can automatically trigger Skills for the core process except for necessary user choices, while the state machine
88
- also protects state transition reliability.
89
-
90
- - **How to turn the Spec lifecycle into a resumable workflow** — Comet links OpenSpec change/spec artifacts with
91
- Superpowers design and planning documents, then records phase, execution mode, verification results, and archive
92
- status in `.comet.yaml`, so the Agent can resume after interruption instead of rereading documents and guessing
93
- progress.
94
-
95
- - **How to turn document synchronization from "user reminders" into automation** — Comet puts handoff, state updates,
96
- validation, and archive sync into scripted flows, reducing repeated prompts like "remember to update the design
97
- doc", "remember to sync the spec", and "remember to archive the change".
98
-
99
- - **How to design guard conditions that Agents can execute** — Comet does not simply trust the Agent saying "done" at
100
- phase exits. Scripts such as `comet-guard.sh`, `comet-yaml-validate.sh`, and `comet-state.sh` check tasks, state
101
- fields, verification evidence, and archive conditions before allowing the workflow to advance.
102
-
103
- - **How to distribute and install Skills across platforms** — Comet supports multiple AI coding platforms,
104
- project/global installation, Chinese/English Skill choices, and platform-specific directory differences such as
105
- Antigravity using different project-level and global paths. It can be a reference for CLI installers and Skill package
106
- structure.
107
-
108
- - **How to turn shell scripts into Agent workflow infrastructure** — Comet's scripts need to work across macOS, Linux,
109
- and Windows Git Bash while handling hashes, YAML fields, state machines, and archive flows. It shows how to move
110
- fragile workflow control out of scattered Prompt text and into testable, reusable tools.
111
-
112
- ## Install
113
-
114
- Requirements:
115
-
116
- - Node.js 20+
117
- - npm/npx
118
- - Git
119
- - Bash-compatible shell for workflow scripts (Windows users should use Git Bash or an equivalent bash environment)
120
-
121
- ```bash
122
- npm install -g @rpamis/comet
123
- ```
124
-
125
- ## Quick Start
126
-
127
- ```bash
128
- cd your-project
129
- comet init
130
- ```
131
-
132
- `comet init` will:
133
-
134
- 1. Prompt you to select AI platforms (auto-detects existing configs)
135
- 2. Choose install scope: project-level (current directory) or global (home directory)
136
- 3. Select language for Comet skills: English or 中文
137
- 4. Install [OpenSpec](https://github.com/Fission-AI/OpenSpec) skills
138
- 5. Install [Superpowers](https://github.com/obra/superpowers) skills
139
- 6. Deploy Comet skills (in your chosen language) to selected platforms
140
- 7. Create `docs/superpowers/specs/` and `docs/superpowers/plans/` working directories for project-scope installs
141
-
142
- > [!TIP]
143
- > update version
144
- >
145
- > `comet update` or `npm install -g @rpamis/comet@latest` to get the latest features and fixes.
146
-
147
- ## Support for OpenClaw and Hermes, and other AI platforms
148
-
149
- For platforms that use the generic `skills` CLI directly, you can install the Comet skill package with:
150
-
151
- ```bash
152
- npx skills add rpamis/comet
153
- ```
154
-
155
- ## Screenshots
156
-
157
- <p align="center">
158
- <img src="https://github.com/rpamis/comet/blob/master/img/runner.png" alt="runner">
159
- </p>
160
-
161
- <p align="center">Auto-install OpenSpec & Superpowers, one-click dev environment setup</p>
162
- <p align="center">Multi-phase Skill entry, auto-detects current Spec stage, auto-triggers core flow, manual review at key nodes</p>
163
-
164
- ## Commands
165
-
166
- <details>
167
- <summary><code>comet init [path]</code> — Initialize Comet workflow</summary>
168
-
169
- Initializes OpenSpec, Superpowers, and Comet skills for selected AI coding platforms.
170
-
171
- | Option | Description |
172
- |-------------------|--------------------------------------------------------------------------------|
173
- | `--yes` | Non-interactive mode, auto-select detected platforms (or all if none detected) |
174
- | `--scope <scope>` | Install scope: `project` or `global` |
175
- | `--skip-existing` | Skip already installed components |
176
- | `--overwrite` | Overwrite already installed components |
177
- | `--json` | Output structured JSON |
178
-
179
- When multiple existing components are found on the same platform, interactive init offers one bulk choice: overwrite
180
- all, skip all, or choose per component.
181
-
182
- </details>
183
-
184
- <details>
185
- <summary><code>comet status [path]</code> — Show active changes and next workflow command</summary>
186
-
187
- Displays active changes, task progress, and the recommended next Comet workflow command.
188
-
189
- | Option | Description |
190
- |----------|------------------------------------------|
191
- | `--json` | Output active changes with `nextCommand` |
192
-
193
- </details>
194
-
195
- <details>
196
- <summary><code>comet doctor [path]</code> — Diagnose Comet installation health</summary>
197
-
198
- Checks project/global installation health, working directories, installed skills, scripts, and Comet state files.
199
-
200
- | Option | Description |
201
- |-------------------|-----------------------------------------------------------------|
202
- | `--json` | Output structured diagnostic results |
203
- | `--scope <scope>` | Diagnose `auto`, `project`, or `global` scope (default: `auto`) |
204
-
205
- </details>
206
-
207
- <details>
208
- <summary><code>comet update [path]</code> — Update Comet package and skills</summary>
209
-
210
- Updates the npm package and refreshes installed Comet skills in detected project/global targets.
211
-
212
- | Option | Description |
213
- |---------------------|-----------------------------------------------|
214
- | `--json` | Output npm and skill update results as JSON |
215
- | `--language <lang>` | Override detected skill language (`en`, `zh`) |
216
- | `--scope <scope>` | Update only `global` or `project` scope |
217
-
218
- </details>
219
-
220
- | Command | Description |
221
- |-------------------|--------------|
222
- | `comet --help` | Show help |
223
- | `comet --version` | Show version |
224
-
225
- ## Supported Platforms
226
-
227
- `comet init` supports 28 AI coding platforms:
228
-
229
- <details>
230
- <summary>View full platform list</summary>
231
-
232
- | Platform | Skills Dir | Platform | Skills Dir |
233
- |--------------------|--------------|------------|---------------|
234
- | Claude Code | `.claude/` | Cursor | `.cursor/` |
235
- | Codex | `.codex/` | OpenCode | `.opencode/` |
236
- | Windsurf | `.windsurf/` | Cline | `.cline/` |
237
- | RooCode | `.roo/` | Continue | `.continue/` |
238
- | GitHub Copilot | `.github/` | Gemini CLI | `.gemini/` |
239
- | Amazon Q Developer | `.amazonq/` | Qwen Code | `.qwen/` |
240
- | Kilo Code | `.kilocode/` | Auggie | `.augment/` |
241
- | Kiro | `.kiro/` | Lingma | `.lingma/` |
242
- | Junie | `.junie/` | CodeBuddy | `.codebuddy/` |
243
- | CoStrict | `.cospec/` | Crush | `.crush/` |
244
- | Factory Droid | `.factory/` | iFlow | `.iflow/` |
245
- | Pi | `.pi/` | Qoder | `.qoder/` |
246
- | Antigravity | `.agents/` | Bob Shell | `.bob/` |
247
- | ForgeCode | `.forge/` | Trae | `.trae/` |
248
-
249
- </details>
250
-
251
- Some platforms use different project and global directories. For example, OpenCode global installs use
252
- `.config/opencode`, Lingma global installs use `.lingma`, and Antigravity global installs use `.gemini/antigravity`.
253
-
254
- ## Skills
255
-
256
- After `comet init`, three groups of skills are installed to the selected platform's `skills/` directory:
257
-
258
- ### Comet Skills
259
-
260
- <details>
261
- <summary>View Comet skills</summary>
262
-
263
- | Skill | Description |
264
- |------------------|----------------------------------------------------------------|
265
- | `/comet` | Main entry auto-detects phase and dispatches to sub-commands |
266
- | `/comet-open` | Phase 1: Open a change (proposal, design, task breakdown) |
267
- | `/comet-design` | Phase 2: Deep design (brainstorming, Design Doc) |
268
- | `/comet-build` | Phase 3: Plan and build (implementation plan, code commits) |
269
- | `/comet-verify` | Phase 4: Verify and finish (testing, verification report) |
270
- | `/comet-archive` | Phase 5: Archive (delta spec sync, status annotation) |
271
- | `/comet-hotfix` | Preset: Quick bug fix (skips brainstorming) |
272
- | `/comet-tweak` | Preset: Small change (skips brainstorming and full plan) |
273
-
274
- </details>
275
-
276
- ### Guard & Automation Scripts
277
-
278
- <details>
279
- <summary>View script list</summary>
280
-
281
- | Script | Purpose |
282
- |--------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
283
- | `comet-env.sh` | Script discovery helper — exports bundled script paths such as `COMET_GUARD`, `COMET_STATE`, `COMET_HANDOFF`, and `COMET_ARCHIVE` |
284
- | `comet-guard.sh` | Phase transition guard — validates exit conditions, `--apply` auto-updates `.comet.yaml` |
285
- | `comet-handoff.sh` | Design handoffgenerates deterministic context packages from OpenSpec artifacts with SHA256 tracing |
286
- | `comet-archive.sh` | One-command archive validates state, syncs specs, moves to archive, updates status |
287
- | `comet-yaml-validate.sh` | Schema validator validates `.comet.yaml` structure and field values |
288
- | `comet-hook-guard.sh` | Phase write guard PreToolUse hook, blocks file writes during open/design/archive phases |
289
- | `comet-state.sh` | Unified state management init/set/get/check/scale, agents' exclusive YAML interface |
290
-
291
- </details>
292
-
293
- ### OpenSpec Skills
294
-
295
- Spec lifecycle management: propose, explore, sync, verify, archive, and more.
296
-
297
- ### Superpowers Skills
298
-
299
- Development methodology: brainstorming, TDD, subagent-driven development, code review, plan writing, and more.
300
-
301
- ## Workflow
302
-
303
- ```
304
- /comet
305
- auto-detect
306
- /comet-open --> /comet-design --> /comet-build --> /comet-verify --> /comet-archive
307
- (OpenSpec) (Superpowers) (Superpowers) (Both) (OpenSpec)
308
-
309
- /comet-hotfix (preset path, skips brainstorming)
310
- open --> build --> verify --> archive
311
-
312
- /comet-tweak (preset path, skips brainstorming and full plan)
313
- open --> lightweight build --> light verify --> archive
314
- ```
315
-
316
- ### Five Phases
317
-
318
- | Phase | Command | Owner | Artifacts |
319
- |--------------------|------------------|-------------|--------------------------------------|
320
- | 1. Open | `/comet-open` | OpenSpec | proposal.md, design.md, tasks.md |
321
- | 2. Deep Design | `/comet-design` | Superpowers | Design Doc, delta spec |
322
- | 3. Plan & Build | `/comet-build` | Superpowers | Implementation plan, code commits |
323
- | 4. Verify & Finish | `/comet-verify` | Both | Verification report, branch handling |
324
- | 5. Archive | `/comet-archive` | OpenSpec | delta→main spec sync, archive |
325
-
326
- ### Core Principles
327
-
328
- - **Brainstorming is non-skippable** — every change must go through deep design (except hotfix/tweak)
329
- - **Delta specs are living documents** — freely editable during Phase 3, synced at archive
330
- - **Keep tasks.md in sync** — check off each task as completed
331
- - **Commit frequently** — one commit per task, message reflects design intent
332
- - **Verify before archive** `/comet-verify` must pass before `/comet-archive`
333
-
334
- ### State Management
335
-
336
- Comet uses a decoupled state architecture with separate YAML files:
337
-
338
- | File | Owner | Purpose |
339
- |------------------|----------|-----------------------------------------------------|
340
- | `.openspec.yaml` | OpenSpec | Spec lifecycle, change metadata |
341
- | `.comet.yaml` | Comet | Workflow phase, execution mode, verification status |
342
-
343
- All states and execution phases are updated via scripts, and each phase verifies that tasks are truly complete before
344
- advancing. Compared to storing complex state rules only in Skill text, this script-backed state machine gives Comet more
345
- reliable phase transitions, correct YAML, and easier breakpoint recovery; agents can read the current Spec situation
346
- through Comet's built-in commands.
347
-
348
- <details>
349
- <summary>View key .comet.yaml fields</summary>
350
-
351
- **Key Fields in `.comet.yaml`:**
352
-
353
- ```yaml
354
- workflow: full
355
- auto_transition: true
356
- phase: build
357
- build_mode: subagent-driven-development
358
- build_pause: null
359
- isolation: branch
360
- verify_mode: null
361
- tdd_mode: null
362
- subagent_dispatch: null
363
- design_doc: docs/superpowers/specs/YYYY-MM-DD-topic-design.md
364
- plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
365
- verify_result: pending
366
- verification_report: null
367
- branch_status: pending
368
- verified_at: null
369
- archived: false
370
- direct_override: false
371
- build_command: null
372
- verify_command: null
373
- handoff_context: openspec/changes/<name>/.comet/handoff/design-context.json
374
- handoff_hash: <sha256>
375
- ```
376
-
377
- In full workflow, `build_mode`, `build_pause`, `isolation`, `verify_mode`, `tdd_mode`, and `subagent_dispatch` may
378
- temporarily be `null`; `build_mode` and `isolation` must be resolved before `build → verify`. `auto_transition` controls automatic vs manual skill invocation after phase completion — see [AUTO-TRANSITION.md](docs/AUTO-TRANSITION.md). `build_pause` records an internal build-phase pause point:
379
- `null` means no pause, while `plan-ready` means the plan has been generated and the user paused before choosing
380
- isolation and execution mode. It is not an execution mode and must not be written into `build_mode`.
381
- `verification_report` stays `null` until verification writes a report, and `verify-pass` requires that report to exist
382
- plus `branch_status: handled`. Fields after `archived` in the example are optional or script-derived: `direct_override`
383
- is only needed for full-workflow direct builds, project commands may be absent unless configured, and
384
- `handoff_context` / `handoff_hash` are recorded by `comet-handoff.sh` before leaving design. Projects can configure
385
- `build_command` / `verify_command` in the change or repo root, and guard will run those commands first and print failure
386
- output.
387
-
388
- </details>
389
-
390
- ### Reliability Features
391
-
392
- Comet ensures agent execution reliability through automated state transitions:
393
-
394
- <details>
395
- <summary>View reliability features</summary>
396
-
397
- 1. **Entry Verification** Each phase validates preconditions before execution
398
- - Checks file existence, state consistency, and phase transitions
399
- - Outputs `[HARD STOP]` with actionable suggestions if validation fails
400
-
401
- 2. **Automated State Transitions** `comet-guard.sh --apply` updates `.comet.yaml` automatically
402
- - All phase transitions (open design/build verify archive) use `guard --apply`
403
- - No manual state editing required eliminates write-verification errors
404
- - `comet-state.sh` is the agents' exclusive interface for state operations
405
- - Guard and archive scripts use `comet-state.sh` internally for state management
406
-
407
- 3. **Schema Validation** — `comet-yaml-validate.sh` ensures data integrity
408
- - Validates required and optional fields
409
- - Validates enum values, including `direct_override`
410
- - Validates `design_doc`, `plan`, and `handoff_context` paths exist, plus `handoff_hash` format
411
- - Detects unknown/typos fields
412
-
413
- 4. **Build Decision Enforcement** — Guard and state transitions both block skipped build choices
414
- - `isolation` must be `branch` or `worktree`
415
- - `build_mode` must be selected before leaving build
416
- - `build_pause: plan-ready` is a recoverable pause after plan generation, not a `build_mode`
417
- - Full workflow `build_mode: direct` requires `direct_override: true`
418
-
419
- 5. **Verification Evidence** Guard enforces proof before phase advance
420
- - `verify-pass` transition requires `verification_report` pointing to an existing report file
421
- - `branch_status` must be `handled` before verify can pass
422
- - Guard checks `verification_report exists` and `branch_status=handled` as hard prerequisites
423
- - Prevents false phase advances when verification or branch handling was skipped
424
-
425
- 6. **Archive Automation** `comet-archive.sh` handles the full archive flow in one command
426
- - Validates entry state, merges delta specs into main specs through OpenSpec
427
- - Annotates design doc and plan frontmatter
428
- - Moves change to archive directory and updates `archived: true`
429
- - Supports `--dry-run` for preview
430
-
431
- </details>
432
-
433
- ## Project Structure
434
-
435
- ```
436
- your-project/
437
- ├── .comet/
438
- │ └── config.yaml # Project-level global config (context_compression, auto_transition, etc.)
439
- ├── .claude/skills/ # Platform skills dir (Comet + OpenSpec + Superpowers)
440
- │ ├── comet/SKILL.md
441
- │ │ └── scripts/
442
- │ │ ├── comet-guard.sh # Phase transition guard (--apply auto-updates state)
443
- │ │ ├── comet-env.sh # Script discovery helper
444
- │ │ ├── comet-handoff.sh # Design handoff (OpenSpec → Superpowers context tracing)
445
- │ │ ├── comet-archive.sh # One-command archive automation
446
- │ │ ├── comet-yaml-validate.sh # Schema validator
447
- │ │ ├── comet-hook-guard.sh # Phase write guard (PreToolUse hook)
448
- │ │ └── comet-state.sh # Unified state management (init/set/get/check/scale)
449
- │ ├── comet-*/SKILL.md
450
- │ ├── openspec-*/SKILL.md
451
- │ └── brainstorming/SKILL.md
452
- ├── openspec/ # OpenSpec — WHAT
453
- │ ├── config.yaml
454
- │ └── changes/
455
- │ └── <name>/
456
- │ ├── .openspec.yaml # OpenSpec state
457
- ├── .comet.yaml # Comet workflow state (decoupled)
458
- ├── proposal.md
459
- ├── design.md
460
- ├── specs/<capability>/spec.md
461
- └── tasks.md
462
- └── docs/superpowers/ # Superpowers HOW
463
- ├── specs/ # Design documents
464
- └── plans/ # Implementation plans
465
- ```
466
-
467
- <details>
468
- <summary>Context Compression (Beta)</summary>
469
-
470
- Comet supports context compression at the Design → Build handoff. When enabled, `comet-handoff.sh` generates a compact
471
- context package that reduces Build-phase input tokens by **25–30%** without affecting implementation correctness.
472
-
473
- | Mode | Behavior | Token Savings |
474
- |--------|------------------------------------------|---------------|
475
- | `off` | Full Spec excerpts in handoff context | Baseline |
476
- | `beta` | Design Doc + SHA256 hash references only | ~25–30% |
477
-
478
- Key findings from benchmark testing:
479
-
480
- - **Test pass rate**: 100% across all tiers (compression does not affect correctness)
481
- - **Spec coverage**: 100% (off) vs 95% (beta) — minor edge-case detail loss
482
- - **Scaling**: Larger tasks yield higher absolute savings (up to 15,000 tokens for large-tier tasks)
483
-
484
- Enable in `.comet/config.yaml`: `context_compression: beta`
485
-
486
- See [CONTEXT-COMPRESSION.md](docs/CONTEXT-COMPRESSION.md) for the full benchmark report, compression principles, and
487
- reproduction steps.
488
-
489
- </details>
490
-
491
- <details>
492
- <summary>Auto Transition</summary>
493
-
494
- `auto_transition` controls whether Comet automatically invokes the next skill after a phase completes, or pauses for
495
- manual handoff. Phase advancement itself always happens this setting only affects skill invocation.
496
-
497
- | Value | Behavior |
498
- |--------|----------|
499
- | `true` | Auto-invoke the next skill after each phase (default) |
500
- | `false` | Pause after each phase; user manually triggers the next skill |
501
-
502
- Three-layer configuration with precedence: `COMET_AUTO_TRANSITION` env var > `.comet/config.yaml` (project) > `.comet.yaml` (change).
503
-
504
- See [AUTO-TRANSITION.md](docs/AUTO-TRANSITION.md) for configuration details, workflow mapping, and FAQ.
505
-
506
- </details>
507
-
508
- ## Development
509
-
510
- See [CONTRIBUTING.md](CONTRIBUTING.md) | [中文版](CONTRIBUTING-zh.md) for development setup, commit
511
- conventions, PR process, branch workflow, and guidance for adding platforms,
512
- skills, scripts, or changelog entries.
513
-
514
- See [CHANGELOG.md](CHANGELOG.md) for version history and updates.
515
-
516
- ## Roadmap
517
-
518
- Track our development progress and upcoming features on the [Comet Roadmap](https://github.com/orgs/rpamis/projects/1).
519
-
520
- ## Star History
521
-
522
- [![Star History Chart](https://api.star-history.com/svg?repos=rpamis/comet&type=Date)](https://star-history.com/#rpamis/comet&Date)
523
-
524
- ## Contributors
525
-
526
- <a href="https://github.com/rpamis/comet/graphs/contributors">
527
- <img src="https://contrib.rocks/image?repo=rpamis/comet&columns=12&anon=1" />
528
- </a>
529
-
530
- ## License
531
-
532
- [MIT](LICENSE)
533
-
534
- ## Community
535
-
1
+ <p align="center">
2
+ <a href="https://github.com/rpamis/comet/blob/master/img/title-log.png">
3
+ <picture>
4
+ <source srcset="https://github.com/rpamis/comet/blob/master/img/title-log.png">
5
+ <img src="https://github.com/rpamis/comet/blob/master/img/title-log.png" alt="Comet logo">
6
+ </picture>
7
+ </a>
8
+ </p>
9
+
10
+ <p align="center">
11
+ <a href="https://github.com/rpamis/comet/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/rpamis/comet/ci.yml?branch=master&style=flat-square&label=CI" /></a>
12
+ <a href="https://deepwiki.com/rpamis/comet"><img alt="DeepWiki" src="https://img.shields.io/badge/DeepWiki-rpamis%2Fcomet-blue?style=flat-square" /></a>
13
+ <a href="https://www.npmjs.com/package/@rpamis/comet"><img alt="npm version" src="https://img.shields.io/npm/v/@rpamis/comet?style=flat-square" /></a>
14
+ <a href="https://www.npmjs.com/package/@rpamis/comet"><img alt="npm download count" src="https://img.shields.io/npm/dm/@rpamis/comet?style=flat-square&label=Downloads/mo" /></a>
15
+ <a href="https://www.npmjs.com/package/@rpamis/comet"><img alt="npm weekly download count" src="https://img.shields.io/npm/dw/@rpamis/comet?style=flat-square&label=Downloads/wk" /></a>
16
+ <a href="./LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" /></a>
17
+ </p>
18
+
19
+ # @rpamis/comet
20
+
21
+ ```
22
+ ██████╗ ██████╗ ███╗ ███╗███████╗████████╗
23
+ ██╔════╝██╔═══██╗████╗ ████║██╔════╝╚══██╔══╝
24
+ ██║ ██║ ██║██╔████╔██║█████╗ ██║
25
+ ██║ ██║ ██║██║╚██╔╝██║██╔══╝ ██║
26
+ ╚██████╗╚██████╔╝██║ ╚═╝ ██║███████╗ ██║
27
+ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝
28
+ ```
29
+
30
+ > 中文版:[README-zh.md](README-zh.md)
31
+ > [Bilibili video](https://www.bilibili.com/video/BV1y4Gi6CEo1/?spm_id_from=333.1387.homepage.video_card.click&vd_source=d22726fe6b108647dbebf1c5d8817377)
32
+ > [DouYin](https://www.douyin.com/search/comet?aid=cd8fcc82-498b-4d59-8860-617deb719412&modal_id=7646429015808936293&type=general)
33
+
34
+ **OpenSpec + Superpowers dual-star development workflow** — one command from idea to archive.
35
+
36
+ OpenSpec handles **WHAT** (outlines, proposals, spec lifecycle, archiving).
37
+
38
+ Superpowers handles **HOW** (technical design, planning, execution, wrap-up).
39
+
40
+ Comet chains both into a five-phase automated pipeline.
41
+
42
+ > [!IMPORTANT]
43
+ > **0.3.7 Highlights** — One-step [CodeGraph](https://github.com/colbymchenry/codegraph) semantic code indexing (official: cost **↓16%**, tool calls **↓58%**);
44
+ >
45
+ > New **Beta context compression** cutting Build-phase input tokens by **25–30%**;
46
+ > New active context compression mechanism to release context consumed by reading specs and brainstorming, preserving window space for the subsequent Build phase.
47
+ > 6 default-on workflow token optimizations; New `auto_transition` config for automatic or manual phase handoff;
48
+ > Hook+Rule anti-drift phase guard; Optional TDD mode and subagent dispatch confirmation;
49
+ > Large PRD split into multiple changes; Pre-archive confirmation with reopen, verify retry limit, systematic debugging interception, and verification completion check.
50
+ >
51
+ > See [NEWS.md](NEWS.md) for details.
52
+
53
+ ## Why Comet
54
+
55
+ OpenSpec excels at managing requirements, creating proposals, managing Spec lifecycles, and archiving, but its proposals
56
+ and tasks lack the detail of Superpowers brainstorming.
57
+
58
+ Superpowers generates Spec documents after brainstorming, but these documents typically lack stateful design — after
59
+ completing requirements, Specs only have tasks checked off in the document, and Agents even forget to check them off.
60
+ This causes the Agent to re-examine documents and project code to verify on resumption, wasting many tokens.
61
+
62
+ **Comet combines the strengths of both**, integrating the core workflow into 5 phases
63
+
64
+ The main entry `/comet` supports current Spec state detection, suitable for long tasks — after closing your AI coding
65
+ session midway, just `/comet` and Comet will automatically read the active Spec (lists multiple for selection),
66
+ dynamically identify which phase is currently executing, and continue.
67
+
68
+ At the same time, Comet provides full Spec lifecycle management. During execution, it links OpenSpec change/spec
69
+ artifacts with Superpowers design and planning documents, then automates handoff, state updates, validation, and archive
70
+ sync so users do not have to repeatedly remind the Agent to keep documents synchronized and connected.
71
+
72
+ ## What You'll Learn
73
+
74
+ Many excellent Skill projects exist in the current Skill market, but they generally have preference issues — users may
75
+ only like some features. For example, when using both OpenSpec and Superpowers, one might only use OpenSpec's Spec
76
+ management capabilities, but prefer Superpowers' TDD-driven approach for coding.
77
+
78
+ Long-term Skill users know these capabilities can be freely combined, but exactly how to do so still requires real
79
+ practice. The Comet project can serve as a reference:
80
+
81
+ - **How to reliably trigger nested Skills** — Not letting the Agent rely on document descriptions to perform "look-alike
82
+ Skill trigger" operations (like writing files based on Skill descriptions), but truly triggering Skills (key feature:
83
+ Skill trigger prints on CC). Comet triggers many capabilities from OpenSpec and Superpowers. How is this Prompt
84
+ written?
85
+
86
+ - **How to make combined Skills flow automatically across phases** — Not relying on manual intervention. Comet's 5-phase
87
+ flow can automatically trigger Skills for the core process except for necessary user choices, while the state machine
88
+ also protects state transition reliability.
89
+
90
+ - **How to turn the Spec lifecycle into a resumable workflow** — Comet links OpenSpec change/spec artifacts with
91
+ Superpowers design and planning documents, then records phase, execution mode, verification results, and archive
92
+ status in `.comet.yaml`, so the Agent can resume after interruption instead of rereading documents and guessing
93
+ progress.
94
+
95
+ - **How to turn document synchronization from "user reminders" into automation** — Comet puts handoff, state updates,
96
+ validation, and archive sync into scripted flows, reducing repeated prompts like "remember to update the design
97
+ doc", "remember to sync the spec", and "remember to archive the change".
98
+
99
+ - **How to design guard conditions that Agents can execute** — Comet does not simply trust the Agent saying "done" at
100
+ phase exits. Scripts such as `comet-guard.sh`, `comet-yaml-validate.sh`, and `comet-state.sh` check tasks, state
101
+ fields, verification evidence, and archive conditions before allowing the workflow to advance.
102
+
103
+ - **How to distribute and install Skills across platforms** — Comet supports multiple AI coding platforms,
104
+ project/global installation, Chinese/English Skill choices, and platform-specific directory differences such as
105
+ Antigravity using different project-level and global paths. It can be a reference for CLI installers and Skill package
106
+ structure.
107
+
108
+ - **How to turn shell scripts into Agent workflow infrastructure** — Comet's scripts need to work across macOS, Linux,
109
+ and Windows Git Bash while handling hashes, YAML fields, state machines, and archive flows. It shows how to move
110
+ fragile workflow control out of scattered Prompt text and into testable, reusable tools.
111
+
112
+ ## Install
113
+
114
+ Requirements:
115
+
116
+ - Node.js 20+
117
+ - npm/npx
118
+ - Git
119
+ - Bash-compatible shell for workflow scripts (Windows users should use Git Bash or an equivalent bash environment)
120
+
121
+ ```bash
122
+ npm install -g @rpamis/comet
123
+ ```
124
+
125
+ ## Quick Start
126
+
127
+ ```bash
128
+ cd your-project
129
+ comet init
130
+ ```
131
+
132
+ `comet init` will:
133
+
134
+ 1. Prompt you to select AI platforms (auto-detects existing configs)
135
+ 2. Choose install scope: project-level (current directory) or global (home directory)
136
+ 3. Select language for Comet skills: English or 中文
137
+ 4. Install [OpenSpec](https://github.com/Fission-AI/OpenSpec) skills
138
+ 5. Install [Superpowers](https://github.com/obra/superpowers) skills
139
+ 6. Deploy Comet skills (in your chosen language) to selected platforms
140
+ 7. Create `docs/superpowers/specs/` and `docs/superpowers/plans/` working directories for project-scope installs
141
+
142
+ > [!TIP]
143
+ > update version
144
+ >
145
+ > `comet update` or `npm install -g @rpamis/comet@latest` to get the latest features and fixes.
146
+
147
+ ## Support for OpenClaw and Hermes, and other AI platforms
148
+
149
+ For platforms that use the generic `skills` CLI directly, you can install the Comet skill package with:
150
+
151
+ ```bash
152
+ npx skills add rpamis/comet
153
+ ```
154
+
155
+ ## Screenshots
156
+
157
+ <p align="center">
158
+ <img src="https://github.com/rpamis/comet/blob/master/img/runner.png" alt="runner">
159
+ </p>
160
+
161
+ <p align="center">Auto-install OpenSpec & Superpowers, one-click dev environment setup</p>
162
+ <p align="center">Multi-phase Skill entry, auto-detects current Spec stage, auto-triggers core flow, manual review at key nodes</p>
163
+
164
+ ## Commands
165
+
166
+ <details>
167
+ <summary><code>comet init [path]</code> — Initialize Comet workflow</summary>
168
+
169
+ Initializes OpenSpec, Superpowers, and Comet skills for selected AI coding platforms.
170
+
171
+ | Option | Description |
172
+ |-------------------|--------------------------------------------------------------------------------|
173
+ | `--yes` | Non-interactive mode, auto-select detected platforms (or all if none detected) |
174
+ | `--scope <scope>` | Install scope: `project` or `global` |
175
+ | `--skip-existing` | Skip already installed components |
176
+ | `--overwrite` | Overwrite already installed components |
177
+ | `--json` | Output structured JSON |
178
+
179
+ When multiple existing components are found on the same platform, interactive init offers one bulk choice: overwrite
180
+ all, skip all, or choose per component.
181
+
182
+ </details>
183
+
184
+ <details>
185
+ <summary><code>comet status [path]</code> — Show active changes and next workflow command</summary>
186
+
187
+ Displays active changes, task progress, and the recommended next Comet workflow command.
188
+
189
+ | Option | Description |
190
+ |----------|------------------------------------------|
191
+ | `--json` | Output active changes with `nextCommand` |
192
+
193
+ </details>
194
+
195
+ <details>
196
+ <summary><code>comet doctor [path]</code> — Diagnose Comet installation health</summary>
197
+
198
+ Checks project/global installation health, working directories, installed skills, scripts, and Comet state files.
199
+
200
+ | Option | Description |
201
+ |-------------------|-----------------------------------------------------------------|
202
+ | `--json` | Output structured diagnostic results |
203
+ | `--scope <scope>` | Diagnose `auto`, `project`, or `global` scope (default: `auto`) |
204
+
205
+ </details>
206
+
207
+ <details>
208
+ <summary><code>comet update [path]</code> — Update Comet package and skills</summary>
209
+
210
+ Updates the npm package and refreshes installed Comet skills in detected project/global targets.
211
+
212
+ | Option | Description |
213
+ |---------------------|-----------------------------------------------|
214
+ | `--json` | Output npm and skill update results as JSON |
215
+ | `--language <lang>` | Override detected skill language (`en`, `zh`) |
216
+ | `--scope <scope>` | Update only `global` or `project` scope |
217
+
218
+ </details>
219
+
220
+ <details>
221
+ <summary><code>comet uninstall [path]</code> — Remove Comet skills, rules, and hooks</summary>
222
+
223
+ Safely removes Comet-distributed skills, rules, and hooks from all detected platforms. Preserves user-defined hooks and non-Comet configuration.
224
+
225
+ | Option | Description |
226
+ |-------------------|------------------------------------------------|
227
+ | `--force` | Skip confirmation prompt |
228
+ | `--scope <scope>` | Uninstall only `global` or `project` scope |
229
+ | `--json` | Output removal results as JSON |
230
+
231
+ ```bash
232
+ comet uninstall # Interactive shows targets, asks for confirmation
233
+ comet uninstall --force # Non-interactive — removes everything immediately
234
+ comet uninstall --scope project # Only remove project-level installations
235
+ ```
236
+
237
+ </details>
238
+
239
+ | Command | Description |
240
+ |-------------------|--------------|
241
+ | `comet --help` | Show help |
242
+ | `comet --version` | Show version |
243
+
244
+ ## Supported Platforms
245
+
246
+ `comet init` supports 29 AI coding platforms:
247
+
248
+ <details>
249
+ <summary>View full platform list</summary>
250
+
251
+ | Platform | Skills Dir | Platform | Skills Dir |
252
+ |--------------------|--------------|------------|---------------|
253
+ | Claude Code | `.claude/` | Cursor | `.cursor/` |
254
+ | Codex | `.codex/` | OpenCode | `.opencode/` |
255
+ | Windsurf | `.windsurf/` | Cline | `.cline/` |
256
+ | RooCode | `.roo/` | Continue | `.continue/` |
257
+ | GitHub Copilot | `.github/` | Gemini CLI | `.gemini/` |
258
+ | Amazon Q Developer | `.amazonq/` | Qwen Code | `.qwen/` |
259
+ | Kilo Code | `.kilocode/` | Auggie | `.augment/` |
260
+ | Kimi Code | `.kimi-code/`| Kiro | `.kiro/` |
261
+ | Lingma | `.lingma/` | Junie | `.junie/` |
262
+ | CodeBuddy | `.codebuddy/`| CoStrict | `.cospec/` |
263
+ | Crush | `.crush/` | Factory Droid | `.factory/` |
264
+ | iFlow | `.iflow/` | Pi | `.pi/` |
265
+ | Qoder | `.qoder/` | Antigravity | `.agents/` |
266
+ | Bob Shell | `.bob/` | ForgeCode | `.forge/` |
267
+ | Trae | `.trae/` | | |
268
+
269
+ </details>
270
+
271
+ Some platforms use different project and global directories. For example, OpenCode global installs use
272
+ `.config/opencode`, Lingma global installs use `.lingma`, and Antigravity global installs use `.gemini/antigravity`.
273
+
274
+ ## Skills
275
+
276
+ After `comet init`, three groups of skills are installed to the selected platform's `skills/` directory:
277
+
278
+ ### Comet Skills
279
+
280
+ <details>
281
+ <summary>View Comet skills</summary>
282
+
283
+ | Skill | Description |
284
+ |------------------|----------------------------------------------------------------|
285
+ | `/comet` | Main entryauto-detects phase and dispatches to sub-commands |
286
+ | `/comet-open` | Phase 1: Open a change (proposal, design, task breakdown) |
287
+ | `/comet-design` | Phase 2: Deep design (brainstorming, Design Doc) |
288
+ | `/comet-build` | Phase 3: Plan and build (implementation plan, code commits) |
289
+ | `/comet-verify` | Phase 4: Verify and finish (testing, verification report) |
290
+ | `/comet-archive` | Phase 5: Archive (delta spec sync, status annotation) |
291
+ | `/comet-hotfix` | Preset: Quick bug fix (skips brainstorming) |
292
+ | `/comet-tweak` | Preset: Small change (skips brainstorming and full plan) |
293
+
294
+ </details>
295
+
296
+ ### Guard & Automation Scripts
297
+
298
+ <details>
299
+ <summary>View script list</summary>
300
+
301
+ | Script | Purpose |
302
+ |--------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
303
+ | `comet-env.sh` | Script discovery helper — exports bundled script paths such as `COMET_GUARD`, `COMET_STATE`, `COMET_HANDOFF`, and `COMET_ARCHIVE` |
304
+ | `comet-guard.sh` | Phase transition guard — validates exit conditions, `--apply` auto-updates `.comet.yaml` |
305
+ | `comet-handoff.sh` | Design handoff — generates deterministic context packages from OpenSpec artifacts with SHA256 tracing |
306
+ | `comet-archive.sh` | One-command archive — validates state, syncs specs, moves to archive, updates status |
307
+ | `comet-yaml-validate.sh` | Schema validator — validates `.comet.yaml` structure and field values |
308
+ | `comet-hook-guard.sh` | Phase write guard — PreToolUse hook, blocks file writes during open/design/archive phases |
309
+ | `comet-state.sh` | Unified state management — init/set/get/check/scale, agents' exclusive YAML interface |
310
+
311
+ </details>
312
+
313
+ ### OpenSpec Skills
314
+
315
+ Spec lifecycle management: propose, explore, sync, verify, archive, and more.
316
+
317
+ ### Superpowers Skills
318
+
319
+ Development methodology: brainstorming, TDD, subagent-driven development, code review, plan writing, and more.
320
+
321
+ ## Workflow
322
+
323
+ ```
324
+ /comet
325
+ ↓ auto-detect
326
+ /comet-open --> /comet-design --> /comet-build --> /comet-verify --> /comet-archive
327
+ (OpenSpec) (Superpowers) (Superpowers) (Both) (OpenSpec)
328
+
329
+ /comet-hotfix (preset path, skips brainstorming)
330
+ open --> build --> verify --> archive
331
+
332
+ /comet-tweak (preset path, skips brainstorming and full plan)
333
+ open --> lightweight build --> light verify --> archive
334
+ ```
335
+
336
+ ### Five Phases
337
+
338
+ | Phase | Command | Owner | Artifacts |
339
+ |--------------------|------------------|-------------|--------------------------------------|
340
+ | 1. Open | `/comet-open` | OpenSpec | proposal.md, design.md, tasks.md |
341
+ | 2. Deep Design | `/comet-design` | Superpowers | Design Doc, delta spec |
342
+ | 3. Plan & Build | `/comet-build` | Superpowers | Implementation plan, code commits |
343
+ | 4. Verify & Finish | `/comet-verify` | Both | Verification report, branch handling |
344
+ | 5. Archive | `/comet-archive` | OpenSpec | delta→main spec sync, archive |
345
+
346
+ ### Core Principles
347
+
348
+ - **Brainstorming is non-skippable** — every change must go through deep design (except hotfix/tweak)
349
+ - **Delta specs are living documents** — freely editable during Phase 3, synced at archive
350
+ - **Keep tasks.md in sync** — check off each task as completed
351
+ - **Commit frequently** one commit per task, message reflects design intent
352
+ - **Verify before archive** — `/comet-verify` must pass before `/comet-archive`
353
+
354
+ ### State Management
355
+
356
+ Comet uses a decoupled state architecture with separate YAML files:
357
+
358
+ | File | Owner | Purpose |
359
+ |------------------|----------|-----------------------------------------------------|
360
+ | `.openspec.yaml` | OpenSpec | Spec lifecycle, change metadata |
361
+ | `.comet.yaml` | Comet | Workflow phase, execution mode, verification status |
362
+
363
+ All states and execution phases are updated via scripts, and each phase verifies that tasks are truly complete before
364
+ advancing. Compared to storing complex state rules only in Skill text, this script-backed state machine gives Comet more
365
+ reliable phase transitions, correct YAML, and easier breakpoint recovery; agents can read the current Spec situation
366
+ through Comet's built-in commands.
367
+
368
+ <details>
369
+ <summary>View key .comet.yaml fields</summary>
370
+
371
+ **Key Fields in `.comet.yaml`:**
372
+
373
+ ```yaml
374
+ workflow: full
375
+ auto_transition: true
376
+ phase: build
377
+ build_mode: subagent-driven-development
378
+ build_pause: null
379
+ isolation: branch
380
+ verify_mode: null
381
+ tdd_mode: null
382
+ subagent_dispatch: null
383
+ design_doc: docs/superpowers/specs/YYYY-MM-DD-topic-design.md
384
+ plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
385
+ verify_result: pending
386
+ verification_report: null
387
+ branch_status: pending
388
+ verified_at: null
389
+ archived: false
390
+ direct_override: false
391
+ build_command: null
392
+ verify_command: null
393
+ handoff_context: openspec/changes/<name>/.comet/handoff/design-context.json
394
+ handoff_hash: <sha256>
395
+ ```
396
+
397
+ In full workflow, `build_mode`, `build_pause`, `isolation`, `verify_mode`, `tdd_mode`, and `subagent_dispatch` may
398
+ temporarily be `null`; `build_mode` and `isolation` must be resolved before `build → verify`. `auto_transition` controls automatic vs manual skill invocation after phase completion — see [AUTO-TRANSITION.md](docs/AUTO-TRANSITION.md). `build_pause` records an internal build-phase pause point:
399
+ `null` means no pause, while `plan-ready` means the plan has been generated and the user paused before choosing
400
+ isolation and execution mode. It is not an execution mode and must not be written into `build_mode`.
401
+ `verification_report` stays `null` until verification writes a report, and `verify-pass` requires that report to exist
402
+ plus `branch_status: handled`. Fields after `archived` in the example are optional or script-derived: `direct_override`
403
+ is only needed for full-workflow direct builds, project commands may be absent unless configured, and
404
+ `handoff_context` / `handoff_hash` are recorded by `comet-handoff.sh` before leaving design. Projects can configure
405
+ `build_command` / `verify_command` in the change or repo root, and guard will run those commands first and print failure
406
+ output.
407
+
408
+ </details>
409
+
410
+ ### Reliability Features
411
+
412
+ Comet ensures agent execution reliability through automated state transitions:
413
+
414
+ <details>
415
+ <summary>View reliability features</summary>
416
+
417
+ 1. **Entry Verification** Each phase validates preconditions before execution
418
+ - Checks file existence, state consistency, and phase transitions
419
+ - Outputs `[HARD STOP]` with actionable suggestions if validation fails
420
+
421
+ 2. **Automated State Transitions** `comet-guard.sh --apply` updates `.comet.yaml` automatically
422
+ - All phase transitions (open design/build verify → archive) use `guard --apply`
423
+ - No manual state editing required eliminates write-verification errors
424
+ - `comet-state.sh` is the agents' exclusive interface for state operations
425
+ - Guard and archive scripts use `comet-state.sh` internally for state management
426
+
427
+ 3. **Schema Validation** `comet-yaml-validate.sh` ensures data integrity
428
+ - Validates required and optional fields
429
+ - Validates enum values, including `direct_override`
430
+ - Validates `design_doc`, `plan`, and `handoff_context` paths exist, plus `handoff_hash` format
431
+ - Detects unknown/typos fields
432
+
433
+ 4. **Build Decision Enforcement** — Guard and state transitions both block skipped build choices
434
+ - `isolation` must be `branch` or `worktree`
435
+ - `build_mode` must be selected before leaving build
436
+ - `build_pause: plan-ready` is a recoverable pause after plan generation, not a `build_mode`
437
+ - Full workflow `build_mode: direct` requires `direct_override: true`
438
+
439
+ 5. **Verification Evidence** Guard enforces proof before phase advance
440
+ - `verify-pass` transition requires `verification_report` pointing to an existing report file
441
+ - `branch_status` must be `handled` before verify can pass
442
+ - Guard checks `verification_report exists` and `branch_status=handled` as hard prerequisites
443
+ - Prevents false phase advances when verification or branch handling was skipped
444
+
445
+ 6. **Archive Automation** — `comet-archive.sh` handles the full archive flow in one command
446
+ - Validates entry state, merges delta specs into main specs through OpenSpec
447
+ - Annotates design doc and plan frontmatter
448
+ - Moves change to archive directory and updates `archived: true`
449
+ - Supports `--dry-run` for preview
450
+
451
+ </details>
452
+
453
+ ## Project Structure
454
+
455
+ ```
456
+ your-project/
457
+ ├── .comet/
458
+ └── config.yaml # Project-level global config (context_compression, auto_transition, etc.)
459
+ ├── .claude/skills/ # Platform skills dir (Comet + OpenSpec + Superpowers)
460
+ ├── comet/SKILL.md
461
+ └── scripts/
462
+ │ │ ├── comet-guard.sh # Phase transition guard (--apply auto-updates state)
463
+ │ │ ├── comet-env.sh # Script discovery helper
464
+ │ │ ├── comet-handoff.sh # Design handoff (OpenSpec → Superpowers context tracing)
465
+ │ │ ├── comet-archive.sh # One-command archive automation
466
+ │ │ ├── comet-yaml-validate.sh # Schema validator
467
+ │ │ ├── comet-hook-guard.sh # Phase write guard (PreToolUse hook)
468
+ │ │ └── comet-state.sh # Unified state management (init/set/get/check/scale)
469
+ │ ├── comet-*/SKILL.md
470
+ │ ├── openspec-*/SKILL.md
471
+ │ └── brainstorming/SKILL.md
472
+ ├── openspec/ # OpenSpec — WHAT
473
+ ├── config.yaml
474
+ │ └── changes/
475
+ │ └── <name>/
476
+ │ ├── .openspec.yaml # OpenSpec state
477
+ │ ├── .comet.yaml # Comet workflow state (decoupled)
478
+ │ ├── proposal.md
479
+ │ ├── design.md
480
+ │ ├── specs/<capability>/spec.md
481
+ │ └── tasks.md
482
+ └── docs/superpowers/ # Superpowers HOW
483
+ ├── specs/ # Design documents
484
+ └── plans/ # Implementation plans
485
+ ```
486
+
487
+ <details>
488
+ <summary>Context Compression (Beta)</summary>
489
+
490
+ Comet supports context compression at the Design → Build handoff. When enabled, `comet-handoff.sh` generates a compact
491
+ context package that reduces Build-phase input tokens by **25–30%** without affecting implementation correctness.
492
+
493
+ | Mode | Behavior | Token Savings |
494
+ |--------|------------------------------------------|---------------|
495
+ | `off` | Full Spec excerpts in handoff context | Baseline |
496
+ | `beta` | Design Doc + SHA256 hash references only | ~25–30% |
497
+
498
+ Key findings from benchmark testing:
499
+
500
+ - **Test pass rate**: 100% across all tiers (compression does not affect correctness)
501
+ - **Spec coverage**: 100% (off) vs 95% (beta) — minor edge-case detail loss
502
+ - **Scaling**: Larger tasks yield higher absolute savings (up to 15,000 tokens for large-tier tasks)
503
+
504
+ Enable in `.comet/config.yaml`: `context_compression: beta`
505
+
506
+ See [CONTEXT-COMPRESSION.md](docs/CONTEXT-COMPRESSION.md) for the full benchmark report, compression principles, and
507
+ reproduction steps.
508
+
509
+ </details>
510
+
511
+ <details>
512
+ <summary>Auto Transition</summary>
513
+
514
+ `auto_transition` controls whether Comet automatically invokes the next skill after a phase completes, or pauses for
515
+ manual handoff. Phase advancement itself always happens — this setting only affects skill invocation.
516
+
517
+ | Value | Behavior |
518
+ |--------|----------|
519
+ | `true` | Auto-invoke the next skill after each phase (default) |
520
+ | `false` | Pause after each phase; user manually triggers the next skill |
521
+
522
+ Three-layer configuration with precedence: `COMET_AUTO_TRANSITION` env var > `.comet/config.yaml` (project) > `.comet.yaml` (change).
523
+
524
+ See [AUTO-TRANSITION.md](docs/AUTO-TRANSITION.md) for configuration details, workflow mapping, and FAQ.
525
+
526
+ </details>
527
+
528
+ ## Development
529
+
530
+ See [CONTRIBUTING.md](CONTRIBUTING.md) | [中文版](CONTRIBUTING-zh.md) for development setup, commit
531
+ conventions, PR process, branch workflow, and guidance for adding platforms,
532
+ skills, scripts, or changelog entries.
533
+
534
+ See [CHANGELOG.md](CHANGELOG.md) for version history and updates.
535
+
536
+ ## Roadmap
537
+
538
+ Track our development progress and upcoming features on the [Comet Roadmap](https://github.com/orgs/rpamis/projects/1).
539
+
540
+ ## Star History
541
+
542
+ [![Star History Chart](https://api.star-history.com/svg?repos=rpamis/comet&type=Date)](https://star-history.com/#rpamis/comet&Date)
543
+
544
+ ## Contributors
545
+
546
+ <a href="https://github.com/rpamis/comet/graphs/contributors">
547
+ <img src="https://contrib.rocks/image?repo=rpamis/comet&columns=12&anon=1" />
548
+ </a>
549
+
550
+ ## License
551
+
552
+ [MIT](LICENSE)
553
+
554
+ ## Community
555
+
536
556
  <table align="center">
537
557
  <tr>
538
558
  <td align="center" width="180">
@@ -549,7 +569,7 @@ Track our development progress and upcoming features on the [Comet Roadmap](http
549
569
  </td>
550
570
  </tr>
551
571
  </table>
552
-
553
- ## Reference
554
-
555
- [LINUX DO - 新的理想型社区](https://linux.do/)
572
+
573
+ ## Reference
574
+
575
+ [LINUX DO - 新的理想型社区](https://linux.do/)