finalize-spec-verify-ci
After the finalize pull request merges, watch main's CI for that merge commit, class each failed job real, infra or unknown (never flake without a mechanism), and run a bounded remediate-or-escalate loop through fix pull requests
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-10
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- finalize-spec-verify-ci
- description
- After the finalize pull request merges, watch main's CI for that merge commit, class each failed job real, infra or unknown (never flake without a mechanism), and run a bounded remediate-or-escalate loop through fix pull requests
- argument-hint
- <spec-name> --sha <merge-commit> [--alias <word>]
03 SKILL.md 正文
Finalize Spec — Verify CI
Step 5 of /finalize-spec. A pull request's checks ran on its own head; main after the merge is a different tree, since other work landed in between. This step confirms that main is green with the spec's record in it, and repairs it through pull requests when it is not.
Input
$ARGUMENTS: <spec-name> --sha <the finalize merge commit> [--alias <word>]. Run alone after a recovery, pass the commit to re-verify, usually main's tip.
Invocation contexts
- Slash command: waits, classes, and runs the remediation loop. Merging a fix pull request is its own step's write;
/finalize-specinvoking this skill is the approval, and standalone it needs the person's--merge, else it stops at the gate with the fix pull request open. - Model-invoked: the same.
- Non-interactive: the same, waiting in the foreground only. Every escalation stops and returns the report.
Steps
-
Wait for a verdict on the commit, in the foreground, with a Bash timeout of 600000:
python3 scripts/harness/finalize.py ci --sha <full-sha> --wait --timeout 540Pass the full 40-character SHA (
git rev-parse <sha>when starting from a short one):gh run list --commitdoes not match short SHAs, and a short SHA yields a falseverdict=pendingeven when the runs are green.The script polls
gh run list --branch main --commit <sha>itself, every 30 seconds, and exits when every push run on that commit has completed. Exit 3 (verdict=pending) means its time ran out: run it again, at most eight times in all; after that escalateci-timeoutwith the runs still pending. Waiting inside the script, not by an agent'ssleepor by yielding the turn, keeps the delay real and the budget countable. -
Read the verdict.
- 0,
verdict=green: done. - 2: GitHub could not be read. Retry once, then escalate: missing data is never green.
- 1,
verdict=red: every failed job is onejob=line with its class. Decide on all of them together:
Classes present Action only realremediate (step 3) any infraescalate: the job never judged the code (a setup step failed, the run was cancelled, the runner never started). Ask the maintainer to re-run it: gh run rerunis a publishing action behind.claude/hooks/guard-publish.sh, and the agent never arms it for itselfany unknownescalate with the job lines and the log tail ( gh run view <run-id> --log-failed, last 60 lines): a timeout or an unreadable failure can be the code's own hangA failure is never recorded as a flake. If the same job fails and later passes on the same commit, that is nondeterminism; its record names the mechanism with the failing and passing values, or says
unexplained nondeterminism(.claude/rules/agent-behavioral-posture.md§7). - 0,
-
Remediate a real failure, at most two cycles.
- Find what broke: the failing step's command and log (
gh run view <run-id> --log-failed), and whether the parent commit was green (finalize.py ci --sha <sha>^). A parent that was already red means the break predates this merge; fix it all the same and say so. - Dispatch one fix pull request as
/finalize-spec§Fix pull requests describes: the owning agent by the failing files,isolation: "worktree", titlefix(ci): <what> (<alias> fix), with the job line, the log tail and the evidence of step 1 in the prompt. Recorddispatched=1 returned=M failed=K. - Merge on
python3 scripts/harness/finalize.py publish-check --spec <spec> --pr <n> --fixprintingverdict=ready, confirm its merge commit on origin/main, and go back to step 1 with that commit. - Never weaken a test, a gate or the
CI OKjob'sneeds:to turn main green; that is a finding for the maintainer, not a fix.
After two cycles that end red, escalate
retry-capwith every cycle's job lines and pull requests. - Find what broke: the failing step's command and log (
-
Record the outcome:
python3 scripts/harness/runspec.py event --spec <spec> --kind verify --detail "verify-ci <outcome> <sha7>" --result <ok|fail>. When a fix was needed, its pull request also adds one line tospecs/done/<spec>/retrospective.md§CI history naming the failure, its class and the fix; the dispatch prompt says so.
Output
Verify CI: <green | green after fix PRs #a, #b | escalated: ci-timeout | infra | unknown | retry-cap>
Commit: <sha7>; runs <n>; cycles <used>/2
<the job= lines of the last red verdict, when any>
04 同仓库更多 Skills
mythhelm-deliver-backlog
Coordinate a MYTHHELM backlog run with the shared stage checks and maintainer checkpoints.
mythhelm-bootstrap
Orient a Grok Build session in the MYTHHELM repository before task or spec work.
vendor-consult
Run one advisory stage consult (premise-ground, spec-validate, task-review, change-review, stuck-oracle, dossier) with an optional external vendor, then adjudicate the answer at its anchors
update-docs
Bring README, docs/, knowledge/, WORKFLOW.md and CLAUDE.md in line with what a shipped spec or a merged change actually did — find every statement the change made stale, fix it where readers look, and add only the new facts they need
triage
Score an idea or a GitHub issue against the master spec's stages, gates and commitments, check it for duplicates, and recommend whether it becomes a backlog card; read-only
test-driven-development
Red-green-refactor for Go — use when implementing any feature, bug fix or behaviour change, before writing implementation code