@rpamis/comet 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +180 -56
  3. package/assets/manifest.json +11 -1
  4. package/assets/skills/comet/SKILL.md +59 -24
  5. package/assets/skills/comet/reference/dirty-worktree.md +1 -0
  6. package/assets/skills/comet/rules/comet-phase-guard.md +90 -0
  7. package/assets/skills/comet/scripts/comet-archive.sh +75 -57
  8. package/assets/skills/comet/scripts/comet-env.sh +57 -2
  9. package/assets/skills/comet/scripts/comet-guard.sh +187 -29
  10. package/assets/skills/comet/scripts/comet-handoff.sh +137 -8
  11. package/assets/skills/comet/scripts/comet-hook-guard.sh +260 -0
  12. package/assets/skills/comet/scripts/comet-state.sh +312 -25
  13. package/assets/skills/comet/scripts/comet-yaml-validate.sh +26 -1
  14. package/assets/skills/comet-archive/SKILL.md +45 -12
  15. package/assets/skills/comet-build/SKILL.md +159 -33
  16. package/assets/skills/comet-design/SKILL.md +129 -23
  17. package/assets/skills/comet-hotfix/SKILL.md +57 -15
  18. package/assets/skills/comet-open/SKILL.md +90 -17
  19. package/assets/skills/comet-tweak/SKILL.md +40 -15
  20. package/assets/skills/comet-verify/SKILL.md +64 -25
  21. package/assets/skills-zh/comet/SKILL.md +63 -25
  22. package/assets/skills-zh/comet/reference/dirty-worktree.md +2 -1
  23. package/assets/skills-zh/comet-archive/SKILL.md +46 -13
  24. package/assets/skills-zh/comet-build/SKILL.md +161 -35
  25. package/assets/skills-zh/comet-design/SKILL.md +132 -25
  26. package/assets/skills-zh/comet-hotfix/SKILL.md +53 -15
  27. package/assets/skills-zh/comet-open/SKILL.md +90 -17
  28. package/assets/skills-zh/comet-tweak/SKILL.md +36 -15
  29. package/assets/skills-zh/comet-verify/SKILL.md +64 -27
  30. package/bin/comet.js +3 -3
  31. package/dist/commands/doctor.d.ts.map +1 -1
  32. package/dist/commands/doctor.js +22 -0
  33. package/dist/commands/doctor.js.map +1 -1
  34. package/dist/commands/init.d.ts +5 -1
  35. package/dist/commands/init.d.ts.map +1 -1
  36. package/dist/commands/init.js +64 -9
  37. package/dist/commands/init.js.map +1 -1
  38. package/dist/commands/update.d.ts.map +1 -1
  39. package/dist/commands/update.js +60 -1
  40. package/dist/commands/update.js.map +1 -1
  41. package/dist/core/codegraph.d.ts +9 -0
  42. package/dist/core/codegraph.d.ts.map +1 -0
  43. package/dist/core/codegraph.js +96 -0
  44. package/dist/core/codegraph.js.map +1 -0
  45. package/dist/core/platforms.d.ts +10 -0
  46. package/dist/core/platforms.d.ts.map +1 -1
  47. package/dist/core/platforms.js +163 -15
  48. package/dist/core/platforms.js.map +1 -1
  49. package/dist/core/skills.d.ts +34 -1
  50. package/dist/core/skills.d.ts.map +1 -1
  51. package/dist/core/skills.js +360 -1
  52. package/dist/core/skills.js.map +1 -1
  53. package/package.json +3 -1
  54. package/scripts/postinstall.js +44 -44
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 rpamis
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rpamis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -29,6 +29,7 @@
29
29
 
30
30
  > 中文版:[README-zh.md](README-zh.md)
31
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)
32
33
 
33
34
  **OpenSpec + Superpowers dual-star development workflow** — one command from idea to archive.
34
35
 
@@ -38,37 +39,75 @@ Superpowers handles **HOW** (technical design, planning, execution, wrap-up).
38
39
 
39
40
  Comet chains both into a five-phase automated pipeline.
40
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
+
41
53
  ## Why Comet
42
54
 
43
- OpenSpec excels at managing requirements, creating proposals, managing Spec lifecycles, and archiving, but its proposals and tasks lack the detail of Superpowers brainstorming.
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.
44
57
 
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.
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.
46
61
 
47
62
  **Comet combines the strengths of both**, integrating the core workflow into 5 phases
48
63
 
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.
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.
50
67
 
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.
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.
52
71
 
53
72
  ## What You'll Learn
54
73
 
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.
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.
56
77
 
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:
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:
58
80
 
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?
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?
60
85
 
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.
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.
62
89
 
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.
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.
64
94
 
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".
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".
66
98
 
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.
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.
68
102
 
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.
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.
70
107
 
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.
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.
72
111
 
73
112
  ## Install
74
113
 
@@ -130,14 +169,15 @@ npx skills add rpamis/comet
130
169
  Initializes OpenSpec, Superpowers, and Comet skills for selected AI coding platforms.
131
170
 
132
171
  | Option | Description |
133
- | ----------------- | ------------------------------------------------------------------------------ |
172
+ |-------------------|--------------------------------------------------------------------------------|
134
173
  | `--yes` | Non-interactive mode, auto-select detected platforms (or all if none detected) |
135
174
  | `--scope <scope>` | Install scope: `project` or `global` |
136
175
  | `--skip-existing` | Skip already installed components |
137
176
  | `--overwrite` | Overwrite already installed components |
138
177
  | `--json` | Output structured JSON |
139
178
 
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.
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.
141
181
 
142
182
  </details>
143
183
 
@@ -147,7 +187,7 @@ When multiple existing components are found on the same platform, interactive in
147
187
  Displays active changes, task progress, and the recommended next Comet workflow command.
148
188
 
149
189
  | Option | Description |
150
- | -------- | ---------------------------------------- |
190
+ |----------|------------------------------------------|
151
191
  | `--json` | Output active changes with `nextCommand` |
152
192
 
153
193
  </details>
@@ -158,7 +198,7 @@ Displays active changes, task progress, and the recommended next Comet workflow
158
198
  Checks project/global installation health, working directories, installed skills, scripts, and Comet state files.
159
199
 
160
200
  | Option | Description |
161
- | ----------------- | --------------------------------------------------------------- |
201
+ |-------------------|-----------------------------------------------------------------|
162
202
  | `--json` | Output structured diagnostic results |
163
203
  | `--scope <scope>` | Diagnose `auto`, `project`, or `global` scope (default: `auto`) |
164
204
 
@@ -170,7 +210,7 @@ Checks project/global installation health, working directories, installed skills
170
210
  Updates the npm package and refreshes installed Comet skills in detected project/global targets.
171
211
 
172
212
  | Option | Description |
173
- | ------------------- | --------------------------------------------- |
213
+ |---------------------|-----------------------------------------------|
174
214
  | `--json` | Output npm and skill update results as JSON |
175
215
  | `--language <lang>` | Override detected skill language (`en`, `zh`) |
176
216
  | `--scope <scope>` | Update only `global` or `project` scope |
@@ -178,7 +218,7 @@ Updates the npm package and refreshes installed Comet skills in detected project
178
218
  </details>
179
219
 
180
220
  | Command | Description |
181
- | ----------------- | ------------ |
221
+ |-------------------|--------------|
182
222
  | `comet --help` | Show help |
183
223
  | `comet --version` | Show version |
184
224
 
@@ -190,7 +230,7 @@ Updates the npm package and refreshes installed Comet skills in detected project
190
230
  <summary>View full platform list</summary>
191
231
 
192
232
  | Platform | Skills Dir | Platform | Skills Dir |
193
- | ------------------ | ------------ | ---------- | ------------- |
233
+ |--------------------|--------------|------------|---------------|
194
234
  | Claude Code | `.claude/` | Cursor | `.cursor/` |
195
235
  | Codex | `.codex/` | OpenCode | `.opencode/` |
196
236
  | Windsurf | `.windsurf/` | Cline | `.cline/` |
@@ -208,7 +248,8 @@ Updates the npm package and refreshes installed Comet skills in detected project
208
248
 
209
249
  </details>
210
250
 
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`.
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`.
212
253
 
213
254
  ## Skills
214
255
 
@@ -220,7 +261,7 @@ After `comet init`, three groups of skills are installed to the selected platfor
220
261
  <summary>View Comet skills</summary>
221
262
 
222
263
  | Skill | Description |
223
- | ---------------- | -------------------------------------------------------------- |
264
+ |------------------|----------------------------------------------------------------|
224
265
  | `/comet` | Main entry — auto-detects phase and dispatches to sub-commands |
225
266
  | `/comet-open` | Phase 1: Open a change (proposal, design, task breakdown) |
226
267
  | `/comet-design` | Phase 2: Deep design (brainstorming, Design Doc) |
@@ -237,14 +278,15 @@ After `comet init`, three groups of skills are installed to the selected platfor
237
278
  <details>
238
279
  <summary>View script list</summary>
239
280
 
240
- | Script | Purpose |
241
- | ------------------------ | ----------------------------------------------------------------------------------------------------- |
281
+ | Script | Purpose |
282
+ |--------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
242
283
  | `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 managementinit/set/get/check/scale, agents' exclusive YAML interface |
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 guardPreToolUse 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 |
248
290
 
249
291
  </details>
250
292
 
@@ -274,7 +316,7 @@ Development methodology: brainstorming, TDD, subagent-driven development, code r
274
316
  ### Five Phases
275
317
 
276
318
  | Phase | Command | Owner | Artifacts |
277
- | ------------------ | ---------------- | ----------- | ------------------------------------ |
319
+ |--------------------|------------------|-------------|--------------------------------------|
278
320
  | 1. Open | `/comet-open` | OpenSpec | proposal.md, design.md, tasks.md |
279
321
  | 2. Deep Design | `/comet-design` | Superpowers | Design Doc, delta spec |
280
322
  | 3. Plan & Build | `/comet-build` | Superpowers | Implementation plan, code commits |
@@ -294,11 +336,14 @@ Development methodology: brainstorming, TDD, subagent-driven development, code r
294
336
  Comet uses a decoupled state architecture with separate YAML files:
295
337
 
296
338
  | File | Owner | Purpose |
297
- | ---------------- | -------- | --------------------------------------------------- |
339
+ |------------------|----------|-----------------------------------------------------|
298
340
  | `.openspec.yaml` | OpenSpec | Spec lifecycle, change metadata |
299
341
  | `.comet.yaml` | Comet | Workflow phase, execution mode, verification status |
300
342
 
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.
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.
302
347
 
303
348
  <details>
304
349
  <summary>View key .comet.yaml fields</summary>
@@ -307,10 +352,14 @@ All states and execution phases are updated via scripts, and each phase verifies
307
352
 
308
353
  ```yaml
309
354
  workflow: full
355
+ auto_transition: true
310
356
  phase: build
311
357
  build_mode: subagent-driven-development
358
+ build_pause: null
312
359
  isolation: branch
313
360
  verify_mode: null
361
+ tdd_mode: null
362
+ subagent_dispatch: null
314
363
  design_doc: docs/superpowers/specs/YYYY-MM-DD-topic-design.md
315
364
  plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
316
365
  verify_result: pending
@@ -325,7 +374,16 @@ handoff_context: openspec/changes/<name>/.comet/handoff/design-context.json
325
374
  handoff_hash: <sha256>
326
375
  ```
327
376
 
328
- In full workflow, `build_mode`, `isolation`, and `verify_mode` may temporarily be `null`; `build_mode` and `isolation` must be resolved before `build → verify`. `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.
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.
329
387
 
330
388
  </details>
331
389
 
@@ -337,37 +395,38 @@ Comet ensures agent execution reliability through automated state transitions:
337
395
  <summary>View reliability features</summary>
338
396
 
339
397
  1. **Entry Verification** — Each phase validates preconditions before execution
340
- - Checks file existence, state consistency, and phase transitions
341
- - Outputs `[HARD STOP]` with actionable suggestions if validation fails
398
+ - Checks file existence, state consistency, and phase transitions
399
+ - Outputs `[HARD STOP]` with actionable suggestions if validation fails
342
400
 
343
401
  2. **Automated State Transitions** — `comet-guard.sh --apply` updates `.comet.yaml` automatically
344
- - All phase transitions (open → design/build → verify → archive) use `guard --apply`
345
- - No manual state editing required — eliminates write-verification errors
346
- - `comet-state.sh` is the agents' exclusive interface for state operations
347
- - Guard and archive scripts use `comet-state.sh` internally for state management
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
348
406
 
349
407
  3. **Schema Validation** — `comet-yaml-validate.sh` ensures data integrity
350
- - Validates required and optional fields
351
- - Validates enum values, including `direct_override`
352
- - Validates `design_doc`, `plan`, and `handoff_context` paths exist, plus `handoff_hash` format
353
- - Detects unknown/typos fields
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
354
412
 
355
413
  4. **Build Decision Enforcement** — Guard and state transitions both block skipped build choices
356
- - `isolation` must be `branch` or `worktree`
357
- - `build_mode` must be selected before leaving build
358
- - Full workflow `build_mode: direct` requires `direct_override: true`
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`
359
418
 
360
419
  5. **Verification Evidence** — Guard enforces proof before phase advance
361
- - `verify-pass` transition requires `verification_report` pointing to an existing report file
362
- - `branch_status` must be `handled` before verify can pass
363
- - Guard checks `verification_report exists` and `branch_status=handled` as hard prerequisites
364
- - Prevents false phase advances when verification or branch handling was skipped
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
365
424
 
366
425
  6. **Archive Automation** — `comet-archive.sh` handles the full archive flow in one command
367
- - Validates entry state, syncs delta specs to main specs
368
- - Annotates design doc and plan frontmatter
369
- - Moves change to archive directory and updates `archived: true`
370
- - Supports `--dry-run` for preview
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
371
430
 
372
431
  </details>
373
432
 
@@ -375,6 +434,8 @@ Comet ensures agent execution reliability through automated state transitions:
375
434
 
376
435
  ```
377
436
  your-project/
437
+ ├── .comet/
438
+ │ └── config.yaml # Project-level global config (context_compression, auto_transition, etc.)
378
439
  ├── .claude/skills/ # Platform skills dir (Comet + OpenSpec + Superpowers)
379
440
  │ ├── comet/SKILL.md
380
441
  │ │ └── scripts/
@@ -383,6 +444,7 @@ your-project/
383
444
  │ │ ├── comet-handoff.sh # Design handoff (OpenSpec → Superpowers context tracing)
384
445
  │ │ ├── comet-archive.sh # One-command archive automation
385
446
  │ │ ├── comet-yaml-validate.sh # Schema validator
447
+ │ │ ├── comet-hook-guard.sh # Phase write guard (PreToolUse hook)
386
448
  │ │ └── comet-state.sh # Unified state management (init/set/get/check/scale)
387
449
  │ ├── comet-*/SKILL.md
388
450
  │ ├── openspec-*/SKILL.md
@@ -402,9 +464,52 @@ your-project/
402
464
  └── plans/ # Implementation plans
403
465
  ```
404
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
+
405
508
  ## Development
406
509
 
407
- See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, commit conventions, PR process, and guidance for adding platforms or skills.
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.
408
513
 
409
514
  See [CHANGELOG.md](CHANGELOG.md) for version history and updates.
410
515
 
@@ -419,13 +524,32 @@ Track our development progress and upcoming features on the [Comet Roadmap](http
419
524
  ## Contributors
420
525
 
421
526
  <a href="https://github.com/rpamis/comet/graphs/contributors">
422
- <img src="https://contrib.rocks/image?repo=rpamis/comet&max=999&columns=12&anon=1" />
527
+ <img src="https://contrib.rocks/image?repo=rpamis/comet&columns=12&anon=1" />
423
528
  </a>
424
529
 
425
530
  ## License
426
531
 
427
532
  [MIT](LICENSE)
428
533
 
534
+ ## Community
535
+
536
+ <table align="center">
537
+ <tr>
538
+ <td align="center" width="180">
539
+ <img src="https://github.com/rpamis/comet/blob/master/img/douyin.png" width="120" height="120"><br>
540
+ <b>DouYin (Recommended)</b>
541
+ </td>
542
+ <td align="center" width="180">
543
+ <img src="https://github.com/rpamis/comet/blob/master/img/wechat.jpg" width="120" height="120"><br>
544
+ <b>WeChat</b>
545
+ </td>
546
+ <td align="center" width="180">
547
+ <img src="https://github.com/rpamis/comet/blob/master/img/qq.jpg" width="120" height="120"><br>
548
+ <b>QQ</b>
549
+ </td>
550
+ </tr>
551
+ </table>
552
+
429
553
  ## Reference
430
554
 
431
555
  [LINUX DO - 新的理想型社区](https://linux.do/)
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.2",
2
+ "version": "0.3.3",
3
3
  "skills": [
4
4
  "comet/SKILL.md",
5
5
  "comet/reference/dirty-worktree.md",
@@ -9,6 +9,7 @@
9
9
  "comet/scripts/comet-handoff.sh",
10
10
  "comet/scripts/comet-archive.sh",
11
11
  "comet/scripts/comet-yaml-validate.sh",
12
+ "comet/scripts/comet-hook-guard.sh",
12
13
  "comet-open/SKILL.md",
13
14
  "comet-design/SKILL.md",
14
15
  "comet-build/SKILL.md",
@@ -17,6 +18,15 @@
17
18
  "comet-hotfix/SKILL.md",
18
19
  "comet-tweak/SKILL.md"
19
20
  ],
21
+ "rules": [
22
+ "comet/rules/comet-phase-guard.md"
23
+ ],
24
+ "hooks": {
25
+ "comet/scripts/comet-hook-guard.sh": {
26
+ "matcher": "Write|Edit",
27
+ "description": "Block code writes in wrong Comet phase (open/design/archive)"
28
+ }
29
+ },
20
30
  "languages": [
21
31
  { "id": "en", "name": "English", "skillsDir": "skills" },
22
32
  { "id": "zh", "name": "中文", "skillsDir": "skills-zh" }