From sundial-org-awesome-openclaw-skills-4
Generates bash scripts for Ralph Wiggum AI agent loops (Codex, Claude Code, OpenCode, Goose) to plan and build code via PROMPT.md, AGENTS.md, specs, and IMPLEMENTATION_PLAN.md.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sundial-org-awesome-openclaw-skills-4:ralph-loopThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate a ready-to-run bash script that runs an AI coding CLI in a loop. Align with the Ralph playbook flow:
Generate a ready-to-run bash script that runs an AI coding CLI in a loop. Align with the Ralph playbook flow:
specs/*.mdIMPLEMENTATION_PLAN.md (no implementation)The loop persists context via PROMPT.md + AGENTS.md (loaded every iteration) plus the on-disk plan/specs.
codex, claude-code, opencode, goose, other)PLANNING, BUILDING, or BOTHSTATUS: COMPLETE in IMPLEMENTATION_PLAN.md)none | docker | other) + security postureAGENTS.md--full-auto--dangerously-skip-permissionsIf the user wants “full Ralph” (or unclear requirements), do this before the loop:
specs/<topic>.md.PROMPT.md + AGENTS.md.AGENTS.md should include:
PROMPT.md should reference:
specs/*.mdIMPLEMENTATION_PLAN.mdCreate two prompts and swap PROMPT.md based on mode.
PLANNING prompt (no implementation):
You are running a Ralph PLANNING loop for: <JTBD/GOAL>.
Read specs/* and the current codebase. Do a gap analysis and update IMPLEMENTATION_PLAN.md only.
Rules:
- Do NOT implement.
- Do NOT commit.
- Prioritize tasks and keep plan concise.
- If requirements are unclear, write clarifying questions into the plan.
Completion:
If the plan is complete, add line: STATUS: COMPLETE
BUILDING prompt:
You are running a Ralph BUILDING loop for: <JTBD/GOAL>.
Context:
- specs/*
- IMPLEMENTATION_PLAN.md
- AGENTS.md (tests/backpressure)
Tasks:
1) Pick the most important task from IMPLEMENTATION_PLAN.md.
2) Investigate relevant code (don’t assume missing).
3) Implement.
4) Run the backpressure commands from AGENTS.md.
5) Update IMPLEMENTATION_PLAN.md (mark done + notes).
6) Update AGENTS.md if you learned new operational details.
7) Commit with a clear message.
Completion:
If all tasks are done, add line: STATUS: COMPLETE
codex exec <FLAGS> "$(cat PROMPT.md)"
claude <FLAGS> "$(cat PROMPT.md)"opencode run "$(cat PROMPT.md)"goose run "$(cat PROMPT.md)" (ask if they want the Goose recipe)If the CLI is unknown, ask for the exact command to run each iteration.
Provide either a minimal loop or a controlled loop with max iters + stop conditions.
Minimal loop (Geoff style):
while :; do cat PROMPT.md | claude ; done
Controlled loop (recommended):
#!/usr/bin/env bash
set -euo pipefail
PROMISE='...'
MAX_ITERS=...
CLI_FLAGS="..." # optional
PLAN_SENTINEL='STATUS: COMPLETE'
TEST_CMD='...' # optional
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "❌ Run this inside a git repo."
exit 1
fi
touch PROMPT.md AGENTS.md IMPLEMENTATION_PLAN.md
LOG_FILE=".ralph/ralph.log"
mkdir -p .ralph
CLI_CMD="..." # e.g. "codex exec" or "claude"
for i in $(seq 1 "$MAX_ITERS"); do
echo -e "\n=== Ralph iteration $i/$MAX_ITERS ===" | tee -a "$LOG_FILE"
$CLI_CMD $CLI_FLAGS "$(cat PROMPT.md)" | tee -a "$LOG_FILE"
if [[ -n "${TEST_CMD}" ]]; then
echo "Running tests: $TEST_CMD" | tee -a "$LOG_FILE"
bash -lc "$TEST_CMD" | tee -a "$LOG_FILE"
fi
if grep -Fq "$PROMISE" "$LOG_FILE" || grep -Fq "$PLAN_SENTINEL" IMPLEMENTATION_PLAN.md; then
echo "✅ Completion detected. Stopping." | tee -a "$LOG_FILE"
exit 0
fi
done
echo "❌ Max iterations reached without completion." | tee -a "$LOG_FILE"
exit 1
--dangerously-skip-permissions or --full-auto implies trust + risk.Ctrl+C to stop; git reset --hard to revert.AGENTS.md.npx claudepluginhub joshuarweaver/cascade-ai-ml-agents-misc-2 --plugin sundial-org-awesome-openclaw-skills-4Set up and configure Geoffrey Huntley's original Ralph Wiggum autonomous coding loop in any directory with proper structure, prompts, and backpressure.
Transforms approved implementation plans into ralph loop autonomous execution infrastructure. Creates .ralph/ directory with prd.json, loop.py, CLAUDE.md, and supporting files for multi-step implementation.
Runs a coding agent in an autonomous loop via /ralph, gated by a preflight check for CLI readiness. Use for long-running autonomous development from a wide, outcome-focused prompt.