Back to loops
Automationmanual

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.

0 views0 usesby solo lemon.

// parameters

Triggermanual
Max iterations20
Check commandcat .ralph/prd.json | grep -c '"passes": false' || true
Exit conditionAll stories in prd.json have passes: true

// run_this_loop

Copy the kickoff into your agent first. The blueprint below explains how the loop evaluates progress and when it should stop.

Open in CursorOpen in Claude

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.

Goal

every story in .ralph/prd.json has passes: true

// loop_sequence

// loop_sequence_diagram.json
closed loop

Trigger

Manual start

Actions block

4 steps
1Read state
2Implement one story
3Run backpressure
4Commit and record

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

Safety capMax 20 iterations

// steps

  1. 1
    Read state

    Read .ralph/prd.json and .ralph/progress.md. Resume any story marked inProgress, else pick the lowest-priority story with passes: false.

  2. 2
    Implement one story

    Implement exactly one user story with minimal scope. Mark it inProgress in prd.json before coding.

  3. 3
    Run 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
  4. 4
    Commit and record

    Commit with a story-scoped message. Set passes: true in prd.json and append learnings to progress.md.