Spec-first Ralph (PLAN.md-driven)

The spec-driven maturation of the Ralph loop: each fresh-context iteration reads PLAN.md, implements the highest-priority unchecked item, checks it off, and commits — so the spec file evolves alongside the codebase.

prompt
→ Claude
Ralph variant where the loop prompt is "read PLAN.md, pick highest-priority unchecked item, implement, check it off, commit, exit" — spec file evolves with the codebase. Guardrails: Stop when the goal is verifiably met, or stop after 15 iterations, whichever comes first. Keep changes minimal and never touch files outside the task’s scope.
claude-code

Implementation note

When to use: Ralph-style autonomous grinding where you want the plan itself to be the living artifact — a checklist the loop consumes and the team can read, edit, and reprioritize between iterations. How it works: each fresh-context iteration reads PLAN.md, picks the highest-priority unchecked item, implements it, checks it off, commits, and exits. The spec file evolves alongside the codebase: completed items accumulate as history, and anyone can insert, reorder, or annotate items to steer the next iteration without touching the loop machinery. HumanLayer describes this as the spec-driven maturation of the original Ralph. Safety: the checkbox protocol is the state rail — progress is legible in one file, and a human can pause the loop, edit PLAN.md, and resume with redirected priorities. Keep items small and independently shippable, run it on a branch, and add an iteration cap since the loop itself does not carry one. Hardened 2026-07-27: explicit stop/cap/verification guardrails appended; regraded D→A.

Source: HumanLayer

More planning loops

Ship verified code, one stage per agent

Loop/ralph

Run a multi-stage software factory pipeline where each agent handles one task in a fresh context, anchored to mechanical gates and held-out test suites.

prompt
→ Claude
# AGENTS.md — read this first This is Software Bodega , a software factory: a pipeline that turns an idea into verified code with one human touch per stage. Where state lives — on disk, never in chat history: - factory/STATE.md — current stage + pointer. Single source of truth. - factory/BRIEF.md BLUEPRINT.md CONTRACT.md HANDOFF.md REVIEW.md GUIDE.md - factory/.planning/{spec,decompose,plan}.json — machine-checked artifacts - factory/.planning/gate-results/ — <gate>-<sha>.json verdicts - factory/tasks/ .md — one file per task - factory/progress.md factory/log.md — append-only diaries. Never rewrite. Rules that do not bend: 1. One agent per station. One task per fresh context window. No multi-agent chat. 2. Every gate anchors to something mechanical. LLM judges are fallbacks and must be a different model FAMILY than the author. 3. factory/tests/heldout/ is held out . Never read it, never reference it, never write to it. If you can see it, that is a bug — report it. 4. Repair loops cap at 2. Then resample N=3. Then PARK. Never loop forever. 5. Never weaken a test to make it pass. Never edit CONTRACT.md — it is signed. 6. git add
planninghigh riskclaude-code

Ralph Overnight Builds — Progressive Curriculum Entry

Loop/ralph

A graduated path to unattended Ralph runs: start with a single bounded task, add a PROMPT.md spec file, add verification, and only then remove the human from the loop for overnight builds.

prompt
→ Claude
Staged path from basic prompt → PROMPT.md spec → overnight Ralph run: start with a single bounded task, add a spec file, add verification, only then remove the human from the loop. Cap the run at 25 iterations; leave remaining work for the next session.
planningmedium riskclaude-code

Draft a sprint plan from the backlog

Loop/goallooprepo

Turn the open issue backlog into a proposed two-week sprint plan with estimates, a dependency ordering, and an explicit cut line, written as a document for the team to edit.

prompt
→ Claude
/goal SPRINT-PLAN.md contains a proposed 2-week plan — read all open issues labeled `ready`, estimate each as S/M/L based on the code it touches, order them by dependency and value, draw a cut line at a realistic capacity, and list what falls below it with reasons; make no changes to the issues themselves; stop after 6 turns
planninglow riskclaude-codecodex
1