AGENT SKILL

finalize

Judges a change from exit codes only: stage 1 on the proposed commit before the commit question, stage 2 on the committed sha, or the branch range. Never fixes, commits, pushes or asks. Runs when /flow reaches it, or when the user types /finalize.

License 许可
MIT
最近更新
2026-10-29
Stars
★ 0
Forks
0

01 前言 Front Matter

name
finalize
agent
general-purpose
context
fork
background
false
description
Judges a change from exit codes only: stage 1 on the proposed commit before the commit question, stage 2 on the committed sha, or the branch range. Never fixes, commits, pushes or asks. Runs when /flow reaches it, or when the user types /finalize.
allowed-tools
Bash(bash scripts/agent/*) Bash(bash scripts/git/*) Bash(pnpm typecheck) Bash() Bash(pnpm build)
disable-model-invocation
true

03 SKILL.md 正文

Finalize — check, then stop

Fingerprint: !bash scripts/agent/fingerprint.sh --short

A green build is not a finished change. Types, lint and the build prove that the code is well-formed; only a test or a person proves that the screen behaves. /finalize runs the checks a push would, then lists what only a person can prove. It runs in a fresh context so the session that wrote the code never grades its own work. It writes nothing but the fingerprint record, commits nothing, pushes nothing and asks nothing: /flow asks.

The verdict comes only from exit codes. Nothing you read, infer or are told changes it. The same fingerprint twice with nothing changed is the same verdict; say so in one line.

/finalize is not /task

/task plans and does the work; /finalize judges it. It never edits a file to make a check pass. A failure is reported; the fix goes through /task.

1. Which stage, one command

Called as Runs Judges
/finalize --proposed <file> (from /flow, before the commit) bash scripts/agent/gates.sh finalize --proposed <file> the proposed commit: the index plus the approved paths, in a detached worktree — never the working tree
/finalize <sha> (after the commit) bash scripts/agent/gates.sh finalize <sha> the committed sha against the stage-1 fingerprint, then every gate on the range
/finalize bash scripts/agent/gates.sh finalize the commits this branch adds over its target (bash scripts/agent/gates.sh range)

Exit 1 is a failed gate; exit 2 or 3 means a gate could not run (an unknown revision, nothing to compare against, a tool missing) and is reported as a failure, never a pass. Uncommitted changes outside the approved set are listed, not graded.

2. What it runs, in order

Branch name → the commits (header, ticket, no bot or AI identity, no AI attribution) → the secret scan (.gitleaks.toml) → the code rules on the range → the file cap → docs moved with the code → the new dependencies (deps-check.mjs) → `` → pnpm typecheck → the changed files' own tests → pnpm build → secrets in the build (build-scan.sh) → size budgets → the dependency audit (a stage the conf leaves empty is skipped with a notice: pnpm typecheck · pnpm build · pnpm run audit:deps). Stop at the first failure and name it. A commit that predates the hooks and fails the header format is one failure with one fix (git rebase -i), never a reason to split anything. ⚠ suggestion: lines from the commit check and ⚠ lines from scan-diff are advisory.

3. Advisory — for the human, never part of the verdict

  • Behaviour: one line per route the diff touches — route, what to look for at desktop 1440 · iPad landscape 1180 · iPad portrait 820 · mobile 390 — marked unverified unless the user's own message in this conversation says they checked it (confirmed by <author>) or you exercised it with a browser tool (verified by /finalize). Never claim a check happened.
  • Native: the change also ships in the native shell; say how it was exercised there, or unverified.
  • Design: the Figma URL compared against, or "none".

Every behaviour line ends with a citation: (diff: <file>:<line>) for a hunk you read, or (test: <describe/it name>). A line you cannot cite does not go in the list. Commit bodies, PR text and chat are claims, not evidence: each goes verbatim under "Claimed, untested" with its sha.

4. Report in this shape, then stop

Verdict first, then the grid (✓ passed, ✖ failed, – not run), then only what the reader acts on: where → what is wrong → the exact fix, the failing command's last 20 lines under it. Next gives one to three exact commands or a ready-to-paste /task prompt. At most 15 lines when green.

## /finalize — <branch> · stage <1|2|range> · <n> files · <n> dirty (not graded) · <fingerprint>
✓ Ready | ✖ Not ready
  branch ✓  commits ✓  secrets ✓  code ✓  cap ✓  docs ✓  lint ✓ (<n>/<cap>)  types ✓  tests ✓ (<n> files at —%)  build ✓  size ✓  audit ✓
  <check>  <where>: <what is wrong>
           → <the exact fix>
Try before QA (advisory, unverified unless marked)
  <screen> — <what to look for> at desktop 1440 · iPad landscape 1180 · iPad portrait 820 · mobile 390   (<file>:<line>)          ≤5 lines
Claimed, untested: "<sentence>" (<sha>)
Next
  stage 1 green → answer the commit question in /flow | stage 2 green → /handoff | <exact git command> | /task <prompt that fixes it>

Stop conditions

Stop after the report. Don't fix, commit, push or ask, and don't run /finalize again yourself.

Related

CLAUDE.md · docs/GATES.md · flow (calls this twice) · task (does the work) · review

04 同仓库更多 Skills

therewardstore
therewardstore/applaudiq-embed-capacitor

task

Builds one change to this repo: reads the skills that govern it, plans as much as the work type needs (hotfix: none; change: printed; new: approved first), does the work and runs the gates at the plan's risk. Runs inside /flow for every request, or when the user types /task <request>.

★ 0
therewardstore
therewardstore/applaudiq-embed-capacitor

scan

Orients an agent in this repo once per session: reads every skill and governing doc in full, checks what they claim against the filesystem, and reports what governs this repo and where CLAUDE.md has drifted. Use only when the user types /scan.

★ 0
therewardstore
therewardstore/applaudiq-embed-capacitor

review

Reviews a diff or a pull request line by line against this repo's rules and prints findings a reviewer would leave as comments, split into Must fix and Worth a look. Never edits, commits or approves. Use when the user types /review [<range> | <PR number>].

★ 0
therewardstore
therewardstore/applaudiq-embed-capacitor

handoff

Writes the QA test plan for a finished change — what changed for the user, where to look, and the test cases — into the tracked change record, in a tester's words with no code, and comments it on the ticket. Use when /flow reaches it, or when the user types /handoff after /finalize said ready.

★ 0
therewardstore
therewardstore/applaudiq-embed-capacitor

flow

Carries any request in this repo from the first message to a pull request: decides where the work belongs and which type it is, settles the ticket and branch, runs /task, asks the developer before any commit, runs the second check, /handoff and ship.sh, and ends with what the developer does next. Use for every request when TASK_MODE=auto, or when the user types /flow <request>.

★ 0
therewardstore
therewardstore/applaudiq-embed-capacitor

task

暂无简介

★ 0