Building with mini, Part 4/9: The main loop — next plan do done In the fourth installment of a series on building with mini, a developer demonstrates the main loop of the mini tool—propose, break down, build, close—using a Python calculator project called pycalc. The loop enforces a structured workflow where each phase corresponds to a single commit, with the agent proposing tasks, planning steps, executing code, and requiring human approval for closure. The developer highlights how the tool's non-goals and backlog interact to guide decisions, and shows that the tokenizer phase was completed with 27 test cases passing. pycalc has a vision Part 2 and a backlog Part 3 — and still not a single line of Python. Today we fix that. Four commands form the heart of mini: propose, break down, build, close . One turn of the loop = one phase = one commit. next — propose mini next next is the entry point of the loop, and the only step that begins with a question: do you have your own idea, or do you leave it to the agent? I left it to the agent — and it's worth showing what it did with last episode's backlog: The backlog has two items so far 1 and % , 2 reading from stdin , but both are explicitly out of scope for this version non-goals , so neither fits the first phase. This is exactly the interplay that project.md and todo.md exist for: the backlog offered itself, the non-goals stopped it. Instead, three candidates came up — tokenizer with positions, a CLI skeleton, a walking skeleton — each with its trade-off: I propose candidate 1: Tokenizer with positions.Why not the walking skeleton: it sounds tempting, but for a project this small the rewriting overhead outweighs the benefit — the pipeline has only three pieces, and in three phases it will be end-to-end anyway. The trade-off of candidate 1: until there's a CLI, you can't poke at anything by hand; verification is purely through tests. After approval the agent saves the phase itself, via mini next --apply --title … --goal … . State is never changed by the model's hand: Phases: proposed 1. Tokenizer with positions Next: mini plan break it down or mini do run directly plan — break down mini plan plan breaks the phase into steps — a short title plus a one-sentence detail that pairing is deliberate: only the titles go into later steps' prompts, the detail is fetched when needed . For the tokenizer it produced five steps, from the Token NamedTuple through the number scanner into Decimal to the unittest table. And here too a decision surfaced that would otherwise only emerge in the code: .5 and 2. are deliberately rejected simplest rule with exact error positions; trade-off: .5 is valid in many calculators — say so if you want it supported and I'll adjust step 3 . Approved, saved mini plan --apply reads the steps from stdin : planned 1. Tokenizer with positions Steps: todo Token type and CalcError in pycalc.py todo tokenize loop: operators, parens, whitespace todo Number scanning into Decimal todo Invalid character raises CalcError with position todo unittest case table in test pycalc.py do — build mini do Only now does code get written. The session gets the phase, the steps and a reference to the project — not the whole conversation history. The agent ticks steps off as it goes mini do --apply --step-done "