@rpamis/comet 0.1.8 → 0.2.1

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 (66) hide show
  1. package/README.md +25 -5
  2. package/assets/manifest.json +2 -0
  3. package/assets/skills/comet/SKILL.md +214 -219
  4. package/assets/skills/comet/scripts/comet-guard.sh +255 -253
  5. package/assets/skills/comet/scripts/comet-state.sh +5 -3
  6. package/assets/skills/comet-archive/SKILL.md +2 -2
  7. package/assets/skills/comet-build/SKILL.md +1 -1
  8. package/assets/skills/comet-design/SKILL.md +1 -1
  9. package/assets/skills/comet-hotfix/SKILL.md +136 -133
  10. package/assets/skills/comet-open/SKILL.md +1 -1
  11. package/assets/skills/comet-tweak/SKILL.md +122 -120
  12. package/assets/skills/comet-verify/SKILL.md +2 -4
  13. package/assets/skills-zh/comet/SKILL.md +87 -98
  14. package/assets/skills-zh/comet-archive/SKILL.md +63 -63
  15. package/assets/skills-zh/comet-build/SKILL.md +153 -153
  16. package/assets/skills-zh/comet-design/SKILL.md +91 -91
  17. package/assets/skills-zh/comet-hotfix/SKILL.md +10 -7
  18. package/assets/skills-zh/comet-open/SKILL.md +70 -70
  19. package/assets/skills-zh/comet-tweak/SKILL.md +11 -9
  20. package/assets/skills-zh/comet-verify/SKILL.md +114 -116
  21. package/dist/cli/index.js +28 -1
  22. package/dist/cli/index.js.map +1 -1
  23. package/dist/commands/doctor.d.ts +6 -0
  24. package/dist/commands/doctor.d.ts.map +1 -0
  25. package/dist/commands/doctor.js +168 -0
  26. package/dist/commands/doctor.js.map +1 -0
  27. package/dist/commands/init.d.ts +9 -0
  28. package/dist/commands/init.d.ts.map +1 -0
  29. package/dist/commands/init.js +183 -0
  30. package/dist/commands/init.js.map +1 -0
  31. package/dist/commands/status.d.ts +6 -0
  32. package/dist/commands/status.d.ts.map +1 -0
  33. package/dist/commands/status.js +89 -0
  34. package/dist/commands/status.js.map +1 -0
  35. package/dist/commands/update.d.ts +8 -0
  36. package/dist/commands/update.d.ts.map +1 -0
  37. package/dist/commands/update.js +47 -0
  38. package/dist/commands/update.js.map +1 -0
  39. package/dist/core/detect.d.ts +8 -0
  40. package/dist/core/detect.d.ts.map +1 -0
  41. package/dist/core/detect.js +73 -0
  42. package/dist/core/detect.js.map +1 -0
  43. package/dist/core/openspec.d.ts +5 -0
  44. package/dist/core/openspec.d.ts.map +1 -0
  45. package/dist/core/openspec.js +58 -0
  46. package/dist/core/openspec.js.map +1 -0
  47. package/dist/core/platforms.d.ts.map +1 -1
  48. package/dist/core/platforms.js +6 -1
  49. package/dist/core/platforms.js.map +1 -1
  50. package/dist/core/skills.d.ts +22 -0
  51. package/dist/core/skills.d.ts.map +1 -0
  52. package/dist/core/skills.js +59 -0
  53. package/dist/core/skills.js.map +1 -0
  54. package/dist/core/superpowers.d.ts +5 -0
  55. package/dist/core/superpowers.d.ts.map +1 -0
  56. package/dist/core/superpowers.js +60 -0
  57. package/dist/core/superpowers.js.map +1 -0
  58. package/dist/core/types.d.ts +2 -0
  59. package/dist/core/types.d.ts.map +1 -0
  60. package/dist/core/types.js +2 -0
  61. package/dist/core/types.js.map +1 -0
  62. package/package.json +62 -50
  63. package/dist/core/init.d.ts +0 -14
  64. package/dist/core/init.d.ts.map +0 -1
  65. package/dist/core/init.js +0 -492
  66. package/dist/core/init.js.map +0 -1
package/README.md CHANGED
@@ -9,6 +9,8 @@
9
9
  ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝
10
10
  ```
11
11
 
12
+ > 中文版:[README-zh.md](README-zh.md)
13
+
12
14
  **OpenSpec + Superpowers dual-star development workflow** — one command from idea to archive.
13
15
 
14
16
  OpenSpec handles **WHAT** (outlines, proposals, spec lifecycle, archiving). Superpowers handles **HOW** (technical design, planning, execution, wrap-up). Comet chains both into a five-phase automated pipeline.
@@ -41,6 +43,9 @@ comet init
41
43
  | Command | Description |
42
44
  |---------|-------------|
43
45
  | `comet init [path]` | Initialize Comet workflow |
46
+ | `comet status [path]` | Show active changes and workflow status |
47
+ | `comet doctor [path]` | Diagnose Comet installation health |
48
+ | `comet update [path]` | Update comet skills to latest version |
44
49
  | `comet --help` | Show help |
45
50
  | `comet --version` | Show version |
46
51
 
@@ -51,6 +56,15 @@ comet init
51
56
  | `--yes` | Non-interactive mode, auto-select detected platforms |
52
57
  | `--skip-existing` | Skip already installed components |
53
58
  | `--overwrite` | Overwrite already installed components |
59
+ | `--json` | Output structured JSON |
60
+
61
+ ### status / doctor / update Options
62
+
63
+ | Option | Applies to | Description |
64
+ |--------|-----------|-------------|
65
+ | `--json` | `status`, `doctor` | Output structured JSON |
66
+ | `--language <lang>` | `update` | Language for skills (`en`, `zh`) |
67
+ | `--scope <scope>` | `update` | Install scope (`global`, `project`)|
54
68
 
55
69
  ## Supported Platforms
56
70
 
@@ -112,14 +126,14 @@ Development methodology: brainstorming, TDD, subagent-driven development, code r
112
126
  ```
113
127
  /comet
114
128
  ↓ auto-detect
115
- /comet-open ——→ /comet-design ——→ /comet-build ——→ /comet-verify ——→ /comet-archive
116
- (OpenSpec) (Superpowers) (Superpowers) (Both) (OpenSpec)
129
+ /comet-open --> /comet-design --> /comet-build --> /comet-verify --> /comet-archive
130
+ (OpenSpec) (Superpowers) (Superpowers) (Both) (OpenSpec)
117
131
 
118
132
  /comet-hotfix (preset path, skips brainstorming)
119
- open ——→ build ——→ verify ——→ archive
133
+ open --> build --> verify --> archive
120
134
 
121
135
  /comet-tweak (preset path, skips brainstorming and full plan)
122
- open ——→ lightweight build ——→ light verify ——→ archive
136
+ open --> lightweight build --> light verify --> archive
123
137
  ```
124
138
 
125
139
  ### Five Phases
@@ -233,8 +247,14 @@ pnpm dev
233
247
  # Build
234
248
  pnpm build
235
249
 
236
- # Test
250
+ # Test (unit + coverage)
237
251
  pnpm test
252
+ pnpm test:coverage
253
+ pnpm test:shell # bats shell tests
254
+
255
+ # Lint & format
256
+ pnpm lint
257
+ pnpm format
238
258
  ```
239
259
 
240
260
  See [CHANGELOG.md](CHANGELOG.md) for version history and updates.
@@ -3,6 +3,8 @@
3
3
  "skills": [
4
4
  "comet/SKILL.md",
5
5
  "comet/scripts/comet-guard.sh",
6
+ "comet/scripts/comet-state.sh",
7
+ "comet/scripts/comet-archive.sh",
6
8
  "comet/scripts/comet-yaml-validate.sh",
7
9
  "comet-open/SKILL.md",
8
10
  "comet-design/SKILL.md",
@@ -1,219 +1,214 @@
1
- ---
2
- name: comet
3
- description: "Comet — OpenSpec + Superpowers dual-star development workflow. Start with /comet for automatic phase detection and dispatch to subcommands. Five phases: open → design → build → verify → archive."
4
- ---
5
-
6
- # Comet — OpenSpec + Superpowers Dual-Star Development Workflow
7
-
8
- OpenSpec and Superpowers orbit the same goal like a binary star system. OpenSpec handles WHAT, Superpowers handles HOW.
9
-
10
- ```
11
- OpenSpec handles WHAT — outline, proposal, spec lifecycle, archive
12
- Superpowers handles HOW — technical design, planning, execution, closing
13
- ```
14
-
15
- **Core principle: brainstorming cannot be skipped. Every change must undergo deep design (except hotfix and tweak presets).**
16
-
17
- <IMPORTANT>
18
- ## Phase Transitions
19
-
20
- A single `/comet` invocation starts from the detected phase and prompts or advances to the next phase when exit conditions are met.
21
-
22
- Flow chain: open → design → build → verify → archive
23
-
24
- Nodes requiring user participation:
25
- 1. Confirm design approach during brainstorming
26
- 2. Select execution mode during build phase
27
- 3. Decide to fix or accept deviation when verify fails
28
- 4. Choose branch handling method for finishing-branch
29
- 5. Encounter upgrade conditions (hotfix/tweak → full workflow)
30
-
31
- Agents should not skip these decision points; other unambiguous phase transitions can proceed automatically.
32
- </IMPORTANT>
33
-
34
- ## Automatic Phase Detection
35
-
36
- ### Step 0: Active Change Discovery
37
-
38
- **Execute immediately:**
39
-
40
- 1. Run `openspec list --json` to get all active changes
41
- 2. For each change, check `docs/superpowers/specs/` and `docs/superpowers/plans/` for associated files to determine phase and progress
42
-
43
- **Branch logic:**
44
-
45
- | Situation | Action |
46
- |-----------|--------|
47
- | No active change | → Invoke `/comet-open` |
48
- | Exactly 1 active change |Auto-select, enter phase determination (Step 1) |
49
- | Multiple active changes | List for user selection |
50
-
51
- **Multi-change selection**: Display using AskUserQuestion, example format:
52
-
53
- ```
54
- | # | Change Name | Current Phase | Task Progress |
55
- |---|-------------|---------------|---------------|
56
- | 1 | xxx-feature | Build | 3/5 tasks |
57
- | 2 | yyy-fix | Design | No design doc |
58
- ```
59
-
60
- After user selection, enter phase determination for the selected change.
61
-
62
- **Preset detection**:
63
- - If user explicitly describes as bug fix / hotfix and hotfix conditions are met, directly invoke `/comet-hotfix` (skip selection).
64
- - If user explicitly describes as copy, config, docs, prompt, or small non-bug adjustment and tweak conditions are met, directly invoke `/comet-tweak` (skip selection).
65
-
66
- ### Step 1: Comet State Metadata Reading
67
-
68
- Prefer reading `openspec/changes/<name>/.comet.yaml`. If not available, fall back to `openspec status --change "<name>" --json`, `tasks.md`, and `docs/superpowers/` file checks.
69
-
70
- Recommended metadata structure:
71
-
72
- ```yaml
73
- workflow: full
74
- phase: build
75
- design_doc: docs/superpowers/specs/YYYY-MM-DD-topic-design.md
76
- plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
77
- build_mode: subagent-driven-development
78
- isolation: branch
79
- verify_mode: light
80
- verify_result: pending
81
- verified_at: null
82
- archived: false
83
- ```
84
-
85
- Field meanings:
86
-
87
- | Field | Meaning |
88
- |-------|---------|
89
- | `workflow` | `full`, `hotfix`, or `tweak` |
90
- | `phase` | Current phase: `open`, `design`, `build`, `verify`, `archive` |
91
- | `design_doc` | Associated Superpowers Design Doc path, can be empty |
92
- | `plan` | Associated Superpowers Plan path, can be empty |
93
- | `build_mode` | Selected execution mode, can be empty |
94
- | `isolation` | `branch` or `worktree`, workspace isolation method, defaults to `branch` |
95
- | `verify_mode` | `light` or `full`, can be empty |
96
- | `verify_result` | `pending`, `pass`, or `fail` |
97
- | `verified_at` | Verification pass time, can be empty |
98
- | `archived` | Whether change is archived |
99
-
100
- ### Step 2: Phase Determination
101
-
102
- For the selected change, determine current state in the following order:
103
-
104
- 1. **`archived: true` or change moved to archive** Workflow complete
105
- 2. **`verify_result: pass` and `archived` is not `true`** Invoke `/comet-archive`
106
- 3. **`phase: verify` or tasks.md all checked** Invoke `/comet-verify`
107
- 4. **`phase: build` or has Design Doc but plan/execution incomplete** Invoke `/comet-build`
108
- 5. **`phase: design` or has change but no Design Doc** Invoke `/comet-design`
109
- 6. **No active change or state undeterminable** Invoke `/comet-open`
110
-
111
- If metadata conflicts with file state, use verifiable file state as source of truth and correct `.comet.yaml` before continuing phase.
112
-
113
- ---
114
-
115
- ## Subcommands
116
-
117
- | Command | Phase | Owner | Artifacts |
118
- |---------|-------|-------|-----------|
119
- | `/comet-open` | 1. Open | OpenSpec | proposal.md、design.md、tasks.md |
120
- | `/comet-design` | 2. Deep Design | Superpowers | Design Doc、delta spec |
121
- | `/comet-build` | 3. Plan & Build | Superpowers | Implementation plan、code commits |
122
- | `/comet-verify` | 4. Verify & Close | Both | Verification report、branch handling |
123
- | `/comet-archive` | 5. Archive | OpenSpec | deltamain spec sync、design doc markup、archive |
124
- | `/comet-hotfix` | Preset path | Both | Quick fix (skip brainstorming) |
125
- | `/comet-tweak` | Preset path | Both | Small change (skip brainstorming and full plan) |
126
-
127
- ---
128
-
129
- ## Flow Diagram
130
-
131
- ```
132
- /comet
133
- Auto-detect
134
- /comet-open ──→ /comet-design ──→ /comet-build ──→ /comet-verify ──→ /comet-archive
135
- (OpenSpec) (Superpowers) (Superpowers) (Both) (OpenSpec)
136
-
137
- /comet-hotfix(preset path, skip brainstorming)
138
- open ──→ build ──→ verify ──→ archive
139
- If upgrade triggered → supplement Design Doc → return to full workflow
140
-
141
- /comet-tweak(preset path, skip brainstorming and full plan)
142
- open ──→ lightweight build ──→ light verify ──→ archive
143
- ↑ If upgrade triggered → supplement Design Doc → return to full workflow
144
- ```
145
-
146
- ---
147
-
148
- ## Error Handling
149
-
150
- | Scenario | Handling |
151
- |----------|----------|
152
- | `openspec list --json` fails | Check if openspec is installed, prompt user to run `openspec init` |
153
- | Sub-skill unavailable (e.g., `superpowers:brainstorming`) | Stop workflow, prompt to install or enable corresponding skill |
154
- | `.comet.yaml` malformed or missing | Use file state as source of truth (tasks.md、docs/superpowers/), correct metadata then continue |
155
- | Maven compile/test fails | Return to build phase for fixes, do not enter verify |
156
- | Incomplete change directory structure | Fill missing files according to `comet-open` artifact requirements |
157
-
158
- ---
159
-
160
- ## Quick Reference
161
-
162
- ### Script Location
163
-
164
- Comet phase guard script `comet-guard.sh` and archive script `comet-archive.sh` are distributed with the skill package, located in `comet/scripts/` directory.
165
- **Do not hardcode platform paths**, self-locate at runtime with:
166
-
167
- ```bash
168
- COMET_GUARD=$(find . -path '*/comet/scripts/comet-guard.sh' -type f -print -quit)
169
- bash "$COMET_GUARD" <change-name> <phase>
170
- ```
171
-
172
- **Auto state update**: Guard supports `--apply` flag, automatically updating `.comet.yaml` state fields after checks pass:
173
-
174
- ```bash
175
- bash "$COMET_GUARD" <change-name> <phase> --apply
176
- ```
177
-
178
- **Archive script**: Complete all archive steps in one command:
179
-
180
- ```bash
181
- COMET_ARCHIVE=$(find . -path '*/comet/scripts/comet-archive.sh' -type f -print -quit)
182
- bash "$COMET_ARCHIVE" <change-name>
183
- ```
184
-
185
- In subsequent documentation, `bash $COMET_GUARD <change> <phase>` refers to this command. After loading comet, agents should cache `COMET_GUARD` path in shell environment to avoid repeated `find`.
186
-
187
- ### File Structure
188
-
189
- ```
190
- openspec/ # OpenSpec — WHAT
191
- ├── config.yaml
192
- ├── changes/
193
- │ ├── <name>/ # Active change
194
- │ │ ├── .openspec.yaml
195
- │ ├── .comet.yaml
196
- │ │ ├── proposal.md # Why + What
197
- │ │ ├── design.md # High-level architecture decisions
198
- │ │ ├── specs/<capability>/spec.md # Delta capability spec
199
- │ │ └── tasks.md # Task checklist
200
- └── archive/YYYY-MM-DD-<name>/ # Archived
201
- └── specs/<capability>/spec.md # Main specs (overwritten from delta at archive)
202
-
203
- docs/superpowers/ # Superpowers — HOW
204
- ├── specs/YYYY-MM-DD-<topic>-design.md # Design doc (technical RFC, mark status at archive)
205
- └── plans/YYYY-MM-DD-<feature>.md # Implementation plan (file header contains change association metadata)
206
- ```
207
-
208
- ### Best Practices
209
-
210
- 1. **brainstorming cannot be skipped** — Every change must undergo deep design (except hotfix and tweak)
211
- 2. **delta spec is a living document** — Freely modify during phase 3, sync at archive
212
- 3. **Keep tasks.md in sync** — Check off each completed task
213
- 4. **Commit frequently** — One commit per task, message reflects design intent
214
- 5. **Verify before archive** — Execute `/comet-archive` only after `/comet-verify` passes
215
- 6. **Classify incremental updates** — Small edits, medium brainstorming, large new changes
216
- 7. **Plan must associate with change** — File header contains `change:` and `design-doc:` metadata
217
- 8. **Archive closure** — design doc and plan must mark `archived-with` status
218
- 9. **Modifying existing features** — Just open a new change; brainstorming reads existing specs as context naturally
219
- 10. **Preset has limits** — Switch to full workflow promptly when hotfix/tweak meet upgrade conditions
1
+ ---
2
+ name: comet
3
+ description: "Comet — OpenSpec + Superpowers dual-star development workflow. Start with /comet for automatic phase detection and dispatch to subcommands. Five phases: open → design → build → verify → archive."
4
+ ---
5
+
6
+ # Comet — OpenSpec + Superpowers Dual-Star Development Workflow
7
+
8
+ OpenSpec and Superpowers orbit the same goal like a binary star system. OpenSpec handles WHAT, Superpowers handles HOW.
9
+
10
+ ```
11
+ OpenSpec handles WHAT — outline, proposal, spec lifecycle, archive
12
+ Superpowers handles HOW — technical design, planning, execution, closing
13
+ ```
14
+
15
+ **Core principle: brainstorming cannot be skipped. Every change must undergo deep design (except hotfix and tweak presets).**
16
+
17
+ ---
18
+
19
+ ## Decision Core
20
+
21
+ Agents need only read this section for decision-making. Refer to the Reference Appendix as needed.
22
+
23
+ ### Automatic Phase Detection
24
+
25
+ **Step 0: Active Change Discovery**
26
+
27
+ 1. Run `openspec list --json` to get all active changes
28
+ 2. For each change, check `docs/superpowers/specs/` and `docs/superpowers/plans/` for associated files to determine phase and progress
29
+
30
+ | Situation | Action |
31
+ |-----------|--------|
32
+ | No active change | → Invoke `/comet-open` |
33
+ | Exactly 1 active change | → Auto-select, enter Step 1 |
34
+ | Multiple active changes | → List for user selection |
35
+
36
+ **Preset detection**:
37
+ - User describes as bug fix / hotfix + meets hotfix conditions → directly invoke `/comet-hotfix`
38
+ - User describes as copy, config, docs, prompt or small non-bug adjustment + meets tweak conditions → directly invoke `/comet-tweak`
39
+
40
+ **Step 1: Read `.comet.yaml` state metadata**
41
+
42
+ Prefer reading `openspec/changes/<name>/.comet.yaml`. If not available, fall back to `openspec status --change "<name>" --json`, `tasks.md`, and `docs/superpowers/` file checks.
43
+
44
+ **Step 2: Phase Determination** (check in order, first match wins)
45
+
46
+ 1. `archived: true` or change moved to archive → Workflow complete
47
+ 2. `verify_result: pass` and `archived` is not `true` → Invoke `/comet-archive`
48
+ 3. `phase: verify` or tasks.md all checked Invoke `/comet-verify`
49
+ 4. `phase: build` or has Design Doc but plan/execution incomplete → Invoke `/comet-build`
50
+ 5. `phase: design` or has change but no Design Doc → Invoke `/comet-design`
51
+ 6. No active change or state undeterminable Invoke `/comet-open`
52
+
53
+ If metadata conflicts with file state, use verifiable file state as source of truth and correct `.comet.yaml` before continuing.
54
+
55
+ ### Preset Upgrade Criteria
56
+
57
+ **hotfix full** (upgrade if any condition met):
58
+ - Change involves **3+ files**
59
+ - Architecture changes (new modules, new interfaces, new dependencies)
60
+ - Database schema changes
61
+ - Fix introduces new public API
62
+ - Fix scope exceeds a single function/module
63
+
64
+ **tweak full** (upgrade if any condition met):
65
+ - Change involves **5+ files**
66
+ - Cross-module coordination required
67
+ - **5+** new test cases needed
68
+ - Config item additions or deletions (not value changes)
69
+
70
+ ### Error Handling Quick Reference
71
+
72
+ | Scenario | Handling |
73
+ |----------|----------|
74
+ | `openspec list --json` fails | Check if openspec is installed, prompt user to run `openspec init` |
75
+ | Sub-skill unavailable | Stop workflow, prompt to install or enable the corresponding skill |
76
+ | `.comet.yaml` malformed or missing | Use file state as source of truth, correct with `bash $COMET_STATE set` then continue |
77
+ | Maven compile/test fails | Return to build phase for fixes, do not enter verify |
78
+ | Incomplete change directory structure | Fill missing files according to `comet-open` artifact requirements |
79
+
80
+ ### Phase Transitions
81
+
82
+ <IMPORTANT>
83
+ A single `/comet` invocation starts from the detected phase and advances to the next phase when exit conditions are met.
84
+
85
+ Flow chain: open → design → build → verify → archive
86
+
87
+ Nodes requiring user participation:
88
+ 1. Confirm design approach during brainstorming
89
+ 2. Select execution mode during build phase
90
+ 3. Decide to fix or accept deviation when verify fails
91
+ 4. Choose branch handling method for finishing-branch
92
+ 5. Encounter upgrade conditions (hotfix/tweak full workflow)
93
+
94
+ Agents should not skip these decision points; other unambiguous phase transitions can proceed automatically.
95
+ </IMPORTANT>
96
+
97
+ ---
98
+
99
+ ## Subcommand Quick Reference
100
+
101
+ | Command | Phase | Owner | Artifacts |
102
+ |---------|-------|-------|-----------|
103
+ | `/comet-open` | 1. Open | OpenSpec | proposal.md, design.md, tasks.md |
104
+ | `/comet-design` | 2. Deep Design | Superpowers | Design Doc, delta spec |
105
+ | `/comet-build` | 3. Plan and Build | Superpowers | Implementation plan, code commits |
106
+ | `/comet-verify` | 4. Verify and Close | Both | Verification report, branch handling |
107
+ | `/comet-archive` | 5. Archive | OpenSpec | delta→main spec sync, design doc markup, archive |
108
+ | `/comet-hotfix` | Preset path | Both | Quick fix (skip brainstorming) |
109
+ | `/comet-tweak` | Preset path | Both | Small change (skip brainstorming and full plan) |
110
+
111
+ ```
112
+ /comet
113
+ ↓ Auto-detect
114
+ /comet-open ──→ /comet-design ──→ /comet-build ──→ /comet-verify ──→ /comet-archive
115
+ (OpenSpec) (Superpowers) (Superpowers) (Both) (OpenSpec)
116
+
117
+ /comet-hotfix (preset, skip brainstorming)
118
+ open ──→ build ──→ verify ──→ archive
119
+ If upgrade triggered supplement Design Doc return to full workflow
120
+
121
+ /comet-tweak (preset, skip brainstorming and full plan)
122
+ open ──→ lightweight build ──→ light verify ──→ archive
123
+ If upgrade triggered supplement Design Docreturn to full workflow
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Reference Appendix
129
+
130
+ ### .comet.yaml Field Reference
131
+
132
+ ```yaml
133
+ workflow: full
134
+ phase: build
135
+ design_doc: docs/superpowers/specs/YYYY-MM-DD-topic-design.md
136
+ plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
137
+ build_mode: subagent-driven-development
138
+ isolation: branch
139
+ verify_mode: light
140
+ verify_result: pending
141
+ verified_at: null
142
+ archived: false
143
+ ```
144
+
145
+ | Field | Meaning |
146
+ |-------|---------|
147
+ | `workflow` | `full`, `hotfix`, or `tweak` |
148
+ | `phase` | Current phase: `open`, `design`, `build`, `verify`, `archive` |
149
+ | `design_doc` | Associated Superpowers Design Doc path, can be empty |
150
+ | `plan` | Associated Superpowers Plan path, can be empty |
151
+ | `build_mode` | Selected execution mode, can be empty |
152
+ | `isolation` | `branch` or `worktree`, workspace isolation method, defaults to `branch` |
153
+ | `verify_mode` | `light` or `full`, can be empty |
154
+ | `verify_result` | `pending`, `pass`, or `fail` |
155
+ | `verified_at` | Verification pass time, can be empty |
156
+ | `archived` | Whether change is archived |
157
+
158
+ ### Script Location
159
+
160
+ Comet scripts are distributed in `comet/scripts/`. **Do not hardcode paths** — locate once, cache in env vars:
161
+
162
+ ```bash
163
+ COMET_GUARD="${COMET_GUARD:-$(find . -path '*/comet/scripts/comet-guard.sh' -type f -print -quit)}"
164
+ COMET_STATE="${COMET_STATE:-$(find . -path '*/comet/scripts/comet-state.sh' -type f -print -quit)}"
165
+ COMET_ARCHIVE="${COMET_ARCHIVE:-$(find . -path '*/comet/scripts/comet-archive.sh' -type f -print -quit)}"
166
+ ```
167
+
168
+ **Auto state update**: Guard supports `--apply` flag, automatically updating `.comet.yaml` state fields after checks pass:
169
+
170
+ ```bash
171
+ bash "$COMET_GUARD" <change-name> <phase> --apply
172
+ ```
173
+
174
+ **Archive script**: Complete all archive steps in one command:
175
+
176
+ ```bash
177
+ bash "$COMET_ARCHIVE" <change-name>
178
+ ```
179
+
180
+ After loading comet, agents should run the three variable assignments above once, then reuse `$COMET_GUARD`, `$COMET_STATE`, `$COMET_ARCHIVE` throughout the session.
181
+
182
+ ### File Structure
183
+
184
+ ```
185
+ openspec/ # OpenSpec WHAT
186
+ ├── config.yaml
187
+ ├── changes/
188
+ │ ├── <name>/ # Active change
189
+ │ │ ├── .openspec.yaml
190
+ │ │ ├── .comet.yaml
191
+ │ │ ├── proposal.md # Why + What
192
+ │ │ ├── design.md # High-level architecture decisions
193
+ ├── specs/<capability>/spec.md # Delta capability spec
194
+ │ │ └── tasks.md # Task checklist
195
+ └── archive/YYYY-MM-DD-<name>/ # Archived
196
+ └── specs/<capability>/spec.md # Main specs (overwritten from delta at archive)
197
+
198
+ docs/superpowers/ # Superpowers HOW
199
+ ├── specs/YYYY-MM-DD-<topic>-design.md # Design doc (technical RFC, mark status at archive)
200
+ └── plans/YYYY-MM-DD-<feature>.md # Implementation plan (file header contains change association metadata)
201
+ ```
202
+
203
+ ### Best Practices
204
+
205
+ 1. **brainstorming cannot be skipped** Every change must undergo deep design (except hotfix and tweak)
206
+ 2. **delta spec is a living document** — Freely modify during phase 3, sync at archive
207
+ 3. **Keep tasks.md in sync** — Check off each completed task
208
+ 4. **Commit frequently** — One commit per task, message reflects design intent
209
+ 5. **Verify before archive** — Execute `/comet-archive` only after `/comet-verify` passes
210
+ 6. **Classify incremental updates** — Small edits, medium brainstorming, large new changes
211
+ 7. **Plan must associate with change** — File header contains `change:` and `design-doc:` metadata
212
+ 8. **Archive closure** — design doc and plan must mark `archived-with` status
213
+ 9. **Modifying existing features** — Just open a new change
214
+ 10. **Preset has limits** — Switch to full workflow promptly when hotfix/tweak meet upgrade conditions