skills/loop-engineering/SKILL.md
Use this skill whenever designing, configuring, or hardening an autonomous agent "loop" — a goal an agent iterates toward on its own with a real verification gate, persistent state, and a stop condition. Invoke it when the user mentions "build a loop", "agentic loop", "self-iterating agent", "run this on a schedule/cron", "/loop or /goal", "Ralph loop", "maker-checker", "fleet of agents", "autonomous workflow", or wants an agent to keep working a goal unattended until it's verifiably done. Also use when scoping whether a loop is even worth building, when picking a verification gate, when deciding what a loop is allowed to touch (blast radius), or when a loop is burning tokens without producing accepted work.
npx skillsauth add b-open-io/prompts loop-engineeringInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A prompt hands an agent one instruction and waits for you. A loop hands the agent a job, a way to know when the job is done, and a rule for when to give up — then runs the full cycle on its own until the goal is met. This skill is how we design loops that survive production instead of billing you in silence.
The single most important idea: the gate is the loop. Without a real, automated check on the result, you don't have a loop — you have an agent agreeing with itself on repeat. Everything else (scheduling, sub-agents, connectors) is plumbing around that one load-bearing part. Design the gate first.
Every production loop is assembled from these five. Claude Code ships all of them.
| Block | What it is | Our tooling |
|---|---|---|
| 1. Heartbeat | the trigger that makes it a loop, not a one-off: schedule + goal | /loop, /goal, hooks, CronCreate, ScheduleWakeup, GitHub Actions |
| 2. Skill | reusable instructions the loop reads each pass (rules + a never-touch list) | this skill + the project's loop config |
| 3. Sub-agents | split the maker (does the work) from the checker (verifies it) | hunter-skeptic-referee, code-auditor, tester |
| 4. Connectors | let the loop act — open the PR, comment the ticket, ping the channel | Linear MCP, gh, resend, devops |
| 5. Verifier (the gate) | the test/typecheck/build/exercise that automatically rejects bad output | tester (Jason) — owns running it |
The maker is too generous grading its own homework, so block 3 (a separate, often stronger checker) plus block 5 (an objective gate) is most of the quality. Make the maker fast and cheap; make the checker slow and strict.
Most real work needs both, running in parallel, with the ticketing system (the State block) as the seam between them. This is a producer/consumer architecture: discovery produces work, execution consumes it.
DISCOVERY LOOP (free roam) EXECUTION LOOP (systematic)
┌───────────────────────────┐ ┌───────────────────────────┐
│ roam the app like a human │ files │ pull an open ticket │
│ randomized human-like │ tickets │ work it end-to-end │
│ paths, weird inputs │ ────────▶ │ verify at the gate │
│ surface anomalies │ TICKETS │ close the ticket │
│ dedup vs OPEN tickets │ ◀──────── │ (free-roam the fixed area │
│ file NEW tickets │ reads │ as the top verify rung) │
└───────────────────────────┘ └───────────────────────────┘
PRODUCER CONSUMER
Skill(superpowers:subagent-driven-development) or a fleet via Skill(bopen-tools:wave-coordinator).Skill(bopen-tools:free-roam-testing).The dedup-vs-open-tickets step is what stops discovery from re-filing the same issue every pass. Always read open tickets before filing new ones.
Loops are real, but most tasks don't need the heavy version. Build one only when all four are true — miss one box and keep it a manual prompt:
If it doesn't pass, say so and recommend a single good prompt instead. The honest version of this skill: don't force loops into places they don't belong — you'll just burn money for nothing.
Reversibility of an action — not its reliability score — decides three things at once: how autonomous the loop may be, what free roam may touch, and whether cleanup is required. A 99%-accept loop can still ship a catastrophic 1% irreversible outcome, so reliability promotes you within a tier, never across the irreversibility line.
| Tier | Example actions | Autonomy gate | Free roam | Cleanup | |---|---|---|---|---| | Low (reversible) | reads, drafts, sandbox/ephemeral writes | self-certify once the gate is green + audit log | roam freely | none needed | | Medium | staging changes, external messages, non-destructive writes | timed human review window | safe mutations only | teardown or gate | | High (irreversible) | prod deploy, data deletion, payments, push to main | mandatory human approval, regardless of accept-rate history | never (unless on ephemeral env) | must be gated |
Reserve human gates for irreversible actions only — humans rubber-stamp when asked too often (approval fatigue), so over-gating reduces safety. See references/blast-radius.md for the promotion protocol (prove 3–5 runs watched → confirm sandbox + circuit breaker → promote to unattended).
The order matters more than the tools. Scheduling something you haven't made reliable by hand is exactly how loops blow up while you sleep.
/loop/Actions). Promotion respects the blast-radius tier above.Every loop needs at least one of each, or it runs until it succeeds, breaks, or drains the account:
Self-improving caps: the cap is raised by evidence, not vibes. When the process surfaces a defect, fix it; when accept rate proves out, raise the cap and log that decision in the state backend. The loop improves itself.
Not tokens spent, not loops run. If the loop gives ten results and you toss six, you're doing the review work it was meant to save. Below a 50% accept rate it costs more than it gives back — halt and report. CFO (Milton) owns tracking this; context re-reads compound every iteration, so cost is super-linear, not linear.
Decisions 3, 4, and 5 below are per-project — you must ask the project, never assume. Use references/config-questionnaire.md for the full interview; the /loop-init command runs it interactively. The ten fields:
static (typecheck/lint) → unit → integration → real-app exercise.references/state-backends.md)/loop/Actions/hook)? cadence?Loops fail quietly, not loudly. Before shipping, walk references/failure-modes.md and confirm a guard for each: the Ralph Wiggum premature-done, silent runaway, context rot, phantom implementation, scope creep, comprehension debt, approval fatigue, injection propagation. The two cheapest guards that prevent the most damage: an objective external gate (not LLM self-assessment) and a pre-flight budget breaker.
agent-builder (Satchmo) — loop architect; runs this skill, assembles the five blocks, owns the design.tester (Jason) — the gate; implements and runs verification at the required rung.project-manager — the state layer; tickets as loop memory across all three backends.devops — heartbeat + connectors; cron/Actions, circuit breakers, the promotion gate.code-auditor / hunter-skeptic-referee — adversarial maker/checker separation.CFO (Milton) — cost-per-accepted-change watchdog.wave-coordinator — fleets of loops at scale.references/config-questionnaire.md — the full per-project loop interview, field by field.references/blast-radius.md — tiering detail + the prove→harden→automate promotion protocol.references/failure-modes.md — the catalog of quiet failure modes and their guards.references/state-backends.md — Linear vs GitHub Issues vs repo-vault, with the state-file contract.tools
This skill should be used when a Claude Code session needs to keep working after Anthropic usage runs out, or when the user asks to run the Claude Code harness on GPT-5.6 Sol. Trigger phrases include "my Anthropic usage ran out", "I'm out of Claude usage", "usage limit reached, what now", "keep working on another model", "run Claude Code on GPT-5.6 Sol", "use GPT-5.6 Sol as the model", "set up claudex", "claudex isn't working", "route the harness through CLIProxyAPI", or "bill against my ChatGPT/Codex subscription". It stands up a local proxy so the Claude Code CLI runs on OpenAI's Codex backend as an escape hatch, and diagnoses that setup when it drifts. macOS + Homebrew.
testing
This skill should be used when the user asks to "open Visual Wayfinder", "answer a Wayfinder ticket visually", "turn this decision into a configurator", "show Wayfinder choices as a dashboard", "prototype the Wayfinder questionnaire", or wants interactive choice cards, tradeoff controls, rankings, ranges, toggles, and consequence previews for one active Wayfinder decision. It wraps the Wayfinder skill and JSON Render; it never replaces the tracker or resolves more than the active decision.
development
This skill should be used when the user asks to "make a visual proposal", "write this up so I can share it", "present these options visually", "diagram the trade-offs", "turn this plan into something reviewable", or requests a shareable design pitch, architecture proposal, RFC, options comparison, or visual roadmap for work that has not been built. It produces one self-contained, theme-aware HTML page led by grounded diagrams. Use visual-review instead for completed code changes; do not use this skill for internal task tracking.
tools
This skill should be used when the user asks to "add plugin settings", "make a plugin configurable", "store per-project plugin configuration", "use settings.local.json", "create a plugin state file", "expose skill settings in Agent Master", or "add a skill interface". Distinguishes official Claude Code settings from project-owned configuration and documents bOpen Agent Master skill interface discovery.