Agent skill · software engineering · sundial-org

ralph-loop

Generate copy-paste bash scripts for Ralph Wiggum/AI agent loops (Codex, Claude Code, OpenCode, Goose). Use when asked for a “Ralph loop”, “Ralph Wiggum loop”, or an AI loop to plan/build code via PROMPT.md + AGENTS.md, SPECS, and IMPLEMENTATION_PLAN.md, including PLANNING vs BUILDING modes, backpressure, sandboxing, and completion conditions.

Why this skill is useful

Adds a complete bash script for running AI coding loops with specific commands and context management that the AI cannot generate on its own.

What it needs

Requires bash installed locally. About 3k tokens when loaded. Last updated 2026-03-07. 639 stars on the source repository.

What this skill does

Ralph Loop Overview Generate a ready-to-run bash script that runs an AI coding CLI in a loop. Align with the Ralph playbook flow: 1) Define requirements → JTBD → topics of concern → specs/.md 2) PLANNING loop → create/update IMPLEMENTATIONPLAN.md (no implementation) 3) BUILDING loop → implement tasks, run tests (backpressure), update plan, commit The loop persists context via PROMPT.md + AGENTS.md (loaded every iteration) plus the on-disk plan/specs. Workflow 1) Collect inputs (ask if missing) Goal / JTBD (what outcome is needed) CLI (codex, claude-code, opencode, goose, other) Mode: PLANNING, BUILDING, or BOTH Completion condition Promise phrase (string to detect), or Test/command to run each iteration, or Plan sentinel (e.g., a line STATUS: COMPLETE in IMPLEMENTATIONPLAN.md) Max iterations Sandbox choice (none docker other) + security posture Backpressure commands (tests/lints/build) to embed in AGENTS.md Auto‑approve flags (ask explicitly) Codex: --full-auto Claude Code: --dangerously-skip-permissions 2) Phase 1 — Requirements → specs If the user wants “full Ralph” (or unclear requirements), do this before the loop: Break the JTBD into topics of concern (1 topic = 1 spec file). For each topic, draft specs/<topic>.md. Use subagents to load URLs or existing docs into context for spec quality. Keep specs short and testable. 3) Phase 2/3 — PROMPT.md + AGENTS.md Context loaded each iteration: PROMPT.md + AGENTS.md. AGENTS.md should include: project test commands (backpressure) build/run instructions any operational learnings PROMPT.md should reference: specs/.md IMPLEMENTATIONPLAN.md any relevant project files/dirs 4) Two prompt templates (PLANNING vs BUILDING) Create two prompts and swap PROMPT.md based on mode. PLANNING prompt (no implementation): BUILDING prompt: 5) Build the per‑iteration command Codex: codex exec <FLAGS> "$(cat PROMPT.md)" Requires git repo. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills sundial-org/ralph-loop

View the source on GitHub

Browse the @skills marketplace