write-good-loopslisted
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",