@rpamis/comet 0.3.5 → 0.3.6
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 +14 -2
- package/assets/skills/comet/SKILL.md +20 -13
- package/assets/skills/comet/scripts/comet-archive.sh +4 -2
- package/assets/skills/comet/scripts/comet-env.sh +57 -2
- package/assets/skills/comet/scripts/comet-guard.sh +14 -12
- package/assets/skills/comet/scripts/comet-handoff.sh +4 -2
- package/assets/skills/comet/scripts/comet-state.sh +16 -4
- package/assets/skills/comet/scripts/comet-yaml-validate.sh +3 -1
- package/assets/skills/comet-archive/SKILL.md +3 -3
- package/assets/skills/comet-build/SKILL.md +46 -15
- package/assets/skills/comet-design/SKILL.md +11 -11
- package/assets/skills/comet-hotfix/SKILL.md +7 -7
- package/assets/skills/comet-open/SKILL.md +4 -4
- package/assets/skills/comet-tweak/SKILL.md +7 -7
- package/assets/skills/comet-verify/SKILL.md +17 -17
- package/assets/skills-zh/comet/SKILL.md +20 -13
- package/assets/skills-zh/comet-archive/SKILL.md +3 -3
- package/assets/skills-zh/comet-build/SKILL.md +46 -15
- package/assets/skills-zh/comet-design/SKILL.md +11 -11
- package/assets/skills-zh/comet-hotfix/SKILL.md +7 -7
- package/assets/skills-zh/comet-open/SKILL.md +4 -4
- package/assets/skills-zh/comet-tweak/SKILL.md +7 -7
- package/assets/skills-zh/comet-verify/SKILL.md +17 -17
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ if [ -z "$COMET_ENV" ]; then
|
|
|
23
23
|
return 1
|
|
24
24
|
fi
|
|
25
25
|
. "$COMET_ENV"
|
|
26
|
-
|
|
26
|
+
"$COMET_BASH" "$COMET_STATE" check <name> design
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
|
|
@@ -35,7 +35,7 @@ Proceed to Step 1 after verification passes. The script outputs specific failure
|
|
|
35
35
|
**Must be generated by script. Agent writing summaries on the fly is not allowed.**
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
|
|
38
|
+
"$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
The script generates and records:
|
|
@@ -60,7 +60,7 @@ The default handoff package is a **compact traceable excerpt**, not an agent sum
|
|
|
60
60
|
If full context is genuinely needed, explicitly run:
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
|
|
63
|
+
"$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write --full
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
Handoff package sources come from OpenSpec open phase artifacts:
|
|
@@ -71,7 +71,7 @@ Handoff package sources come from OpenSpec open phase artifacts:
|
|
|
71
71
|
|
|
72
72
|
### 1b. Execute Brainstorming (with Context)
|
|
73
73
|
|
|
74
|
-
**Immediately execute:** Use the Skill tool to load the `
|
|
74
|
+
**Immediately execute:** Use the Skill tool to load the Superpowers `brainstorming` skill, ARGUMENTS containing:
|
|
75
75
|
|
|
76
76
|
```
|
|
77
77
|
Change: <change-name>
|
|
@@ -94,7 +94,7 @@ Skip redundant context exploration, proceed directly to design questions.
|
|
|
94
94
|
|
|
95
95
|
Skipping this step is prohibited. Proceeding without loading this skill is prohibited.
|
|
96
96
|
|
|
97
|
-
If `
|
|
97
|
+
If the Superpowers `brainstorming` skill is unavailable, stop the process and prompt to install or enable Superpowers skills. Do not substitute this step with normal conversation.
|
|
98
98
|
|
|
99
99
|
After the skill loads, follow its guidance to produce design proposals (presented as conversation):
|
|
100
100
|
- Technical approach: architecture, data flow, key technology choices and risks
|
|
@@ -121,13 +121,13 @@ First record the design_doc path. If Step 1c wrote back delta spec (added or mod
|
|
|
121
121
|
|
|
122
122
|
```bash
|
|
123
123
|
# Record design_doc path
|
|
124
|
-
|
|
124
|
+
"$COMET_BASH" "$COMET_STATE" set <name> design_doc docs/superpowers/specs/YYYY-MM-DD-topic-design.md
|
|
125
125
|
|
|
126
126
|
# If delta spec changes exist, regenerate handoff (update hash)
|
|
127
|
-
|
|
127
|
+
"$COMET_BASH" "$COMET_HANDOFF" <change-name> design --write
|
|
128
128
|
|
|
129
129
|
# Auto-transition to next phase
|
|
130
|
-
|
|
130
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> design --apply
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
If there are no delta spec changes, skip the handoff regeneration step. The state file updates automatically; no manual editing of other fields needed.
|
|
@@ -141,12 +141,12 @@ If there are no delta spec changes, skip the handoff regeneration step. The stat
|
|
|
141
141
|
- `design-context.md` must be script-generated and contain source path, mode, sha256 traceability markers (enforced by guard)
|
|
142
142
|
- If new capabilities or supplementary acceptance scenarios exist, OpenSpec delta spec has been created/updated
|
|
143
143
|
- `design_doc` written to `.comet.yaml`
|
|
144
|
-
- **Phase guard**: Run `
|
|
144
|
+
- **Phase guard**: Run `"$COMET_BASH" "$COMET_GUARD" <change-name> design --apply`; after all PASS, auto-transitions to `phase: build`
|
|
145
145
|
|
|
146
146
|
Must use `--apply` before exit:
|
|
147
147
|
|
|
148
148
|
```bash
|
|
149
|
-
|
|
149
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> design --apply
|
|
150
150
|
```
|
|
151
151
|
|
|
152
152
|
## Context Compaction Recovery
|
|
@@ -154,7 +154,7 @@ bash "$COMET_GUARD" <change-name> design --apply
|
|
|
154
154
|
The design phase may trigger context compaction during brainstorming. To recover, first run:
|
|
155
155
|
|
|
156
156
|
```bash
|
|
157
|
-
|
|
157
|
+
"$COMET_BASH" "$COMET_STATE" check <change-name> design --recover
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
The script outputs structured recovery context (phase, completed fields, pending fields, recovery action). Follow the Recovery action to determine next step.
|
|
@@ -46,24 +46,24 @@ After the skill loads, follow its guidance to create streamlined artifacts:
|
|
|
46
46
|
Initialize Comet state file:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
|
|
49
|
+
"$COMET_BASH" "$COMET_STATE" init <name> hotfix
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
Verify initialized state:
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
|
-
|
|
55
|
+
"$COMET_BASH" "$COMET_STATE" check <name> open
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
Run phase guard to transition open → build:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
|
|
61
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> open --apply
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
### 2. Direct Build (preset build)
|
|
65
65
|
|
|
66
|
-
Use hotfix defaults: `build_mode: direct`. Skip `
|
|
66
|
+
Use hotfix defaults: `build_mode: direct`. Skip Superpowers `brainstorming` and `writing-plans` (unless tasks > 3; if exceeds 3 tasks, transfer to `/comet-build`'s plan and execution method selection).
|
|
67
67
|
|
|
68
68
|
Before continuing or starting changes, handle uncommitted changes through `comet/reference/dirty-worktree.md`. If attribution shows the fix scope exceeds hotfix, handle it through this file's "Upgrade Conditions".
|
|
69
69
|
|
|
@@ -97,7 +97,7 @@ Before continuing or starting changes, handle uncommitted changes through `comet
|
|
|
97
97
|
After root cause is confirmed eliminated, run phase guard to transition build → verify:
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
-
|
|
100
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> build --apply
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
State automatically updates to `phase: verify`, `verify_result: pending`, then enter verification.
|
|
@@ -154,7 +154,7 @@ When upgrade conditions are met, **must use the AskUserQuestion tool to pause an
|
|
|
154
154
|
After user confirms upgrade, **must first update the workflow field** before entering full flow:
|
|
155
155
|
|
|
156
156
|
```bash
|
|
157
|
-
|
|
157
|
+
"$COMET_BASH" "$COMET_STATE" set <name> workflow full
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
Then on current change basis, supplement Design Doc: **Immediately use the Skill tool to load the `comet-design` skill**, proceed normally with full workflow. If user does not confirm upgrade, stop hotfix and report that current change has exceeded hotfix scope.
|
|
@@ -166,4 +166,4 @@ Then on current change basis, supplement Design Doc: **Immediately use the Skill
|
|
|
166
166
|
- Bug fixed, tests pass
|
|
167
167
|
- Change archived
|
|
168
168
|
- If spec changes, synced to main spec
|
|
169
|
-
- **Phase guard**: Before build → verify run `
|
|
169
|
+
- **Phase guard**: Before build → verify run `"$COMET_BASH" "$COMET_GUARD" <change-name> build --apply`; before verify → archive follow `/comet-verify` and run `"$COMET_BASH" "$COMET_GUARD" <change-name> verify --apply`
|
|
@@ -49,7 +49,7 @@ if [ -z "$COMET_STATE" ] || [ -z "$COMET_GUARD" ]; then
|
|
|
49
49
|
return 1
|
|
50
50
|
fi
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
"$COMET_BASH" "$COMET_STATE" init <name> full
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
### 3. Entry State Verification
|
|
@@ -57,7 +57,7 @@ bash "$COMET_STATE" init <name> full
|
|
|
57
57
|
Verify state machine has been correctly initialized:
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
|
|
60
|
+
"$COMET_BASH" "$COMET_STATE" check <name> open
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
Proceed to Step 4 after verification passes. The script outputs specific failure reasons when verification fails.
|
|
@@ -94,12 +94,12 @@ After user selects "Confirm", proceed to exit conditions. When user selects "Nee
|
|
|
94
94
|
|
|
95
95
|
- proposal.md, design.md, tasks.md all created with complete content
|
|
96
96
|
- **User has confirmed** proposal, design, tasks content meets expectations
|
|
97
|
-
- **Phase guard**: Run `
|
|
97
|
+
- **Phase guard**: Run `"$COMET_BASH" "$COMET_GUARD" <change-name> open --apply`; after all PASS, auto-transitions to next phase
|
|
98
98
|
|
|
99
99
|
Must use `--apply` before exit, otherwise `.comet.yaml` remains at `phase: open` and the next phase entry check will fail.
|
|
100
100
|
|
|
101
101
|
```bash
|
|
102
|
-
|
|
102
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> open --apply
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
Full workflow auto-transitions to `phase: design`; hotfix/tweak presets auto-transition to `phase: build`.
|
|
@@ -49,24 +49,24 @@ After the skill loads, follow its guidance to create streamlined artifacts:
|
|
|
49
49
|
Initialize Comet state file:
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
|
-
|
|
52
|
+
"$COMET_BASH" "$COMET_STATE" init <name> tweak
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
Verify initialized state:
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
|
-
|
|
58
|
+
"$COMET_BASH" "$COMET_STATE" check <name> open
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
Run phase guard to transition open → build:
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
|
|
64
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> open --apply
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
### 2. Lightweight Build (preset build)
|
|
68
68
|
|
|
69
|
-
Use tweak defaults: `build_mode: direct`. Skip `
|
|
69
|
+
Use tweak defaults: `build_mode: direct`. Skip Superpowers `brainstorming` and `writing-plans`.
|
|
70
70
|
|
|
71
71
|
Before continuing or starting changes, handle uncommitted changes through `comet/reference/dirty-worktree.md`. If attribution shows scope exceeds tweak, handle it through this file's "Upgrade Conditions".
|
|
72
72
|
|
|
@@ -83,7 +83,7 @@ Before continuing or starting changes, handle uncommitted changes through `comet
|
|
|
83
83
|
4. Run phase guard to transition build → verify:
|
|
84
84
|
|
|
85
85
|
```bash
|
|
86
|
-
|
|
86
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> build --apply
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
State automatically updates to `phase: verify`, `verify_result: pending`, then enter verification.
|
|
@@ -139,7 +139,7 @@ When upgrade conditions are met, **must use the AskUserQuestion tool to pause an
|
|
|
139
139
|
After user confirms upgrade, **must first update the workflow field** before entering full flow:
|
|
140
140
|
|
|
141
141
|
```bash
|
|
142
|
-
|
|
142
|
+
"$COMET_BASH" "$COMET_STATE" set <name> workflow full
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
Then on current change basis, supplement Design Doc: **Immediately use the Skill tool to load the `comet-design` skill**, proceed normally with full workflow. If user does not confirm upgrade, stop tweak and report that current change has exceeded tweak scope.
|
|
@@ -151,4 +151,4 @@ Then on current change basis, supplement Design Doc: **Immediately use the Skill
|
|
|
151
151
|
- Small change completed, tests pass
|
|
152
152
|
- Change archived
|
|
153
153
|
- No new capability, architecture adjustments or interface changes
|
|
154
|
-
- **Phase guard**: Before build → verify run `
|
|
154
|
+
- **Phase guard**: Before build → verify run `"$COMET_BASH" "$COMET_GUARD" <change-name> build --apply`; before verify → archive follow `/comet-verify` and run `"$COMET_BASH" "$COMET_GUARD" <change-name> verify --apply`
|
|
@@ -23,7 +23,7 @@ if [ -z "$COMET_ENV" ]; then
|
|
|
23
23
|
return 1
|
|
24
24
|
fi
|
|
25
25
|
. "$COMET_ENV"
|
|
26
|
-
|
|
26
|
+
"$COMET_BASH" "$COMET_STATE" check <change-name> verify
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
|
|
@@ -35,7 +35,7 @@ Proceed to Step 1 after verification passes. The script outputs specific failure
|
|
|
35
35
|
Execute scale assessment:
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
|
|
38
|
+
"$COMET_BASH" "$COMET_STATE" scale <change-name>
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
The script automatically counts tasks, delta spec count, changed file count, determines light or full verification mode, and sets the verify_mode field.
|
|
@@ -50,13 +50,13 @@ Only after user chooses fix, allow rollback to build phase:
|
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
# Execute only after user confirms fix
|
|
53
|
-
|
|
53
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Note: If every task in build phase was committed, the script's file count based on working tree diff may underestimate change scale. In this case, must read plan file header `base-ref` and verify with commit range:
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
PLAN=$(
|
|
59
|
+
PLAN=$("$COMET_BASH" "$COMET_STATE" get <change-name> plan)
|
|
60
60
|
BASE_REF=$(grep '^base-ref:' "$PLAN" 2>/dev/null | head -1 | sed 's/^base-ref: *//')
|
|
61
61
|
git diff --stat "$BASE_REF"...HEAD
|
|
62
62
|
```
|
|
@@ -64,12 +64,12 @@ git diff --stat "$BASE_REF"...HEAD
|
|
|
64
64
|
If commit range shows changes exceed lightweight threshold (> 4 files, cross-module coordination, or delta spec spans more than 1 capability), manually set to full verification:
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
|
-
|
|
67
|
+
"$COMET_BASH" "$COMET_STATE" set <change-name> verify_mode full
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
### 1b. Verification Failure Decision (Blocking Point)
|
|
71
71
|
|
|
72
|
-
When verification does not pass, **must use the AskUserQuestion tool to pause and wait for the user to decide fix or accept deviation**. Must not automatically run `
|
|
72
|
+
When verification does not pass, **must use the AskUserQuestion tool to pause and wait for the user to decide fix or accept deviation**. Must not automatically run `"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail`, nor automatically invoke `/comet-build`. Must not just output a text prompt and then continue executing.
|
|
73
73
|
|
|
74
74
|
When pausing, must list:
|
|
75
75
|
- Failed items
|
|
@@ -79,7 +79,7 @@ When pausing, must list:
|
|
|
79
79
|
**Uncertainty principle**: When severity is unclear, downgrade (SUGGESTION > WARNING > CRITICAL). Only use CRITICAL for build failures, test failures, and security issues; ambiguous or uncertain issues should be WARNING or SUGGESTION.
|
|
80
80
|
|
|
81
81
|
After user selection, continue as follows:
|
|
82
|
-
- **Fix all**: Run `
|
|
82
|
+
- **Fix all**: Run `"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail`, then invoke `/comet-build` to fix
|
|
83
83
|
- **Handle item by item**: CRITICAL failures must be fixed; non-CRITICAL failures may choose to accept deviation, but must record acceptance reason and impact scope in verification report. If any CRITICAL failure exists, skipping fix to accept all is not allowed
|
|
84
84
|
|
|
85
85
|
### 2a. Lightweight Verification (Small Changes)
|
|
@@ -98,7 +98,7 @@ When scale assessment result is "small", skip `openspec-verify-change` and direc
|
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
100
|
# Execute only after user confirms fix
|
|
101
|
-
|
|
101
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
**Report format**: Brief table listing 5 check results + PASS/FAIL.
|
|
@@ -128,20 +128,20 @@ When verification does not pass: report missing items, enter Step 1b verificatio
|
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
130
|
# Execute only after user confirms fix
|
|
131
|
-
|
|
131
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
**Spec Drift Handling** (user decision point):
|
|
135
135
|
- If check item 6 finds contradictions (delta spec has content but design doc does not reflect it), **must use the AskUserQuestion tool as a single-select question to pause and wait for user to choose handling method**; must not select automatically. Options:
|
|
136
136
|
- Option A: Append "Implementation Divergence" section to design doc recording deviation reason. Option A is a verify phase allowed artifact; after writing, must not re-trigger Step 1b dirty-worktree decision due to that design doc change
|
|
137
|
-
- Option B: After user selects B, run `
|
|
137
|
+
- Option B: After user selects B, run `"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail`, then invoke `/comet-build`; `/comet-build`'s Spec Incremental Update rules will load the Superpowers `brainstorming` skill to update Design Doc + delta spec
|
|
138
138
|
- Option C: Confirm deviation is acceptable, continue verification (design doc will be marked as `superseded-by-main-spec` during archiving)
|
|
139
139
|
|
|
140
140
|
### 3. Finishing (Superpowers)
|
|
141
141
|
|
|
142
|
-
**Immediately execute:** Use the Skill tool to load the `
|
|
142
|
+
**Immediately execute:** Use the Skill tool to load the Superpowers `finishing-a-development-branch` skill. Skipping this step is prohibited.
|
|
143
143
|
|
|
144
|
-
If `
|
|
144
|
+
If the Superpowers `finishing-a-development-branch` skill is unavailable, stop the process and prompt to install or enable Superpowers skills. Do not substitute this step with normal conversation.
|
|
145
145
|
|
|
146
146
|
After the skill loads, follow its guidance to finish. Branch handling options:
|
|
147
147
|
1. Merge to main branch locally
|
|
@@ -164,8 +164,8 @@ mkdir -p docs/superpowers/reports
|
|
|
164
164
|
# Write verification conclusions to report file, e.g.:
|
|
165
165
|
# docs/superpowers/reports/YYYY-MM-DD-<change-name>-verify.md
|
|
166
166
|
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
"$COMET_BASH" "$COMET_STATE" set <change-name> verification_report docs/superpowers/reports/YYYY-MM-DD-<change-name>-verify.md
|
|
168
|
+
"$COMET_BASH" "$COMET_STATE" set <change-name> branch_status handled
|
|
169
169
|
```
|
|
170
170
|
|
|
171
171
|
## Exit Conditions
|
|
@@ -174,12 +174,12 @@ bash "$COMET_STATE" set <change-name> branch_status handled
|
|
|
174
174
|
- Branch handled
|
|
175
175
|
- `verification_report` in `.comet.yaml` points to an existing verification report file
|
|
176
176
|
- `branch_status: handled` in `.comet.yaml`
|
|
177
|
-
- **Phase guard**: Run `
|
|
177
|
+
- **Phase guard**: Run `"$COMET_BASH" "$COMET_GUARD" <change-name> verify --apply`; after all PASS, auto-transitions to `phase: archive` through `comet-state transition verify-pass`
|
|
178
178
|
|
|
179
179
|
After both verification and branch handling are complete, run guard for auto-transition:
|
|
180
180
|
|
|
181
181
|
```bash
|
|
182
|
-
|
|
182
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> verify --apply
|
|
183
183
|
```
|
|
184
184
|
|
|
185
185
|
State file auto-updates to `phase: archive`, `verify_result: pass`, `verified_at: YYYY-MM-DD`.
|
|
@@ -195,7 +195,7 @@ After exit conditions are met (including user selecting branch handling method),
|
|
|
195
195
|
The verify phase may trigger context compaction. To recover, first run:
|
|
196
196
|
|
|
197
197
|
```bash
|
|
198
|
-
|
|
198
|
+
"$COMET_BASH" "$COMET_STATE" check <change-name> verify --recover
|
|
199
199
|
```
|
|
200
200
|
|
|
201
201
|
The script outputs structured recovery context (phase, verification status, branch status, recovery action). Follow the Recovery action to determine next step.
|
|
@@ -53,9 +53,13 @@ agent 做决策只需读本节,参考附录按需查阅。
|
|
|
53
53
|
**断点恢复规则**:
|
|
54
54
|
- 每次恢复上下文时,先重新执行 Step 0 和 Step 1,不依赖对话历史判断阶段
|
|
55
55
|
- 只要存在 active change 且工作区有未提交改动,必须按 `comet/reference/dirty-worktree.md` 协议处理。该协议定义了检查步骤、归因分类和禁令,本文件不重复
|
|
56
|
-
- 若 `phase: build`,先检查 `build_mode` 和 `isolation
|
|
57
|
-
- 若 `
|
|
58
|
-
- 若 `
|
|
56
|
+
- 若 `phase: build`,先检查 `build_pause`、`plan`、`build_mode` 和 `isolation`:
|
|
57
|
+
- 若 `build_pause: plan-ready` 且 plan 文件存在,回到 `/comet-build` 的 plan-ready 恢复点,提示用户继续选择隔离方式和执行方式,不重新生成 plan
|
|
58
|
+
- 若 `build_pause: plan-ready` 但 plan 文件缺失,回到 `/comet-build` 处理状态损坏或重新生成 plan
|
|
59
|
+
- 若 `build_mode` 或 `isolation` 未设置,回到 `/comet-build` 对应步骤补充后再执行
|
|
60
|
+
- 若均已设置,读取 tasks.md 的下一个未勾选任务继续
|
|
61
|
+
- 若 `phase: verify` 且 `verify_result: fail`,进入验证失败决策阻塞点:暂停并询问用户修复或接受偏差;用户选择修复后才运行 `"$COMET_BASH" "$COMET_STATE" transition <name> verify-fail` 并调用 `/comet-build`
|
|
62
|
+
- 若 `phase: open` 但 proposal/design/tasks 已完整,先运行 `"$COMET_BASH" "$COMET_GUARD" <change-name> open --apply` 修正状态,再继续判定
|
|
59
63
|
- 若 `phase: archive`,只允许调用 `/comet-archive`;归档成功后 change 会移动到 archive 目录,不再对原活跃目录运行 guard
|
|
60
64
|
|
|
61
65
|
**Step 2: 阶段判定**(按顺序,命中即停)
|
|
@@ -92,7 +96,7 @@ agent 做决策只需读本节,参考附录按需查阅。
|
|
|
92
96
|
|------|---------|
|
|
93
97
|
| `openspec list --json` 失败 | 检查 openspec 是否已安装,提示 `openspec init` |
|
|
94
98
|
| 子 skill 不可用 | 停止流程,提示安装或启用对应 skill |
|
|
95
|
-
| `.comet.yaml` 格式异常或缺失 | 以文件状态为准,用 `
|
|
99
|
+
| `.comet.yaml` 格式异常或缺失 | 以文件状态为准,用 `"$COMET_BASH" "$COMET_STATE" set` 修正后继续 |
|
|
96
100
|
| 构建/测试失败 | 返回 build 阶段修复,不进入 verify |
|
|
97
101
|
| change 目录结构不完整 | 按 `comet-open` 产物要求补齐 |
|
|
98
102
|
|
|
@@ -110,7 +114,7 @@ agent 做决策只需读本节,参考附录按需查阅。
|
|
|
110
114
|
需要用户参与的节点(仅在这些节点暂停):
|
|
111
115
|
1. open 阶段 proposal/design/tasks 审视确认
|
|
112
116
|
2. brainstorming 确认设计方案
|
|
113
|
-
3. build
|
|
117
|
+
3. build 阶段 plan-ready 暂停选择,以及随后选择工作方式(隔离方式 + 执行方式)
|
|
114
118
|
4. verify 不通过时决定修复或接受偏差(含 Spec 漂移处理方式选择)
|
|
115
119
|
5. finishing-branch 选择分支处理方式
|
|
116
120
|
6. 遇到升级条件(hotfix/tweak → 完整流程)
|
|
@@ -171,6 +175,7 @@ design_doc: docs/superpowers/specs/YYYY-MM-DD-topic-design.md
|
|
|
171
175
|
plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
|
|
172
176
|
base_ref: a1b2c3d4e5f6...
|
|
173
177
|
build_mode: subagent-driven-development
|
|
178
|
+
build_pause: null
|
|
174
179
|
isolation: branch
|
|
175
180
|
verify_mode: light
|
|
176
181
|
verify_result: pending
|
|
@@ -189,6 +194,7 @@ archived: false
|
|
|
189
194
|
| `plan` | 关联的 Superpowers Plan 路径,可为空 |
|
|
190
195
|
| `base_ref` | init 时记录的 git commit SHA,用于 scale 评估。无 plan 时作为改动文件数统计基准 |
|
|
191
196
|
| `build_mode` | 已选择的执行方式,可为空 |
|
|
197
|
+
| `build_pause` | build 阶段内部暂停点。`null` 表示无暂停,`plan-ready` 表示 plan 已生成,用户选择切换模型后暂停 |
|
|
192
198
|
| `isolation` | `branch` 或 `worktree`,工作区隔离方式。full 初始化可为 `null`,但只允许持续到 `/comet-build` Step 3 前;hotfix/tweak 默认 `branch` |
|
|
193
199
|
| `verify_mode` | `light` 或 `full`,可为空 |
|
|
194
200
|
| `verify_result` | `pending`、`pass` 或 `fail` |
|
|
@@ -210,6 +216,7 @@ archived: false
|
|
|
210
216
|
- `build → verify` 前,`isolation` 必须是 `branch` 或 `worktree`
|
|
211
217
|
- `build → verify` 前,`build_mode` 必须已选择
|
|
212
218
|
- `build_mode: direct` 默认只允许 `hotfix` / `tweak`;full workflow 需要 `direct_override: true`
|
|
219
|
+
- `build_pause` 不是执行方式,不得写入 `build_mode`
|
|
213
220
|
- 这些约束同时存在于 `comet-guard.sh build --apply` 和 `comet-state.sh transition <name> build-complete`
|
|
214
221
|
|
|
215
222
|
### 脚本定位
|
|
@@ -235,24 +242,24 @@ fi
|
|
|
235
242
|
**自动状态更新**:guard 支持 `--apply` 参数,验证通过后自动更新 `.comet.yaml` 状态字段:
|
|
236
243
|
|
|
237
244
|
```bash
|
|
238
|
-
|
|
245
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> <phase> --apply
|
|
239
246
|
```
|
|
240
247
|
|
|
241
248
|
`--apply` 内部委托给 `comet-state transition`。需要直接表达状态事件时使用:
|
|
242
249
|
|
|
243
250
|
```bash
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
251
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> open-complete
|
|
252
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> design-complete
|
|
253
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> build-complete
|
|
254
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-pass
|
|
255
|
+
"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
|
|
256
|
+
"$COMET_BASH" "$COMET_STATE" transition <archive-name> archived
|
|
250
257
|
```
|
|
251
258
|
|
|
252
259
|
**归档脚本**:一键完成归档全部步骤:
|
|
253
260
|
|
|
254
261
|
```bash
|
|
255
|
-
|
|
262
|
+
"$COMET_BASH" "$COMET_ARCHIVE" <change-name>
|
|
256
263
|
```
|
|
257
264
|
|
|
258
265
|
加载 comet 后,agent 应执行以上变量赋值一次,后续全程复用 `$COMET_GUARD`、`$COMET_STATE`、`$COMET_HANDOFF`、`$COMET_ARCHIVE`。
|
|
@@ -24,7 +24,7 @@ if [ -z "$COMET_ENV" ]; then
|
|
|
24
24
|
return 1
|
|
25
25
|
fi
|
|
26
26
|
. "$COMET_ENV"
|
|
27
|
-
|
|
27
|
+
"$COMET_BASH" "$COMET_STATE" check <name> archive
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
验证通过后继续 Step 1。验证失败时脚本会输出具体失败原因。
|
|
@@ -34,7 +34,7 @@ bash "$COMET_STATE" check <name> archive
|
|
|
34
34
|
运行归档脚本,自动完成以下全部步骤:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
|
|
37
|
+
"$COMET_BASH" "$COMET_ARCHIVE" "<change-name>"
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
脚本自动执行:
|
|
@@ -66,7 +66,7 @@ brainstorming → delta spec → 实施 → 验证 → 主 spec 覆盖 → desig
|
|
|
66
66
|
- 归档目录 `openspec/changes/archive/YYYY-MM-DD-<change-name>/` 存在
|
|
67
67
|
- 归档后的 `.comet.yaml` 中 `archived: true`
|
|
68
68
|
|
|
69
|
-
归档脚本会把 `openspec/changes/<name>/` 移动到 `openspec/changes/archive/YYYY-MM-DD-<name>/`。归档成功后**不要再对原 change 名运行** `
|
|
69
|
+
归档脚本会把 `openspec/changes/<name>/` 移动到 `openspec/changes/archive/YYYY-MM-DD-<name>/`。归档成功后**不要再对原 change 名运行** `"$COMET_BASH" "$COMET_GUARD" <change-name> archive`,因为原活跃目录已经不存在。归档完整性以脚本退出码和归档目录状态为准。
|
|
70
70
|
|
|
71
71
|
## 完成
|
|
72
72
|
|
|
@@ -23,7 +23,7 @@ if [ -z "$COMET_ENV" ]; then
|
|
|
23
23
|
return 1
|
|
24
24
|
fi
|
|
25
25
|
. "$COMET_ENV"
|
|
26
|
-
|
|
26
|
+
"$COMET_BASH" "$COMET_STATE" check <name> build
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
验证通过后继续 Step 1。验证失败时脚本会输出具体失败原因。
|
|
@@ -32,7 +32,7 @@ bash "$COMET_STATE" check <name> build
|
|
|
32
32
|
|
|
33
33
|
### 1. 制定计划
|
|
34
34
|
|
|
35
|
-
**立即执行:** 使用 Skill 工具加载 `
|
|
35
|
+
**立即执行:** 使用 Skill 工具加载 Superpowers `writing-plans` 技能。禁止跳过此步骤。
|
|
36
36
|
|
|
37
37
|
技能加载后,按其指引制定计划。计划要求:
|
|
38
38
|
- 保存至 `docs/superpowers/plans/YYYY-MM-DD-<feature>.md`
|
|
@@ -53,18 +53,49 @@ base-ref: <git rev-parse HEAD before implementation>
|
|
|
53
53
|
git rev-parse HEAD
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
### 2.
|
|
56
|
+
### 2. 更新计划状态并提供 plan-ready 暂停点
|
|
57
57
|
|
|
58
58
|
先记录 plan 路径:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
|
|
61
|
+
"$COMET_BASH" "$COMET_STATE" set <name> plan docs/superpowers/plans/YYYY-MM-DD-feature.md
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
无需手动更新 phase,guard 会在退出条件满足后自动流转。
|
|
65
65
|
|
|
66
|
+
计划写入后,立即提供一个新的用户决策点:
|
|
67
|
+
|
|
68
|
+
| 选项 | 行为 | 说明 |
|
|
69
|
+
|------|------|------|
|
|
70
|
+
| A | 继续执行 | 保持在当前模型中,进入 Step 3 选择工作区隔离和执行方式 |
|
|
71
|
+
| B | 暂停切换模型 | 记录 `build_pause: plan-ready`,本次 `/comet-build` 停止,用户稍后可从 `/comet` 或 `/comet-build` 恢复 |
|
|
72
|
+
|
|
73
|
+
这是用户决策点。**必须使用 AskUserQuestion 工具暂停并等待用户明确选择**,不得自动继续,也不得把暂停写入 `build_mode`。
|
|
74
|
+
|
|
75
|
+
用户选择继续时:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
"$COMET_BASH" "$COMET_STATE" set <name> build_pause null
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
用户选择暂停时:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
"$COMET_BASH" "$COMET_STATE" set <name> build_pause plan-ready
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
设置 `build_pause: plan-ready` 后,当前调用停止。不要选择 `isolation` 或 `build_mode`,不要加载执行技能。
|
|
88
|
+
|
|
66
89
|
### 3. 选择工作方式
|
|
67
90
|
|
|
91
|
+
如果恢复时检测到 `build_pause: plan-ready` 且 `plan` 文件存在,不要重新运行 `writing-plans`。先告知用户当前停在 plan-ready 暂停点;用户确认继续后,设置:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
"$COMET_BASH" "$COMET_STATE" set <name> build_pause null
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
然后继续本步骤选择工作区隔离和执行方式。
|
|
98
|
+
|
|
68
99
|
计划已写入当前分支。在开始执行前,**一次性询问用户**选择工作区隔离方式和执行方式:
|
|
69
100
|
|
|
70
101
|
**工作区隔离**:
|
|
@@ -82,8 +113,8 @@ bash "$COMET_STATE" set <name> plan docs/superpowers/plans/YYYY-MM-DD-feature.md
|
|
|
82
113
|
|
|
83
114
|
| 选项 | 技能 | 适用场景 |
|
|
84
115
|
|------|------|---------|
|
|
85
|
-
| A | `
|
|
86
|
-
| B | `
|
|
116
|
+
| A | Superpowers `subagent-driven-development` | 任务独立、复杂度高、需要双阶段审查 |
|
|
117
|
+
| B | Superpowers `executing-plans` | 任务简单、无子agent环境、轻量快速 |
|
|
87
118
|
|
|
88
119
|
**执行方式推荐规则**:
|
|
89
120
|
- 任务数 ≥ 3 → 推荐 A
|
|
@@ -95,8 +126,8 @@ bash "$COMET_STATE" set <name> plan docs/superpowers/plans/YYYY-MM-DD-feature.md
|
|
|
95
126
|
用户选择后,更新 `isolation` 和 `build_mode` 字段:
|
|
96
127
|
|
|
97
128
|
```bash
|
|
98
|
-
|
|
99
|
-
|
|
129
|
+
"$COMET_BASH" "$COMET_STATE" set <name> isolation <branch|worktree>
|
|
130
|
+
"$COMET_BASH" "$COMET_STATE" set <name> build_mode <subagent-driven-development|executing-plans|direct>
|
|
100
131
|
```
|
|
101
132
|
|
|
102
133
|
`isolation` 是脚本级硬约束。full workflow 初始化时可以为 `null`,但只允许存在到本步骤之前。若保持 `null`,`build → verify` 的 guard 和 `comet-state transition build-complete` 都会失败。
|
|
@@ -104,8 +135,8 @@ bash "$COMET_STATE" set <name> build_mode <subagent-driven-development|executing
|
|
|
104
135
|
`build_mode` 默认仅 hotfix/tweak preset 使用 `direct`。full workflow 不得默认使用 `direct`。只有用户明确要求跳过计划执行技能,且你已记录显式 override 时,才允许:
|
|
105
136
|
|
|
106
137
|
```bash
|
|
107
|
-
|
|
108
|
-
|
|
138
|
+
"$COMET_BASH" "$COMET_STATE" set <name> direct_override true
|
|
139
|
+
"$COMET_BASH" "$COMET_STATE" set <name> build_mode direct
|
|
109
140
|
```
|
|
110
141
|
|
|
111
142
|
没有 `direct_override: true` 时,full workflow 的 `build_mode=direct` 会被 guard 和状态转换同时拦截。
|
|
@@ -113,7 +144,7 @@ bash "$COMET_STATE" set <name> build_mode direct
|
|
|
113
144
|
**执行隔离**:
|
|
114
145
|
|
|
115
146
|
- **branch**:执行 `git checkout -b <change-name>`,后续工作在新分支上进行
|
|
116
|
-
- **worktree**:必须使用 Skill 工具加载 `
|
|
147
|
+
- **worktree**:必须使用 Skill 工具加载 Superpowers `using-git-worktrees` 技能创建隔离工作区。禁止用普通 shell 命令或原生工具绕过该技能;如该技能不可用,停止流程并提示安装或启用 Superpowers 技能。
|
|
117
148
|
|
|
118
149
|
创建隔离后,确认计划文件可访问(分支方式天然可访问;worktree 方式需确认计划已提交)。
|
|
119
150
|
|
|
@@ -133,7 +164,7 @@ bash "$COMET_STATE" set <name> build_mode direct
|
|
|
133
164
|
| 规模 | 触发条件 | 做法 |
|
|
134
165
|
|------|---------|------|
|
|
135
166
|
| 小 | 遗漏验收场景、边界条件 | 直接编辑 delta spec + design.md,追加 tasks.md 任务 |
|
|
136
|
-
| 中 | 接口变更、新增组件、数据流变化 | **使用 AskUserQuestion 工具暂停并等待用户确认后**,必须使用 Skill 工具加载 `
|
|
167
|
+
| 中 | 接口变更、新增组件、数据流变化 | **使用 AskUserQuestion 工具暂停并等待用户确认后**,必须使用 Skill 工具加载 Superpowers `brainstorming` 更新 Design Doc + delta spec |
|
|
137
168
|
| 大 | 全新 capability 需求 | **必须使用 AskUserQuestion 工具暂停并等待用户确认拆分**;用户确认后,通过 `/comet-open` 创建独立 change |
|
|
138
169
|
|
|
139
170
|
**50% 阈值判定**:以 tasks.md 初始任务总数为基准,若新增任务数超过该总数的一半,视为超出原计划范围,**必须使用 AskUserQuestion 工具暂停并等待用户决定是否拆分为新 change**。
|
|
@@ -151,7 +182,7 @@ bash "$COMET_STATE" set <name> build_mode direct
|
|
|
151
182
|
Build 是最长阶段,可能跨越大量任务。为支持上下文压缩后断点恢复:
|
|
152
183
|
|
|
153
184
|
- **每完成一个 task**:立即勾选 tasks.md 并提交代码,确保 `.comet.yaml` 和文件状态持久化
|
|
154
|
-
- **上下文压缩后恢复**:先运行 `
|
|
185
|
+
- **上下文压缩后恢复**:先运行 `"$COMET_BASH" "$COMET_STATE" check <change-name> build --recover`,脚本输出结构化恢复上下文(isolation/build_mode 状态、plan 路径、任务完成进度、恢复动作)。根据 Recovery action 决定下一步。
|
|
155
186
|
- **用户手动修改恢复**:按 `comet/reference/dirty-worktree.md` 协议处理未提交改动。该协议定义了检查步骤、归因分类和禁令。build 阶段的特殊处理:
|
|
156
187
|
1. 归因后,若 diff 暗示计划或 spec 已变化,按 Step 4「Spec 增量更新」分级处理
|
|
157
188
|
- **长任务拆分**:单任务超过 200 行代码变更时,考虑拆分为多个子任务分别提交
|
|
@@ -163,7 +194,7 @@ Build 是最长阶段,可能跨越大量任务。为支持上下文压缩后
|
|
|
163
194
|
- 已显式运行项目对应的构建/测试命令并通过(不要只依赖 guard 自动猜测)
|
|
164
195
|
- `isolation` 已写为 `branch` 或 `worktree`
|
|
165
196
|
- `build_mode` 已写为 `subagent-driven-development`、`executing-plans` 或带显式 override 的 `direct`
|
|
166
|
-
- **阶段守卫**:运行 `
|
|
197
|
+
- **阶段守卫**:运行 `"$COMET_BASH" "$COMET_GUARD" <change-name> build --apply`,全部 PASS 后自动流转到 `phase: verify`
|
|
167
198
|
|
|
168
199
|
Guard 会优先读取项目配置中的命令:
|
|
169
200
|
|
|
@@ -178,7 +209,7 @@ verify_command: <verify command>
|
|
|
178
209
|
退出前运行 guard 自动流转:
|
|
179
210
|
|
|
180
211
|
```bash
|
|
181
|
-
|
|
212
|
+
"$COMET_BASH" "$COMET_GUARD" <change-name> build --apply
|
|
182
213
|
```
|
|
183
214
|
|
|
184
215
|
状态文件自动更新为 `phase: verify`、`verify_result: pending`。
|