@rpamis/comet 0.3.6 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +575 -443
  2. package/assets/manifest.json +41 -24
  3. package/assets/skills/comet/SKILL.md +282 -301
  4. package/assets/skills/comet/reference/auto-transition.md +27 -0
  5. package/assets/skills/comet/reference/comet-yaml-fields.md +68 -0
  6. package/assets/skills/comet/reference/context-recovery.md +35 -0
  7. package/assets/skills/comet/reference/debug-gate.md +17 -0
  8. package/assets/skills/comet/reference/decision-point.md +20 -0
  9. package/assets/skills/comet/reference/dirty-worktree.md +1 -0
  10. package/assets/skills/comet/reference/file-structure.md +28 -0
  11. package/assets/skills/comet/reference/subagent-dispatch.md +113 -0
  12. package/assets/skills/comet/rules/comet-phase-guard.en.md +99 -0
  13. package/assets/skills/comet/rules/comet-phase-guard.md +99 -0
  14. package/assets/skills/comet/scripts/comet-archive.sh +71 -55
  15. package/assets/skills/comet/scripts/comet-guard.sh +174 -18
  16. package/assets/skills/comet/scripts/comet-handoff.sh +133 -6
  17. package/assets/skills/comet/scripts/comet-hook-guard.sh +260 -0
  18. package/assets/skills/comet/scripts/comet-state.sh +362 -25
  19. package/assets/skills/comet/scripts/comet-yaml-validate.sh +24 -1
  20. package/assets/skills/comet-archive/SKILL.md +100 -73
  21. package/assets/skills/comet-build/SKILL.md +304 -221
  22. package/assets/skills/comet-design/SKILL.md +263 -166
  23. package/assets/skills/comet-hotfix/SKILL.md +204 -169
  24. package/assets/skills/comet-open/SKILL.md +203 -113
  25. package/assets/skills/comet-tweak/SKILL.md +180 -154
  26. package/assets/skills/comet-verify/SKILL.md +234 -201
  27. package/assets/skills-zh/comet/SKILL.md +269 -301
  28. package/assets/skills-zh/comet/reference/auto-transition.md +27 -0
  29. package/assets/skills-zh/comet/reference/comet-yaml-fields.md +68 -0
  30. package/assets/skills-zh/comet/reference/context-recovery.md +35 -0
  31. package/assets/skills-zh/comet/reference/debug-gate.md +17 -0
  32. package/assets/skills-zh/comet/reference/decision-point.md +20 -0
  33. package/assets/skills-zh/comet/reference/dirty-worktree.md +2 -1
  34. package/assets/skills-zh/comet/reference/file-structure.md +28 -0
  35. package/assets/skills-zh/comet/reference/subagent-dispatch.md +113 -0
  36. package/assets/skills-zh/comet-archive/SKILL.md +100 -73
  37. package/assets/skills-zh/comet-build/SKILL.md +304 -221
  38. package/assets/skills-zh/comet-design/SKILL.md +264 -166
  39. package/assets/skills-zh/comet-hotfix/SKILL.md +200 -169
  40. package/assets/skills-zh/comet-open/SKILL.md +203 -113
  41. package/assets/skills-zh/comet-tweak/SKILL.md +176 -154
  42. package/assets/skills-zh/comet-verify/SKILL.md +232 -201
  43. package/dist/cli/index.js +19 -0
  44. package/dist/cli/index.js.map +1 -1
  45. package/dist/commands/doctor.d.ts.map +1 -1
  46. package/dist/commands/doctor.js +22 -0
  47. package/dist/commands/doctor.js.map +1 -1
  48. package/dist/commands/init.d.ts +5 -1
  49. package/dist/commands/init.d.ts.map +1 -1
  50. package/dist/commands/init.js +64 -9
  51. package/dist/commands/init.js.map +1 -1
  52. package/dist/commands/uninstall.d.ts +9 -0
  53. package/dist/commands/uninstall.d.ts.map +1 -0
  54. package/dist/commands/uninstall.js +113 -0
  55. package/dist/commands/uninstall.js.map +1 -0
  56. package/dist/commands/update.d.ts +1 -1
  57. package/dist/commands/update.d.ts.map +1 -1
  58. package/dist/commands/update.js +120 -32
  59. package/dist/commands/update.js.map +1 -1
  60. package/dist/core/codegraph.d.ts +4 -0
  61. package/dist/core/codegraph.d.ts.map +1 -0
  62. package/dist/core/codegraph.js +63 -0
  63. package/dist/core/codegraph.js.map +1 -0
  64. package/dist/core/detect.d.ts +8 -1
  65. package/dist/core/detect.d.ts.map +1 -1
  66. package/dist/core/detect.js +41 -2
  67. package/dist/core/detect.js.map +1 -1
  68. package/dist/core/openspec.d.ts +1 -1
  69. package/dist/core/openspec.d.ts.map +1 -1
  70. package/dist/core/openspec.js +40 -17
  71. package/dist/core/openspec.js.map +1 -1
  72. package/dist/core/platforms.d.ts +10 -0
  73. package/dist/core/platforms.d.ts.map +1 -1
  74. package/dist/core/platforms.js +177 -16
  75. package/dist/core/platforms.js.map +1 -1
  76. package/dist/core/skills.d.ts +36 -1
  77. package/dist/core/skills.d.ts.map +1 -1
  78. package/dist/core/skills.js +451 -15
  79. package/dist/core/skills.js.map +1 -1
  80. package/dist/core/superpowers.d.ts.map +1 -1
  81. package/dist/core/superpowers.js +1 -0
  82. package/dist/core/superpowers.js.map +1 -1
  83. package/dist/core/uninstall.d.ts +28 -0
  84. package/dist/core/uninstall.d.ts.map +1 -0
  85. package/dist/core/uninstall.js +421 -0
  86. package/dist/core/uninstall.js.map +1 -0
  87. package/dist/core/version.d.ts +31 -0
  88. package/dist/core/version.d.ts.map +1 -0
  89. package/dist/core/version.js +111 -0
  90. package/dist/core/version.js.map +1 -0
  91. package/dist/utils/file-system.d.ts +23 -0
  92. package/dist/utils/file-system.d.ts.map +1 -1
  93. package/dist/utils/file-system.js +100 -5
  94. package/dist/utils/file-system.js.map +1 -1
  95. package/package.json +69 -62
@@ -1,201 +1,234 @@
1
- ---
2
- name: comet-verify
3
- description: "Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify implementation matches design, handle development branch."
4
- ---
5
-
6
- # Comet Phase 4: Verify and Close (Verify)
7
-
8
- ## Prerequisites
9
-
10
- - Code committed (Phase 3 complete)
11
- - All tasks.md tasks completed
12
-
13
- ## Steps
14
-
15
- ### 0. Entry State Verification (Entry Check)
16
-
17
- Execute entry verification:
18
-
19
- ```bash
20
- COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
21
- if [ -z "$COMET_ENV" ]; then
22
- echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
23
- return 1
24
- fi
25
- . "$COMET_ENV"
26
- "$COMET_BASH" "$COMET_STATE" check <change-name> verify
27
- ```
28
-
29
- Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
30
-
31
- **Idempotency**: All verify phase checks can be safely re-executed. If `verify_result` is already `pass` and `branch_status` is `handled`, verification is complete — execute guard to transition. If `verify_result` is `pending`, start verification from the beginning.
32
-
33
- ### 1. Scale Assessment
34
-
35
- Execute scale assessment:
36
-
37
- ```bash
38
- "$COMET_BASH" "$COMET_STATE" scale <change-name>
39
- ```
40
-
41
- The script automatically counts tasks, delta spec count, changed file count, determines light or full verification mode, and sets the verify_mode field.
42
-
43
- Before verification begins, handle uncommitted changes through `comet/reference/dirty-worktree.md` protocol. Verify phase special handling:
44
-
45
- 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
46
- 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
47
- 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
48
-
49
- Only after user chooses fix, allow rollback to build phase:
50
-
51
- ```bash
52
- # Execute only after user confirms fix
53
- "$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
54
- ```
55
-
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
-
58
- ```bash
59
- PLAN=$("$COMET_BASH" "$COMET_STATE" get <change-name> plan)
60
- BASE_REF=$(grep '^base-ref:' "$PLAN" 2>/dev/null | head -1 | sed 's/^base-ref: *//')
61
- git diff --stat "$BASE_REF"...HEAD
62
- ```
63
-
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
-
66
- ```bash
67
- "$COMET_BASH" "$COMET_STATE" set <change-name> verify_mode full
68
- ```
69
-
70
- ### 1b. Verification Failure Decision (Blocking Point)
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 `"$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
-
74
- When pausing, must list:
75
- - Failed items
76
- - Whether CRITICAL (build failure, test failure, security issues, core acceptance scenario failure)
77
- - Recommended handling approach
78
-
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
-
81
- After user selection, continue as follows:
82
- - **Fix all**: Run `"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail`, then invoke `/comet-build` to fix
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
-
85
- ### 2a. Lightweight Verification (Small Changes)
86
-
87
- When scale assessment result is "small", skip `openspec-verify-change` and directly execute these checks:
88
-
89
- 1. All tasks.md tasks completed `[x]`
90
- 2. Changed files match tasks.md descriptions (`git diff --stat` / `git diff --cached --stat` / `git diff --stat <base-ref>...HEAD` compared against tasks content)
91
- 3. Build passes (run project-specific build command, e.g., `npm run build`, `mvn compile`, `cargo build`, etc.)
92
- 4. Related tests pass
93
- 5. No obvious security issues (no hardcoded keys, no new unsafe operations)
94
-
95
- **Pass criteria**: All 5 items OK, no CRITICAL issues.
96
-
97
- **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:
98
-
99
- ```bash
100
- # Execute only after user confirms fix
101
- "$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
102
- ```
103
-
104
- **Report format**: Brief table listing 5 check results + PASS/FAIL.
105
-
106
- **Skipped items** (not checked in lightweight verification):
107
- - spec scenario coverage
108
- - design doc consistency deep comparison
109
- - code pattern consistency suggestions
110
- - delta spec and design doc drift detection
111
-
112
- ### 2b. Full Verification (Large Changes)
113
-
114
- When scale assessment result is "large":
115
-
116
- **Immediately execute:** Use the Skill tool to load the `openspec-verify-change` skill. Skipping this step is prohibited.
117
-
118
- After the skill loads, follow its guidance to verify. Check items:
119
- 1. All tasks.md tasks completed (`[x]`)
120
- 2. Implementation matches `openspec/changes/<name>/design.md` high-level design decisions
121
- 3. Implementation matches Design Doc (technical design documents under `docs/superpowers/specs/`)
122
- 4. All capability spec scenarios pass
123
- 5. proposal.md goals are satisfied
124
- 6. No contradictions between delta spec and design doc (if Build phase had incremental spec modifications, check if design doc has corresponding records)
125
- 7. Associated design documents under `docs/superpowers/specs/` are locatable (file exists and is related to current change)
126
-
127
- 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:
128
-
129
- ```bash
130
- # Execute only after user confirms fix
131
- "$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
132
- ```
133
-
134
- **Spec Drift Handling** (user decision point):
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
- - 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 `"$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
- - Option C: Confirm deviation is acceptable, continue verification (design doc will be marked as `superseded-by-main-spec` during archiving)
139
-
140
- ### 3. Finishing (Superpowers)
141
-
142
- **Immediately execute:** Use the Skill tool to load the Superpowers `finishing-a-development-branch` skill. Skipping this step is prohibited.
143
-
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
-
146
- After the skill loads, follow its guidance to finish. Branch handling options:
147
- 1. Merge to main branch locally
148
- 2. Push and create PR
149
- 3. Keep branch (handle later)
150
- 4. Discard work
151
-
152
- This is a user decision point. **Must use the AskUserQuestion tool to pause and wait for user to choose branch handling method**. Must not select based on recommendations, defaults, or current branch status. Must not just output a text prompt and then continue executing. Only after the user completes selection and the corresponding operation finishes, may `branch_status: handled` be written.
153
-
154
- **Confirmation items**:
155
- - All tests pass
156
- - No hardcoded keys or security issues
157
-
158
- ### 4. Record Verification Evidence
159
-
160
- 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.
161
-
162
- ```bash
163
- mkdir -p docs/superpowers/reports
164
- # Write verification conclusions to report file, e.g.:
165
- # docs/superpowers/reports/YYYY-MM-DD-<change-name>-verify.md
166
-
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
- ```
170
-
171
- ## Exit Conditions
172
-
173
- - Verification report passed
174
- - Branch handled
175
- - `verification_report` in `.comet.yaml` points to an existing verification report file
176
- - `branch_status: handled` in `.comet.yaml`
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
-
179
- After both verification and branch handling are complete, run guard for auto-transition:
180
-
181
- ```bash
182
- "$COMET_BASH" "$COMET_GUARD" <change-name> verify --apply
183
- ```
184
-
185
- State file auto-updates to `phase: archive`, `verify_result: pass`, `verified_at: YYYY-MM-DD`.
186
-
187
- ## Automatic Transition
188
-
189
- After exit conditions are met (including user selecting branch handling method), auto-transition to next phase:
190
-
191
- > **REQUIRED NEXT SKILL:** Invoke `comet-archive` skill to enter the archive phase.
192
-
193
- ## Context Compaction Recovery
194
-
195
- The verify phase may trigger context compaction. To recover, first run:
196
-
197
- ```bash
198
- "$COMET_BASH" "$COMET_STATE" check <change-name> verify --recover
199
- ```
200
-
201
- The script outputs structured recovery context (phase, verification status, branch status, recovery action). Follow the Recovery action to determine next step.
1
+ ---
2
+ name: comet-verify
3
+ description: "Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify implementation matches design, handle development branch."
4
+ ---
5
+
6
+ # Comet Phase 4: Verify and Close (Verify)
7
+
8
+ ## Prerequisites
9
+
10
+ - Code committed (Phase 3 complete)
11
+ - All tasks.md tasks completed
12
+
13
+ ## Steps
14
+
15
+ ### 0a. Output Language Constraint
16
+
17
+ Verification reports and branch-handling notes must use the language of the user request that triggered this workflow.
18
+
19
+ ### 0b. Entry State Verification (Entry Check)
20
+
21
+ Execute entry verification:
22
+
23
+ ```bash
24
+ COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
25
+ if [ -z "$COMET_ENV" ]; then
26
+ echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
27
+ return 1
28
+ fi
29
+ . "$COMET_ENV"
30
+ "$COMET_BASH" "$COMET_STATE" check <change-name> verify
31
+ ```
32
+
33
+ Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
34
+
35
+ **Idempotency**: All verify phase checks can be safely re-executed. If `verify_result` is already `pass` and `branch_status` is `handled`, verification is complete — execute guard to transition. If `verify_result` is `pending`, start verification from the beginning.
36
+
37
+ ### 1. Scale Assessment
38
+
39
+ Execute scale assessment:
40
+
41
+ ```bash
42
+ "$COMET_BASH" "$COMET_STATE" scale <change-name>
43
+ ```
44
+
45
+ The script automatically counts tasks, delta spec count, changed file count, determines light or full verification mode, and sets the verify_mode field. Decision rule (any condition triggers full): tasks > 3, delta spec capabilities > 1, changed files > 4.
46
+
47
+ Before verification begins, handle uncommitted changes through `comet/reference/dirty-worktree.md` protocol. Verify phase special handling:
48
+
49
+ 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
50
+ 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
51
+ 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
52
+
53
+ Only after user chooses fix, allow rollback to build phase:
54
+
55
+ ```bash
56
+ # Execute only after user confirms fix
57
+ "$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
58
+ ```
59
+
60
+ Note: When verify-fail rolls back to build, `branch_status` is not reset. If branch handling was already completed during the first verify attempt, skip the branch handling step on re-verify and keep the existing `branch_status: handled`.
61
+
62
+ 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:
63
+
64
+ ```bash
65
+ PLAN=$("$COMET_BASH" "$COMET_STATE" get <change-name> plan)
66
+ BASE_REF=$(grep '^base-ref:' "$PLAN" 2>/dev/null | head -1 | sed 's/^base-ref: *//')
67
+ git diff --stat "$BASE_REF"...HEAD
68
+ ```
69
+
70
+ 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:
71
+
72
+ ```bash
73
+ "$COMET_BASH" "$COMET_STATE" set <change-name> verify_mode full
74
+ ```
75
+
76
+ **Override mechanism**: If the agent or user believes the automated assessment is inappropriate, override at any time with `"$COMET_BASH" "$COMET_STATE" set <change-name> verify_mode <light|full>`.
77
+
78
+ ### 1b. Verification Failure Decision (Blocking Point)
79
+
80
+ When verification does not pass, **must follow the `comet/reference/decision-point.md` protocol to pause and wait for the user to decide whether to fix or accept the deviation**. Must not automatically run `"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail`, nor automatically invoke `/comet-build`.
81
+
82
+ When pausing, must list:
83
+ - Failed items
84
+ - Whether CRITICAL or IMPORTANT (build failure, test failure, security issues, core acceptance scenario failure, lightweight code review correctness/security/edge-case issue)
85
+ - Recommended handling approach
86
+
87
+ **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.
88
+
89
+ After user selection, continue as follows:
90
+ - **Fix all**: Run `"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail`, then invoke `/comet-build` to fix
91
+ - **Handle item by item**: CRITICAL or IMPORTANT failures must be fixed; WARNING/SUGGESTION failures may choose to accept deviation, but must record acceptance reason and impact scope in verification report. If any CRITICAL or IMPORTANT failure exists, skipping fix to accept all is not allowed
92
+
93
+ **Retry limit**: After 3 consecutive verify-fail cycles, on the 4th failure the agent must not automatically choose to continue fixing; **must use the current platform's available user input/confirmation mechanism to pause** with only two options: "Accept all deviations and record" or "Continue fixing", for the user to explicitly decide.
94
+
95
+ ### 2. Artifact Context Loading (Hash On-Demand Read)
96
+
97
+ When verification needs to read OpenSpec artifacts, first check whether they have changed since the design phase:
98
+
99
+ ```bash
100
+ RECORDED_HASH=$("$COMET_BASH" "$COMET_STATE" get <change-name> handoff_hash)
101
+ CURRENT_HASH=$("$COMET_BASH" "$COMET_HANDOFF" <change-name> --hash-only 2>/dev/null || echo "")
102
+ ```
103
+
104
+ - If `RECORDED_HASH` = `CURRENT_HASH` and both are non-empty and neither is `null`: OpenSpec artifacts are unchanged. **tasks.md does not need to be re-read in full** (use `grep -c '\- \[ \]' tasks.md` to confirm completion count). proposal.md, design.md, and delta specs must still be read for comparison checks.
105
+ - If `RECORDED_HASH` is empty, is `null`, or differs from `CURRENT_HASH`: artifacts have changed or hash was never recorded. Read all required files in full normally.
106
+
107
+ This optimization only skips re-reading tasks.md in full. proposal.md and design.md contain the full context needed for verification checks and must not be skipped due to hash match.
108
+
109
+ **Immediately execute:** Use the Skill tool to load the Superpowers `verification-before-completion` skill. Skipping this step is prohibited.
110
+
111
+ After the skill loads, follow the `verify_mode` branch:
112
+
113
+ ### 2a. Lightweight Verification (Small Changes)
114
+
115
+ Run these 6 checks:
116
+
117
+ 1. All tasks.md tasks completed `[x]`
118
+ 2. Changed files match tasks.md descriptions (`git diff --stat` / `git diff --cached --stat` / `git diff --stat <base-ref>...HEAD` compared against tasks content)
119
+ 3. Build passes (run project-specific build command, e.g., `npm run build`, `mvn compile`, `cargo build`, etc.)
120
+ 4. Related tests pass
121
+ 5. No obvious security issues (no hardcoded keys, no new unsafe operations)
122
+ 6. Lightweight code review passes: use the Skill tool to load the Superpowers `requesting-code-review` skill and request a lightweight review that checks only correctness, security, and edge cases
123
+
124
+ The lightweight code review input should be limited to this change's diff, tasks.md, and necessary test results; the review scope covers implementation correctness, security risk, and edge cases only, and does not perform spec coverage, Design Doc consistency, or drift checks. If the review finds CRITICAL or IMPORTANT issues, treat verification as failed and enter Step 1b.
125
+
126
+ **Pass criteria**: All 6 items OK, no CRITICAL or IMPORTANT issues.
127
+
128
+ **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:
129
+
130
+ ```bash
131
+ # Execute only after user confirms fix
132
+ "$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
133
+ ```
134
+
135
+ **Report format**: Brief table listing 6 check results + PASS/FAIL.
136
+
137
+ **Skipped items** (not checked in lightweight verification):
138
+ - spec scenario coverage
139
+ - design doc consistency deep comparison
140
+ - code pattern consistency suggestions that do not affect correctness, security, or edge cases
141
+ - delta spec and design doc drift detection
142
+
143
+ ### 2b. Full Verification (Large Changes)
144
+
145
+ When scale assessment result is "large":
146
+
147
+ **Immediately execute:** Use the Skill tool to load the `openspec-verify-change` skill. Skipping this step is prohibited.
148
+
149
+ After the skill loads, follow its guidance to verify. Check items:
150
+ 1. All tasks.md tasks completed (`[x]`)
151
+ 2. Implementation matches `openspec/changes/<name>/design.md` high-level design decisions
152
+ 3. Implementation matches Design Doc (technical design documents under `docs/superpowers/specs/`)
153
+ 4. All capability spec scenarios pass
154
+ 5. proposal.md goals are satisfied
155
+ 6. No contradictions between delta spec and design doc (if Build phase had incremental spec modifications, check if design doc has corresponding records)
156
+ 7. Associated design documents under `docs/superpowers/specs/` are locatable (file exists and is related to current change)
157
+
158
+ 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:
159
+
160
+ ```bash
161
+ # Execute only after user confirms fix
162
+ "$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
163
+ ```
164
+
165
+ **Spec Drift Handling** (user decision point):
166
+ - If check item 6 finds contradictions (delta spec has content but design doc does not reflect it), **must use the current platform's available user input/confirmation mechanism as a single-select question to pause and wait for the user to choose the handling method**; must not select automatically. Options:
167
+ - 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
168
+ - 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
169
+ - Option C: Confirm deviation is acceptable, continue verification (design doc will be marked as `superseded-by-main-spec` during archiving)
170
+
171
+ ### 3. Finishing (Superpowers)
172
+
173
+ **Immediately execute:** Use the Skill tool to load the Superpowers `finishing-a-development-branch` skill. Skipping this step is prohibited.
174
+
175
+ 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.
176
+
177
+ After the skill loads, follow its guidance to finish. Branch handling options:
178
+ 1. Merge to main branch locally
179
+ 2. Push and create PR
180
+ 3. Keep branch (handle later)
181
+ 4. Discard work
182
+
183
+ This is a user decision point. **Must follow the `comet/reference/decision-point.md` protocol to pause and wait for the 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.
184
+
185
+ **Confirmation items**:
186
+ - All tests pass
187
+ - No hardcoded keys or security issues
188
+
189
+ ### 4. Record Verification Evidence
190
+
191
+ 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.
192
+
193
+ ```bash
194
+ mkdir -p docs/superpowers/reports
195
+ # Write verification conclusions to report file, e.g.:
196
+ # docs/superpowers/reports/YYYY-MM-DD-<change-name>-verify.md
197
+
198
+ "$COMET_BASH" "$COMET_STATE" set <change-name> verification_report docs/superpowers/reports/YYYY-MM-DD-<change-name>-verify.md
199
+ "$COMET_BASH" "$COMET_STATE" set <change-name> branch_status handled
200
+ ```
201
+
202
+ ## Exit Conditions
203
+
204
+ - Verification report passed
205
+ - Branch handled
206
+ - `verification_report` in `.comet.yaml` points to an existing verification report file
207
+ - `branch_status: handled` in `.comet.yaml`
208
+ - **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`
209
+
210
+ After both verification and branch handling are complete, run guard for auto-transition:
211
+
212
+ ```bash
213
+ "$COMET_BASH" "$COMET_GUARD" <change-name> verify --apply
214
+ ```
215
+
216
+ State file auto-updates to `phase: archive`, `verify_result: pass`, `verified_at: YYYY-MM-DD`.
217
+
218
+ ## Automatic Handoff to Next Phase
219
+
220
+ Follow `comet/reference/auto-transition.md`. Key command:
221
+
222
+ ```bash
223
+ "$COMET_BASH" "$COMET_STATE" next <change-name>
224
+ ```
225
+
226
+ - `NEXT: auto` → invoke the skill pointed to by `SKILL` to enter the next phase
227
+ - `NEXT: manual` → do not invoke the next skill; prompt user to run `/<SKILL>` manually
228
+ - `NEXT: done` → workflow is complete, no further action needed
229
+
230
+ Note: after `comet-archive` starts, it must first execute the final archive confirmation blocking point and wait for the user to explicitly choose "Confirm archive" before running the archive script. Must not automatically archive just because verification passed.
231
+
232
+ ## Context Compression Recovery
233
+
234
+ Follow `comet/reference/context-recovery.md` with phase set to `verify`.