mirror of
https://github.com/anthropics/claude-plugins-official.git
synced 2026-03-18 10:53:09 +00:00
* fix readme typo * fix(plugin-dev): add missing .claude-plugin/plugin.json The plugin-dev plugin was missing its required plugin.json manifest file, causing the plugin to fail loading. This adds the missing configuration file following the same format as other official plugins. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add README and setup documentation for Greptile plugin - Add README.md with setup instructions for getting API key - Document the GREPTILE_API_KEY environment variable requirement - Add homepage, author URL, and keywords to plugin.json - Update description to reflect Greptile as AI code review agent 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: add c7 agent * Update Context7 plugin for v2 API - Update skill/agent/command to use new query-docs tool (replaces get-library-docs) - Add query parameter usage for intelligent reranking - Add version pinning support (e.g., /vercel/next.js/v15.1.8) - Add tools and model metadata to agent - Simplify docs to focus on workflow, not parameter details - Add README.md with usage examples * Switch Context7 MCP to remote HTTP server * feat: update tools with better skill/agent format prompt * fmt * fix: installation guide * Change Notion name to lowercase in marketplace.json According to the SKILLS spec (see https://agentskills.io/specification#:~:text=Max%2064%20characters.%20Lowercase%20letters%2C%20numbers%2C%20and%20hyphens%20only.%20Must%20not%20start%20or%20end%20with%20a%20hyphen.) names should not contain uppercase letters. This prevents loading the marketplace in spec-compliant agents. Update the name to be in lowercase. * Fix empty array crash on bash 3.2 in setup-ralph-loop.sh * Update Vercel plugin to point to vercel-labs/vercel-plugin Replace the marketplace pointer for the Vercel plugin from vercel/vercel-deploy-claude-code-plugin to vercel-labs/vercel-plugin. * vercel-labs to vercel * docs(ralph-loop): add Windows compatibility section Retargeted from PR #124 (originally against plugins/ralph-wiggum/, since renamed). Documents the Git Bash workaround for Windows users hitting WSL bash resolution issues in the stop hook. Original author: @stefanzvonar * add(plugin): terraform — HashiCorp infrastructure-as-code Adapted from PR #14 by @gautambaghel (HashiCorp). Original: https://github.com/anthropics/claude-plugins-official/pull/14 * add(plugin): autofix-bot — DeepSource automated code review Adapted from PR #23 by @jai-deepsource (DeepSource). Original: https://github.com/anthropics/claude-plugins-official/pull/23 * add(plugin): stagehand — Browserbase browser automation Adapted from PR #43 by @Kylejeong2 (Browserbase). PR's marketplace.json had a syntax error (missing '},' before adjacent entry); entry reconstructed from the diff. Original: https://github.com/anthropics/claude-plugins-official/pull/43 * add(plugin): atomic-agents — BrainBlend-AI framework Adapted from PR #46 by @KennyVaneetvelde (BrainBlend-AI). Original: https://github.com/anthropics/claude-plugins-official/pull/46 * add(plugin): microsoft-docs — official Microsoft documentation MCP Adapted from PR #55 by @TianqiZhang (Microsoft). Original: https://github.com/anthropics/claude-plugins-official/pull/55 * add(plugin): bonfire — session-context workflow tooling Adapted from PR #108 by @vieko (Vercel). Original: https://github.com/anthropics/claude-plugins-official/pull/108 * Add intercom to marketplace * Add neon to marketplace * Remove qodo SHA * Merge staging into add-plugin/intercom to resolve conflict * Merge latest staging to resolve conflict * Remove external_plugins changes from staging Moved to external-plugins-staging branch for separate review. --------- Co-authored-by: Han T. <han.tan@shopify.com> Co-authored-by: Julien Tavernier <jtavernier@Juliens-MacBook-Pro.local> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Daksh Gupta <daksh510@gmail.com> Co-authored-by: Fahreddin Özcan <ozcanfahrettinn@gmail.com> Co-authored-by: Matt Kotsenas <Matt.Kotsenas@gmail.com> Co-authored-by: LuciferDono <pranavj821@gmail.com>
198 lines
5.9 KiB
Markdown
198 lines
5.9 KiB
Markdown
# Ralph Loop Plugin
|
|
|
|
Implementation of the Ralph Wiggum technique for iterative, self-referential AI development loops in Claude Code.
|
|
|
|
## What is Ralph Loop?
|
|
|
|
Ralph Loop is a development methodology based on continuous AI agent loops. As Geoffrey Huntley describes it: **"Ralph is a Bash loop"** - a simple `while true` that repeatedly feeds an AI agent a prompt file, allowing it to iteratively improve its work until completion.
|
|
|
|
This technique is inspired by the Ralph Wiggum coding technique (named after the character from The Simpsons), embodying the philosophy of persistent iteration despite setbacks.
|
|
|
|
### Core Concept
|
|
|
|
This plugin implements Ralph using a **Stop hook** that intercepts Claude's exit attempts:
|
|
|
|
```bash
|
|
# You run ONCE:
|
|
/ralph-loop "Your task description" --completion-promise "DONE"
|
|
|
|
# Then Claude Code automatically:
|
|
# 1. Works on the task
|
|
# 2. Tries to exit
|
|
# 3. Stop hook blocks exit
|
|
# 4. Stop hook feeds the SAME prompt back
|
|
# 5. Repeat until completion
|
|
```
|
|
|
|
The loop happens **inside your current session** - you don't need external bash loops. The Stop hook in `hooks/stop-hook.sh` creates the self-referential feedback loop by blocking normal session exit.
|
|
|
|
This creates a **self-referential feedback loop** where:
|
|
- The prompt never changes between iterations
|
|
- Claude's previous work persists in files
|
|
- Each iteration sees modified files and git history
|
|
- Claude autonomously improves by reading its own past work in files
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
/ralph-loop "Build a REST API for todos. Requirements: CRUD operations, input validation, tests. Output <promise>COMPLETE</promise> when done." --completion-promise "COMPLETE" --max-iterations 50
|
|
```
|
|
|
|
Claude will:
|
|
- Implement the API iteratively
|
|
- Run tests and see failures
|
|
- Fix bugs based on test output
|
|
- Iterate until all requirements met
|
|
- Output the completion promise when done
|
|
|
|
## Commands
|
|
|
|
### /ralph-loop
|
|
|
|
Start a Ralph loop in your current session.
|
|
|
|
**Usage:**
|
|
```bash
|
|
/ralph-loop "<prompt>" --max-iterations <n> --completion-promise "<text>"
|
|
```
|
|
|
|
**Options:**
|
|
- `--max-iterations <n>` - Stop after N iterations (default: unlimited)
|
|
- `--completion-promise <text>` - Phrase that signals completion
|
|
|
|
### /cancel-ralph
|
|
|
|
Cancel the active Ralph loop.
|
|
|
|
**Usage:**
|
|
```bash
|
|
/cancel-ralph
|
|
```
|
|
|
|
## Prompt Writing Best Practices
|
|
|
|
### 1. Clear Completion Criteria
|
|
|
|
❌ Bad: "Build a todo API and make it good."
|
|
|
|
✅ Good:
|
|
```markdown
|
|
Build a REST API for todos.
|
|
|
|
When complete:
|
|
- All CRUD endpoints working
|
|
- Input validation in place
|
|
- Tests passing (coverage > 80%)
|
|
- README with API docs
|
|
- Output: <promise>COMPLETE</promise>
|
|
```
|
|
|
|
### 2. Incremental Goals
|
|
|
|
❌ Bad: "Create a complete e-commerce platform."
|
|
|
|
✅ Good:
|
|
```markdown
|
|
Phase 1: User authentication (JWT, tests)
|
|
Phase 2: Product catalog (list/search, tests)
|
|
Phase 3: Shopping cart (add/remove, tests)
|
|
|
|
Output <promise>COMPLETE</promise> when all phases done.
|
|
```
|
|
|
|
### 3. Self-Correction
|
|
|
|
❌ Bad: "Write code for feature X."
|
|
|
|
✅ Good:
|
|
```markdown
|
|
Implement feature X following TDD:
|
|
1. Write failing tests
|
|
2. Implement feature
|
|
3. Run tests
|
|
4. If any fail, debug and fix
|
|
5. Refactor if needed
|
|
6. Repeat until all green
|
|
7. Output: <promise>COMPLETE</promise>
|
|
```
|
|
|
|
### 4. Escape Hatches
|
|
|
|
Always use `--max-iterations` as a safety net to prevent infinite loops on impossible tasks:
|
|
|
|
```bash
|
|
# Recommended: Always set a reasonable iteration limit
|
|
/ralph-loop "Try to implement feature X" --max-iterations 20
|
|
|
|
# In your prompt, include what to do if stuck:
|
|
# "After 15 iterations, if not complete:
|
|
# - Document what's blocking progress
|
|
# - List what was attempted
|
|
# - Suggest alternative approaches"
|
|
```
|
|
|
|
**Note**: The `--completion-promise` uses exact string matching, so you cannot use it for multiple completion conditions (like "SUCCESS" vs "BLOCKED"). Always rely on `--max-iterations` as your primary safety mechanism.
|
|
|
|
## Philosophy
|
|
|
|
Ralph embodies several key principles:
|
|
|
|
### 1. Iteration > Perfection
|
|
Don't aim for perfect on first try. Let the loop refine the work.
|
|
|
|
### 2. Failures Are Data
|
|
"Deterministically bad" means failures are predictable and informative. Use them to tune prompts.
|
|
|
|
### 3. Operator Skill Matters
|
|
Success depends on writing good prompts, not just having a good model.
|
|
|
|
### 4. Persistence Wins
|
|
Keep trying until success. The loop handles retry logic automatically.
|
|
|
|
## When to Use Ralph
|
|
|
|
**Good for:**
|
|
- Well-defined tasks with clear success criteria
|
|
- Tasks requiring iteration and refinement (e.g., getting tests to pass)
|
|
- Greenfield projects where you can walk away
|
|
- Tasks with automatic verification (tests, linters)
|
|
|
|
**Not good for:**
|
|
- Tasks requiring human judgment or design decisions
|
|
- One-shot operations
|
|
- Tasks with unclear success criteria
|
|
- Production debugging (use targeted debugging instead)
|
|
|
|
## Real-World Results
|
|
|
|
- Successfully generated 6 repositories overnight in Y Combinator hackathon testing
|
|
- One $50k contract completed for $297 in API costs
|
|
- Created entire programming language ("cursed") over 3 months using this approach
|
|
|
|
## Windows Compatibility
|
|
|
|
The stop hook uses a bash script that requires Git for Windows to run properly.
|
|
|
|
**Issue**: On Windows, the `bash` command may resolve to WSL bash (often misconfigured) instead of Git Bash, causing the hook to fail with errors like:
|
|
- `wsl: Unknown key 'automount.crossDistro'`
|
|
- `execvpe(/bin/bash) failed: No such file or directory`
|
|
|
|
**Workaround**: Edit the cached plugin's `hooks/hooks.json` to use Git Bash explicitly:
|
|
|
|
```json
|
|
"command": "\"C:/Program Files/Git/bin/bash.exe\" ${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh"
|
|
```
|
|
|
|
**Location**: `~/.claude/plugins/cache/claude-plugins-official/ralph-wiggum/<hash>/hooks/hooks.json`
|
|
|
|
**Note**: Use `Git/bin/bash.exe` (the wrapper with proper PATH), not `Git/usr/bin/bash.exe` (raw MinGW bash without utilities in PATH).
|
|
|
|
## Learn More
|
|
|
|
- Original technique: https://ghuntley.com/ralph/
|
|
- Ralph Orchestrator: https://github.com/mikeyobrien/ralph-orchestrator
|
|
|
|
## For Help
|
|
|
|
Run `/help` in Claude Code for detailed command reference and examples.
|