一键导入
ralph
Ralph Wiggum methodology for autonomous agentic development. Use when setting up a new Ralph task, preparing specs, or troubleshooting Ralph loops.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Ralph Wiggum methodology for autonomous agentic development. Use when setting up a new Ralph task, preparing specs, or troubleshooting Ralph loops.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Start a detached zellij session for a tracker-linked or natural-language task, and launch Codex or Claude as the default shell with an initial `$start-new-task ...` handoff prompt.
Initialize a new task folder with status.md, user_inputs/initial.md, user_inputs/input_artifacts/, task-progress-artifacts/, and task-progress-artifacts/scratchpad/. Supports GitHub issue URL inputs, Linear issue URL inputs, default Linear issue creation for trackerless starts, tracker-informed slugs, and machine/zellij metadata capture with optional live-session issue block sync.
Initialize a new task folder with status.md, user_inputs/initial.md, user_inputs/input_artifacts/, task-progress-artifacts/, and task-progress-artifacts/scratchpad/. Supports GitHub issue URL inputs, Linear issue URL inputs, default Linear issue creation for trackerless starts, tracker-informed slugs, and machine/zellij metadata capture with optional live-session issue block sync.
Rename Codex app thread labels and titles in local Codex state. Use when a user asks to rename, retitle, relabel, or make a Codex chat/thread easier to find in the Codex app sidebar or thread list, especially when the visible label still shows the first prompt such as "$start-new-task ZON-218".
Create compact Codex `/goal` plan files that require an implementation loop with Oracle GPT-5.5 Pro review between iterations. Use when the user wants a goal plan that explicitly sequences implementation, strongest-model Oracle review, rework from Oracle findings, repeated review until no material changes remain, and final verification.
Create a Linear ticket and immediately launch a detached zellij/Codex worker session for it. Use when the user asks to "create a ticket and start a session", "make a Linear task and $start-zellij-session-for-task", spin up a side worker for a new task, or repeat the common parent-orchestrator flow of drafting a scoped issue, linking it to a parent lane, and starting `$start-new-task ISSUE-ID`.
| name | Ralph |
| description | Ralph Wiggum methodology for autonomous agentic development. Use when setting up a new Ralph task, preparing specs, or troubleshooting Ralph loops. |
| source | personal |
Ralph is a technique for autonomous agentic software development using LLMs in a deterministic loop. Named after the naive character from The Simpsons, Ralph represents giving an AI minimal planning ability and maximum execution autonomy.
The orchestrator session prepares the loop. The loop agent does the work.
When a plan involves a Ralph loop, do NOT implement the code changes yourself. Your job is to create the Ralph infrastructure files (PROMPT.md, AGENT.md, fix_plan.md, specs/, run-ralph.sh) and hand off to the user to run the loop. The loop agent — spawned fresh each iteration by run-ralph.sh — reads PROMPT.md, picks the next incomplete task from fix_plan.md, implements it, validates, commits, and loops.
Blame Yourself, Not Ralph: If Ralph does something wrong, look at your prompts, specs, and instructions. "Tune Ralph like a guitar."
One Thing Per Loop: Ralph does ONE task per iteration. If things go off the rails, narrow to one item.
Trust Eventual Consistency: Every problem created by AI can be resolved through a different series of prompts.
LLMs Are Mirrors: The quality of Ralph's output reflects the quality of your specs and prompts.
When NOT to use Ralph:
Ralph allocates these files as persistent context every loop:
The current task/instruction for Ralph. This is where you "tune Ralph" by adding guidance (signs).
Important: if your loop uses a completion promise string, include that exact string only once in PROMPT.md. Repeating the same promise text in multiple sections can cause false-positive completion detection when a runner echoes the prompt.
Instructions on HOW to build, run, and test the project:
Key: Ralph updates this file when learning new commands.
Bullet-point list of items sorted by priority:
- [ ] for pending tasks- [x] for completed tasksRalph keeps this updated. Delete and regenerate when stale.
One file per feature/module. Each spec contains:
Key insight: Specs are formed through conversation, not written in isolation.
Ralph cycles through three phases (repeat forever):
Specs are the most critical input. Bad specs = bad output.
Process:
Spec structure:
# Feature: [Name]
## Purpose
[What this feature does]
## Function Signatures
[Full typed signatures]
## Requirements
[Specific requirements, library versions, GPU needs, etc.]
## Reference Code
[Working code from tested notebook/implementation]
## Expected Behavior
[Input/output examples]
When Ralph goes wrong, add "signs" to PROMPT.md:
| Problem | Sign to Add |
|---|---|
| Placeholder implementations | "DO NOT IMPLEMENT PLACEHOLDER IMPLEMENTATIONS. WE WANT FULL IMPLEMENTATIONS." |
| Wrong assumptions | "Before making changes, search codebase using parallel subagents. Don't assume code doesn't exist." |
| Priority confusion | "Choose the most important incomplete item from fix_plan.md" |
| Forgetting context | "Capture test importance in comments explaining WHY the test exists" |
| Excessive changes | "Only modify files related to the current task" |
Create staging folder in your instructions directory:
orchestration/instructions/daily/YYYY-MM-DD/<project>/<task>/staging/
Copy templates from ~/.codex/skills/ralph/templates/
Write specs through conversation:
Fill AGENT.md with project-specific commands:
Keep the completion promise single-sourced:
PROMPT.mdGenerate run-ralph.sh (see Running Ralph below) or use the ralph-loop plugin
Copy staging to target and run (see Orchestrator Workflow below)
This skill is designed for the orchestrator session (Personal OS) to prepare Ralph tasks for execution in target Claude Code sessions.
┌─────────────────────────────────────────────────────────────┐
│ ORCHESTRATOR (Personal OS) │
│ │
│ 1. Brainstorm with user to make task ralph-able │
│ 2. Create staging/ folder with AGENT.md, PROMPT.md, │
│ fix_plan.md, specs/ │
│ 3. Generate run-ralph.sh (or plan to use ralph-loop) │
│ 4. Copy staging to target codebase │
│ 5. Provide execution command to user │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ TARGET SESSION (in codebase folder) │
│ │
│ Option A: ./run-ralph.sh codex|claude [max_iterations] │
│ Option B: /ralph-loop "$(cat PROMPT.md)" ... │
│ Ralph iterates: generate → test → commit → repeat │
└─────────────────────────────────────────────────────────────┘
Ask the user:
Create a staging folder in the instructions directory:
orchestration/instructions/daily/YYYY-MM-DD/<project>/<task>/staging/
├── AGENT.md
├── PROMPT.md
├── fix_plan.md
├── run-ralph.sh (if using loop script)
└── specs/
└── feature.md
Use templates from ~/.codex/skills/ralph/templates/ as starting point.
Local codebase:
cp -r staging/* /path/to/target/codebase/
Remote VM (via scp):
scp -r staging/* user@hostname:/path/to/target/codebase/
# Example for GPU VM
scp -r staging/* ladduu-dev-ml-vm:~/pro/zone-analytics/
Based on the execution environment, provide the appropriate command:
Option A: Loop script (unattended/remote execution)
cd /path/to/target/codebase
chmod +x run-ralph.sh
./run-ralph.sh codex # or: ./run-ralph.sh claude
Option B: Ralph-loop plugin (interactive Claude Code session)
cd /path/to/target/codebase
/ralph-loop "$(cat PROMPT.md)" --max-iterations 30 --completion-promise "TASK_COMPLETE"
There are three ways to execute a Ralph loop. Choose based on your environment and needs:
| Execution Path | Best For | Engine |
|---|---|---|
| Loop script (Codex) | Unattended remote runs, overnight execution | codex CLI |
| Loop script (Claude Code) | Unattended remote runs, overnight execution | claude CLI |
| Ralph-loop plugin | Interactive Claude Code sessions, local development | Built-in plugin |
A bash script that pipes PROMPT.md to the chosen engine in a loop with promise detection.
Generating the script:
When the user invokes this skill to create a Ralph task, determine which variant to generate based on their phrasing:
| User says | Generate |
|---|---|
| "with codex" / "using codex" | Codex-only script: RUN_CMD hardcoded, ./run-ralph.sh [max_iterations] |
| "with claude code" / "with claude" / "using claude" | Claude-only script: RUN_CMD hardcoded, ./run-ralph.sh [max_iterations] |
| No preference / ambiguous | Dual-engine script: ./run-ralph.sh <codex|claude> [max_iterations] |
Dual-engine template is at ~/.codex/skills/ralph/templates/run-ralph.sh.
Template variables to fill in:
{{TASK_NAME}} - Human-readable task name (e.g., "ZonEye Backend Alerts"){{WORKDIR}} - Absolute path to target codebase working directory{{COMPLETION_PROMISE}} - Promise string from PROMPT.md (e.g., "PROMISE_FULFILLED: ZONEYE_BACKEND_ALERTS_COMPLETE"){{LOG_FILE}} - Log filename (e.g., "ralph-backend.log"){{MAX_ITERATIONS_DEFAULT}} - Default iteration count (e.g., 20)Promise detection threshold differs by engine:
PROMISE_THRESHOLD=2.-p does NOT echo the prompt — only the AI's response is output. The promise string appears once. Threshold: PROMISE_THRESHOLD=1.The dual-engine template handles this automatically via the PROMISE_THRESHOLD variable set in the engine case block. For single-engine variants, hardcode the appropriate threshold.
For single-engine variants, simplify the template:
RUN_CMD to the appropriate command:
codex --dangerously-bypass-approvals-and-sandbox execclaude --dangerously-skip-permissions -pPROMISE_THRESHOLD to the appropriate value:
PROMISE_THRESHOLD=2PROMISE_THRESHOLD=1./run-ralph.sh [max_iterations] with MAX_ITERATIONS="${1:-$MAX_ITERATIONS_DEFAULT}"For interactive Claude Code sessions, use the built-in plugin:
# In target codebase directory
/ralph-loop "$(cat PROMPT.md)" --max-iterations 30 --completion-promise "PROMISE_TEXT"
Options:
--max-iterations N: Safety limit (default: 30)--completion-promise "TEXT": Stop when Ralph outputs this text/cancel-ralph to stop earlyThis is the recommended approach when you're actively working in a Claude Code session and want plugin-level safety controls and monitoring.
git reset --hard and restartgit reset --hard to last good commitdeno check / tsc may not be available on the target machineEnd PROMPT.md with a "promise" - a keyword Ralph outputs when done:
When all items in fix_plan.md are complete, respond with: TASK_COMPLETE
templates/ directory in this skill