Skip to content
/ ralphzilla Public template

A starter kit for building apps using the Ralph methodology — autonomous AI coding loops that ship features while you sleep.

Notifications You must be signed in to change notification settings

thesobercoder/ralphzilla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦸 Ralphzilla

A starter kit for building apps using the Ralph methodology — autonomous AI coding loops that ship features while you sleep.

Ralph Agents


What is Ralph?

Ralph is an autonomous coding loop where an AI agent works through a task list iteration by iteration until everything is done. No babysitting. No copy-pasting. Just describe what you want, and let Ralph build it.

This repo is a template to get you started with Ralph-style development using your favorite AI coding agent.


🙏 Credits

Inspired by Ryan Carson and Matt Pocock's Ralph tutorial on X.


Supported Agents

Agent CLI Docs
Claude Code claude anthropic.com/claude-code
OpenCode opencode opencode.ai
Amp amp amp.dev

Prerequisites

Before you start, make sure you have:

  • jq — JSON processor (brew install jq on macOS)
  • Your agent CLI installed and authenticated:
    • Claude Code: claude CLI logged in
    • OpenCode: opencode CLI configured
    • Amp: amp CLI authenticated

🚀 Quick Start

1. Clone this template

git clone https://github.com/yourusername/ralphzilla.git my-app
cd my-app

2. Run the /plan command

Start your AI agent and invoke the plan command:

/plan

This kicks off an intensive PRD planning session. Ralph will quiz you relentlessly about your app idea until every atomic detail is figured out. Don't hold back — answer everything.

💡 Tip: Let Ralph ask you as many questions as it wants. The more detail you provide upfront, the better the output.

The result: docs/prd.md — your complete Product Requirements Document.

3. Run the /tasks command

Once your PRD is ready:

/tasks

This converts your PRD into docs/tasks.json — a structured task list that Ralph will execute autonomously.

4. Create your prompt file

Create docs/prompt.md with the instructions for each Ralph iteration. This tells Ralph what to do each time it runs.

5. Configure your agent

Open ralph.sh and uncomment the line for your agent:

# For Claude Code (default):
OUTPUT=$(cat "$SCRIPT_DIR/docs/prompt.md" | claude -p --dangerously-skip-permissions 2>&1 | tee /dev/stderr) || true

# For Amp:
# OUTPUT=$(cat "$SCRIPT_DIR/docs/prompt.md" | amp --dangerously-allow-all 2>&1 | tee /dev/stderr) || true

# For OpenCode:
# OUTPUT=$(cat "$SCRIPT_DIR/docs/prompt.md" | opencode run --agent ralph 2>&1 | tee /dev/stderr) || true

6. Make it executable & run

chmod +x ralph.sh
./ralph.sh 10  # Run up to 10 iterations

Ralph will loop through iterations, working through your tasks. When all tasks are complete, it outputs <promise>COMPLETE</promise> and exits.


📁 Project Structure

ralphzilla/
├── ralph.sh              # The main loop script
├── docs/
│   ├── prd.md            # Your PRD (created by /plan)
│   ├── tasks.json        # Your tasks (created by /tasks)
│   └── prompt.md         # Instructions for each iteration
├── tmp/
│   └── progress.txt      # Ralph's progress log
├── archive/              # Archived runs from previous features
├── .agents/              # Main commands & skills folder
├── .claude/              # Symlink → .agents
├── .opencode/            # Symlink → .agents
├── CLAUDE.md             # Agent instructions
└── opencode.json         # OpenCode config

💡 Note: .claude/ and .opencode/ are symlinks to .agents/. This means you only need to edit files in .agents/ once, and all agents share the same commands and skills. No duplication needed!


How It Works

┌─────────────────────────────────────────────────────────┐
│                    YOU                                  │
│                     │                                   │
│            Describe your idea                           │
│                     ▼                                   │
│              ┌──────────┐                               │
│              │  /plan   │  Quiz until atomic clarity    │
│              └────┬─────┘                               │
│                   ▼                                     │
│              docs/prd.md                                │
│                   │                                     │
│              ┌────┴─────┐                               │
│              │  /tasks  │  Break into executable tasks  │
│              └────┬─────┘                               │
│                   ▼                                     │
│             docs/tasks.json                             │
│                   │                                     │
│              ┌────┴─────┐                               │
│              │ ralph.sh │  Autonomous loop              │
│              └────┬─────┘                               │
│                   │                                     │
│         ┌─────────┼─────────┐                           │
│         ▼         ▼         ▼                           │
│    Iteration  Iteration  Iteration                      │
│       1          2         ...N                         │
│         │         │         │                           │
│         └─────────┴─────────┘                           │
│                   │                                     │
│                   ▼                                     │
│            ✅ COMPLETE                                  │
│                                                         │
│              Your app is built!                         │
└─────────────────────────────────────────────────────────┘

🧠 The Slash Commands

/plan

Starts an intensive PRD session. Ralph will:

  • Quiz you relentlessly about your app idea
  • Ask about edge cases, user flows, error states
  • Not stop until every detail is crystal clear
  • Generate docs/prd.md when satisfied

/tasks

Converts your PRD to executable tasks:

  • Reads docs/prd.md
  • Breaks it into small, atomic user stories
  • Orders by dependency (schema → backend → UI)
  • Outputs docs/tasks.json

💡 Best Practices

  1. Let Ralph quiz you thoroughly — The /plan phase is where the magic happens. Don't rush it. Answer every question in detail.

  2. Keep tasks atomic — Each task should be completable in one iteration. If Ralph suggests breaking something down, trust it.

  3. Review tasks.json before running — Glance at the generated tasks to make sure they make sense.

  4. Start small — Try a simple feature first to get comfortable with the workflow.

  5. Check progress.txt — Ralph logs its progress in tmp/progress.txt. Check it to see what's happening.


🗄️ Archiving

Ralph automatically archives previous runs when you switch branches:

  • Archives go to archive/YYYY-MM-DD-feature-name/
  • Contains the old tasks.json and progress.txt
  • Lets you track multiple features/experiments

🌐 Chrome DevTools MCP Server

This repo includes an opinionated setup for the Chrome DevTools MCP server, which lets Ralph interact with a browser for UI verification.

Recommended Setup (More Predictable)

Step 1: Open Chrome with remote debugging enabled:

# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

# Linux
google-chrome --remote-debugging-port=9222

# Windows
"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222

Step 2: The MCP config (.mcp.json) is already set up to connect to this:

{
  "mcpServers": {
    "chrome-devtools": {
      "command": "chrome-devtools-mcp",
      "args": [
        "--browserUrl",
        "http://127.0.0.1:9222",
        "--categoryNetwork=false",
        "--categoryEmulation=false",
        "--categoryPerformance=false"
      ]
    }
  }
}

⚠️ This assumes chrome-devtools-mcp is installed globally. If not, see alternatives below.

Alternative: Use npx (No Global Install)

If you don't have chrome-devtools-mcp installed globally, change the command to use npx:

{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": ["chrome-devtools-mcp", "--browserUrl", "http://127.0.0.1:9222"]
    }
  }
}

Alternative: Let MCP Control Chrome

If you don't want to manually open Chrome, remove the --browserUrl argument. The MCP server will find and launch Chrome automatically:

{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": ["chrome-devtools-mcp"]
    }
  }
}

💡 The manual approach (--browserUrl) is more predictable and gives you control over which Chrome instance Ralph uses.


License

MIT — Use it, fork it, ship with it. 🚀


Now go build something awesome. 🦸

About

A starter kit for building apps using the Ralph methodology — autonomous AI coding loops that ship features while you sleep.

Resources

Stars

Watchers

Forks

Languages