ralph 通过在循环中运行 AI 编码工具并不断刷新上下文,自主完成软件开发需求,在质量检查通过后才提交代码。该项目针对 LLM 在处理大型任务时因上下文耗尽导致代码质量下降的问题。
项目概览
每次迭代启动全新 AI 实例并通过 git 历史和进度文件保持记忆,从机制上规避了单次上下文窗口耗尽的问题,使自主完成多步骤开发任务成为可能。
项目类型
AI Agent · AI 编程
应用场景
编程开发 · 自动化执行
部署方式
查看项目说明
License
MIT
适合谁
需要利用 AI 自主完成已拆分为较小条目的多步骤软件开发需求的开发者。
核心能力
反复运行 AI 编码工具,直到 PRD 中的所有条目完成或达到最大迭代次数。
通过 git 历史、progress.txt 和 prd.json 在迭代之间维持记忆。
包含生成产品需求文档并将其转换为结构化 JSON 格式以供自主执行的技能。
在每次迭代期间运行类型检查和测试,以验证行为并保持 CI 通过状态。
限制与风险
每个 PRD 条目必须足够小,以确保能在单个上下文窗口内完成。
需要类型检查、测试和 CI 等反馈循环正常工作才能正确运行。
如果 CI 未保持通过状态,有问题的代码会在迭代之间累积叠加。
如何开始
安装 Amp 或 Claude Code 及 jq,将 ralph.sh 和提示文件复制到项目中,使用技能创建 PRD 并转换为 prd.json,最后运行 ./scripts/ralph/ralph.sh。整体配置难度中等,需安装外部 AI 编码工具、配置项目文件并使用终端命令。
核验依据
README: Ralph is an autonomous AI agent loop that runs AI coding tools ([Amp](https://ampcode.com) or [Claude Code](https://docs.anthropic.com/en/docs/claude-code)) repeatedly until all P…
README: Each PRD item should be small enough to complete in one context window. If a task is too big, the LLM runs out of context before finishing and produces poor code.
GitHub 项目简介: Ralph is an autonomous AI agent loop that runs repeatedly until all PRD items are complete.
README: Ralph will: 1. Create a feature branch (from PRD `branchName`) 2. Pick the highest priority story where `passes: false` 3. Implement that single story 4. Run quality checks (typec…
README: - One of the following AI coding tools installed and authenticated: - [Amp CLI](https://ampcode.com) (default) - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (`np…