kanso-runner¶
Let a coding agent work through your plan, one reviewed pull request per step.
Kanso asks for an implementation plan before risky work. kanso-runner turns those plans into a queue. It reads the plans at a git ref, picks the next open step and prints the prompt for that one step. It never edits files, runs an agent or talks to GitHub: the agent does the work, and whatever starts the agent, a shell loop or a maintainer bot such as repo-steward, decides when to ask again.
The loop¶
kanso-runner nextreadsdocs/*-implementation-plan.mdonmainand prints the next open step with its prompt.- A fresh agent session gets the prompt. It implements exactly that step with the Kanso skill, keeps every check green, and in the same commit removes the step from the plan or narrows it to what is left with a new next action.
- The agent opens a pull request. Once CI is green and it is merged, the step is gone from
main. - The next call to
nextreturns the following step. When the last step is done, the agent deletes the plan and moves the decisions that still matter into the project's documentation.
Because the plan on main is the state, a step is never worked twice, and every change stays small enough to review and to revert.
What counts as a step¶
A plan is any file docs/<name>-implementation-plan.md directly under docs/, where <name> is letters, digits, _ and -. The plan's name is <name>, for example music-ab.
- Only the sections
## Stepsand## Open workhold work. A heading that starts with either counts, such as## Open work, in order. The section ends at the next#or##heading;###subheadings stay inside it. - Every line inside that starts with
1.(any number and a dot) or-is a step. Following lines that start with a space belong to the same step. - A step that starts with
(owner)right after its number or dash, such as2. (owner) **Old repos:** …, is the owner's and is never picked. - Anything else, including notes under
## Open,## Decisionsor## Owner, is never picked. - A plan with a line
## Designand no## Stepsor## Open worksection yields one step: a request to split the design into numbered steps, then implement the first.
The step the agent gets is always the first open one of its plan.
Which plan goes first¶
- The plan the owner named with
--first. - The plan in work, named with
--current, so a plan is finished before another starts. - Every other plan with an open step, the oldest first, by the time of the commit that added it to the ref; plans added in the same commit go in path order.
A plan named with --stopped is skipped entirely, even when it is also named first. Leave it out of --stopped to restart it. kanso-runner keeps no state of its own: the caller remembers which plan is current and which stopped, as RetroSpeedLab's maintainer does when a step fails twice.
When no plan has an open step, next prints nothing and exits with code 3.
The prompt¶
Every step is wrapped in the same prompt, with {path} and {step} filled in:
Work on the implementation plan {path} with the Kanso skill, one step per session. Implement exactly
this step of it and nothing else:
{step}
Keep every check green. In the same commit, remove the step from the plan, or narrow it to what is left with a new
next action. When the step is too big for one session, split it in the plan into smaller steps and implement the
first. When no open item is left, delete the plan and move the decisions that still matter into the project docs.
Never work on an item tagged (owner): it is the owner's.
From Python¶
The same logic is importable, for agents that run the steps themselves. RetroSpeedLab's maintainer, repo-steward, works its plans this way:
from pathlib import Path
from kanso_runner.plans import Progress, chosen, read_plans, request
found = chosen(read_plans(Path("."), "main"), Progress(first=None, current="suite", stopped=[]))
if found is not None:
name, step = found
run_agent_session(request(name, step)) # your agent
The Reference lists every function.