ralph-wiggum
新しいプロジェクトを立ち上げたり、決まった作業を改善したりする際に、記憶管理のように状況を把握し、必要に応じてリセットしながら、自律的に開発を進めていくのを支援するSkill。
📜 元の英語説明(参考)
Implements the Ralph Wiggum autonomous iteration technique with deliberate context management. Use when building greenfield projects, iterating on well-defined tasks, or when continuous autonomous development is needed. Manages context like memory - tracks allocations, prevents redlining, and knows when to start fresh.
🇯🇵 日本人クリエイター向け解説
新しいプロジェクトを立ち上げたり、決まった作業を改善したりする際に、記憶管理のように状況を把握し、必要に応じてリセットしながら、自律的に開発を進めていくのを支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o ralph-wiggum.zip https://jpskill.com/download/10591.zip && unzip -o ralph-wiggum.zip && rm ralph-wiggum.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10591.zip -OutFile "$d\ralph-wiggum.zip"; Expand-Archive "$d\ralph-wiggum.zip" -DestinationPath $d -Force; ri "$d\ralph-wiggum.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
ralph-wiggum.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
ralph-wiggumフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Ralph Wiggum: コンテキストエンジニアリングによる自律反復
Ralph は、自律的な AI 開発のためのテクニックです。最も純粋な形では、Ralph は同じプロンプトを AI エージェントに繰り返しフィードし、完了するまでタスクを反復させるループです。重要な洞察は、コンテキストはメモリのようなものであるということです。コンテキストウィンドウに malloc() でデータをロードすると、新たにやり直す以外に free() することはできません。
コアとなる哲学
「Ralph の美しさは、そのテクニックが非決定的な世界において決定的に悪いことだ」
Ralph は間違いを犯します。それは想定内です。それぞれの間違いは、将来的にその間違いを防ぐための「サイン」(ガードレール)を追加する機会となります。ギターをチューニングするように、Ralph が正しい音を奏でるまで調整します。
malloc/free のメタファー
- コンテキストはメモリ: LLM のコンテキストウィンドウにロードされたものはすべてそこに留まります
- コンテキストを free() できない: コンテキストをクリアする唯一の方法は、新しい会話を開始することです
- コンテキストごとに 1 つのタスク: 複数の懸念事項が混在すると、自己回帰的な失敗につながります
- レッドラインを超えない: コンテキストを限界までプッシュすると、パフォーマンスが低下します
- 溝の検出: ボーリングのボールが溝に入ったら、新たにやり直します
この Skill の仕組み
ステートファイル (永続メモリ)
Ralph は、コンテキストではなく、ファイルに状態を追跡します。
.ralph/
├── state.md # 現在のイテレーション、タスク、完了基準
├── guardrails.md # 観察された失敗から蓄積された「サイン」
├── context-log.md # コンテキストにロードされたもの
├── failures.md # 学習のための失敗パターン
└── progress.md # 達成されたこと
イテレーションサイクル
- ステートファイルを読み込み、現在のタスクと進捗状況を理解します
- ガードレールをチェックして、従うべき関連する「サイン」を探します
- タスクに取り組みます - 実装、テスト、改良
- 進捗状況をファイルに更新します (コンテキストだけでなく)
- git を介してチェックポイントをコミットします
- 基準に対して完了を評価します
- 完了していない場合: 次のイテレーションのシグナルを送ります
- 行き詰まった場合: 溝を検出し、新しいコンテキストを提案します
ガードレール ("サイン")
Ralph が間違いを犯した場合、サインを追加します。
## サイン: スライドから飛び降りないでください
- **トリガー**: 認証を実装するとき
- **指示**: クレームを信頼する前に、常にトークンを検証してください
- **追加された後**: イテレーション 5 - セキュリティの脆弱性が導入されました
サインは guardrails.md に蓄積され、将来のイテレーションに注入されます。
使い方
Ralph ループの開始
プロジェクトのルートに RALPH_TASK.md ファイルを作成します。
---
task: タスク管理のための REST API を構築する
completion_criteria:
- すべての CRUD エンドポイントが動作している
- 入力検証が実装されている
- テストが 80% 以上のカバレッジで合格している
- API ドキュメントが完成している
max_iterations: 50
---
## 要件
次のエンドポイントを持つタスク管理 API を構築します。
- POST /tasks - タスクを作成する
- GET /tasks - すべてのタスクをリストする
- GET /tasks/:id - タスクを取得する
- PUT /tasks/:id - タスクを更新する
- DELETE /tasks/:id - タスクを削除する
## 制約
- TypeScript を使用する
- Express.js を使用する
- ストレージに SQLite を使用する
- REST の規約に従う
次に、Cursor に「このタスクで Ralph ループを開始してください」と伝えます。
進捗状況の監視
.ralph/progress.md をチェックして、何が達成されたかを確認します。
## イテレーション 1
- プロジェクト構造を作成しました
- POST /tasks エンドポイントを実装しました
- ステータス: 部分的な進捗
## イテレーション 2
- GET エンドポイントを追加しました
- 検証バグを修正しました
- ステータス: 継続中
新規に開始するタイミング
Ralph は「溝」の状況を検出します。
- 同じエラーが 3 回以上繰り返される
- コンテキストが限界に近づいている
- 循環的な失敗パターン
検出されると、Ralph は次のように提案します。「コンテキストが汚染されています。新しい会話を開始することをお勧めします。」
ベストプラクティス
1. 明確な完了基準
❌ 悪い例: 「良い API を作る」 ✅ 良い例: 「すべてのテストに合格し、カバレッジが 80% 以上で、ドキュメントが完成している」
2. 段階的な目標
❌ 悪い例: 「完全な e コマースプラットフォームを構築する」 ✅ 良い例: フェーズ 1: 認証、フェーズ 2: 製品、フェーズ 3: カート
3. 失敗から学ぶ
すぐに介入しないでください。Ralph に失敗させてから、サインを追加します。
4. ファイルを信頼する
進捗状況は、あなたの頭の中やコンテキストではなく、ファイルと git にあります。
5. 新しいコンテキストは安価
新たに開始することを躊躇しないでください。状態はファイルに保持されます。
Cursor フックとの統合
この skill は、Cursor フックを次の目的で使用します。
- beforeSubmitPrompt: ガードレールとコンテキスト認識を注入します
- beforeReadFile: コンテキストの割り当てを追跡します
- afterFileEdit: 進捗状況の追跡を更新します
- stop: 完了を評価し、次のイテレーションまたは新規開始をトリガーします
フックの実装については、scripts/ を参照してください。
詳しくはこちら
- 元のテクニック: https://ghuntley.com/ralph/
- コンテキストエンジニアリング: https://ghuntley.com/gutter/
- malloc/free のメタファー: https://ghuntley.com/allocations/
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Ralph Wiggum: Autonomous Iteration with Context Engineering
Ralph is a technique for autonomous AI development. In its purest form, Ralph is a loop that repeatedly feeds the same prompt to an AI agent, letting it iterate on a task until completion. The key insight is that context is like memory - when you malloc() data into the context window, it cannot be free()'d except by starting fresh.
Core Philosophy
"That's the beauty of Ralph - the technique is deterministically bad in an undeterministic world."
Ralph will make mistakes. That's expected. Each mistake is an opportunity to add a "sign" (guardrail) that prevents that mistake in the future. Like tuning a guitar, you adjust Ralph until it plays the right notes.
The malloc/free Metaphor
- Context is memory: Everything loaded into the LLM's context window stays there
- You cannot free() context: The only way to clear context is to start a new conversation
- One task per context: Mixed concerns lead to autoregressive failure
- Don't redline: Pushing context to limits degrades performance
- Gutter detection: Once the bowling ball is in the gutter, start fresh
How This Skill Works
State Files (The Persistent Memory)
Ralph tracks state in files, NOT in context:
.ralph/
├── state.md # Current iteration, task, completion criteria
├── guardrails.md # Accumulated "signs" from observed failures
├── context-log.md # What's been loaded into context
├── failures.md # Failure patterns for learning
└── progress.md # What's been accomplished
The Iteration Cycle
- Read state files to understand current task and progress
- Check guardrails for relevant "signs" to follow
- Work on the task - implement, test, refine
- Update progress in files (not just context)
- Commit checkpoint via git
- Evaluate completion against criteria
- If not complete: Signal for next iteration
- If stuck: Detect gutter, suggest fresh context
Guardrails ("Signs")
When Ralph makes a mistake, add a sign:
## Sign: Don't Jump Off The Slide
- **Trigger**: When implementing authentication
- **Instruction**: Always validate tokens before trusting claims
- **Added after**: Iteration 5 - security vulnerability introduced
Signs accumulate in guardrails.md and are injected into future iterations.
Usage
Starting a Ralph Loop
Create a RALPH_TASK.md file in your project root:
---
task: Build a REST API for task management
completion_criteria:
- All CRUD endpoints working
- Input validation implemented
- Tests passing with >80% coverage
- API documentation complete
max_iterations: 50
---
## Requirements
Build a task management API with the following endpoints:
- POST /tasks - Create a task
- GET /tasks - List all tasks
- GET /tasks/:id - Get a task
- PUT /tasks/:id - Update a task
- DELETE /tasks/:id - Delete a task
## Constraints
- Use TypeScript
- Use Express.js
- Use SQLite for storage
- Follow REST conventions
Then tell Cursor: "Start a Ralph loop on this task"
Monitoring Progress
Check .ralph/progress.md to see what's been accomplished:
## Iteration 1
- Created project structure
- Implemented POST /tasks endpoint
- Status: Partial progress
## Iteration 2
- Added GET endpoints
- Fixed validation bug
- Status: Continuing
When to Start Fresh
Ralph will detect "gutter" situations:
- Same error repeated 3+ times
- Context approaching limits
- Circular failure patterns
When detected, Ralph will suggest: "Context is polluted. Recommend starting fresh conversation."
Best Practices
1. Clear Completion Criteria
❌ Bad: "Make a good API" ✅ Good: "All tests passing, coverage >80%, docs complete"
2. Incremental Goals
❌ Bad: "Build complete e-commerce platform" ✅ Good: Phase 1: Auth, Phase 2: Products, Phase 3: Cart
3. Let Failures Teach
Don't intervene too quickly. Let Ralph fail, then add signs.
4. Trust the Files
Progress is in files and git, not in your head or the context.
5. Fresh Context is Cheap
Don't hesitate to start fresh. State persists in files.
Integration with Cursor Hooks
This skill uses Cursor hooks for:
- beforeSubmitPrompt: Inject guardrails and context awareness
- beforeReadFile: Track context allocations
- afterFileEdit: Update progress tracking
- stop: Evaluate completion, trigger next iteration or fresh start
See scripts/ for hook implementations.
Learn More
- Original technique: https://ghuntley.com/ralph/
- Context engineering: https://ghuntley.com/gutter/
- malloc/free metaphor: https://ghuntley.com/allocations/