@rpamis/comet 0.1.7 → 0.2.0
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.
- package/README.md +45 -13
- package/assets/manifest.json +2 -0
- package/assets/skills/comet/SKILL.md +214 -219
- package/assets/skills/comet/scripts/comet-archive.sh +8 -2
- package/assets/skills/comet/scripts/comet-guard.sh +32 -22
- package/assets/skills/comet/scripts/comet-state.sh +496 -0
- package/assets/skills/comet-archive/SKILL.md +6 -19
- package/assets/skills/comet-build/SKILL.md +16 -23
- package/assets/skills/comet-design/SKILL.md +7 -23
- package/assets/skills/comet-hotfix/SKILL.md +136 -167
- package/assets/skills/comet-open/SKILL.md +9 -31
- package/assets/skills/comet-tweak/SKILL.md +122 -154
- package/assets/skills/comet-verify/SKILL.md +11 -33
- package/assets/skills-zh/comet/SKILL.md +87 -92
- package/assets/skills-zh/comet-archive/SKILL.md +63 -76
- package/assets/skills-zh/comet-build/SKILL.md +153 -160
- package/assets/skills-zh/comet-design/SKILL.md +91 -107
- package/assets/skills-zh/comet-hotfix/SKILL.md +18 -49
- package/assets/skills-zh/comet-open/SKILL.md +70 -92
- package/assets/skills-zh/comet-tweak/SKILL.md +19 -51
- package/assets/skills-zh/comet-verify/SKILL.md +114 -136
- package/dist/cli/index.js +28 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/doctor.d.ts +6 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +168 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +183 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/status.d.ts +6 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +89 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/update.d.ts +8 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +47 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/core/detect.d.ts +8 -0
- package/dist/core/detect.d.ts.map +1 -0
- package/dist/core/detect.js +73 -0
- package/dist/core/detect.js.map +1 -0
- package/dist/core/openspec.d.ts +5 -0
- package/dist/core/openspec.d.ts.map +1 -0
- package/dist/core/openspec.js +58 -0
- package/dist/core/openspec.js.map +1 -0
- package/dist/core/platforms.d.ts.map +1 -1
- package/dist/core/platforms.js +6 -1
- package/dist/core/platforms.js.map +1 -1
- package/dist/core/skills.d.ts +22 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +59 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/superpowers.d.ts +5 -0
- package/dist/core/superpowers.d.ts.map +1 -0
- package/dist/core/superpowers.js +60 -0
- package/dist/core/superpowers.js.map +1 -0
- package/dist/core/types.d.ts +2 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/package.json +61 -50
- package/dist/core/init.d.ts +0 -14
- package/dist/core/init.d.ts.map +0 -1
- package/dist/core/init.js +0 -492
- 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
|
|
|
@@ -90,12 +104,14 @@ After `comet init`, three groups of skills are installed to the selected platfor
|
|
|
90
104
|
| `/comet-hotfix` | Preset: Quick bug fix (skips brainstorming) |
|
|
91
105
|
| `/comet-tweak` | Preset: Small change (skips brainstorming and full plan) |
|
|
92
106
|
|
|
93
|
-
### Guard Scripts
|
|
107
|
+
### Guard & Automation Scripts
|
|
94
108
|
|
|
95
109
|
| Script | Purpose |
|
|
96
110
|
|--------|---------|
|
|
97
|
-
| `comet-guard.sh` | Phase transition guard — validates exit conditions
|
|
111
|
+
| `comet-guard.sh` | Phase transition guard — validates exit conditions, `--apply` auto-updates `.comet.yaml` |
|
|
112
|
+
| `comet-archive.sh` | One-command archive — validates state, syncs specs, moves to archive, updates status |
|
|
98
113
|
| `comet-yaml-validate.sh` | Schema validator — validates `.comet.yaml` structure and field values |
|
|
114
|
+
| `comet-state.sh` | Unified state management — init/set/get/check/scale, agents' exclusive YAML interface |
|
|
99
115
|
|
|
100
116
|
### OpenSpec Skills
|
|
101
117
|
|
|
@@ -110,14 +126,14 @@ Development methodology: brainstorming, TDD, subagent-driven development, code r
|
|
|
110
126
|
```
|
|
111
127
|
/comet
|
|
112
128
|
↓ auto-detect
|
|
113
|
-
/comet-open
|
|
114
|
-
|
|
129
|
+
/comet-open --> /comet-design --> /comet-build --> /comet-verify --> /comet-archive
|
|
130
|
+
(OpenSpec) (Superpowers) (Superpowers) (Both) (OpenSpec)
|
|
115
131
|
|
|
116
132
|
/comet-hotfix (preset path, skips brainstorming)
|
|
117
|
-
open
|
|
133
|
+
open --> build --> verify --> archive
|
|
118
134
|
|
|
119
135
|
/comet-tweak (preset path, skips brainstorming and full plan)
|
|
120
|
-
open
|
|
136
|
+
open --> lightweight build --> light verify --> archive
|
|
121
137
|
```
|
|
122
138
|
|
|
123
139
|
### Five Phases
|
|
@@ -160,15 +176,17 @@ Comet uses a decoupled state architecture with separate YAML files:
|
|
|
160
176
|
|
|
161
177
|
### Reliability Features
|
|
162
178
|
|
|
163
|
-
Comet
|
|
179
|
+
Comet ensures agent execution reliability through automated state transitions:
|
|
164
180
|
|
|
165
181
|
1. **Entry Verification** — Each phase validates preconditions before execution
|
|
166
182
|
- Checks file existence, state consistency, and phase transitions
|
|
167
183
|
- Outputs `[HARD STOP]` with actionable suggestions if validation fails
|
|
168
184
|
|
|
169
|
-
2. **
|
|
170
|
-
-
|
|
171
|
-
-
|
|
185
|
+
2. **Automated State Transitions** — `comet-guard.sh --apply` updates `.comet.yaml` automatically
|
|
186
|
+
- All phase transitions (design → build → verify → archive) use `guard --apply`
|
|
187
|
+
- No manual state editing required — eliminates write-verification errors
|
|
188
|
+
- `comet-state.sh` is the agents' exclusive interface for state operations
|
|
189
|
+
- Guard and archive scripts use `comet-state.sh` internally for state management
|
|
172
190
|
|
|
173
191
|
3. **Schema Validation** — `comet-yaml-validate.sh` ensures data integrity
|
|
174
192
|
- Validates required fields (10 fields)
|
|
@@ -176,6 +194,12 @@ Comet includes three-layer defense to ensure agent execution reliability:
|
|
|
176
194
|
- Validates referenced file paths exist
|
|
177
195
|
- Detects unknown/typos fields
|
|
178
196
|
|
|
197
|
+
4. **Archive Automation** — `comet-archive.sh` handles the full archive flow in one command
|
|
198
|
+
- Validates entry state, syncs delta specs to main specs
|
|
199
|
+
- Annotates design doc and plan frontmatter
|
|
200
|
+
- Moves change to archive directory and updates `archived: true`
|
|
201
|
+
- Supports `--dry-run` for preview
|
|
202
|
+
|
|
179
203
|
**Security**: Path traversal protection on all change name inputs
|
|
180
204
|
|
|
181
205
|
## Project Structure
|
|
@@ -185,8 +209,10 @@ your-project/
|
|
|
185
209
|
├── .claude/skills/ # Platform skills dir (Comet + OpenSpec + Superpowers)
|
|
186
210
|
│ ├── comet/SKILL.md
|
|
187
211
|
│ │ └── scripts/
|
|
188
|
-
│ │ ├── comet-guard.sh # Phase transition guard
|
|
189
|
-
│ │
|
|
212
|
+
│ │ ├── comet-guard.sh # Phase transition guard (--apply auto-updates state)
|
|
213
|
+
│ │ ├── comet-archive.sh # One-command archive automation
|
|
214
|
+
│ │ ├── comet-yaml-validate.sh # Schema validator
|
|
215
|
+
│ │ └── comet-state.sh # Unified state management (init/set/get/check/scale)
|
|
190
216
|
│ ├── comet-*/SKILL.md
|
|
191
217
|
│ ├── openspec-*/SKILL.md
|
|
192
218
|
│ └── brainstorming/SKILL.md
|
|
@@ -221,8 +247,14 @@ pnpm dev
|
|
|
221
247
|
# Build
|
|
222
248
|
pnpm build
|
|
223
249
|
|
|
224
|
-
# Test
|
|
250
|
+
# Test (unit + coverage)
|
|
225
251
|
pnpm test
|
|
252
|
+
pnpm test:coverage
|
|
253
|
+
pnpm test:shell # bats shell tests
|
|
254
|
+
|
|
255
|
+
# Lint & format
|
|
256
|
+
pnpm lint
|
|
257
|
+
pnpm format
|
|
226
258
|
```
|
|
227
259
|
|
|
228
260
|
See [CHANGELOG.md](CHANGELOG.md) for version history and updates.
|
package/assets/manifest.json
CHANGED
|
@@ -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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
1
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
|
151
|
-
|
|
152
|
-
| `
|
|
153
|
-
|
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
├──
|
|
192
|
-
├──
|
|
193
|
-
│ ├──
|
|
194
|
-
│ │
|
|
195
|
-
│
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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 Doc → return 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
|
|
@@ -37,6 +37,8 @@ validate_change_name "$CHANGE"
|
|
|
37
37
|
|
|
38
38
|
CHANGE_DIR="openspec/changes/$CHANGE"
|
|
39
39
|
YAML="$CHANGE_DIR/.comet.yaml"
|
|
40
|
+
SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "$0" 2>/dev/null || echo "$0")" 2>/dev/null || dirname "$0")" && pwd)"
|
|
41
|
+
STATE_SH="$SCRIPT_DIR/comet-state.sh"
|
|
40
42
|
TODAY=$(date +%Y-%m-%d)
|
|
41
43
|
ARCHIVE_NAME="${TODAY}-${CHANGE}"
|
|
42
44
|
ARCHIVE_DIR="openspec/changes/archive/${ARCHIVE_NAME}"
|
|
@@ -61,8 +63,12 @@ echo "=== Comet Archive: $CHANGE ===" >&2
|
|
|
61
63
|
|
|
62
64
|
yaml_field() {
|
|
63
65
|
local field="$1"
|
|
64
|
-
if [ -f "$
|
|
65
|
-
|
|
66
|
+
if [ -f "$STATE_SH" ]; then
|
|
67
|
+
bash "$STATE_SH" get "$CHANGE" "$field" 2>/dev/null
|
|
68
|
+
else
|
|
69
|
+
if [ -f "$YAML" ]; then
|
|
70
|
+
grep "^${field}:" "$YAML" | sed "s/^${field}: *//" | tr -d '"' | tr -d "'"
|
|
71
|
+
fi
|
|
66
72
|
fi
|
|
67
73
|
}
|
|
68
74
|
|