@rpamis/comet 0.3.7 → 0.3.9

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