ralph-loop
Skill7 starsChanged 5 months agoMITView on GitHub
Ralph Loop — 防止 AI 提前结束未完成任务的循环机制。本质是一个 bash 循环脚本, 每次迭代启动一个全新的 AI 实例(干净上下文),从 PRD 里挑出未完成的任务、 实现它、跑测试、通过则提交并标记完成,然后把关键信息写进 progress.txt。 持续循环直到所有任务完成。每轮全新上下文,避免传统对话中上下文臃肿导致的质量下降。 Trigger keywords: ralph loop, 循环开发, 自动迭代, 持续开发, 上下文隔离, 批量任务, PRD驱动开发, 自动化开发循环, 迭代开发, ralph, progress.txt, 自动完成任务, 持续集成开发。
26 other projects use a version of this.
Adopted by
Most recently taken up by
- shawnclybor/clybor-claude-toolingtheir own version, first seen Nov 8, 2026
- belumume/claude-skillstheir own version, first seen Nov 3, 2026
- burakkaygusuz/ralph-wiggumtheir own version, first seen Nov 1, 2026
- harness-mini/harness-minitheir own version, first seen Nov 1, 2026
- cornch-k/batontheir own version, first seen Nov 1, 2026
- boyingliu01/xp-gatetheir own version, first seen Oct 25, 2026
Used with
Projects with it also use to-issues and review.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.Other versions26 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 26
- mikeyobrien/ralph-orchestrator★ 3.2ksame name
- zrosenfield/sharepoint-ai-skills★ 96same name
- dannys-code-corner/incan★ 73same name
- yylo-dev/yylo★ 66same name
- regression-io/coder-config★ 47same name
- belumume/claude-skills★ 46same name
- xfstudio/skills★ 9same name
- mnzralee/claude-multi-agent-architecture★ 8same name
- shyamsridhar123/kevin-copilot★ 7same name
- carlkibler/agent-skills★ 6same name
16 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository129 other files it gives its agents.
- last30days-skill/AGENTS.mdAGENTS.md
- tutor/AGENTS.mdAGENTS.md
- vercel-labs-skills/AGENTS.mdAGENTS.md
- baoyu-skills/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- claude-to-im-skill/CLAUDE.mdCLAUDE.md
- html-video/CLAUDE.mdCLAUDE.md
- last30days-skill/CLAUDE.mdCLAUDE.md
- ui-ux-pro-max-skill/CLAUDE.mdCLAUDE.md
- academic-research-skillsSkill
- agency-agents-zhSkill
- algorithmic-artSkill
- animation-craftSkill
- apple-designSkill
- archifySkill
- architecture-diagramSkill
- article-posterSkill
- baokuan-title-generatorSkill
- baoyu-skillsSkill
- brand-workshopSkill
- canvas-designSkill
- cc-dispatchSkill
- claude-to-imSkill
- code-reviewSkill
- code-simplifierSkill
- codex-claude-pmSkill
- comprehensive-thinkingSkill
- context7Skill
- creator-buddySkill
- dashi-pptSkill
- dbskillSkill
- design-buddySkill
- dog-frontierSkill
- dog-posterSkill
- dog-pptSkill
- Dog-Project-EvaluateSkill
- dog-tutorSkill
- emil-design-engSkill
- excalidraw-diagramSkill
- family-doctorSkill
- feynman-learningSkill
- fireworks-tech-graphSkill
- first-principlesSkill
- ghostwriterSkill
- gpt-researcherSkill
- handshakeSkill
- html-videoSkill
- huashu-agent-swarmSkill
- huashu-article-editSkill
- huashu-article-to-xSkill
- huashu-data-proSkill
- huashu-designSkill
- huashu-douyin-scriptSkill
- huashu-image-uploadSkill
- huashu-info-searchSkill
- huashu-material-searchSkill
- huashu-md-to-pdfSkill
- huashu-prompt-saveSkill
- huashu-proofreadingSkill
- huashu-researchSkill
- The first 60 shown.
The file
Files
Ralph Loop — 防止 AI 提前结束任务的循环机制
Ralph Loop 干的事非常单一:如果 AI 想提前结束还没完成的任务,它会拦截并退回给 AI 重新处理,直到任务真正开发完成。
核心原理
┌─────────────────────────────────────────────┐
│ Ralph Loop │
│ │
│ ① 读取 PRD → 挑出未完成的任务 │
│ ↓ │
│ ② 启动全新 AI 实例(干净上下文) │
│ ↓ │
│ ③ 实现任务 → 跑测试 → 通过 → 提交 │
│ ↓ │
│ ④ 标记完成 → 关键信息写入 progress.txt │
│ ↓ │
│ ⑤ 检查是否所有任务完成? │
│ ├─ 否 → 回到 ① │
│ └─ 是 → 结束 │
└─────────────────────────────────────────────┘为什么有效
上下文隔离是关键
传统对话中 AI 的上下文会越来越臃肿,输出质量断崖式下降。Ralph 每轮都是全新上下文,没有历史包袱,只看:
- 当前任务
progress.txt里的关键信息
这种"干净启动"保证了每一轮的质量一致性。
安装
git clone https://github.com/snarktank/ralph.git
cp -r ralph/scripts ./
./scripts/ralph/ralph.sh前置条件(必须!)
- PRD story 足够小:每个 story 必须小到一个上下文窗口能完成。太大了 AI 会跑偏。
- 项目必须配 typecheck 和测试:没有反馈回路的话,AI 写出来的东西会越跑越歪。
- 每个 story 有明确的验收标准:AI 需要知道自己做完了没有。
使用建议
- 适合大项目:几十个 story 的自动化迭代
- 不适合小需求:配置成本高于直接让 Claude Code 做
- CI 集成:可以放入 CI 流水线,让 AI 在无人值守下持续开发
风险提示
- 没有人工审查环节,代码质量依赖测试覆盖率和 typecheck
- 如果 PRD 写得不清楚,AI 可能越做越偏
- 建议配合 Code Review 和 Code Simplifier 使用,在提交前加质量门
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

