Ralph Story Executor
Fresh-context loop: pick one incomplete story from prd.json, implement it, run backpressure checks, commit, and update progress before the next iteration.
// parameters
// run_this_loop
Copy the kickoff into your agent first. The blueprint below explains how the loop evaluates progress and when it should stop.
Use loop copies the kickoff prompt. Share copies the loop link. Open in Cursor / Claude only pre-fill that prompt — they do not install hook files. Download loop saves the loop as ralph-story-executor.md.
Start the "Ralph Story Executor" loop.
Goal: every story in .ralph/prd.json has passes: true
Max iterations: 20
Between iterations run: npm test && npm run lint && npm run build
Exit when: no stories remain with passes: false (respond "ALL STORIES ARE COMPLETE")
Step 1: Read .ralph/prd.json and .ralph/progress.md. Pick one incomplete story, implement it, run backpressure checks, commit, update prd.json and progress.md, then stop this iteration.
Self-pace this loop. Each iteration does exactly one story. State lives on disk, not in chat history.// blueprint
The loop contract: target outcome, execution sequence, checks, stopping condition, and safety constraints.
every story in .ralph/prd.json has passes: true
// loop_sequence
Trigger
Manual start
Actions block
Feedback gate
Evaluate: cat .ralph/prd.json | grep -c '"passes": false' || true
Run the check, read the output, then decide whether the loop is complete.
Check failed
Repeat actions with the latest feedback.
Success
All stories in prd.json have passes: true
// steps
- 1Read state
Read .ralph/prd.json and .ralph/progress.md. Resume any story marked inProgress, else pick the lowest-priority story with passes: false.
- 2Implement one story
Implement exactly one user story with minimal scope. Mark it inProgress in prd.json before coding.
- 3Run backpressure
Run the project's test, lint, and build commands from AGENTS.md. Fix failures before committing.
npm test && npm run lint && npm run build - 4Commit and record
Commit with a story-scoped message. Set passes: true in prd.json and append learnings to progress.md.