setup-ralph
Set up and configure Geoffrey Huntley's original Ralph Wiggum autonomous coding loop in any directory with proper structure, prompts, and backpressure.
- License 许可
- MIT
- 最近更新
- 2026-10-24
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- setup-ralph
- description
- Set up and configure Geoffrey Huntley's original Ralph Wiggum autonomous coding loop in any directory with proper structure, prompts, and backpressure.
02 资源文件 17
- 许可证LICENSE1.0 KB
- 参考文档origin.yaml778 B
- 参考文档README.md4.4 KB
- 参考文档references/operational-learnings.md10.9 KB
- 参考文档references/project-structure.md6.3 KB
- 参考文档references/prompt-design.md10.0 KB
- 参考文档references/ralph-fundamentals.md6.9 KB
- 参考文档references/validation-strategy.md8.7 KB
- 其他templates/Dockerfile793 B
- 脚本templates/loop-docker.sh6.4 KB
- 脚本templates/loop.sh16.7 KB
- 参考文档templates/PROMPT_build.md3.0 KB
- 参考文档templates/PROMPT_plan.md1.5 KB
- 参考文档workflows/customize-loop.md5.1 KB
- 参考文档workflows/setup-new-loop.md7.9 KB
- 参考文档workflows/troubleshoot-loop.md5.9 KB
- 参考文档workflows/understand-ralph.md6.9 KB
03 SKILL.md 正文
Learnings (Maintainer): bekannte Probleme/Erkenntnisse zu diesem Skill in
docs/skill-learnings.md→ Sektion „setup-ralph".
<essential_principles>
What is Ralph?
Ralph is Geoffrey Huntley's autonomous AI coding methodology that uses iterative loops with task selection, execution, and validation. In its purest form, it's a Bash loop:
while :; do cat PROMPT.md | claude ; done
The loop feeds a prompt file to Claude, the agent completes one task, updates the implementation plan, commits changes, then exits. The loop restarts immediately with fresh context.
Core Philosophy
The Ralph Wiggum Technique is deterministically bad in an undeterministic world. Ralph solves context accumulation by starting each iteration with fresh context—the core insight behind Geoffrey's approach.
Three Phases, Two Prompts, One Loop
- Planning Phase: Gap analysis (specs vs code) outputs prioritized TODO list—no implementation, no commits
- Building Phase: Picks tasks from plan, implements, runs tests (backpressure), commits
- Observation Phase: You sit on the loop, not in it—engineer the setup and environment that allows Ralph to succeed
Key Principles
Your Role: Ralph does all the work, including deciding which planned work to implement next and how to implement it. Your job is to engineer the environment.
Backpressure: Create backpressure via tests, typechecks, lints, builds that reject invalid/unacceptable work.
Observation: Watch, especially early on. Prompts evolve through observed failure patterns.
Context Efficiency: With ~176K usable tokens from 200K window, allocating 40-60% to "smart zone" means tight tasks with one task per loop achieves maximum context utilization.
File I/O as State: The plan file persists between isolated loop executions, serving as deterministic shared state—no sophisticated orchestration needed.
Remote Backup: The loop automatically creates a private GitHub repo and pushes after each commit. This protects against accidental data loss from autonomous operations. Requires gh CLI authenticated. Disable with RALPH_BACKUP=false.
Safety Rules: PROMPT_build.md includes critical safety rules prohibiting dangerous operations like rm -rf on project directories. Tests must run in isolated temp directories.
</essential_principles>
<intake> What would you like to do?
- Set up a new Ralph loop - Initialize Ralph structure in a directory
- Understand Ralph concepts - Learn about the technique and how it works
- Customize existing loop - Modify prompts or configuration
- Troubleshoot Ralph - Debug loop issues or improve performance
Wait for response before proceeding. </intake>
<routing>
| Response | Workflow |
|---|---|
| 1, "set up", "setup", "new", "initialize", "create" | workflows/setup-new-loop.md |
| 2, "understand", "learn", "concepts", "explain", "how" | workflows/understand-ralph.md |
| 3, "customize", "modify", "change", "update", "edit" | workflows/customize-loop.md |
| 4, "troubleshoot", "debug", "fix", "problem", "issue" | workflows/troubleshoot-loop.md |
| Other | Clarify intent, then select appropriate workflow |
After reading the workflow, follow it exactly. </routing>
<reference_index>
Domain Knowledge
All in references/:
Core Concepts: ralph-fundamentals.md - Three phases, two prompts, one loop Structure: project-structure.md - Required files and directory layout Prompts: prompt-design.md - Planning vs building mode instructions Backpressure: validation-strategy.md - Tests, lints, builds as steering Best Practices: operational-learnings.md - AGENTS.md guidance and evolution </reference_index>
<workflows_index>
| Workflow | Purpose |
|---|---|
| setup-new-loop.md | Initialize Ralph structure in a directory |
| understand-ralph.md | Learn Ralph concepts and philosophy |
| customize-loop.md | Modify prompts or loop configuration |
| troubleshoot-loop.md | Debug loop issues and improve performance |
| </workflows_index> |
<success_criteria> Skill is successful when:
- User understands which workflow they need
- Appropriate workflow loaded based on intent
- All required references loaded by workflow
- User can set up and run Ralph loops independently </success_criteria>
04 同仓库更多 Skills
debug-like-expert
Deep analysis debugging mode for complex issues. Activates methodical investigation protocol with evidence gathering, hypothesis testing, and rigorous verification. Use when standard troubleshooting fails or when issues require systematic root cause analysis.
create-subagents
Expert guidance for creating, building, and using Claude Code subagents and the Task tool. Use when working with subagents, setting up agent configurations, understanding how agents work, or using the Task tool to launch specialized agents.
create-slash-commands
Expert guidance for creating Claude Code slash commands. Use when working with slash commands, creating custom commands, understanding command structure, or learning YAML configuration.
create-plans
Create hierarchical project plans optimized for solo agentic development. Use when planning projects, phases, or tasks that Claude will execute. Produces Claude-executable plans with verification criteria, not enterprise documentation. Handles briefs, roadmaps, phase plans, and context handoffs.
create-meta-prompts
Create optimized prompts for Claude-to-Claude pipelines with research, planning, and execution stages. Use when building prompts that produce outputs for other prompts to consume, or when running multi-stage workflows (research -> plan -> implement).
create-agent-skills
Expert guidance for creating, writing, building, and refining Claude Code Skills. Use when working with SKILL.md files, authoring new skills, improving existing skills, or understanding skill structure and best practices.