<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Max Zemskov: technical notes</title><description>Max Zemskov writes about AI agents doing measured work in large production codebases, and the platforms, architecture and tooling underneath.</description><link>https://nodge.me/</link><language>en</language><item><title>I moved my Claude Code workflow scripts into skills any agent harness can run</title><link>https://nodge.me/blog/workflow-scripts-into-skills/</link><guid isPermaLink="true">https://nodge.me/blog/workflow-scripts-into-skills/</guid><description>Claude Code workflows can&apos;t ask you a question mid-run and are tied to one vendor. I moved mine into Agent Skills that run in any agent harness.</description><pubDate>Tue, 17 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href=&quot;https://hackernoon.com/i-moved-my-claude-code-workflow-scripts-into-skills-any-agent-harness-can-run&quot;&gt;HackerNoon&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;A workflow script is a program that launches your agents step by step. It fixes the main problem of multi-step agent work: code picks the next step, so the model can’t skip the review or lose count of the fix rounds. I wrote dozens of them for Claude Code, and they did their job.&lt;/p&gt;
&lt;p&gt;But a Claude Code workflow takes no input once it’s running. It can’t stop in the middle to ask me a question, and I kept tripping over that. A procedure that needed my answer halfway had to be cut into smaller workflows, with a gap between them where I could be asked.&lt;/p&gt;
&lt;p&gt;A workflow is also tied to one vendor. It runs only inside Claude Code, and it can spawn only Claude agents. In my procedures Claude writes the code and Codex reviews it, so every review step was a workaround.&lt;/p&gt;
&lt;p&gt;So every workflow I still run became a runbook: an Agent Skill with a set of prompts and a page of Python that picks the next step. It asks me when a decision is mine. Because it’s a skill, it runs in any agent harness, the tool you run an agent in: Claude Code, Codex, OpenCode and so on. Each step goes to the model I name for it, whatever the vendor. And the state of a run is in files, so a lost session doesn’t lose the run.&lt;/p&gt;
&lt;p&gt;I’ve tested the approach at my day job, on a production codebase of over 4 million lines. AI agents write the code there and carry out the main procedures, and they now do it through runbooks.&lt;/p&gt;
&lt;p&gt;In this article, I’ll show what’s inside a runbook, follow one change through it on a small repository, and show where it falls short of a workflow script.&lt;/p&gt;
&lt;h2 id=&quot;where-claude-code-workflows-fell-short&quot; data-section=&quot;I&quot;&gt;&lt;span class=&quot;sec-num&quot; aria-hidden=&quot;true&quot;&gt;I.&lt;/span&gt;Where Claude Code workflows fell short&lt;a class=&quot;anchor&quot; href=&quot;#where-claude-code-workflows-fell-short&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M6.5 9.5l3-3M7 4.5l1-1a2.5 2.5 0 0 1 3.5 3.5l-1 1M9 11.5l-1 1A2.5 2.5 0 0 1 4.5 9l1-1&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.5&quot; stroke-linecap=&quot;round&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;My example is the workflow that ran every code task on &lt;a href=&quot;https://github.com/agent-runbooks/throng-mcp&quot;&gt;throng-mcp&lt;/a&gt;, one of my open-source projects. It was JavaScript for the Claude Code Workflow tool, and the procedure in it had five steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A coder implements the brief.&lt;/li&gt;
&lt;li&gt;The checks run.&lt;/li&gt;
&lt;li&gt;Two reviewers from different vendors read the diff.&lt;/li&gt;
&lt;li&gt;A third agent sorts their findings.&lt;/li&gt;
&lt;li&gt;The coder fixes what’s left.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It worked. Here’s where it got in my way.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It can’t ask me anything. When mine still had blocking findings after two rounds of fixes, it could only end and tell me to sort them out by hand.&lt;/li&gt;
&lt;li&gt;It runs in one vendor’s tool. The orchestrator, the main session that launches the steps and waits for them, could only be Claude.&lt;/li&gt;
&lt;li&gt;Another vendor’s model on one step is a workaround. My second reviewer was Codex, so the workflow spawned a cheap Claude agent as a relay. Its whole job was to make one call to an MCP server that ran the Codex review, and to hand the answer back.&lt;/li&gt;
&lt;li&gt;A run lives in the session. The Workflow tool keeps the state of a run inside the session. When the session was gone, the run was gone with it, and a procedure this long does get interrupted.&lt;/li&gt;
&lt;li&gt;The prompts are inside the program. In my workflow the prompts were strings in the JavaScript, next to the launch logic. To see what the reviewer was asked to do, you read a program.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So I stopped writing workflows and moved the procedures into skills.&lt;/p&gt;
&lt;figure class=&quot;figure&quot;&gt;&lt;div class=&quot;figure-plate&quot;&gt;&lt;img src=&quot;https://nodge.me/_astro/cover.Da4gUWo7_2h2VaC.webp&quot; srcset=&quot;https://nodge.me/_astro/cover.Da4gUWo7_Z1cLq92.webp 700w, https://nodge.me/_astro/cover.Da4gUWo7_ZgHotj.webp 1100w, https://nodge.me/_astro/cover.Da4gUWo7_ZDUsNo.webp 1400w&quot; alt=&quot;A single workflow.js file that runs in Claude Code only, next to an Agent Skill made of SKILL.md, flow.py and prompts that runs in Claude Code, Codex, OpenCode and other harnesses&quot; sizes=&quot;(max-width: 760px) 100vw, 700px&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;2800&quot; height=&quot;1200&quot;&gt;&lt;/div&gt;&lt;figcaption&gt;&lt;span class=&quot;fig-num&quot;&gt;&lt;/span&gt;One workflow file for Claude Code, and the same procedure as an Agent Skill.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;a-runbook-is-an-agent-skill&quot; data-section=&quot;II&quot;&gt;&lt;span class=&quot;sec-num&quot; aria-hidden=&quot;true&quot;&gt;II.&lt;/span&gt;A runbook is an Agent Skill&lt;a class=&quot;anchor&quot; href=&quot;#a-runbook-is-an-agent-skill&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M6.5 9.5l3-3M7 4.5l1-1a2.5 2.5 0 0 1 3.5 3.5l-1 1M9 11.5l-1 1A2.5 2.5 0 0 1 4.5 9l1-1&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.5&quot; stroke-linecap=&quot;round&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A runbook installs as an ordinary &lt;a href=&quot;https://agentskills.io&quot;&gt;Agent Skill&lt;/a&gt;, and you start it like any other skill: you ask your agent to run it. From there the main session goes step by step. It launches a separate agent, a &lt;em&gt;subagent&lt;/em&gt;, with the step’s prompt. It collects the subagent’s reply. Then it runs a small Python program to find out what comes next.&lt;/p&gt;
&lt;p&gt;I like to think of the Python program as the referee of a board game. The referee knows the rules, whose turn it is and when the game is over. The players still decide what to do on their turn. In a runbook the players are the subagents, and your main session is the person who moves the pieces where the referee points.&lt;/p&gt;
&lt;p&gt;Here’s what’s inside the smallest runbook, &lt;a href=&quot;https://github.com/agent-runbooks/gallery/tree/main/skills/runbook-review-loop&quot;&gt;runbook-review-loop&lt;/a&gt;:&lt;/p&gt;
&lt;dl class=&quot;file-tree&quot;&gt;&lt;div data-kind=&quot;file&quot;&gt;&lt;dt&gt;&lt;code&gt;SKILL.md&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;what the main session reads: inputs, execution rules, end of run&lt;/dd&gt;&lt;/div&gt;&lt;div data-kind=&quot;file&quot; data-note=&quot;the referee&quot;&gt;&lt;dt&gt;&lt;code&gt;flow.py&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;the procedure: its steps and their order&lt;/dd&gt;&lt;/div&gt;&lt;div data-kind=&quot;file&quot;&gt;&lt;dt&gt;&lt;code&gt;agent_runbooks.py&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;the engine that flow.py imports, bundled with the runbook&lt;/dd&gt;&lt;/div&gt;&lt;div data-kind=&quot;dir&quot;&gt;&lt;dt&gt;&lt;code&gt;prompts/&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;one prompt per step&lt;/dd&gt;&lt;/div&gt;&lt;/dl&gt;
&lt;p&gt;Each step has a prompt file and an executor. An executor is a description of who runs the step, such as “the model of the main session” or “GPT-6.1 Sol at xhigh effort”. The session maps it onto what it can launch. Here are the two executors and the review step:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes nodge-light nodge-dark&quot; style=&quot;--shiki-light:#2b2668;--shiki-dark:#e3dfff;--shiki-light-bg:#f4f2fb;--shiki-dark-bg:#1a1930;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;coder &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt; rb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#4434C8;--shiki-dark:#B8AEFF&quot;&gt;executor&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt;&amp;#39;coder&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; &amp;#39;the model of the main session&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;reviewer &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt; rb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#4434C8;--shiki-dark:#B8AEFF&quot;&gt;executor&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt;&amp;#39;reviewer&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; &amp;#39;GPT-6.1 Sol at xhigh effort&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;review &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt; rb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#4434C8;--shiki-dark:#B8AEFF&quot;&gt;step&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt;    &amp;#39;review&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7A3E9D;--shiki-dark:#D7B4FF&quot;&gt;    executor&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;reviewer&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7A3E9D;--shiki-dark:#D7B4FF&quot;&gt;    prompt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt;&amp;#39;prompts/02-review.md&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7A3E9D;--shiki-dark:#D7B4FF&quot;&gt;    reads&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;=[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt;&amp;#39;brief.md&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; &amp;#39;implement.md&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; &amp;#39;fix.md&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; &amp;#39;working tree&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7A3E9D;--shiki-dark:#D7B4FF&quot;&gt;    writes&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;=[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt;&amp;#39;review.md&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7A3E9D;--shiki-dark:#D7B4FF&quot;&gt;    reply&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;={&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt;&amp;#39;findings&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt;&amp;#39;type&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; &amp;#39;integer&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;}},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The published runbook gives both roles to the main session’s model. I moved the reviewer to another model here to show that it takes one line.&lt;/p&gt;
&lt;p&gt;The flow is one Python function, where a loop is a &lt;code&gt;while&lt;/code&gt; and a branch is an &lt;code&gt;if&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes nodge-light nodge-dark&quot; style=&quot;--shiki-light:#2b2668;--shiki-dark:#e3dfff;--shiki-light-bg:#f4f2fb;--shiki-dark-bg:#1a1930;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt;@rb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt;flow&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;--shiki-light:#4434C8;--shiki-dark:#B8AEFF&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#7A3E9D;--shiki-dark:#D7B4FF&quot;&gt;ctx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt;    yield&lt;/span&gt;&lt;span style=&quot;--shiki-light:#4434C8;--shiki-dark:#B8AEFF&quot;&gt; implement&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;    budget&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt; used &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt; ctx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;maxFixRounds&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8A2BC2;--shiki-dark:#E4A8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt;    while&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8A2BC2;--shiki-dark:#E4A8FF&quot;&gt; True&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;        r &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt; yield&lt;/span&gt;&lt;span style=&quot;--shiki-light:#4434C8;--shiki-dark:#B8AEFF&quot;&gt; review&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt;        if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt; r&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;findings &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8A2BC2;--shiki-dark:#E4A8FF&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt;            return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#4434C8;--shiki-dark:#B8AEFF&quot;&gt; end&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt;&amp;#39;ready&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; &amp;#39;read &amp;lt;run&amp;gt;/review.md&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt;        if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt; used &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt; budget&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;            a &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt; yield&lt;/span&gt;&lt;span style=&quot;--shiki-light:#4434C8;--shiki-dark:#B8AEFF&quot;&gt; ask_rounds&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt;            if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt; a&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;choice &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; &amp;#39;stop&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt;                return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#4434C8;--shiki-dark:#B8AEFF&quot;&gt; end&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt;&amp;#39;needs_attention&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; &amp;#39;read &amp;lt;run&amp;gt;/review.md&amp;#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;            budget &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt; a&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;rounds&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#B5401C;--shiki-dark:#FF9372&quot;&gt;        yield&lt;/span&gt;&lt;span style=&quot;--shiki-light:#4434C8;--shiki-dark:#B8AEFF&quot;&gt; fix&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#2B2668;--shiki-dark:#E3DFFF&quot;&gt;        used &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6B6789;--shiki-dark:#A19DC4&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8A2BC2;--shiki-dark:#E4A8FF&quot;&gt; 1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;figure class=&quot;figure diagram-figure&quot;&gt;&lt;div class=&quot;figure-plate diagram-plate&quot;&gt;&lt;svg class=&quot;diagram diagram-compact dg-wide-only&quot; viewBox=&quot;0 0 640 444&quot; role=&quot;img&quot; aria-labelledby=&quot;fig-diagram-title&quot;&gt;&lt;title id=&quot;fig-diagram-title&quot;&gt;The review loop runbook: implement, then review; with no findings the run ends ready, otherwise fix and review again, and once the fix budget is spent ask the human for more rounds.&lt;/title&gt;&lt;defs&gt;&lt;marker id=&quot;fig-diagram-head&quot; viewBox=&quot;0 0 10 10&quot; refX=&quot;8.5&quot; refY=&quot;5&quot; markerWidth=&quot;7&quot; markerHeight=&quot;7&quot; orient=&quot;auto-start-reverse&quot;&gt;&lt;path class=&quot;dg-head&quot; d=&quot;M1 1.5 8.5 5 1 8.5&quot;&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id=&quot;fig-diagram-head-accent&quot; viewBox=&quot;0 0 10 10&quot; refX=&quot;8.5&quot; refY=&quot;5&quot; markerWidth=&quot;7&quot; markerHeight=&quot;7&quot; orient=&quot;auto-start-reverse&quot;&gt;&lt;path class=&quot;dg-head dg-head-accent&quot; d=&quot;M1 1.5 8.5 5 1 8.5&quot;&gt;&lt;/path&gt;&lt;/marker&gt;&lt;/defs&gt;&lt;g&gt;&lt;g class=&quot;dg-edges&quot;&gt;&lt;path d=&quot;M154 96H247&quot; marker-end=&quot;url(#fig-diagram-head)&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M390 96H483&quot; marker-end=&quot;url(#fig-diagram-head)&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M300 124V247&quot; marker-end=&quot;url(#fig-diagram-head)&quot;&gt;&lt;/path&gt;&lt;path class=&quot;dg-loop&quot; d=&quot;M340 248V129&quot; marker-end=&quot;url(#fig-diagram-head-accent)&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M390 112C452 112 556 150 556 247&quot; marker-end=&quot;url(#fig-diagram-head)&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M486 278H393&quot; marker-end=&quot;url(#fig-diagram-head)&quot;&gt;&lt;/path&gt;&lt;/g&gt;&lt;g class=&quot;dg-labels&quot;&gt;&lt;text x=&quot;436&quot; y=&quot;84&quot; text-anchor=&quot;middle&quot;&gt;&lt;tspan x=&quot;436&quot; dy=&quot;0&quot;&gt;0 found&lt;/tspan&gt;&lt;/text&gt;&lt;text x=&quot;290&quot; y=&quot;192&quot; text-anchor=&quot;end&quot;&gt;&lt;tspan x=&quot;290&quot; dy=&quot;0&quot;&gt;findings &amp;gt; 0&lt;/tspan&gt;&lt;/text&gt;&lt;text x=&quot;352&quot; y=&quot;192&quot; class=&quot;dg-accent-text&quot;&gt;&lt;tspan x=&quot;352&quot; dy=&quot;0&quot;&gt;while True&lt;/tspan&gt;&lt;/text&gt;&lt;text x=&quot;568&quot; y=&quot;170&quot;&gt;&lt;tspan x=&quot;568&quot; dy=&quot;0&quot;&gt;budget&lt;/tspan&gt;&lt;tspan x=&quot;568&quot; dy=&quot;16&quot;&gt;spent&lt;/tspan&gt;&lt;/text&gt;&lt;text x=&quot;439&quot; y=&quot;300&quot; text-anchor=&quot;middle&quot;&gt;&lt;tspan x=&quot;439&quot; dy=&quot;0&quot;&gt;+ rounds&lt;/tspan&gt;&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;dg-captions&quot;&gt;&lt;text x=&quot;84&quot; y=&quot;54&quot; text-anchor=&quot;middle&quot;&gt;coder&lt;/text&gt;&lt;text x=&quot;320&quot; y=&quot;54&quot; text-anchor=&quot;middle&quot;&gt;reviewer&lt;/text&gt;&lt;text x=&quot;556&quot; y=&quot;54&quot; text-anchor=&quot;middle&quot;&gt;end of run&lt;/text&gt;&lt;text x=&quot;320&quot; y=&quot;336&quot; text-anchor=&quot;middle&quot;&gt;coder&lt;/text&gt;&lt;text x=&quot;556&quot; y=&quot;336&quot; text-anchor=&quot;middle&quot;&gt;you&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;dg-nodes&quot;&gt;&lt;g&gt;&lt;rect x=&quot;16&quot; y=&quot;70&quot; width=&quot;136&quot; height=&quot;52&quot; rx=&quot;14&quot;&gt;&lt;/rect&gt;&lt;text x=&quot;84&quot; y=&quot;101&quot; text-anchor=&quot;middle&quot;&gt;implement()&lt;/text&gt;&lt;/g&gt;&lt;g&gt;&lt;rect x=&quot;252&quot; y=&quot;70&quot; width=&quot;136&quot; height=&quot;52&quot; rx=&quot;14&quot;&gt;&lt;/rect&gt;&lt;text x=&quot;320&quot; y=&quot;101&quot; text-anchor=&quot;middle&quot;&gt;review()&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;dg-end&quot;&gt;&lt;rect x=&quot;488&quot; y=&quot;70&quot; width=&quot;136&quot; height=&quot;52&quot; rx=&quot;14&quot;&gt;&lt;/rect&gt;&lt;text x=&quot;556&quot; y=&quot;101&quot; text-anchor=&quot;middle&quot;&gt;end(&amp;#39;ready&amp;#39;)&lt;/text&gt;&lt;/g&gt;&lt;g&gt;&lt;rect x=&quot;252&quot; y=&quot;252&quot; width=&quot;136&quot; height=&quot;52&quot; rx=&quot;14&quot;&gt;&lt;/rect&gt;&lt;text x=&quot;320&quot; y=&quot;283&quot; text-anchor=&quot;middle&quot;&gt;fix()&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;dg-human&quot;&gt;&lt;rect x=&quot;488&quot; y=&quot;252&quot; width=&quot;136&quot; height=&quot;52&quot; rx=&quot;14&quot;&gt;&lt;/rect&gt;&lt;text x=&quot;556&quot; y=&quot;283&quot; text-anchor=&quot;middle&quot;&gt;ask_rounds()&lt;/text&gt;&lt;/g&gt;&lt;/g&gt;&lt;circle class=&quot;dg-token&quot; r=&quot;5&quot;&gt;&lt;animateMotion dur=&quot;5s&quot; repeatCount=&quot;indefinite&quot; path=&quot;M300 124V252H340V124Z&quot;&gt;&lt;/animateMotion&gt;&lt;/circle&gt;&lt;/g&gt;&lt;g class=&quot;dg-notes&quot; aria-hidden=&quot;true&quot;&gt;&lt;text x=&quot;600&quot; y=&quot;398&quot; text-anchor=&quot;end&quot;&gt;it asks me when&lt;/text&gt;&lt;text x=&quot;600&quot; y=&quot;430&quot; text-anchor=&quot;end&quot;&gt;a decision is mine&lt;/text&gt;&lt;path d=&quot;M380 376C372 352 410 326 484 314M484 314l-13-2M484 314l-9 9&quot;&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;svg class=&quot;diagram diagram-tall dg-tall-only&quot; viewBox=&quot;0 0 380 440&quot; role=&quot;img&quot; aria-labelledby=&quot;fig-diagram-tall-title&quot;&gt;&lt;title id=&quot;fig-diagram-tall-title&quot;&gt;The review loop runbook: implement, then review; with no findings the run ends ready, otherwise fix and review again, and once the fix budget is spent ask the human for more rounds.&lt;/title&gt;&lt;defs&gt;&lt;marker id=&quot;fig-diagram-tall-head&quot; viewBox=&quot;0 0 10 10&quot; refX=&quot;8.5&quot; refY=&quot;5&quot; markerWidth=&quot;7&quot; markerHeight=&quot;7&quot; orient=&quot;auto-start-reverse&quot;&gt;&lt;path class=&quot;dg-head&quot; d=&quot;M1 1.5 8.5 5 1 8.5&quot;&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id=&quot;fig-diagram-tall-head-accent&quot; viewBox=&quot;0 0 10 10&quot; refX=&quot;8.5&quot; refY=&quot;5&quot; markerWidth=&quot;7&quot; markerHeight=&quot;7&quot; orient=&quot;auto-start-reverse&quot;&gt;&lt;path class=&quot;dg-head dg-head-accent&quot; d=&quot;M1 1.5 8.5 5 1 8.5&quot;&gt;&lt;/path&gt;&lt;/marker&gt;&lt;/defs&gt;&lt;g&gt;&lt;g class=&quot;dg-edges&quot;&gt;&lt;path d=&quot;M40 92V153&quot; marker-end=&quot;url(#fig-diagram-tall-head)&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M152 186H223&quot; marker-end=&quot;url(#fig-diagram-tall-head)&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M44 212V293&quot; marker-end=&quot;url(#fig-diagram-tall-head)&quot;&gt;&lt;/path&gt;&lt;path class=&quot;dg-loop&quot; d=&quot;M124 294V219&quot; marker-end=&quot;url(#fig-diagram-tall-head-accent)&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M152 202C214 212 296 232 296 293&quot; marker-end=&quot;url(#fig-diagram-tall-head)&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M228 326H159&quot; marker-end=&quot;url(#fig-diagram-tall-head)&quot;&gt;&lt;/path&gt;&lt;/g&gt;&lt;g class=&quot;dg-labels&quot;&gt;&lt;text x=&quot;190&quot; y=&quot;176&quot; text-anchor=&quot;middle&quot;&gt;&lt;tspan x=&quot;190&quot; dy=&quot;0&quot;&gt;0 found&lt;/tspan&gt;&lt;/text&gt;&lt;text x=&quot;52&quot; y=&quot;248&quot;&gt;&lt;tspan x=&quot;52&quot; dy=&quot;0&quot;&gt;findings&lt;/tspan&gt;&lt;tspan x=&quot;52&quot; dy=&quot;16&quot;&gt;&amp;gt; 0&lt;/tspan&gt;&lt;/text&gt;&lt;text x=&quot;132&quot; y=&quot;262&quot; class=&quot;dg-accent-text&quot;&gt;&lt;tspan x=&quot;132&quot; dy=&quot;0&quot;&gt;while True&lt;/tspan&gt;&lt;/text&gt;&lt;text x=&quot;306&quot; y=&quot;246&quot;&gt;&lt;tspan x=&quot;306&quot; dy=&quot;0&quot;&gt;budget&lt;/tspan&gt;&lt;tspan x=&quot;306&quot; dy=&quot;16&quot;&gt;spent&lt;/tspan&gt;&lt;/text&gt;&lt;text x=&quot;190&quot; y=&quot;346&quot; text-anchor=&quot;middle&quot;&gt;&lt;tspan x=&quot;190&quot; dy=&quot;0&quot;&gt;+ rounds&lt;/tspan&gt;&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;dg-captions&quot;&gt;&lt;text x=&quot;84&quot; y=&quot;30&quot; text-anchor=&quot;middle&quot;&gt;coder&lt;/text&gt;&lt;text x=&quot;88&quot; y=&quot;150&quot; text-anchor=&quot;middle&quot;&gt;reviewer&lt;/text&gt;&lt;text x=&quot;296&quot; y=&quot;150&quot; text-anchor=&quot;middle&quot;&gt;end of run&lt;/text&gt;&lt;text x=&quot;84&quot; y=&quot;292&quot; text-anchor=&quot;middle&quot;&gt;coder&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;dg-nodes&quot;&gt;&lt;g&gt;&lt;rect x=&quot;16&quot; y=&quot;40&quot; width=&quot;136&quot; height=&quot;52&quot; rx=&quot;14&quot;&gt;&lt;/rect&gt;&lt;text x=&quot;84&quot; y=&quot;71&quot; text-anchor=&quot;middle&quot;&gt;implement()&lt;/text&gt;&lt;/g&gt;&lt;g&gt;&lt;rect x=&quot;16&quot; y=&quot;160&quot; width=&quot;136&quot; height=&quot;52&quot; rx=&quot;14&quot;&gt;&lt;/rect&gt;&lt;text x=&quot;84&quot; y=&quot;191&quot; text-anchor=&quot;middle&quot;&gt;review()&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;dg-end&quot;&gt;&lt;rect x=&quot;228&quot; y=&quot;160&quot; width=&quot;136&quot; height=&quot;52&quot; rx=&quot;14&quot;&gt;&lt;/rect&gt;&lt;text x=&quot;296&quot; y=&quot;191&quot; text-anchor=&quot;middle&quot;&gt;end(&amp;#39;ready&amp;#39;)&lt;/text&gt;&lt;/g&gt;&lt;g&gt;&lt;rect x=&quot;16&quot; y=&quot;300&quot; width=&quot;136&quot; height=&quot;52&quot; rx=&quot;14&quot;&gt;&lt;/rect&gt;&lt;text x=&quot;84&quot; y=&quot;331&quot; text-anchor=&quot;middle&quot;&gt;fix()&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;dg-human&quot;&gt;&lt;rect x=&quot;228&quot; y=&quot;300&quot; width=&quot;136&quot; height=&quot;52&quot; rx=&quot;14&quot;&gt;&lt;/rect&gt;&lt;text x=&quot;296&quot; y=&quot;331&quot; text-anchor=&quot;middle&quot;&gt;ask_rounds()&lt;/text&gt;&lt;/g&gt;&lt;/g&gt;&lt;circle class=&quot;dg-token&quot; r=&quot;5&quot;&gt;&lt;animateMotion dur=&quot;5s&quot; repeatCount=&quot;indefinite&quot; path=&quot;M44 212V300H124V212Z&quot;&gt;&lt;/animateMotion&gt;&lt;/circle&gt;&lt;/g&gt;&lt;g class=&quot;dg-notes&quot; aria-hidden=&quot;true&quot;&gt;&lt;text x=&quot;364&quot; y=&quot;404&quot; text-anchor=&quot;end&quot;&gt;it asks me when&lt;/text&gt;&lt;text x=&quot;364&quot; y=&quot;430&quot; text-anchor=&quot;end&quot;&gt;a decision is mine&lt;/text&gt;&lt;path d=&quot;M248 396C242 384 246 370 258 360M258 360l-12 3M258 360l1 12&quot;&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;figcaption&gt;&lt;span class=&quot;fig-num&quot;&gt;&lt;/span&gt;The flow of runbook-review-loop, drawn from the code above.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The session runs &lt;code&gt;flow.py&lt;/code&gt;, and it prints the next launch: which executor to use and the exact message for the subagent. The session launches a subagent with that text, waits, and passes the subagent’s last JSON object back to &lt;code&gt;flow.py&lt;/code&gt;. The reply is typed. The review step returns &lt;code&gt;{&amp;quot;findings&amp;quot;: 1}&lt;/code&gt;, and &lt;code&gt;flow.py&lt;/code&gt; decides from that number what comes next: a fix, a question to the human, or the end of the run. &lt;strong&gt;The model does the step. The code picks the next step.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Steps pass their work through files in a run directory, so the main session doesn’t carry every step’s output in its context. The state of the run is &lt;code&gt;state.json&lt;/code&gt; in the same directory. A new session with access to that directory can run &lt;code&gt;python3 flow.py &amp;lt;run&amp;gt;&lt;/code&gt; and get the next action.&lt;/p&gt;
&lt;p&gt;The engine comes with the runbook, so there are no external dependencies beyond Python 3.9 or newer. Mixing vendors is optional. A step for another vendor’s model needs some way to launch that model from your session. I use &lt;a href=&quot;https://github.com/agent-runbooks/throng-mcp&quot;&gt;throng-mcp&lt;/a&gt;, an MCP server I wrote for that, and any other tool that starts an agent would do.&lt;/p&gt;
&lt;p&gt;A fair question is why &lt;code&gt;flow.py&lt;/code&gt; doesn’t launch the subagents itself, with &lt;code&gt;claude -p&lt;/code&gt; or &lt;code&gt;codex exec&lt;/code&gt;. The tool you start the skill from already knows how to run agents. Building that a second time inside the runbook would force my way of orchestrating on you, and I think that does more harm than good. So the runbook only says what to launch next, and your session does it with its own tools and permissions. I start mine from T3 Code, with Claude or Codex as the main session. A step’s question arrives in the chat you already have open. In CI, where nobody is in the chat, I hand those questions to a separate agent that makes the decisions.&lt;/p&gt;
&lt;p&gt;The executors never talk to each other: each one reads what the previous step left in the run directory. In computing that’s a blackboard system, and the version with no referee is what biologists call stigmergy, after Grassé’s termites.&lt;/p&gt;
&lt;h2 id=&quot;one-run-start-to-finish&quot; data-section=&quot;III&quot;&gt;&lt;span class=&quot;sec-num&quot; aria-hidden=&quot;true&quot;&gt;III.&lt;/span&gt;One run, start to finish&lt;a class=&quot;anchor&quot; href=&quot;#one-run-start-to-finish&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M6.5 9.5l3-3M7 4.5l1-1a2.5 2.5 0 0 1 3.5 3.5l-1 1M9 11.5l-1 1A2.5 2.5 0 0 1 4.5 9l1-1&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.5&quot; stroke-linecap=&quot;round&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The example repository is a Python package with a &lt;code&gt;slugify&lt;/code&gt; function and five unit tests. The brief asks for an optional &lt;code&gt;max_length&lt;/code&gt; parameter that limits the length of the slug. The checks are &lt;code&gt;python3 -m unittest&lt;/code&gt;, and the fix budget is one round.&lt;/p&gt;
&lt;p&gt;Here’s the report the runbook printed in the chat when the run ended:&lt;/p&gt;
&lt;figure class=&quot;figure&quot;&gt;&lt;div class=&quot;figure-plate&quot;&gt;&lt;img src=&quot;https://nodge.me/_astro/cover.BJIFVLDM_NAKYx.webp&quot; srcset=&quot;https://nodge.me/_astro/cover.BJIFVLDM_ZDTCv6.webp 700w, https://nodge.me/_astro/cover.BJIFVLDM_14elFK.webp 1100w, https://nodge.me/_astro/cover.BJIFVLDM_Z28mAwh.webp 1400w&quot; alt=&quot;The report of the run in the chat: status ready, seven rows with step, executor, time, result and output file&quot; sizes=&quot;(max-width: 760px) 100vw, 700px&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1480&quot; height=&quot;780&quot;&gt;&lt;/div&gt;&lt;figcaption&gt;&lt;span class=&quot;fig-num&quot;&gt;&lt;/span&gt;The report in the chat: every step with its executor, time, result and output file.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;And here’s the same run in &lt;a href=&quot;https://github.com/agent-runbooks/skills/tree/main/skills/runbook-viewer&quot;&gt;runbook-viewer&lt;/a&gt;, an optional page that reads the run directory and lists each step with its time and output:&lt;/p&gt;
&lt;figure class=&quot;figure&quot;&gt;&lt;div class=&quot;figure-plate&quot;&gt;&lt;img src=&quot;https://nodge.me/_astro/cover.gVeCPu5d_ZotE3F.webp&quot; srcset=&quot;https://nodge.me/_astro/cover.gVeCPu5d_Z1QE7s7.webp 700w, https://nodge.me/_astro/cover.gVeCPu5d_PfiHA.webp 1100w, https://nodge.me/_astro/cover.gVeCPu5d_1rSFb0.webp 1400w&quot; alt=&quot;runbook-viewer: the run 20261031-slugify-max-length ended ready after six subagent steps and one question&quot; sizes=&quot;(max-width: 760px) 100vw, 700px&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1440&quot; height=&quot;900&quot;&gt;&lt;/div&gt;&lt;figcaption&gt;&lt;span class=&quot;fig-num&quot;&gt;&lt;/span&gt;The same run in runbook-viewer.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The brief didn’t say what a negative &lt;code&gt;max_length&lt;/code&gt; should do. The coder chose to raise &lt;code&gt;ValueError&lt;/code&gt;. The reviewer found no errors in the cases it checked, and its one finding was that choice, which it left for me to decide. The fix round changed nothing and wrote down why, the second review kept the finding open, and &lt;code&gt;flow.py&lt;/code&gt; asked me:&lt;/p&gt;
&lt;blockquote data-note=&quot;flow.py asked me this&quot;&gt;
&lt;p&gt;Fix rounds are spent and &lt;code&gt;03-review.md&lt;/code&gt; still lists findings. More rounds, and how many, or stop here? Anything you add goes to the coder.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I answered in the chat: one more round, keep the error, mention it in the CHANGELOG line. The session mapped that onto the choice &lt;code&gt;more rounds&lt;/code&gt; with &lt;code&gt;rounds: 1&lt;/code&gt;, and &lt;code&gt;flow.py&lt;/code&gt; wrote my words to a file the coder reads. The second fix added one line to the CHANGELOG, the third review returned &lt;code&gt;findings: 0&lt;/code&gt;, and the run ended &lt;code&gt;ready&lt;/code&gt;, the runbook’s status for a normal end, with the changes uncommitted and a review file that says what they do.&lt;/p&gt;
&lt;p&gt;Six subagent launches, about seven minutes of their time, one question to me, three files changed. The whole run is &lt;a href=&quot;https://github.com/agent-runbooks/skills/tree/main/tests/fixtures/20261031-slugify-max-length&quot;&gt;in the repository&lt;/a&gt;, with every step’s reply. The example is simplified on purpose, so six agents for one small function can look like overkill. My real tasks are much bigger. There a separate agent per step pays off: each one starts with a clean context, and the context of the main session stays small.&lt;/p&gt;
&lt;h2 id=&quot;run-statistics&quot; data-section=&quot;IV&quot;&gt;&lt;span class=&quot;sec-num&quot; aria-hidden=&quot;true&quot;&gt;IV.&lt;/span&gt;Run statistics&lt;a class=&quot;anchor&quot; href=&quot;#run-statistics&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M6.5 9.5l3-3M7 4.5l1-1a2.5 2.5 0 0 1 3.5 3.5l-1 1M9 11.5l-1 1A2.5 2.5 0 0 1 4.5 9l1-1&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.5&quot; stroke-linecap=&quot;round&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I counted more than 300 real runs that still had their logs. None of them failed because the session didn’t follow the runbook.&lt;/p&gt;
&lt;p&gt;More than a quarter of the runs went through &lt;a href=&quot;https://github.com/agent-runbooks/gallery/tree/main/skills/runbook-implement-task&quot;&gt;runbook-implement-task&lt;/a&gt;, a bigger runbook with two reviewers from different vendors and a third agent that sorts their findings.&lt;/p&gt;
&lt;p&gt;The orchestration itself is cheap. Each step adds about 3,400 tokens to the context of the main session. The work of a step stays in its subagent, and what that costs depends on the task.&lt;/p&gt;
&lt;h2 id=&quot;where-it-falls-short&quot; data-section=&quot;V&quot;&gt;&lt;span class=&quot;sec-num&quot; aria-hidden=&quot;true&quot;&gt;V.&lt;/span&gt;Where it falls short&lt;a class=&quot;anchor&quot; href=&quot;#where-it-falls-short&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M6.5 9.5l3-3M7 4.5l1-1a2.5 2.5 0 0 1 3.5 3.5l-1 1M9 11.5l-1 1A2.5 2.5 0 0 1 4.5 9l1-1&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.5&quot; stroke-linecap=&quot;round&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The orchestrator is still a model, and it may not do exactly what &lt;code&gt;flow.py&lt;/code&gt; printed. The execution rules in &lt;code&gt;SKILL.md&lt;/code&gt; make the session write every deviation into the run’s log, so I can count them: in under 8% of my runs the session deviated from the runbook on its own. It guessed a file name instead of using the printed one. It cut a printed launch message with &lt;code&gt;head&lt;/code&gt; and rebuilt it from memory.&lt;/p&gt;
&lt;p&gt;In my experience these deviations rarely change the result. Mostly they cost the model a few extra steps. This is the one place where a workflow script is stricter, because its code launches the next step itself. In a runbook the referee can announce the next move, and the session can still move the wrong piece. But models are improving fast, so I expect this problem to stop mattering soon.&lt;/p&gt;
&lt;p&gt;A runbook has no spending limit of its own. The only cap in the engine is the item count of a &lt;code&gt;foreach&lt;/code&gt;, the flow’s loop over a list: 50 by default. My biggest run launched 257 subagents: a one-off migration of a large repository, done in chunks that were each validated, reviewed and fixed. It ran through.&lt;/p&gt;
&lt;h2 id=&quot;try-it&quot; data-section=&quot;VI&quot;&gt;&lt;span class=&quot;sec-num&quot; aria-hidden=&quot;true&quot;&gt;VI.&lt;/span&gt;Try it&lt;a class=&quot;anchor&quot; href=&quot;#try-it&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M6.5 9.5l3-3M7 4.5l1-1a2.5 2.5 0 0 1 3.5 3.5l-1 1M9 11.5l-1 1A2.5 2.5 0 0 1 4.5 9l1-1&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.5&quot; stroke-linecap=&quot;round&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The project is open source, &lt;a href=&quot;https://github.com/agent-runbooks&quot;&gt;agent-runbooks&lt;/a&gt; on GitHub. You need Python 3.9 or newer and a harness whose session can launch subagents and wait for them (basically any harness). Install the smallest runbook into your user directory:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes nodge-light nodge-dark&quot; style=&quot;--shiki-light:#2b2668;--shiki-dark:#e3dfff;--shiki-light-bg:#f4f2fb;--shiki-dark-bg:#1a1930;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#4434C8;--shiki-dark:#B8AEFF&quot;&gt;npx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; skills&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; agent-runbooks/gallery&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8A2BC2;--shiki-dark:#E4A8FF&quot;&gt; --skill&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0B7068;--shiki-dark:#6FE0C4&quot;&gt; runbook-review-loop&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8A2BC2;--shiki-dark:#E4A8FF&quot;&gt; -g&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Both the coder and the reviewer run on the model of your main session. Ask your agent:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Run runbook-review-loop: &amp;lt;your change&amp;gt;. The checks are &amp;lt;your test command&amp;gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The runbook tells you its progress in the chat when you ask and its final state when the run ends. To follow a run live on the page from the screenshot above, install &lt;a href=&quot;https://github.com/agent-runbooks/skills/tree/main/skills/runbook-viewer&quot;&gt;runbook-viewer&lt;/a&gt; as well and ask the agent to open the viewer page.&lt;/p&gt;
&lt;p&gt;To write your own, install &lt;a href=&quot;https://github.com/agent-runbooks/skills&quot;&gt;agent-runbook-authoring&lt;/a&gt; with &lt;code&gt;npx skills add agent-runbooks/skills&lt;/code&gt;, take a procedure you run by hand every week, and ask the session for a runbook of it. The skill writes it with you.&lt;/p&gt;
&lt;p&gt;If you try it, I’d be glad to hear how it went. The &lt;a href=&quot;https://github.com/agent-runbooks/skills/discussions&quot;&gt;Discussions&lt;/a&gt; page is open for that.&lt;/p&gt;
&lt;p&gt;I start thinking about a runbook when a task needs several subagents that have to work in a certain order. And I always write one once there’s orchestration logic on top of those subagents.&lt;/p&gt;
&lt;h2 id=&quot;sources&quot;&gt;Sources&lt;a class=&quot;anchor&quot; href=&quot;#sources&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M6.5 9.5l3-3M7 4.5l1-1a2.5 2.5 0 0 1 3.5 3.5l-1 1M9 11.5l-1 1A2.5 2.5 0 0 1 4.5 9l1-1&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.5&quot; stroke-linecap=&quot;round&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Runbooks follow the &lt;a href=&quot;https://agentskills.io&quot;&gt;Agent Skills&lt;/a&gt; format.&lt;/li&gt;
&lt;li&gt;What runbooks are compared against: &lt;a href=&quot;https://github.com/agent-runbooks/skills/blob/main/docs/comparison.md&quot;&gt;Runbooks compared with workflow engines&lt;/a&gt;, covering &lt;a href=&quot;https://code.claude.com/docs/en/workflows&quot;&gt;Claude Code workflows&lt;/a&gt;, &lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/dynamic-workflows&quot;&gt;Copilot dynamic workflows&lt;/a&gt;, LangGraph, the OpenAI Agents SDK and Mastra.&lt;/li&gt;
&lt;li&gt;The subagent tools the orchestrating session uses: &lt;a href=&quot;https://code.claude.com/docs/en/sub-agents&quot;&gt;Claude Code subagents&lt;/a&gt; and &lt;a href=&quot;https://developers.openai.com/codex/subagents&quot;&gt;Codex subagents&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Blackboard systems and stigmergy: L. Erman and others, &lt;a href=&quot;https://doi.org/10.1145/356810.356816&quot;&gt;The Hearsay-II Speech-Understanding System&lt;/a&gt;, ACM Computing Surveys, 1980, and G. Theraulaz and E. Bonabeau, &lt;a href=&quot;https://doi.org/10.1162/106454699568700&quot;&gt;A Brief History of Stigmergy&lt;/a&gt;, Artificial Life, 1999.&lt;/li&gt;
&lt;/ul&gt;</content:encoded></item></channel></rss>