name: finish description: Verifies, commits and wraps up a reviewed task, then asks for /clear. argument-hint: "[slug or handoff file]" disable-model-invocation: true
Finish the task (handoff file $ARGUMENTS, or the one most recently reviewed). Stop at the
first step that fails and report it.
- Gate: run the project's lint, type and test commands once (from
.claude/dev-workflow.jsonchecks, or in a workspace thechecksof each repository the task touched underrepos, else the project's CLAUDE.md). Run every non-empty command there, including extra keys such asbuild. All must pass. Never weaken or skip a test. A check recorded as unsafe to run (it calls a live service) is not run: say so and name what stands in for it. - Every acceptance criterion in the handoff file is ticked with evidence and the last review
verdict is PASS on the code as it is now, with no reproduced blocker open. If not, go back to
/dev-workflow:buildor/dev-workflow:review. - If the project has
<workflowDir>/risk.md, say which tier this change is in and follow it (when unsure, the higher tier). IfdesignGateis true in.claude/dev-workflow.jsonand the change is visual, the screenshots and the design review named in<workflowDir>/design-gate.mdmust be recorded in the handoff file first. - Before the commit, set the handoff Status to
done(commit: pending) with the branch, so a session that ends between the two never repeats a committed task. If the task came from a spec, tick its line in the spec'sTaskslist. If something went wrong or was corrected during the task (a wrong assumption, a failed fix, a rule broken), add one line to<workflowDir>/lessons.md(create it if missing): what happened and the rule that prevents it. The same lesson a second time is proposed to the user as a rule in CLAUDE.md or a guard setting. Keep the file under 50 lines. These go into the same commit when the project keeps them in git; a handoff file outside the repository (a workspace folder) stays uncommitted. - Commit on the task branch with a short message saying what is now true. If the work is
still on the repository's default branch, first create
<type>/<slug>from it, unless the project's rules say to commit to the default branch directly; a change above the lowest risk tier always goes on a branch, so the person who must review it can. Merging the branch follows the risk tier; an agent merges only where the tier and the project's rules allow. In a workspace, commit once in each repository the task touched, naming it withgit -C <folder>, each under that repository's own git rules. Write the message in the style of the repository's recentgit log --oneline, within the git rules below. Follow the project's git rules (branch, signing, account, no AI attribution). Never--no-verify, never force-push, never commit secrets. Push or open a PR only if the project's rules or the user say so. - Report in at most 6 lines (what is now true, check summary, verdict, the commit hash and
whether it is merged, and any compliance or security prerequisite still open: env vars to
set, migrations to run, a standards rule recorded as not met) and ask the user to type
/clear. The hash goes in the report only, not in a follow-up commit.