[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-3771":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":15,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},3771,"ralph","snarktank\u002Fralph","snarktank","Ralph is an autonomous AI agent loop that runs repeatedly until all PRD items are complete. ","https:\u002F\u002Fx.com\u002Fryancarson\u002Fstatus\u002F2008548371712135632",null,"TypeScript",20147,1990,107,33,0,223,1241,178,44.9,"MIT License",false,"main",true,[],"2026-06-12 02:00:54","# Ralph\n\n![Ralph](ralph.webp)\n\nRalph is an autonomous AI agent loop that runs AI coding tools ([Amp](https:\u002F\u002Fampcode.com) or [Claude Code](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-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`.\n\nBased on [Geoffrey Huntley's Ralph pattern](https:\u002F\u002Fghuntley.com\u002Fralph\u002F).\n\n[Read my in-depth article on how I use Ralph](https:\u002F\u002Fx.com\u002Fryancarson\u002Fstatus\u002F2008548371712135632)\n\n## Prerequisites\n\n- One of the following AI coding tools installed and authenticated:\n  - [Amp CLI](https:\u002F\u002Fampcode.com) (default)\n  - [Claude Code](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code) (`npm install -g @anthropic-ai\u002Fclaude-code`)\n- `jq` installed (`brew install jq` on macOS)\n- A git repository for your project\n\n## Setup\n\n### Option 1: Copy to your project\n\nCopy the ralph files into your project:\n\n```bash\n# From your project root\nmkdir -p scripts\u002Fralph\ncp \u002Fpath\u002Fto\u002Fralph\u002Fralph.sh scripts\u002Fralph\u002F\n\n# Copy the prompt template for your AI tool of choice:\ncp \u002Fpath\u002Fto\u002Fralph\u002Fprompt.md scripts\u002Fralph\u002Fprompt.md    # For Amp\n# OR\ncp \u002Fpath\u002Fto\u002Fralph\u002FCLAUDE.md scripts\u002Fralph\u002FCLAUDE.md    # For Claude Code\n\nchmod +x scripts\u002Fralph\u002Fralph.sh\n```\n\n### Option 2: Install skills globally (Amp)\n\nCopy the skills to your Amp or Claude config for use across all projects:\n\nFor AMP\n```bash\ncp -r skills\u002Fprd ~\u002F.config\u002Famp\u002Fskills\u002F\ncp -r skills\u002Fralph ~\u002F.config\u002Famp\u002Fskills\u002F\n```\n\nFor Claude Code (manual)\n```bash\ncp -r skills\u002Fprd ~\u002F.claude\u002Fskills\u002F\ncp -r skills\u002Fralph ~\u002F.claude\u002Fskills\u002F\n```\n\n### Option 3: Use as Claude Code Marketplace\n\nAdd the Ralph marketplace to Claude Code:\n\n```bash\n\u002Fplugin marketplace add snarktank\u002Fralph\n```\n\nThen install the skills:\n\n```bash\n\u002Fplugin install ralph-skills@ralph-marketplace\n```\n\nAvailable skills after installation:\n- `\u002Fprd` - Generate Product Requirements Documents\n- `\u002Fralph` - Convert PRDs to prd.json format\n\nSkills are automatically invoked when you ask Claude to:\n- \"create a prd\", \"write prd for\", \"plan this feature\"\n- \"convert this prd\", \"turn into ralph format\", \"create prd.json\"\n\n### Configure Amp auto-handoff (recommended)\n\nAdd to `~\u002F.config\u002Famp\u002Fsettings.json`:\n\n```json\n{\n  \"amp.experimental.autoHandoff\": { \"context\": 90 }\n}\n```\n\nThis enables automatic handoff when context fills up, allowing Ralph to handle large stories that exceed a single context window.\n\n## Workflow\n\n### 1. Create a PRD\n\nUse the PRD skill to generate a detailed requirements document:\n\n```\nLoad the prd skill and create a PRD for [your feature description]\n```\n\nAnswer the clarifying questions. The skill saves output to `tasks\u002Fprd-[feature-name].md`.\n\n### 2. Convert PRD to Ralph format\n\nUse the Ralph skill to convert the markdown PRD to JSON:\n\n```\nLoad the ralph skill and convert tasks\u002Fprd-[feature-name].md to prd.json\n```\n\nThis creates `prd.json` with user stories structured for autonomous execution.\n\n### 3. Run Ralph\n\n```bash\n# Using Amp (default)\n.\u002Fscripts\u002Fralph\u002Fralph.sh [max_iterations]\n\n# Using Claude Code\n.\u002Fscripts\u002Fralph\u002Fralph.sh --tool claude [max_iterations]\n```\n\nDefault is 10 iterations. Use `--tool amp` or `--tool claude` to select your AI coding tool.\n\nRalph will:\n1. Create a feature branch (from PRD `branchName`)\n2. Pick the highest priority story where `passes: false`\n3. Implement that single story\n4. Run quality checks (typecheck, tests)\n5. Commit if checks pass\n6. Update `prd.json` to mark story as `passes: true`\n7. Append learnings to `progress.txt`\n8. Repeat until all stories pass or max iterations reached\n\n## Key Files\n\n| File | Purpose |\n|------|---------|\n| `ralph.sh` | The bash loop that spawns fresh AI instances (supports `--tool amp` or `--tool claude`) |\n| `prompt.md` | Prompt template for Amp |\n| `CLAUDE.md` | Prompt template for Claude Code |\n| `prd.json` | User stories with `passes` status (the task list) |\n| `prd.json.example` | Example PRD format for reference |\n| `progress.txt` | Append-only learnings for future iterations |\n| `skills\u002Fprd\u002F` | Skill for generating PRDs (works with Amp and Claude Code) |\n| `skills\u002Fralph\u002F` | Skill for converting PRDs to JSON (works with Amp and Claude Code) |\n| `.claude-plugin\u002F` | Plugin manifest for Claude Code marketplace discovery |\n| `flowchart\u002F` | Interactive visualization of how Ralph works |\n\n## Flowchart\n\n[![Ralph Flowchart](ralph-flowchart.png)](https:\u002F\u002Fsnarktank.github.io\u002Fralph\u002F)\n\n**[View Interactive Flowchart](https:\u002F\u002Fsnarktank.github.io\u002Fralph\u002F)** - Click through to see each step with animations.\n\nThe `flowchart\u002F` directory contains the source code. To run locally:\n\n```bash\ncd flowchart\nnpm install\nnpm run dev\n```\n\n## Critical Concepts\n\n### Each Iteration = Fresh Context\n\nEach iteration spawns a **new AI instance** (Amp or Claude Code) with clean context. The only memory between iterations is:\n- Git history (commits from previous iterations)\n- `progress.txt` (learnings and context)\n- `prd.json` (which stories are done)\n\n### Small Tasks\n\nEach 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.\n\nRight-sized stories:\n- Add a database column and migration\n- Add a UI component to an existing page\n- Update a server action with new logic\n- Add a filter dropdown to a list\n\nToo big (split these):\n- \"Build the entire dashboard\"\n- \"Add authentication\"\n- \"Refactor the API\"\n\n### AGENTS.md Updates Are Critical\n\nAfter 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.\n\nExamples of what to add to AGENTS.md:\n- Patterns discovered (\"this codebase uses X for Y\")\n- Gotchas (\"do not forget to update Z when changing W\")\n- Useful context (\"the settings panel is in component X\")\n\n### Feedback Loops\n\nRalph only works if there are feedback loops:\n- Typecheck catches type errors\n- Tests verify behavior\n- CI must stay green (broken code compounds across iterations)\n\n### Browser Verification for UI Stories\n\nFrontend 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.\n\n### Stop Condition\n\nWhen all stories have `passes: true`, Ralph outputs `\u003Cpromise>COMPLETE\u003C\u002Fpromise>` and the loop exits.\n\n## Debugging\n\nCheck current state:\n\n```bash\n# See which stories are done\ncat prd.json | jq '.userStories[] | {id, title, passes}'\n\n# See learnings from previous iterations\ncat progress.txt\n\n# Check git history\ngit log --oneline -10\n```\n\n## Customizing the Prompt\n\nAfter copying `prompt.md` (for Amp) or `CLAUDE.md` (for Claude Code) to your project, customize it for your project:\n- Add project-specific quality check commands\n- Include codebase conventions\n- Add common gotchas for your stack\n\n## Archiving\n\nRalph automatically archives previous runs when you start a new feature (different `branchName`). Archives are saved to `archive\u002FYYYY-MM-DD-feature-name\u002F`.\n\n## References\n\n- [Geoffrey Huntley's Ralph article](https:\u002F\u002Fghuntley.com\u002Fralph\u002F)\n- [Amp documentation](https:\u002F\u002Fampcode.com\u002Fmanual)\n- [Claude Code documentation](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code)\n","Ralph 是一个自主运行的AI代理循环工具，它通过反复运行AI编码工具（如Amp或Claude Code）来完成所有产品需求文档（PRD）中的项目。其核心功能包括使用AI进行代码生成、自动处理任务直至所有PRD项完成，并且每次迭代都是一个新的实例，具有干净的上下文环境。Ralph通过git历史记录、`progress.txt`和`prd.json`文件保持记忆连续性。该工具适合于需要自动化处理复杂软件开发任务的场景，特别是那些涉及大量重复性和详细需求定义的工作流程中，能够显著提高效率和准确性。",2,"2026-06-11 02:56:08","top_language"]