Finish

From swissarmyhammer/swissarmyhammer · View interactive version

Finish is an AI agent skill from the GitHub repository swissarmyhammer/swissarmyhammer. Drive kanban tasks from ready to done by looping implement → test → commit → review until each task is clean. Use when the user says "/finish", "drive tasks to done", "work the board", "finish the tasks", "finish the batch", or otherwise wants to orchestrate tasks through the full pipeline to done.

How to use this skill

Skill file

Finish

Drive kanban tasks all the way to done — orchestrating /implement, /test, /commit, and /review in a loop until each task lands in done or is reported stuck.

Orchestrator only — does not write code, run tests, or commit. Delegates each step (/implement, /test, /commit, /review) to its own sub agent.

Your job: finish every requested task

The user asked for a set of tasks: one task id, one tag or filter, or all ready

tasks. Your job is to drive every task in that set to done, or to stuck.

You are not done until the set is empty. One finished task is not the end of the

job. A card report is not the end of the job. Keep going.

The only valid ends of /finish:

both return empty. Every task that you worked is done or stuck.

Any other stop is a failure. Do not stop to ask the user whether to continue. Do

not stop to summarize the progress. Do not stop because the batch is long.

Run each step (/implement, /test, /commit, /review) in its own sub agent,

one at a time, to keep this session small. Each sub agent returns the step record

block. When a task is done or stuck, go directly to the next task in scope. If

a sub agent fails, the task is stuck: record it and go to the next task.

Invocation

| Invocation | Mode | Meaning |

|------------|------|---------|

| /finish <task-id> (ULID or short id) | single-task | Drive exactly that task. Never call next task. |

| /finish | scoped-batch (no scope) | All ready tasks. |

| /finish #<tag> | scoped-batch | Matching tag. |

| /finish @<user> | scoped-batch | Assigned to user. |

| /finish <filter-expr> | scoped-batch | Any filter DSL — applied to every list tasks. |

Detection:

  1. ULID (26 chars, [0-9A-Z]) or short ULID → single-task
  2. No arg → scoped-batch, no filter
  3. Otherwise → scoped-batch, arg passed verbatim as filter

Let <SCOPE_FILTER> be the DSL expression (or absent). Combine with #READY via && on every scoped list tasks.

Filter DSL recap

Atoms: #<tag>, @<user>, ^<task-id>. Operators: &&, ||, !, (). Virtual tags: #READY, #BLOCKED, #BLOCKING. All scoping flows through the filter.

The ^<task-id> atom and every id argument accept a full ULID, a 7-char short id, ^<short>, or a unique ULID prefix. When reporting on a task in prose, quote its short_id field (^<short>) rather than hand-abbreviating the ULID by prefix.

Process

Detect Projects

/detected-projects so we know what we are working with up front.

Single-task mode

Pin <TASK_ID> for the entire loop — never next task, never switch tasks.

  1. Verify exists: op: "get task", id: "<TASK_ID>". Missing → report and stop.
  2. Implement: /implement <TASK_ID>. Implement moves the task into doing (pulling it back from review if it's returning with findings), does the work, and leaves it in doing.
  3. Test: /test. Failures → step 2.
  4. Checkpoint the green state: invoke /commit to create a local commit of the green, tested working tree. This is the per-iteration rollback point and — critically — it is what makes the next review tight: with the work committed, the review scopes to this iteration's commit, not the whole accumulated uncommitted diff. Push when and if you judge it right. /commit stages all changes; "nothing to commit" is a no-op, not an error — but it means implement produced no change this iteration (no progress): record it and treat it under the step 7 guardrail rather than re-reviewing a stale diff.
  5. Review: /review <TASK_ID> HEAD~1..HEAD — task-mode on <TASK_ID>, scoped to the checkpoint delta just committed (only this iteration's change, never the whole accumulated task diff). /review pulls the task doing → review and records findings on <TASK_ID>:
  1. Verify done: op: "get task". Not in done → step 2. In done → the last checkpoint (step 4) already is the verified-good commit (green + clean review); no separate post-done commit is needed.
  2. Write the ledger entry, then check the guardrail. Record this iteration on the task (see The iteration ledger below), then decide from the ledger — never from your memory of it: the same finding (file:line + message) in 3 ledger entries — or 3 consecutive no-change entries (step 4 "nothing to commit") — → stop and report what persists. Hitting the guardrail means the task is stuck: leave it in review and report it — never force it to done. A finding that survives 3 rounds is either a fix you haven't cracked yet or a contradictory/faulty rule; if it's the latter (per Scope), report it on the task and leave it stuck for a human to resolve — do not edit validators yourself and do not re-close. Closing a task with open findings is out of bounds.
  3. Report with the card block (see Report the card).

The iteration ledger (both modes)

{% include "_partials/step-record" %}

Every delegated step returns that block. Read the block — do not re-derive the outcome from the step's prose, and do not re-run the step to find out what it did.

At the end of every iteration, write one ledger comment on the task. This is the only durable copy of the loop state:

{"op": "add comment", "task_id": "<TASK_ID>", "text": "### finish iteration 3 — findings\n- implement: changed — 3 files\n- test: green — cargo nextest, 1284 passed\n- commit: 42e32c3a3\n- review: findings — crates/kanban/src/tag.rs:88, crates/kanban/src/tag.rs:140"}

Rules for the ledger:

Read the ledger before you decide:

{"op": "list comments", "task_id": "<TASK_ID>"}

The guardrail in step 7 compares the last three ledger entries. Reading them from the card — not from this conversation — is what makes the loop survive a context summary, a stopped session, or a different agent that picks the card up.

Report the card

{% include "_partials/card-report" %}

Show the card block after every iteration, and once more when the loop stops.

In scoped-batch mode, show one block for each task as it leaves the loop. When the scope is clear, close with a list of three groups: done, stuck, and skipped. Name each task by its short_id and give the reason for every stuck and skipped task.

Scoped-batch mode

Strictly sequential — one task at a time. Never use worktrees, never run concurrent /implement or /review. Pick one task, drive it fully to done using the exact single-task loop, then pick the next. (Parallel work on the shared working tree have repeatedly clobbered changes via stash/revert races — the slowness of sequential runs is far cheaper than lost work.)

  1. Pick one task in scope. First check the review column, then the ready todo column — a task already in review is closer to done, so finish it first:

Tasks in doing are already being worked — leave them. Take the first task from review if any, otherwise the first ready todo task. Pin its id as <TASK_ID>.

  1. Drive it to done. Run the single-task mode loop (above) on <TASK_ID> in this session, one sub agent per step. Never put the whole loop in one sub agent. Reusing the loop means each iteration commits a local checkpoint via step 4, so by the time a task reaches done its verified-good state is already committed — before the next task is picked. Do not switch tasks mid-loop. A task that hits the guardrail is reported as stuck and skipped.
  1. Pick the next. Return to step 1. Do not stop between tasks.
  1. Stop: both the scoped review query and the scoped ready todo query return empty → report and stop. Tasks outside scope are deliberately ignored.

Sequential safety (both modes)

Scope

{% include "_partials/findings-are-requirements" %}

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.