ワンクリックで
comet-verify
Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify implementation matches design, handle development branch.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify implementation matches design, handle development branch.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use only when explicitly invoked as /comet-any or when the user explicitly wants to customize the /comet-classic five-phase workflow or create/upgrade a workflow Skill managed by Comet Creator. Do not use for general Skill authoring, cleanup, or review.
Use only when explicitly invoked as /comet-archive or routed by the root Comet skill/runtime to the archive phase; confirm archive, merge delta specs, and finish the branch.
Use only when explicitly invoked as /comet-build or routed by the root Comet skill/runtime to a full workflow build phase; create or recover the implementation plan and execute tasks.
Use when the user explicitly invokes /comet-classic, asks to start or resume the permanent Comet Classic workflow, or repository evidence identifies one unambiguous active Classic change; route through the intent runtime and .comet.yaml.
Use only when explicitly invoked as /comet-design or routed by the root Comet skill/runtime to a full workflow design phase; create or recover the deep technical Design Doc.
Use only when explicitly invoked as /comet-hotfix or routed by the root Comet skill/runtime to the hotfix preset; fix an existing behavior bug, not an ordinary unmanaged bugfix.
| name | comet-verify |
| description | Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify implementation matches design, handle development branch. |
Verification reports and branch-handling notes must use the language of the user request that triggered this workflow.
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"
"$COMET_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:
"$COMET_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. Decision rule (any condition triggers full): tasks > 3, delta spec capabilities > 1, changed files > 4.
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
"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
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.
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=$("$COMET_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:
"$COMET_BASH" "$COMET_STATE" set <change-name> verify_mode full
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>.
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.
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:
"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail, then invoke /comet-build to fixRetry 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.
When verification needs to read OpenSpec artifacts, first check whether they have changed since the design phase:
RECORDED_HASH=$("$COMET_BASH" "$COMET_STATE" get <change-name> handoff_hash)
CURRENT_HASH=$("$COMET_BASH" "$COMET_HANDOFF" <change-name> --hash-only 2>/dev/null || echo "")
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.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.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.
Immediately execute: Use the Skill tool to load the Superpowers verification-before-completion skill. Skipping this step is prohibited.
After the skill loads, follow the verify_mode branch:
Run these 6 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.)requesting-code-review skill and request a lightweight review that checks only correctness, security, and edge casesThe 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.
Pass criteria: All 6 items OK, no CRITICAL or IMPORTANT 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
"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
Report format: Brief table listing 6 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
"$COMET_BASH" "$COMET_STATE" transition <change-name> verify-fail
Spec Drift Handling (user decision point):
"$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 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 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.
After the skill loads, follow its guidance to finish. Branch handling options:
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.
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
"$COMET_BASH" "$COMET_STATE" set <change-name> verification_report docs/superpowers/reports/YYYY-MM-DD-<change-name>-verify.md
"$COMET_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.yaml"$COMET_BASH" "$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:
"$COMET_BASH" "$COMET_GUARD" <change-name> verify --apply
State file auto-updates to phase: archive, verify_result: pass, verified_at: YYYY-MM-DD.
Follow comet/reference/auto-transition.md. Key command:
"$COMET_BASH" "$COMET_STATE" next <change-name>
NEXT: auto → invoke the skill pointed to by SKILL to enter the next phaseNEXT: manual → do not invoke the next skill; prompt user to run /<SKILL> manuallyNEXT: done → workflow is complete, no further action neededNote: 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.
Follow comet/reference/context-recovery.md with phase set to verify.