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