← 开源
snarktank

ralph

Ralph is an autonomous AI agent loop that runs repeatedly until all PRD items are complete.

ApplicationsCodingTypeScript
在 GitHub 打开
增长势头
+1324 小时新增 Star+0.1%
22.0k
Star
2.10k
Fork
+44
本周
4
贡献者
创建于 2026-01-07 · 更新于 2026-10-16 · 今日第 1053 名
主要开发者
snarktankdenen99manav148

snarktank/ralph 排名第 1,053,有 21,979 个星标。

同类别比较

snarktank/ralph 排名第 1,053,此处有 8 个同类条目;QuantConnect/Lean 排名第 1,052。

同类别比较
名称排名指标
OthmanAdi/planning-with-files1,047
语言:
Python
星标数:
27,476
分叉数:
2,277
简介:
Persistent file-based planning for AI coding agents and long-running tasks. Crash-proof markdown plans, session recovery after /clear and compaction, per-turn re-injection against context rot, deterministic completion gate. Manus-style. Install from npm, the Claude Code plugin marketplace, or npx skills. Codex, Cursor, OpenCode, 60+ agents.
wandb/openui1,049
语言:
TypeScript
星标数:
22,609
分叉数:
2,058
简介:
OpenUI let's you describe UI using your imagination, then see it rendered live.
k4yt3x/video2x1,051
语言:
C++
星标数:
22,276
分叉数:
1,944
简介:
A machine learning-based video super resolution and frame interpolation framework. Est. Hack the Valley II, 2018.
QuantConnect/Lean1,052
语言:
C#
星标数:
22,031
分叉数:
5,308
简介:
Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
Huanshere/VideoLingo1,054
语言:
Python
星标数:
18,816
分叉数:
2,080
简介:
Netflix-level subtitle cutting, translation, alignment, and even dubbing - one-click fully automated AI video subtitle team | Netflix级字幕切割、翻译、对齐、甚至加上配音,一键全自动视频搬运AI字幕组
UFund-Me/Qbot1,055
语言:
Jupyter Notebook
星标数:
18,677
分叉数:
2,610
简介:
[🔥updating ...] AI 自动量化交易机器人(完全本地部署) AI-powered Quantitative Investment Research Platform. 📃 online docs: https://ufund-me.github.io/Qbot ✨ :news: qbot-mini: https://github.com/Charmve/iQuant
web-infra-dev/midscene1,058
语言:
TypeScript
星标数:
15,304
分叉数:
1,200
简介:
See interfaces like a human. E2E testing in natural language.
siteboon/claudecodeui1,060
语言:
TypeScript
星标数:
14,117
分叉数:
2,043
简介:
Use Claude Code, OpenCode, Cursor CLI, and Codex on mobile and web with CloudCLI (aka Claude Code UI). CloudCLI is a free open source webui/GUI that helps you manage your Claude Code session and projects remotely.
关键参数与规格
关键参数与规格
参数值
语言TypeScript
类别Applications
子类别Coding
星标数21,979
分叉数2,096
贡献者4
创建日期2026-01-07
更新日期2026-10-16
1 天星标数13
7 天星标数44
排名1,053
上次排名1,185
排名变化132
7 天星标排名1,691
上次 7 天星标排名1,892
7 天星标排名变化201
总星标排名656
上次总星标排名656
总星标排名变化0
README 摘录

Ralph Ralph is an autonomous AI agent loop that runs AI coding tools (Amp or Claude Code) repeatedly until all PRD items are complete. Each iteration is a fresh instance with clean context. Memory persists via git history, , and . Based on Geoffrey Huntley's Ralph pattern. Read my in-depth article on how I use Ralph Prerequisites One of the following AI coding tools installed and authenticated: Amp CLI (default) Claude Code ( ) installed ( on macOS) A git repository for your project

Setup Option 1: Copy to your project Copy the ralph files into your project: Option 2: Install skills globally (Amp) Copy the skills to your Amp or Claude config for use across all projects: For AMP For Claude Code (manual) Option 3: Use as Claude Code Marketplace Add the Ralph marketplace to Claude Code: Then install the skills: Available skills after installation: - Generate Product Requirements Documents - Convert PRDs to prd. json format Skills are automatically invoked when you ask Claude

to: "create a prd", "write prd for", "plan this feature" "convert this prd", "turn into ralph format", "create prd. json" Configure Amp auto-handoff (recommended) Add to : This enables automatic handoff when context fills up, allowing Ralph to handle large stories that exceed a single context window. Create a PRD Use the PRD skill to generate a detailed requirements document: Answer the clarifying questions. Convert PRD to Ralph format Use the Ralph skill to convert the markdown PRD to JSON

: This creates with user stories structured for autonomous execution. Pick the highest priority story where 3. Run quality checks (typecheck, tests) 5. To run locally: Critical Concepts Each Iteration = Fresh Context Each iteration spawns a **new AI instance** (Amp or Claude Code) with clean context. The only memory between iterations is: Git history (commits from previous iterations) (learnings and context) (which stories are done) Small Tasks 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. Right-sized stories: Add a database column and migration Add a UI component to an existing page Update a server action with new logic Add a filter dropdown to a list Too big (split these): "Build the entire dashboard" "Add authentication" "Refactor the API" AGENTS. md Updates Are Critical After each iteration, Ralph updates the relevant files with learnings. This is key because

AI coding tools automatically read these files, so future iterations (and future human developers) benefit from discovered patterns, gotchas, and conventions. md: Patterns discovered ("this codebase uses X for Y") Gotchas ("do not forget to update Z when changing W") Useful context ("the settings panel is in component X") Feedback Loops Ralph only works if there are feedback loops: Typecheck catches type errors Tests verify behavior CI must stay green (broken code compounds across iterations) Browser Verification for UI Stories

Frontend stories must include "Verify in browser using dev-browser skill" in acceptance criteria. Ralph will use the dev-browser

常见问题

记录了多少星标和分叉?

snarktank/ralph 有 21,979 个星标和 2,096 个分叉。

仓库排名是多少?

snarktank/ralph 排名第 1,053。

记录的语言和类别是什么?

snarktank/ralph 有 21,979 个星标,语言为 TypeScript,类别为 Applications。

哪个仓库排名最接近?

snarktank/ralph 与 QuantConnect/Lean 比较,后者排名第 1,052,有 22,031 个星标。

README

Ralph

Ralph is an autonomous AI agent loop that runs AI coding tools (Amp or Claude Code) repeatedly until all PRD items are complete. Each iteration is a fresh instance with clean context. Memory persists via git history, progress.txt, and prd.json.

Based on Geoffrey Huntley's Ralph pattern.

Read my in-depth article on how I use Ralph

Prerequisites

  • One of the following AI coding tools installed and authenticated:
  • jq installed (brew install jq on macOS)
  • A git repository for your project

Setup

Option 1: Copy to your project

Copy the ralph files into your project:

# From your project root
mkdir -p scripts/ralph
cp /path/to/ralph/ralph.sh scripts/ralph/

# Copy the prompt template for your AI tool of choice:
cp /path/to/ralph/prompt.md scripts/ralph/prompt.md    # For Amp
# OR
cp /path/to/ralph/CLAUDE.md scripts/ralph/CLAUDE.md    # For Claude Code

chmod +x scripts/ralph/ralph.sh

Option 2: Install skills globally (Amp)

Copy the skills to your Amp or Claude config for use across all projects:

For AMP

cp -r skills/prd ~/.config/amp/skills/
cp -r skills/ralph ~/.config/amp/skills/

For Claude Code (manual)

cp -r skills/prd ~/.claude/skills/
cp -r skills/ralph ~/.claude/skills/

Option 3: Use as Claude Code Marketplace

Add the Ralph marketplace to Claude Code:

/plugin marketplace add snarktank/ralph

Then install the skills:

/plugin install ralph-skills@ralph-marketplace

Available skills after installation:

  • /prd - Generate Product Requirements Documents
  • /ralph - Convert PRDs to prd.json format

Skills are automatically invoked when you ask Claude to:

  • "create a prd", "write prd for", "plan this feature"
  • "convert this prd", "turn into ralph format", "create prd.json"

Configure Amp auto-handoff (recommended)

Add to ~/.config/amp/settings.json:

{
  "amp.experimental.autoHandoff": { "context": 90 }
}

This enables automatic handoff when context fills up, allowing Ralph to handle large stories that exceed a single context window.

Workflow

1. Create a PRD

Use the PRD skill to generate a detailed requirements document:

Load the prd skill and create a PRD for [your feature description]

Answer the clarifying questions. The skill saves output to tasks/prd-[feature-name].md.

2. Convert PRD to Ralph format

Use the Ralph skill to convert the markdown PRD to JSON:

Load the ralph skill and convert tasks/prd-[feature-name].md to prd.json

This creates prd.json with user stories structured for autonomous execution.

3. Run Ralph

# Using Amp (default)
./scripts/ralph/ralph.sh [max_iterations]

# Using Claude Code
./scripts/ralph/ralph.sh --tool claude [max_iterations]

Default is 10 iterations. Use --tool amp or --tool claude to select your AI coding tool.

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 (typecheck, tests)
  5. Commit if checks pass
  6. Update prd.json to mark story as passes: true
  7. Append learnings to progress.txt
  8. Repeat until all stories pass or max iterations reached

Key Files

File Purpose
ralph.sh The bash loop that spawns fresh AI instances (supports --tool amp or --tool claude)
prompt.md Prompt template for Amp
CLAUDE.md Prompt template for Claude Code
prd.json User stories with passes status (the task list)
prd.json.example Example PRD format for reference
progress.txt Append-only learnings for future iterations
skills/prd/ Skill for generating PRDs (works with Amp and Claude Code)
skills/ralph/ Skill for converting PRDs to JSON (works with Amp and Claude Code)
.claude-plugin/ Plugin manifest for Claude Code marketplace discovery
flowchart/ Interactive visualization of how Ralph works

Flowchart

View Interactive Flowchart - Click through to see each step with animations.

The flowchart/ directory contains the source code. To run locally:

cd flowchart
npm install
npm run dev

Critical Concepts

Each Iteration = Fresh Context

Each iteration spawns a new AI instance (Amp or Claude Code) with clean context. The only memory between iterations is:

  • Git history (commits from previous iterations)
  • progress.txt (learnings and context)
  • prd.json (which stories are done)

Small Tasks

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.

Right-sized stories:

  • Add a database column and migration
  • Add a UI component to an existing page
  • Update a server action with new logic
  • Add a filter dropdown to a list

Too big (split these):

  • "Build the entire dashboard"
  • "Add authentication"
  • "Refactor the API"

AGENTS.md Updates Are Critical

After each iteration, Ralph updates the relevant AGENTS.md files with learnings. This is key because AI coding tools automatically read these files, so future iterations (and future human developers) benefit from discovered patterns, gotchas, and conventions.

Examples of what to add to AGENTS.md:

  • Patterns discovered ("this codebase uses X for Y")
  • Gotchas ("do not forget to update Z when changing W")
  • Useful context ("the settings panel is in component X")

Feedback Loops

Ralph only works if there are feedback loops:

  • Typecheck catches type errors
  • Tests verify behavior
  • CI must stay green (broken code compounds across iterations)

Browser Verification for UI Stories

Frontend stories must include "Verify in browser using dev-browser skill" in acceptance criteria. Ralph will use the dev-browser skill to navigate to the page, interact with the UI, and confirm changes work.

Stop Condition

When all stories have passes: true, Ralph outputs COMPLETE and the loop exits.

Debugging

Check current state:

# See which stories are done
cat prd.json | jq '.userStories[] | {id, title, passes}'

# See learnings from previous iterations
cat progress.txt

# Check git history
git log --oneline -10

Customizing the Prompt

After copying prompt.md (for Amp) or CLAUDE.md (for Claude Code) to your project, customize it for your project:

  • Add project-specific quality check commands
  • Include codebase conventions
  • Add common gotchas for your stack

Archiving

Ralph automatically archives previous runs when you start a new feature (different branchName). Archives are saved to archive/YYYY-MM-DD-feature-name/.

References

排名相邻
同类项目