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:
- single-task: the task is
done, or it isstuck. - scoped-batch: the scoped
reviewquery and the scoped readytodoquery
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:
- ULID (26 chars,
[0-9A-Z]) or short ULID → single-task - No arg → scoped-batch, no filter
- 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.
- Verify exists:
op: "get task", id: "<TASK_ID>". Missing → report and stop. - Implement:
/implement <TASK_ID>. Implement moves the task intodoing(pulling it back fromreviewif it's returning with findings), does the work, and leaves it indoing. - Test:
/test. Failures → step 2. - Checkpoint the green state: invoke
/committo 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./commitstages 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. - 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)./reviewpulls the taskdoing → reviewand records findings on<TASK_ID>:
- clean → task moves to
done. Step 6. - findings → fresh dated
## Review Findingschecklist appended to the task, task stays inreview. Step 2 —/implement <TASK_ID>pulls it back todoing, works the unchecked items, and flips them to- [x].
- Verify done:
op: "get task". Not indone→ step 2. Indone→ the last checkpoint (step 4) already is the verified-good commit (green + clean review); no separate post-done commit is needed. - 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-changeentries (step 4 "nothing to commit") — → stop and report what persists. Hitting the guardrail means the task is stuck: leave it inreviewand report it — never force it todone. 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. - 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:
- The heading outcome is the outcome of the last step that ran in the iteration.
- The iteration number is the count of ledger comments already on the card, plus one. It is not the count of iterations in this session. A card picked up after a restart continues the count.
- Write the entry even when the iteration made no progress.
no-changeis the entry that arms the guardrail.
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.)
- Pick one task in scope. First check the
reviewcolumn, then the readytodocolumn — a task already inreviewis closer to done, so finish it first:
op: "list tasks", column: "review",filter:- No scope → absent
- Scope →
"<SCOPE_FILTER>" op: "list tasks", column: "todo",filter:- No scope →
"#READY" - Scope →
"#READY && (<SCOPE_FILTER>)"
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>.
- 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 reachesdoneits 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.
- Pick the next. Return to step 1. Do not stop between tasks.
- Stop: both the scoped
reviewquery and the scoped readytodoquery return empty → report and stop. Tasks outside scope are deliberately ignored.
Sequential safety (both modes)
- One task at a time. Never spawn parallel
Agentsubagents, never run concurrent/implementor/review. Scoped-batch picks one task, drives it todone, then picks the next. - No worktrees.
isolation: "worktree"loses changes — agents write to isolated copies never merged back. All work happens in the current tree. - Parallel agents on the shared tree have repeatedly clobbered work via stash/revert races. If asked to "speed up" finish, say no — slow and correct beats fast and lost.
Scope
- Review findings are in scope by definition. A finding recorded by
/reviewis work the task must address; acting on it is never "bonus refactoring." The no-bonus-refactoring rule restrains changes you invent — never the engine's findings. - The review gate is the only way to
done. A task reachesdonewhen a fresh/reviewreturns zero new findings, every prior item is checked, and/reviewitself moves it. Do not force a task todonewithcomplete task/move taskwhile findings are open. A task with open findings is stuck: leave it inreviewand report it. - Re-review is not noise. New findings each round are the engine working. Keep looping.
{% include "_partials/findings-are-requirements" %}