From compound-teams
The Ralph Loop pattern for Agent Team teammates. Use when spawning builder teammates that need to iterate until all tests, lint, and type checks pass. Provides the standard retry logic, max attempts, and escalation rules.
How this skill is triggered — by the user, by Claude, or both
Slash command
/compound-teams:ralph-loopThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The Ralph Loop is a persistent retry pattern for AI coding agents. Instead of writing code and hoping it works, the agent implements → tests → fixes → retests in a loop until everything passes.
The Ralph Loop is a persistent retry pattern for AI coding agents. Instead of writing code and hoping it works, the agent implements → tests → fixes → retests in a loop until everything passes.
implement → test → [FAIL?] → read error → fix → test again → [PASS?] → lint → [FAIL?] → fix → lint again → [PASS?] → typecheck → [FAIL?] → fix → typecheck again → [PASS?] → DONE
Max 5 retries per unique error. If the same test fails 5 times with the same root cause, stop and escalate.
Max 3 retries before escalating. If stuck on the same error after 3 attempts, message the team lead with:
Run checks in order: tests → lint → typecheck. Don't skip ahead.
Each retry should be different. Don't repeat the same fix. If approach A failed, try approach B. If both fail, try a fundamentally different strategy.
Read the error message carefully. Most failures contain the answer. Parse stack traces, find the actual line, understand the assertion.
Read these from CLAUDE.md "Build Commands" section. Common patterns:
| Stack | Tests | Lint | Typecheck |
|---|---|---|---|
| Next.js/React | npm test or npx vitest | npm run lint | npx tsc --noEmit |
| Python | pytest | ruff check . | mypy . |
| Node.js | npm test | npx eslint . | npx tsc --noEmit |
| Go | go test ./... | golangci-lint run | (built into compiler) |
Stop looping and escalate when:
npx claudepluginhub tbdng/compound-teams-plugin --plugin compound-teamsExecutes tasks with a verification loop, breaking work into steps and confirming completion with fresh test/build/lint evidence. Supports delegation, adversarial testing, and parallel execution.
Runs a command repeatedly, fixing errors one at a time until it exits with code 0. Use when build, typecheck, lint, or test is failing.
Provides patterns for autonomous Claude Code loops from sequential pipelines and agentic REPLs to RFC-driven multi-agent DAGs. Use for continuous dev workflows, parallel agents, and CI/CD-style pipelines.