← ClaudeAtlas

write-good-loopslisted

Use when a user wants to build an agent LOOP in Boardwalk, a workflow that iterates until a goal is reached rather than running once. Covers find/fix/verify loops, poll-until-healthy, drain-a-queue, and run-on-a-schedule maintainers. Teaches the core loop shape (plain control flow over agent()), the layered exits every loop needs (a verifier, a hard iteration cap, a budget plus usage.get() self-governing, no-progress detection), choosing the topology (one long run with while+sleep vs a recurring cron trigger of many short runs vs workflows.schedule for runtime-computed cadences), splitting the maker from the checker for verification, carrying durable state across runs, and never paying for idle wait. Pairs with boardwalk-use-cli for scaffolding, validating (boardwalk check), and running the loop.
boardwalk-labs/plugins · ★ 1 · AI & Automation · score 70
Install: claude install-skill boardwalk-labs/plugins
# Write good loops Use this skill whenever the user wants an agent to **keep going until a job is done** instead of running a single prompt: find every bug in a diff, drain a queue, watch a service until it's healthy, or maintain a repo every night. A loop is how you hand the whole find → act → check → repeat cycle to the workflow, so the user defines the goal once instead of re-prompting each step. A Boardwalk workflow is a `run` function plus a `workflow.jsonc` descriptor (new to Boardwalk? see `boardwalk-overview` for the mental model, `write-good-workflows` for the general authoring craft, and `boardwalk-use-cli` for how to scaffold/validate/run one). A loop is **not** a platform feature you configure; it's ordinary control flow in that function. So the whole skill is about writing that control flow well: giving it exits, shaping it right, verifying its output, and carrying state. ## The core shape The smallest good loop runs until the work runs **dry**, not for a fixed number of passes. A fixed "do 3 passes" either stops early or wastes the last passes; looping to dryness adapts to how much is actually there. Track what's been seen in plain code, ask the agent only for what's new, stop after a couple of empty rounds. ```ts import { agent, phase } from "@boardwalk-labs/workflow"; interface Job { text: string; maxRounds?: number } const FINDINGS_SCHEMA = { type: "object", properties: { findings: { type: "array", items: { type: "object",