@rpamis/comet 0.3.0 → 0.3.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.
- package/LICENSE +21 -21
- package/assets/manifest.json +1 -1
- package/assets/skills/comet/SKILL.md +37 -26
- package/assets/skills/comet/scripts/comet-state.sh +23 -7
- package/assets/skills/comet/scripts/comet-yaml-validate.sh +1 -1
- package/assets/skills/comet-archive/SKILL.md +2 -2
- package/assets/skills/comet-build/SKILL.md +30 -41
- package/assets/skills/comet-design/SKILL.md +88 -20
- package/assets/skills/comet-hotfix/SKILL.md +34 -21
- package/assets/skills/comet-open/SKILL.md +34 -30
- package/assets/skills/comet-tweak/SKILL.md +29 -18
- package/assets/skills/comet-verify/SKILL.md +64 -46
- package/assets/skills-zh/comet/SKILL.md +16 -9
- package/assets/skills-zh/comet-build/SKILL.md +29 -40
- package/assets/skills-zh/comet-design/SKILL.md +23 -5
- package/assets/skills-zh/comet-hotfix/SKILL.md +30 -17
- package/assets/skills-zh/comet-open/SKILL.md +3 -1
- package/assets/skills-zh/comet-tweak/SKILL.md +15 -4
- package/assets/skills-zh/comet-verify/SKILL.md +30 -12
- package/bin/comet.js +3 -3
- package/dist/commands/update.js +1 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/core/superpowers.d.ts.map +1 -1
- package/dist/core/superpowers.js +17 -1
- package/dist/core/superpowers.js.map +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +44 -44
|
@@ -16,9 +16,9 @@ Quick bug fix workflow: open → build → verify → archive. Skip brainstormin
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
## Process (preset workflow,
|
|
19
|
+
## Process (preset workflow, 5 steps)
|
|
20
20
|
|
|
21
|
-
Execution chain: open → build → verify → archive. Hotfix provides default decisions for each phase: streamlined open, direct build, scale-based verification, archive after verification passes.
|
|
21
|
+
Execution chain: open → build → root cause check → verify → archive. Hotfix provides default decisions for each phase: streamlined open, direct build, root cause confirmation, scale-based verification, archive after verification passes.
|
|
22
22
|
|
|
23
23
|
Locate Comet scripts before starting:
|
|
24
24
|
|
|
@@ -75,33 +75,34 @@ Before continuing or starting changes, handle uncommitted changes through `comet
|
|
|
75
75
|
- Check corresponding `- [ ]` to `- [x]` in tasks.md
|
|
76
76
|
- Commit code, commit message format: `fix: <brief fix description>`
|
|
77
77
|
3. After all tasks complete, explicitly run relevant project tests and build commands
|
|
78
|
-
4. Run phase guard to transition build → verify:
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
bash "$COMET_GUARD" <change-name> build --apply
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
State automatically updates to `phase: verify`, `verify_result: pending`, then enter verification.
|
|
85
78
|
|
|
86
79
|
**If fix affects existing spec acceptance scenarios**:
|
|
87
80
|
- Create delta spec in `openspec/changes/<name>/specs/<capability>/spec.md`
|
|
88
81
|
- Only include `## MODIFIED Requirements` section
|
|
89
82
|
|
|
90
|
-
###
|
|
83
|
+
### 3. Root Cause Elimination Check
|
|
91
84
|
|
|
92
|
-
**Execute before
|
|
85
|
+
**Execute before running build guard**, ensuring the fix actually eliminates the root cause:
|
|
93
86
|
|
|
94
87
|
1. Read bug description and root cause in proposal.md
|
|
95
88
|
2. Search and verify problem code no longer exists
|
|
96
|
-
3. If root cause not eliminated, return to Step 2 to continue fix
|
|
89
|
+
3. If root cause not eliminated, return to Step 2 to continue fix (still in build phase, no state transition needed)
|
|
97
90
|
|
|
98
91
|
**Upgrade conditions**:
|
|
99
|
-
- Root cause check reveals deep architecture issues → Stop hotfix,
|
|
100
|
-
- Fix requires additional interface changes → Stop hotfix,
|
|
92
|
+
- Root cause check reveals deep architecture issues → Stop hotfix, handle per "Upgrade Conditions" section
|
|
93
|
+
- Fix requires additional interface changes → Stop hotfix, handle per "Upgrade Conditions" section
|
|
101
94
|
|
|
102
|
-
|
|
95
|
+
After root cause is confirmed eliminated, run phase guard to transition build → verify:
|
|
103
96
|
|
|
104
|
-
|
|
97
|
+
```bash
|
|
98
|
+
bash "$COMET_GUARD" <change-name> build --apply
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
State automatically updates to `phase: verify`, `verify_result: pending`, then enter verification.
|
|
102
|
+
|
|
103
|
+
### 4. Verification (preset verify)
|
|
104
|
+
|
|
105
|
+
Reuse `/comet-verify`, with comet-verify's scale assessment deciding lightweight or full verification.
|
|
105
106
|
|
|
106
107
|
**Immediately execute:** Use the Skill tool to load the `comet-verify` skill. Skipping this step is prohibited.
|
|
107
108
|
|
|
@@ -109,7 +110,7 @@ Small-scale hotfixes without delta spec usually meet lightweight verification co
|
|
|
109
110
|
|
|
110
111
|
After verification passes, record `.comet.yaml` `verify_result` as `pass` according to `/comet-verify` rules, must not skip this status before archiving.
|
|
111
112
|
|
|
112
|
-
###
|
|
113
|
+
### 5. Archive (preset archive)
|
|
113
114
|
|
|
114
115
|
Reuse `/comet-archive`. Must satisfy `verify_result: pass` in `.comet.yaml` before archiving.
|
|
115
116
|
|
|
@@ -121,11 +122,15 @@ If there is delta spec, sync to main spec according to comet-archive rules, and
|
|
|
121
122
|
## Continuous Execution Mode
|
|
122
123
|
|
|
123
124
|
<IMPORTANT>
|
|
124
|
-
Hotfix workflow is **one-time continuous execution**. After invoking `/comet-hotfix`, agent must automatically
|
|
125
|
+
Hotfix workflow is **one-time continuous execution**. After invoking `/comet-hotfix`, agent must automatically advance through hotfix steps, without pausing to wait for user input mid-way. But the following situations must pause and wait for user confirmation:
|
|
125
126
|
|
|
126
|
-
|
|
127
|
+
1. Encountering upgrade conditions (see "Upgrade Conditions" section)
|
|
128
|
+
2. When tasks exceed 3 and transfer to `/comet-build` for workspace isolation and execution method selection
|
|
129
|
+
3. Verification phase (comet-verify) verification failure decision and branch handling decision
|
|
127
130
|
|
|
128
|
-
|
|
131
|
+
Execution order: quick open → direct build → root cause check → verification → archive → complete
|
|
132
|
+
|
|
133
|
+
After each step completes, immediately enter next step. Within each phase, must still call corresponding Comet/OpenSpec/Superpowers skill according to above requirements; if the called skill has its own user decision points, follow that skill's rules.
|
|
129
134
|
</IMPORTANT>
|
|
130
135
|
|
|
131
136
|
---
|
|
@@ -142,7 +147,15 @@ Upgrade to full `/comet` when **any** of the following conditions are met:
|
|
|
142
147
|
| Introduces new public API | Fix creates new external interface |
|
|
143
148
|
| Fix scope exceeds single function/module | Requires coordinated changes |
|
|
144
149
|
|
|
145
|
-
|
|
150
|
+
When upgrade conditions are met, must pause and wait for user to explicitly confirm upgrade to full `/comet` workflow. Must not directly enter `/comet-design`, must not automatically supplement Design Doc.
|
|
151
|
+
|
|
152
|
+
After user confirms upgrade, **must first update the workflow field** before entering full flow:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
bash "$COMET_STATE" set <name> workflow full
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Then on current change basis, supplement Design Doc: **immediately use Skill tool to load `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.
|
|
146
159
|
|
|
147
160
|
---
|
|
148
161
|
|
|
@@ -1,40 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: comet-open
|
|
3
|
-
description: "Comet Phase 1: Open. Invoke with /comet-open. Explore ideas through OpenSpec
|
|
3
|
+
description: "Comet Phase 1: Open. Invoke with /comet-open. Explore ideas through OpenSpec, create change structure (proposal + design + tasks)."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Comet Phase 1: Open
|
|
7
7
|
|
|
8
8
|
## Prerequisites
|
|
9
9
|
|
|
10
|
-
- No active change, or user
|
|
10
|
+
- No active change, or user wants to create a new change
|
|
11
11
|
|
|
12
12
|
## Steps
|
|
13
13
|
|
|
14
|
-
###
|
|
15
|
-
|
|
16
|
-
Locate scripts before creating state:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
COMET_SEARCH_ROOTS=("." "$HOME/.claude/skills" "$HOME/.codex/skills" "$HOME/.cursor/skills")
|
|
20
|
-
COMET_STATE="${COMET_STATE:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-state.sh' -type f -print -quit 2>/dev/null)}"
|
|
21
|
-
COMET_GUARD="${COMET_GUARD:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-guard.sh' -type f -print -quit 2>/dev/null)}"
|
|
22
|
-
|
|
23
|
-
if [ -z "$COMET_STATE" ] || [ -z "$COMET_GUARD" ]; then
|
|
24
|
-
echo "ERROR: Comet scripts not found. Ensure the comet skill is installed." >&2
|
|
25
|
-
return 1
|
|
26
|
-
fi
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### 1. Explore Idea
|
|
14
|
+
### 1. Explore Ideas
|
|
30
15
|
|
|
31
16
|
**Immediately execute:** Use the Skill tool to load the `openspec-explore` skill. Skipping this step is prohibited.
|
|
32
17
|
|
|
33
18
|
After the skill loads, freely explore the problem space following its guidance.
|
|
34
19
|
|
|
35
|
-
### 2. Create Change Structure
|
|
20
|
+
### 2. Create Change Structure + Initialize State
|
|
36
21
|
|
|
37
|
-
**Immediately execute:** Use the Skill tool to load the `openspec-new-change` skill. If user intent is unclear and needs
|
|
22
|
+
**Immediately execute:** Use the Skill tool to load the `openspec-new-change` skill. If the user's intent is unclear and needs proposal formation first, load `openspec-propose` instead. Skipping this step is prohibited.
|
|
38
23
|
|
|
39
24
|
Confirm the following artifacts have been created:
|
|
40
25
|
|
|
@@ -43,40 +28,59 @@ openspec/changes/<name>/
|
|
|
43
28
|
├── .openspec.yaml
|
|
44
29
|
├── .comet.yaml
|
|
45
30
|
├── proposal.md # Why + What: problem, goals, scope
|
|
46
|
-
├── design.md # How (high-level):
|
|
31
|
+
├── design.md # How (high-level): architecture decisions, approach selection
|
|
47
32
|
└── tasks.md # Task checklist (checkboxes)
|
|
48
33
|
```
|
|
49
34
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Initialize Comet state file:
|
|
35
|
+
Create `.comet.yaml` state file:
|
|
53
36
|
|
|
54
37
|
```bash
|
|
38
|
+
COMET_SEARCH_ROOTS=("." "$HOME/.claude/skills" "$HOME/.codex/skills" "$HOME/.cursor/skills")
|
|
39
|
+
COMET_STATE="${COMET_STATE:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-state.sh' -type f -print -quit 2>/dev/null)}"
|
|
40
|
+
COMET_GUARD="${COMET_GUARD:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-guard.sh' -type f -print -quit 2>/dev/null)}"
|
|
41
|
+
|
|
42
|
+
if [ -z "$COMET_STATE" ] || [ -z "$COMET_GUARD" ]; then
|
|
43
|
+
echo "ERROR: Comet scripts not found. Ensure the comet skill is installed." >&2
|
|
44
|
+
return 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
55
47
|
bash "$COMET_STATE" init <name> full
|
|
56
48
|
```
|
|
57
49
|
|
|
50
|
+
### 3. Entry State Verification
|
|
51
|
+
|
|
52
|
+
Verify state machine has been correctly initialized:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
bash "$COMET_STATE" check <name> open
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Proceed to Step 4 after verification passes. The script outputs specific failure reasons when verification fails.
|
|
59
|
+
|
|
58
60
|
### 4. Content Completeness Check
|
|
59
61
|
|
|
60
62
|
Confirm the three documents have complete content:
|
|
61
63
|
- **proposal.md**: problem background, goals, scope, non-goals
|
|
62
|
-
- **design.md**: high-level
|
|
64
|
+
- **design.md**: high-level architecture decisions, approach selection, data flow
|
|
63
65
|
- **tasks.md**: task list, each task has a clear description
|
|
64
66
|
|
|
65
67
|
## Exit Conditions
|
|
66
68
|
|
|
67
|
-
- proposal.md, design.md,
|
|
68
|
-
- **Phase guard**: Run `bash "$COMET_GUARD" <change-name> open --apply`; after all PASS,
|
|
69
|
+
- proposal.md, design.md, tasks.md all created with complete content
|
|
70
|
+
- **Phase guard**: Run `bash "$COMET_GUARD" <change-name> open --apply`; after all PASS, auto-transitions to next phase
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
Must use `--apply` before exit, otherwise `.comet.yaml` remains at `phase: open` and the next phase entry check will fail.
|
|
71
73
|
|
|
72
74
|
```bash
|
|
73
75
|
bash "$COMET_GUARD" <change-name> open --apply
|
|
74
76
|
```
|
|
75
77
|
|
|
76
|
-
Full workflow
|
|
78
|
+
Full workflow auto-transitions to `phase: design`; hotfix/tweak presets auto-transition to `phase: build`.
|
|
77
79
|
|
|
78
80
|
## Automatic Transition
|
|
79
81
|
|
|
80
82
|
After exit conditions are met, **proceed immediately to the next phase without waiting for user input**:
|
|
81
83
|
|
|
82
|
-
> **REQUIRED NEXT SKILL:** Invoke `comet-design` skill to enter the deep design phase.
|
|
84
|
+
> **REQUIRED NEXT SKILL (full workflow):** Invoke `comet-design` skill to enter the deep design phase.
|
|
85
|
+
>
|
|
86
|
+
> Hotfix/tweak presets are controlled by their corresponding preset skill for subsequent transitions (phase goes directly to build), and do not go through this section.
|
|
@@ -5,17 +5,17 @@ description: "Comet preset path: Non-bug small changes (tweak). Skip brainstormi
|
|
|
5
5
|
|
|
6
6
|
# Comet Preset Path: Tweak
|
|
7
7
|
|
|
8
|
-
Tweak is a preset workflow of Comet's five-phase capabilities, not
|
|
8
|
+
Tweak is a preset workflow of Comet's five-phase capabilities, not an independent parallel process. It reuses open, build, verify, archive capabilities, only skipping brainstorming and full plan.
|
|
9
9
|
|
|
10
|
-
Applicable for
|
|
10
|
+
Applicable for non-bug small scope changes, such as copy adjustment, configuration adjustment, documentation or prompt local optimization.
|
|
11
11
|
|
|
12
12
|
**Applicable conditions** (all must be met):
|
|
13
13
|
1. No new capability
|
|
14
14
|
2. No architecture changes
|
|
15
|
-
3. No interface changes
|
|
16
|
-
4.
|
|
15
|
+
3. No interface changes
|
|
16
|
+
4. Typically no more than 3 tasks, 4 files
|
|
17
17
|
|
|
18
|
-
**Not applicable**: If change process discovers need for capability, architecture
|
|
18
|
+
**Not applicable**: If change process discovers need for capability, architecture or interface adjustments, should upgrade to full `/comet` workflow.
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -41,8 +41,8 @@ Reuse Comet open capability to create change, but use tweak defaults: do not exe
|
|
|
41
41
|
After the skill loads, follow its guidance to create streamlined artifacts:
|
|
42
42
|
- `proposal.md` — change motivation + goals + scope
|
|
43
43
|
- `design.md` — brief implementation description (no solution comparison needed)
|
|
44
|
-
- `tasks.md` —
|
|
45
|
-
- **No delta spec needed** (unless change
|
|
44
|
+
- `tasks.md` — no more than 3 tasks
|
|
45
|
+
- **No delta spec needed** (unless change modifies existing spec acceptance scenarios; once delta spec is needed, upgrade to full `/comet`)
|
|
46
46
|
|
|
47
47
|
Initialize Comet state file:
|
|
48
48
|
|
|
@@ -66,13 +66,13 @@ bash "$COMET_GUARD" <change-name> open --apply
|
|
|
66
66
|
|
|
67
67
|
Use tweak defaults: `build_mode: direct`. Skip `superpowers:brainstorming` and `superpowers:writing-plans`.
|
|
68
68
|
|
|
69
|
-
Before continuing or starting changes, handle uncommitted changes through `comet/reference/dirty-worktree.md`. If attribution shows
|
|
69
|
+
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".
|
|
70
70
|
|
|
71
71
|
**Immediately execute:** Execute tasks one by one according to tasks.md:
|
|
72
72
|
|
|
73
73
|
1. Read `openspec/changes/<name>/tasks.md`, get incomplete task list
|
|
74
74
|
2. For each incomplete task:
|
|
75
|
-
- Modify target
|
|
75
|
+
- Modify target files according to task description
|
|
76
76
|
- Run project formatter (e.g., `mvn spotless:apply`, `npm run format`)
|
|
77
77
|
- Run related tests to confirm pass
|
|
78
78
|
- Check corresponding `- [ ]` to `- [x]` in tasks.md
|
|
@@ -92,7 +92,7 @@ Reuse `/comet-verify`. Tweak must maintain lightweight verification conditions:
|
|
|
92
92
|
|
|
93
93
|
**Immediately execute:** Use the Skill tool to load the `comet-verify` skill. Skipping this step is prohibited.
|
|
94
94
|
|
|
95
|
-
If scale assessment enters full verification path, stop tweak, upgrade
|
|
95
|
+
If scale assessment enters full verification path, stop tweak, handle per upgrade conditions blocking confirmation.
|
|
96
96
|
|
|
97
97
|
After verification passes, record `.comet.yaml` `verify_result` as `pass` according to `/comet-verify` rules, must not skip this status before archiving.
|
|
98
98
|
|
|
@@ -107,11 +107,14 @@ Reuse `/comet-archive`. Must satisfy `verify_result: pass` in `.comet.yaml` befo
|
|
|
107
107
|
## Continuous Execution Mode
|
|
108
108
|
|
|
109
109
|
<IMPORTANT>
|
|
110
|
-
Tweak workflow is **one-time continuous execution**. After invoking `/comet-tweak`, agent must automatically
|
|
110
|
+
Tweak workflow is **one-time continuous execution**. After invoking `/comet-tweak`, agent must automatically advance through tweak steps, without pausing to wait for user input mid-way. But the following situations must pause and wait for user confirmation:
|
|
111
|
+
|
|
112
|
+
1. Encountering upgrade conditions (see "Upgrade Conditions" section)
|
|
113
|
+
2. Verification phase (comet-verify) verification failure decision and branch handling decision
|
|
111
114
|
|
|
112
115
|
Execution order: quick open → lightweight build → lightweight verification → archive → complete
|
|
113
116
|
|
|
114
|
-
After each phase completes, immediately enter next phase
|
|
117
|
+
After each phase completes, immediately enter next phase. Within each phase, must still call corresponding Comet/OpenSpec/Superpowers skill according to above requirements; if the called skill has its own user decision points, follow that skill's rules.
|
|
115
118
|
</IMPORTANT>
|
|
116
119
|
|
|
117
120
|
---
|
|
@@ -123,13 +126,21 @@ Upgrade to full `/comet` when **any** of the following conditions are met:
|
|
|
123
126
|
| Condition | Explanation |
|
|
124
127
|
|-----------|-------------|
|
|
125
128
|
| Change involves **5+ files** | Exceeds small change scope |
|
|
126
|
-
| Cross-module coordination required |
|
|
127
|
-
| **5+** new test cases needed | Change complexity
|
|
128
|
-
| Config item additions or deletions |
|
|
129
|
+
| Cross-module coordination required | Requires cross-component coordination |
|
|
130
|
+
| **5+** new test cases needed | Change complexity rising |
|
|
131
|
+
| Config item additions or deletions | Config changes beyond value modifications |
|
|
129
132
|
| New capability needed | Exceeds local optimization |
|
|
130
|
-
| Delta spec needed | Affects existing
|
|
133
|
+
| Delta spec needed | Affects existing specs |
|
|
134
|
+
|
|
135
|
+
When upgrade conditions are met, must pause and wait for user to explicitly confirm upgrade to full `/comet` workflow. Must not directly enter `/comet-design`, must not automatically supplement Design Doc.
|
|
136
|
+
|
|
137
|
+
After user confirms upgrade, **must first update the workflow field** before entering full flow:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
bash "$COMET_STATE" set <name> workflow full
|
|
141
|
+
```
|
|
131
142
|
|
|
132
|
-
|
|
143
|
+
Then on current change basis, supplement Design Doc: **immediately use Skill tool to load `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.
|
|
133
144
|
|
|
134
145
|
---
|
|
135
146
|
|
|
@@ -137,5 +148,5 @@ Upgrade method: On current change basis, supplement Design Doc (execute `/comet-
|
|
|
137
148
|
|
|
138
149
|
- Small change completed, tests pass
|
|
139
150
|
- Change archived
|
|
140
|
-
- No new capability, architecture adjustments
|
|
151
|
+
- No new capability, architecture adjustments or interface changes
|
|
141
152
|
- **Phase guard**: Before build → verify run `bash "$COMET_GUARD" <change-name> build --apply`; before verify → archive follow `/comet-verify` and run `bash "$COMET_GUARD" <change-name> verify --apply`
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: comet-verify
|
|
3
|
-
description: "Comet Phase 4: Verify and
|
|
3
|
+
description: "Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify implementation matches design, handle development branch."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Comet Phase 4: Verify and
|
|
6
|
+
# Comet Phase 4: Verify and Close (Verify)
|
|
7
7
|
|
|
8
8
|
## Prerequisites
|
|
9
9
|
|
|
10
|
-
- Code
|
|
11
|
-
- All tasks
|
|
10
|
+
- Code committed (Phase 3 complete)
|
|
11
|
+
- All tasks.md tasks completed
|
|
12
12
|
|
|
13
13
|
## Steps
|
|
14
14
|
|
|
@@ -25,7 +25,7 @@ bash "$COMET_STATE" check <change-name> verify
|
|
|
25
25
|
|
|
26
26
|
Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
|
|
27
27
|
|
|
28
|
-
### 1.
|
|
28
|
+
### 1. Scale Assessment
|
|
29
29
|
|
|
30
30
|
Execute scale assessment:
|
|
31
31
|
|
|
@@ -33,21 +33,22 @@ Execute scale assessment:
|
|
|
33
33
|
bash "$COMET_STATE" scale <change-name>
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
The script automatically counts tasks, delta spec count, changed file count, determines light or full verification mode, and sets the verify_mode field.
|
|
37
37
|
|
|
38
|
-
Before verification
|
|
38
|
+
Before verification begins, handle uncommitted changes through `comet/reference/dirty-worktree.md` protocol. Verify phase special handling:
|
|
39
39
|
|
|
40
|
-
1. If dirty diff belongs to
|
|
41
|
-
2. If dirty diff is only
|
|
42
|
-
3. If dirty diff
|
|
40
|
+
1. If dirty diff belongs to current change and involves implementation, tests, tasks, delta spec, or design doc changes, do not fix or commit directly in verify phase; report failures and enter Step 1b verification failure decision blocking point
|
|
41
|
+
2. If dirty diff is only verify phase artifacts (e.g., verification report draft, branch handling records), may continue and record state in verify phase
|
|
42
|
+
3. If dirty diff shows implementation but tasks.md not checked, treat as build state lag; report failures and enter Step 1b, let user decide to roll back for fix or accept deviation
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Only after user chooses fix, allow rollback to build phase:
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
+
# Execute only after user confirms fix
|
|
47
48
|
bash "$COMET_STATE" transition <change-name> verify-fail
|
|
48
49
|
```
|
|
49
50
|
|
|
50
|
-
Note:
|
|
51
|
+
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:
|
|
51
52
|
|
|
52
53
|
```bash
|
|
53
54
|
PLAN=$(bash "$COMET_STATE" get <change-name> plan)
|
|
@@ -55,27 +56,41 @@ BASE_REF=$(grep '^base-ref:' "$PLAN" 2>/dev/null | head -1 | sed 's/^base-ref: *
|
|
|
55
56
|
git diff --stat "$BASE_REF"...HEAD
|
|
56
57
|
```
|
|
57
58
|
|
|
58
|
-
If
|
|
59
|
+
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:
|
|
59
60
|
|
|
60
61
|
```bash
|
|
61
62
|
bash "$COMET_STATE" set <change-name> verify_mode full
|
|
62
63
|
```
|
|
63
64
|
|
|
65
|
+
### 1b. Verification Failure Decision (Blocking Point)
|
|
66
|
+
|
|
67
|
+
When verification does not pass, must pause and wait for the user to decide fix or accept deviation. Must not automatically run `bash "$COMET_STATE" transition <change-name> verify-fail`, nor automatically invoke `/comet-build`.
|
|
68
|
+
|
|
69
|
+
When pausing, must list:
|
|
70
|
+
- Failed items
|
|
71
|
+
- Whether CRITICAL (build failure, test failure, security issues, core acceptance scenario failure)
|
|
72
|
+
- Recommended handling approach
|
|
73
|
+
|
|
74
|
+
After user selection, continue as follows:
|
|
75
|
+
- **Fix all**: Run `bash "$COMET_STATE" transition <change-name> verify-fail`, then invoke `/comet-build` to fix
|
|
76
|
+
- **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
|
|
77
|
+
|
|
64
78
|
### 2a. Lightweight Verification (Small Changes)
|
|
65
79
|
|
|
66
|
-
When scale assessment result is "small", skip `openspec-verify-change
|
|
80
|
+
When scale assessment result is "small", skip `openspec-verify-change` and directly execute these checks:
|
|
67
81
|
|
|
68
|
-
1. All tasks
|
|
69
|
-
2. Changed files
|
|
70
|
-
3. Build passes (run project-
|
|
82
|
+
1. All tasks.md tasks completed `[x]`
|
|
83
|
+
2. Changed files match tasks.md descriptions (`git diff --stat` / `git diff --cached --stat` / `git diff --stat <base-ref>...HEAD` compared against tasks content)
|
|
84
|
+
3. Build passes (run project-specific build command, e.g., `npm run build`, `mvn compile`, `cargo build`, etc.)
|
|
71
85
|
4. Related tests pass
|
|
72
|
-
5. No obvious security issues (no hardcoded
|
|
86
|
+
5. No obvious security issues (no hardcoded keys, no new unsafe operations)
|
|
73
87
|
|
|
74
|
-
**Pass
|
|
88
|
+
**Pass criteria**: All 5 items OK, no CRITICAL issues.
|
|
75
89
|
|
|
76
|
-
**When
|
|
90
|
+
**When not passing**: Report failures, enter Step 1b verification failure decision blocking point. Only after user confirms fix, execute the following command to record failure and roll back to build phase, then invoke `/comet-build` to fix:
|
|
77
91
|
|
|
78
92
|
```bash
|
|
93
|
+
# Execute only after user confirms fix
|
|
79
94
|
bash "$COMET_STATE" transition <change-name> verify-fail
|
|
80
95
|
```
|
|
81
96
|
|
|
@@ -84,7 +99,7 @@ bash "$COMET_STATE" transition <change-name> verify-fail
|
|
|
84
99
|
**Skipped items** (not checked in lightweight verification):
|
|
85
100
|
- spec scenario coverage
|
|
86
101
|
- design doc consistency deep comparison
|
|
87
|
-
- code pattern consistency
|
|
102
|
+
- code pattern consistency suggestions
|
|
88
103
|
- delta spec and design doc drift detection
|
|
89
104
|
|
|
90
105
|
### 2b. Full Verification (Large Changes)
|
|
@@ -94,49 +109,52 @@ When scale assessment result is "large":
|
|
|
94
109
|
**Immediately execute:** Use the Skill tool to load the `openspec-verify-change` skill. Skipping this step is prohibited.
|
|
95
110
|
|
|
96
111
|
After the skill loads, follow its guidance to verify. Check items:
|
|
97
|
-
1. All tasks
|
|
98
|
-
2. Implementation matches design.md design decisions
|
|
99
|
-
3. Implementation matches
|
|
100
|
-
4. All capability
|
|
101
|
-
5. proposal.md goals satisfied
|
|
102
|
-
6. No
|
|
103
|
-
7. `docs/superpowers/specs/`
|
|
112
|
+
1. All tasks.md tasks completed (`[x]`)
|
|
113
|
+
2. Implementation matches `openspec/changes/<name>/design.md` high-level design decisions
|
|
114
|
+
3. Implementation matches Design Doc (technical design documents under `docs/superpowers/specs/`)
|
|
115
|
+
4. All capability spec scenarios pass
|
|
116
|
+
5. proposal.md goals are satisfied
|
|
117
|
+
6. No contradictions between delta spec and design doc (if Build phase had incremental spec modifications, check if design doc has corresponding records)
|
|
118
|
+
7. Associated design documents under `docs/superpowers/specs/` are locatable (file exists and is related to current change)
|
|
104
119
|
|
|
105
|
-
When verification
|
|
120
|
+
When verification does not pass: report missing items, enter Step 1b verification failure decision blocking point. Only after user confirms fix, execute the following command to record failure and roll back to build phase, then invoke `/comet-build` to supplement:
|
|
106
121
|
|
|
107
122
|
```bash
|
|
123
|
+
# Execute only after user confirms fix
|
|
108
124
|
bash "$COMET_STATE" transition <change-name> verify-fail
|
|
109
125
|
```
|
|
110
126
|
|
|
111
|
-
**Spec
|
|
112
|
-
- If check item 6 finds
|
|
113
|
-
- Option A: Append "Implementation Divergence" section to design doc recording deviation reason
|
|
114
|
-
- Option B:
|
|
115
|
-
- Option C: Confirm deviation acceptable, continue verification (design doc will be marked as `superseded-by-main-spec` during archiving)
|
|
127
|
+
**Spec Drift Handling** (user decision point):
|
|
128
|
+
- If check item 6 finds contradictions (delta spec has content but design doc does not reflect it), **must pause and wait for user to choose handling method**; must not select automatically. Options:
|
|
129
|
+
- 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
|
|
130
|
+
- Option B: After user selects B, run `bash "$COMET_STATE" transition <change-name> verify-fail`, then invoke `/comet-build`; `/comet-build`'s Spec Incremental Update rules will load `superpowers:brainstorming` to update Design Doc + delta spec
|
|
131
|
+
- Option C: Confirm deviation is acceptable, continue verification (design doc will be marked as `superseded-by-main-spec` during archiving)
|
|
116
132
|
|
|
117
|
-
### 3.
|
|
133
|
+
### 3. Finishing (Superpowers)
|
|
118
134
|
|
|
119
135
|
**Immediately execute:** Use the Skill tool to load the `superpowers:finishing-a-development-branch` skill. Skipping this step is prohibited.
|
|
120
136
|
|
|
121
137
|
If `superpowers:finishing-a-development-branch` is unavailable, stop the process and prompt to install or enable Superpowers skills. Do not substitute this step with normal conversation.
|
|
122
138
|
|
|
123
|
-
After the skill loads, follow its guidance to
|
|
124
|
-
1.
|
|
139
|
+
After the skill loads, follow its guidance to finish. Branch handling options:
|
|
140
|
+
1. Merge to main branch locally
|
|
125
141
|
2. Push and create PR
|
|
126
142
|
3. Keep branch (handle later)
|
|
127
143
|
4. Discard work
|
|
128
144
|
|
|
145
|
+
This is a user decision point. **Must pause and wait for user to choose branch handling method**. Must not select based on recommendations, defaults, or current branch status. Only after the user completes selection and the corresponding operation finishes, may `branch_status: handled` be written.
|
|
146
|
+
|
|
129
147
|
**Confirmation items**:
|
|
130
148
|
- All tests pass
|
|
131
|
-
- No hardcoded
|
|
149
|
+
- No hardcoded keys or security issues
|
|
132
150
|
|
|
133
151
|
### 4. Record Verification Evidence
|
|
134
152
|
|
|
135
|
-
|
|
153
|
+
Verification report must be saved to disk and recorded in `.comet.yaml`; after branch handling completes, state fields must also be written. Do not manually set `verify_result: pass`; use guard for auto-transition.
|
|
136
154
|
|
|
137
155
|
```bash
|
|
138
156
|
mkdir -p docs/superpowers/reports
|
|
139
|
-
# Write
|
|
157
|
+
# Write verification conclusions to report file, e.g.:
|
|
140
158
|
# docs/superpowers/reports/YYYY-MM-DD-<change-name>-verify.md
|
|
141
159
|
|
|
142
160
|
bash "$COMET_STATE" set <change-name> verification_report docs/superpowers/reports/YYYY-MM-DD-<change-name>-verify.md
|
|
@@ -147,20 +165,20 @@ bash "$COMET_STATE" set <change-name> branch_status handled
|
|
|
147
165
|
|
|
148
166
|
- Verification report passed
|
|
149
167
|
- Branch handled
|
|
150
|
-
- `.comet.yaml`
|
|
151
|
-
-
|
|
152
|
-
- **Phase guard**: Run `bash "$COMET_GUARD" <change-name> verify --apply`; after all PASS,
|
|
168
|
+
- `verification_report` in `.comet.yaml` points to an existing verification report file
|
|
169
|
+
- `branch_status: handled` in `.comet.yaml`
|
|
170
|
+
- **Phase guard**: Run `bash "$COMET_GUARD" <change-name> verify --apply`; after all PASS, auto-transitions to `phase: archive` through `comet-state transition verify-pass`
|
|
153
171
|
|
|
154
|
-
After verification and branch handling are complete, run guard
|
|
172
|
+
After both verification and branch handling are complete, run guard for auto-transition:
|
|
155
173
|
|
|
156
174
|
```bash
|
|
157
175
|
bash "$COMET_GUARD" <change-name> verify --apply
|
|
158
176
|
```
|
|
159
177
|
|
|
160
|
-
State file
|
|
178
|
+
State file auto-updates to `phase: archive`, `verify_result: pass`, `verified_at: YYYY-MM-DD`.
|
|
161
179
|
|
|
162
180
|
## Automatic Transition
|
|
163
181
|
|
|
164
182
|
After exit conditions are met, **proceed immediately to the next phase without waiting for user input**:
|
|
165
183
|
|
|
166
|
-
> **REQUIRED NEXT SKILL:** Invoke `comet-archive` skill to enter the
|
|
184
|
+
> **REQUIRED NEXT SKILL:** Invoke `comet-archive` skill to enter the archive phase.
|
|
@@ -53,8 +53,8 @@ agent 做决策只需读本节,参考附录按需查阅。
|
|
|
53
53
|
**断点恢复规则**:
|
|
54
54
|
- 每次恢复上下文时,先重新执行 Step 0 和 Step 1,不依赖对话历史判断阶段
|
|
55
55
|
- 只要存在 active change 且工作区有未提交改动,必须按 `comet/reference/dirty-worktree.md` 协议处理。该协议定义了检查步骤、归因分类和禁令,本文件不重复
|
|
56
|
-
- 若 `phase: build
|
|
57
|
-
- 若 `phase: verify` 且 `verify_result: fail
|
|
56
|
+
- 若 `phase: build`,先检查 `build_mode` 和 `isolation` 是否已设置;若有未设置的字段,回到 `/comet-build` 对应步骤补充后再执行;若均已设置,读取 tasks.md 的下一个未勾选任务继续
|
|
57
|
+
- 若 `phase: verify` 且 `verify_result: fail`,进入验证失败决策阻塞点:暂停并询问用户修复或接受偏差;用户选择修复后才运行 `bash "$COMET_STATE" transition <name> verify-fail` 并调用 `/comet-build`
|
|
58
58
|
- 若 `phase: open` 但 proposal/design/tasks 已完整,先运行 `bash "$COMET_GUARD" <change-name> open --apply` 修正状态,再继续判定
|
|
59
59
|
- 若 `phase: archive`,只允许调用 `/comet-archive`;归档成功后 change 会移动到 archive 目录,不再对原活跃目录运行 guard
|
|
60
60
|
|
|
@@ -62,9 +62,9 @@ agent 做决策只需读本节,参考附录按需查阅。
|
|
|
62
62
|
|
|
63
63
|
1. `archived: true` 或 change 已移入 archive → 流程已完成
|
|
64
64
|
2. `verify_result: pass` 且 `archived` 不是 `true` → `/comet-archive`
|
|
65
|
-
3. `verify_result: fail` → `
|
|
65
|
+
3. `verify_result: fail` → 进入验证失败决策阻塞点(暂停询问修复或接受偏差;用户选择修复后才 `verify-fail` 并 `/comet-build`)
|
|
66
66
|
4. `phase: verify` 或 tasks.md 全部勾选 → `/comet-verify`
|
|
67
|
-
5. `phase: build` 或已有 Design Doc 但计划/执行未完成 → `/comet-build`
|
|
67
|
+
5. `phase: build` 或已有 Design Doc 但计划/执行未完成 → 优先按 workflow 路由:`hotfix` → `/comet-hotfix`,`tweak` → `/comet-tweak`,`full` → `/comet-build`
|
|
68
68
|
6. `phase: design` 或有 change 但无 Design Doc → `/comet-design`
|
|
69
69
|
7. `phase: open` 或有活跃 change 但 `.comet.yaml` 缺失 → `/comet-open`
|
|
70
70
|
8. 无活跃 change → `/comet-open`
|
|
@@ -103,14 +103,17 @@ agent 做决策只需读本节,参考附录按需查阅。
|
|
|
103
103
|
|
|
104
104
|
流转链:open → design → build → verify → archive
|
|
105
105
|
|
|
106
|
-
**连续执行要求**:从检测到的阶段开始,agent
|
|
106
|
+
**连续执行要求**:从检测到的阶段开始,agent 必须自动推进后续阶段;自动推进只适用于没有用户决策的衔接点。遇到用户决策点时必须暂停并等待用户明确回复,不得用推荐规则、默认值或历史偏好代替用户确认。
|
|
107
|
+
|
|
108
|
+
**决策点是阻塞点**:只要到达下列任一节点,当前 `/comet` 调用必须停住。用户明确选择后才能写入对应状态字段、执行对应操作,随后再继续自动流转。
|
|
107
109
|
|
|
108
110
|
需要用户参与的节点(仅在这些节点暂停):
|
|
109
111
|
1. brainstorming 确认设计方案
|
|
110
|
-
2. build
|
|
111
|
-
|
|
112
|
+
2. build 阶段选择工作方式(隔离方式 + 执行方式,一次交互完成)
|
|
113
|
+
4. verify 不通过时决定修复或接受偏差(含 Spec 漂移处理方式选择)
|
|
112
114
|
4. finishing-branch 选择分支处理方式
|
|
113
115
|
5. 遇到升级条件(hotfix/tweak → 完整流程)
|
|
116
|
+
6. build 阶段范围扩张需重新设计或拆分新 change
|
|
114
117
|
|
|
115
118
|
agent 不应跳过这些决策点;其他明确无歧义的阶段衔接必须自动继续推进,不得中途退出。
|
|
116
119
|
</IMPORTANT>
|
|
@@ -137,11 +140,11 @@ agent 不应跳过这些决策点;其他明确无歧义的阶段衔接必须
|
|
|
137
140
|
|
|
138
141
|
/comet-hotfix(预设路径,跳过 brainstorming)
|
|
139
142
|
open ──→ build ──→ verify ──→ archive
|
|
140
|
-
↑ 如触发升级条件 → 补充 Design Doc → 回到完整流程
|
|
143
|
+
↑ 如触发升级条件 → 阻塞确认升级 → 补充 Design Doc → 回到完整流程
|
|
141
144
|
|
|
142
145
|
/comet-tweak(预设路径,跳过 brainstorming 和完整 plan)
|
|
143
146
|
open ──→ lightweight build ──→ light verify ──→ archive
|
|
144
|
-
↑ 如触发升级条件 → 补充 Design Doc → 回到完整流程
|
|
147
|
+
↑ 如触发升级条件 → 阻塞确认升级 → 补充 Design Doc → 回到完整流程
|
|
145
148
|
```
|
|
146
149
|
|
|
147
150
|
---
|
|
@@ -155,12 +158,14 @@ workflow: full
|
|
|
155
158
|
phase: build
|
|
156
159
|
design_doc: docs/superpowers/specs/YYYY-MM-DD-topic-design.md
|
|
157
160
|
plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
|
|
161
|
+
base_ref: a1b2c3d4e5f6...
|
|
158
162
|
build_mode: subagent-driven-development
|
|
159
163
|
isolation: branch
|
|
160
164
|
verify_mode: light
|
|
161
165
|
verify_result: pending
|
|
162
166
|
verification_report: null
|
|
163
167
|
branch_status: pending
|
|
168
|
+
created_at: 2026-05-26
|
|
164
169
|
verified_at: null
|
|
165
170
|
archived: false
|
|
166
171
|
```
|
|
@@ -171,12 +176,14 @@ archived: false
|
|
|
171
176
|
| `phase` | 当前阶段:`open`、`design`、`build`、`verify`、`archive`(init 统一设为 `open`,guard 负责过渡) |
|
|
172
177
|
| `design_doc` | 关联的 Superpowers Design Doc 路径,可为空 |
|
|
173
178
|
| `plan` | 关联的 Superpowers Plan 路径,可为空 |
|
|
179
|
+
| `base_ref` | init 时记录的 git commit SHA,用于 scale 评估。无 plan 时作为改动文件数统计基准 |
|
|
174
180
|
| `build_mode` | 已选择的执行方式,可为空 |
|
|
175
181
|
| `isolation` | `branch` 或 `worktree`,工作区隔离方式。full 初始化可为 `null`,但只允许持续到 `/comet-build` Step 3 前;hotfix/tweak 默认 `branch` |
|
|
176
182
|
| `verify_mode` | `light` 或 `full`,可为空 |
|
|
177
183
|
| `verify_result` | `pending`、`pass` 或 `fail` |
|
|
178
184
|
| `verification_report` | 验证报告文件路径,verify 通过前必须指向已存在文件 |
|
|
179
185
|
| `branch_status` | `pending` 或 `handled`,分支处理完成后设为 `handled` |
|
|
186
|
+
| `created_at` | change 创建日期(init 时自动写入),格式 `YYYY-MM-DD` |
|
|
180
187
|
| `verified_at` | 验证通过时间,可为空 |
|
|
181
188
|
| `archived` | change 是否已归档 |
|
|
182
189
|
|