with one click
comet-verify
// Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify implementation matches design, handle development branch.
// Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify implementation matches design, handle development branch.
Comet Phase 3: Plan and Build. Invoke with /comet-build. Create plans and select execution method (subagent or direct) for implementation.
Comet Phase 2: Deep Design. Invoke with /comet-design. Produce Design Doc and delta spec through brainstorming.
Comet preset path: Bug fix / hotfix. Skip brainstorming, directly open → build → verify → archive. Applicable for behavior fixes, scenarios not involving new capability design.
Comet Phase 1: Open. Invoke with /comet-open. Explore ideas through OpenSpec, create change structure (proposal + design + tasks).
Comet — OpenSpec + Superpowers dual-star development workflow. Start with /comet for automatic phase detection and dispatch to subcommands. Five phases: open → design → build → verify → archive.
Comet preset path: Non-bug small changes (tweak). Skip brainstorming and full plan, directly open → lightweight build → light verify → archive. Applicable for copy, configuration, documentation or prompt local optimization.
| name | comet-verify |
| description | Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify implementation matches design, handle development branch. |
Execute entry verification:
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
if [ -z "$COMET_ENV" ]; then
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
return 1
fi
. "$COMET_ENV"
bash "$COMET_STATE" check <change-name> verify
Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
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.
Execute scale assessment:
bash "$COMET_STATE" scale <change-name>
The script automatically counts tasks, delta spec count, changed file count, determines light or full verification mode, and sets the verify_mode field.
Before verification begins, handle uncommitted changes through comet/reference/dirty-worktree.md protocol. Verify phase special handling:
Only after user chooses fix, allow rollback to build phase:
# Execute only after user confirms fix
bash "$COMET_STATE" transition <change-name> verify-fail
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:
PLAN=$(bash "$COMET_STATE" get <change-name> plan)
BASE_REF=$(grep '^base-ref:' "$PLAN" 2>/dev/null | head -1 | sed 's/^base-ref: *//')
git diff --stat "$BASE_REF"...HEAD
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:
bash "$COMET_STATE" set <change-name> verify_mode full
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 bash "$COMET_STATE" transition <change-name> verify-fail, nor automatically invoke /comet-build. Must not just output a text prompt and then continue executing.
When pausing, must list:
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.
After user selection, continue as follows:
bash "$COMET_STATE" transition <change-name> verify-fail, then invoke /comet-build to fixWhen scale assessment result is "small", skip openspec-verify-change and directly execute these checks:
[x]git diff --stat / git diff --cached --stat / git diff --stat <base-ref>...HEAD compared against tasks content)npm run build, mvn compile, cargo build, etc.)Pass criteria: All 5 items OK, no CRITICAL issues.
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:
# Execute only after user confirms fix
bash "$COMET_STATE" transition <change-name> verify-fail
Report format: Brief table listing 5 check results + PASS/FAIL.
Skipped items (not checked in lightweight verification):
When scale assessment result is "large":
Immediately execute: Use the Skill tool to load the openspec-verify-change skill. Skipping this step is prohibited.
After the skill loads, follow its guidance to verify. Check items:
[x])openspec/changes/<name>/design.md high-level design decisionsdocs/superpowers/specs/)docs/superpowers/specs/ are locatable (file exists and is related to current change)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:
# Execute only after user confirms fix
bash "$COMET_STATE" transition <change-name> verify-fail
Spec Drift Handling (user decision point):
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 specsuperseded-by-main-spec during archiving)Immediately execute: Use the Skill tool to load the superpowers:finishing-a-development-branch skill. Skipping this step is prohibited.
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.
After the skill loads, follow its guidance to finish. Branch handling options:
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.
Confirmation items:
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.
mkdir -p docs/superpowers/reports
# Write verification conclusions to report file, e.g.:
# docs/superpowers/reports/YYYY-MM-DD-<change-name>-verify.md
bash "$COMET_STATE" set <change-name> verification_report docs/superpowers/reports/YYYY-MM-DD-<change-name>-verify.md
bash "$COMET_STATE" set <change-name> branch_status handled
verification_report in .comet.yaml points to an existing verification report filebranch_status: handled in .comet.yamlbash "$COMET_GUARD" <change-name> verify --apply; after all PASS, auto-transitions to phase: archive through comet-state transition verify-passAfter both verification and branch handling are complete, run guard for auto-transition:
bash "$COMET_GUARD" <change-name> verify --apply
State file auto-updates to phase: archive, verify_result: pass, verified_at: YYYY-MM-DD.
After exit conditions are met (including user selecting branch handling method), auto-transition to next phase:
REQUIRED NEXT SKILL: Invoke
comet-archiveskill to enter the archive phase.
The verify phase may trigger context compaction. To recover, first run:
bash "$COMET_STATE" check <change-name> verify --recover
The script outputs structured recovery context (phase, verification status, branch status, recovery action). Follow the Recovery action to determine next step.