/ralph-supervisor
Ralph loop pattern - Claude supervises while Codex (gpt-5.3-codex) executes implementation work. Use for autonomous coding loops with fresh context per iteration, validation gates, and git-backed persistence. Tools: ralph_init, ralph_story, ralph_iterate, ralph_loop,
$ npx -y skills add joelhooks/swarm-tools --skill ralph-supervisor --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/ralph-supervisor
Context preview
The summary Claude sees to decide when to auto-load this skill.
Ralph loop pattern - Claude supervises while Codex (gpt-5.3-codex) executes implementation work. Use for autonomous coding loops with fresh context per iteration, validation gates, and git-backed persistence. Tools: ralph_init, ralph_story, ralph_iterate, ralph_loop,
SKILL.md
ralph-supervisor.SKILL.mdname: ralph-supervisor
description: |
Ralph loop pattern - Claude supervises while Codex (gpt-5.3-codex) executes
implementation work. Use for autonomous coding loops with fresh context per
iteration, validation gates, and git-backed persistence. Tools: ralph_init,
ralph_story, ralph_iterate, ralph_loop, ralph_status, ralph_cancel, ralph_review.
Ralph Supervisor Pattern
Ralph implements an autonomous coding loop where Claude acts as supervisor and Codex executes implementation work. Named after the pattern from [openclaw-codex-ralph](https://github.com/joelhooks/openclaw-codex-ralph).
Core Philosophy
Traditional AI sessions accumulate context and drift. Ralph uses:
- **Fresh context per iteration** - Each Codex session starts clean
- **Git-backed persistence** - Completed work lives in commits
- **Validation gates** - Tests must pass before progression
- **Progress carryover** - Learnings flow forward (last 2000 chars)
Architecture
┌──────────────────────────────────────────────────────────┐
│ RALPH ARCHITECTURE │
├──────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Claude │ spawns │ Codex │ │
│ │ (Supervisor)│ ──────► │ (Executor) │ │
│ └─────────────┘ └─────────────┘ │
│ │ │ │
│ │ plans/reviews │ implements │
│ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ prd.json │ │ Code + │ │
│ │ (stories) │ │ Tests │ │
│ └─────────────┘ └─────────────┘ │
│ │ │ │
│ │ │ validates │
│ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │progress.txt │◄────────│ npm test │ │
│ │ (learnings) │ logs │ typecheck │ │
│ └─────────────┘ └─────────────┘ │
│ │ │ │
│ │ │ on success │
│ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Hivemind │ │ Git Commit │ │
│ │ (semantic) │ │ (persist) │ │
│ └─────────────┘ └─────────────┘ │
│ │
└──────────────────────────────────────────────────────────┘
Iteration Lifecycle
1. Read PRD → Find next pending story (by priority)
2. Load progress.txt + AGENTS.md for context
3. Build iteration prompt for Codex
4. Spawn Codex (codex exec --full-auto)
5. Run validation command
6. If success:
- Mark story.status = "passed"
- Append to progress.txt
- Git commit
7. If failure:
- Log failure details
- Keep story for retry
8. Repeat until all stories pass or limits hit
Story Structure
{
"id": "story-1234567890",
"title": "Add user authentication",
"description": "Implement login/logout with JWT...",
"priority": 1,
"status": "pending",
"validation_command": "npm test && npm run typecheck",
"acceptance_criteria": [
"JWT token generation works",
"Refresh token flow implemented"
],
"attempts": 0,
"files_touched": [],
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
}PRD Structure
{
"version": "1.0",
"project_name": "My Feature",
"description": "Adding OAuth support...",
"stories": [...],
"metadata": {
"created_at": "...",
"last_iteration": "...",
"total_iterations": 5,
"total_stories_completed": 3
}
}Supervisor Best Practices
Story Design
- **Granular scope** - Each story should fit in one Codex context
- **Clear acceptance criteria** - Specific, testable requirements
- **Proper validation** - Tests that actually verify the work
- **Priority ordering** - Dependencies first (lower number = higher priority)
Review Process
┌─────────────────────────────────────────────────────────────┐
│ REVIEW CHECKLIST │
├─────────────────────────────────────────────────────────────┤
│ │
│ □ Tests pass (validation_command succeeded) │
│ □ Acceptance criteria met │
│ □ Code quality acceptable │
│ □ No security issues introduced │
│ □ Integration with existing code correct │
│ │
│ If YES to all → ralph_review({ approve: true }) │
│ If NO to any → ralph_review({ approve: false, │
│ feedback: "Specific issue"})│
│ │
└─────────────────────────────────────────────────────────────┘Knowledge Persistence
After completing a project, store learnings:
hivemind_store({
information: "OAuth implementation: Used refresh token rotation pattern with 7-day expiry. Key gotcha: must invalidate old refresh token on use.",
tags: "oauth,auth,tokens,patterns",
confidence: 0.9
})Configuration
| Parameter | Default | Description | |-----------|---------|-------------| | `model` | `gpt-5.3-codex` | Codex model to use | | `sandbox` | `workspace-write` | Sandbox mode | | `max_iterations` | `20` | Loop limit | | `auto_commit` | `true` | Commit on success | | `progress_c
Read more
name: ralph-supervisor description: | Ralph loop pattern - Claude supervises while Codex (gpt-5.3-codex) executes implementation work. Use for autonomous coding loops with fresh context per iteration, validation gates, and git-backed persistence. Tools: ralph_init, ralph_story, ralph_iterate, ralph_loop, ralph_status, ralph_cancel, ralph_review.
Ralph Supervisor Pattern
Ralph implements an autonomous coding loop where Claude acts as supervisor and Codex executes implementation work. Named after the pattern from [openclaw-codex-ralph](https://github.com/joelhooks/openclaw-codex-ralph).
Core Philosophy
Traditional AI sessions accumulate context and drift. Ralph uses:
- **Fresh context per iteration** - Each Codex session starts clean
- **Git-backed persistence** - Completed work lives in commits
- **Validation gates** - Tests must pass before progression
- **Progress carryover** - Learnings flow forward (last 2000 chars)
Architecture
┌──────────────────────────────────────────────────────────┐ │ RALPH ARCHITECTURE │ ├──────────────────────────────────────────────────────────┤ │ │ │ ┌─────────────┐ ┌─────────────┐ │ │ │ Claude │ spawns │ Codex │ │ │ │ (Supervisor)│ ──────► │ (Executor) │ │ │ └─────────────┘ └─────────────┘ │ │ │ │ │ │ │ plans/reviews │ implements │ │ ▼ ▼ │ │ ┌─────────────┐ ┌─────────────┐ │ │ │ prd.json │ │ Code + │ │ │ │ (stories) │ │ Tests │ │ │ └─────────────┘ └─────────────┘ │ │ │ │ │ │ │ │ validates │ │ ▼ ▼ │ │ ┌─────────────┐ ┌─────────────┐ │ │ │progress.txt │◄────────│ npm test │ │ │ │ (learnings) │ logs │ typecheck │ │ │ └─────────────┘ └─────────────┘ │ │ │ │ │ │ │ │ on success │ │ ▼ ▼ │ │ ┌─────────────┐ ┌─────────────┐ │ │ │ Hivemind │ │ Git Commit │ │ │ │ (semantic) │ │ (persist) │ │ │ └─────────────┘ └─────────────┘ │ │ │ └──────────────────────────────────────────────────────────┘
Iteration Lifecycle
1. Read PRD → Find next pending story (by priority) 2. Load progress.txt + AGENTS.md for context 3. Build iteration prompt for Codex 4. Spawn Codex (codex exec --full-auto) 5. Run validation command 6. If success: - Mark story.status = "passed" - Append to progress.txt - Git commit 7. If failure: - Log failure details - Keep story for retry 8. Repeat until all stories pass or limits hit
Story Structure
{
"id": "story-1234567890",
"title": "Add user authentication",
"description": "Implement login/logout with JWT...",
"priority": 1,
"status": "pending",
"validation_command": "npm test && npm run typecheck",
"acceptance_criteria": [
"JWT token generation works",
"Refresh token flow implemented"
],
"attempts": 0,
"files_touched": [],
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
}PRD Structure
{
"version": "1.0",
"project_name": "My Feature",
"description": "Adding OAuth support...",
"stories": [...],
"metadata": {
"created_at": "...",
"last_iteration": "...",
"total_iterations": 5,
"total_stories_completed": 3
}
}Supervisor Best Practices
Story Design
- **Granular scope** - Each story should fit in one Codex context
- **Clear acceptance criteria** - Specific, testable requirements
- **Proper validation** - Tests that actually verify the work
- **Priority ordering** - Dependencies first (lower number = higher priority)
Review Process
┌─────────────────────────────────────────────────────────────┐
│ REVIEW CHECKLIST │
├─────────────────────────────────────────────────────────────┤
│ │
│ □ Tests pass (validation_command succeeded) │
│ □ Acceptance criteria met │
│ □ Code quality acceptable │
│ □ No security issues introduced │
│ □ Integration with existing code correct │
│ │
│ If YES to all → ralph_review({ approve: true }) │
│ If NO to any → ralph_review({ approve: false, │
│ feedback: "Specific issue"})│
│ │
└─────────────────────────────────────────────────────────────┘Knowledge Persistence
After completing a project, store learnings:
hivemind_store({
information: "OAuth implementation: Used refresh token rotation pattern with 7-day expiry. Key gotcha: must invalidate old refresh token on use.",
tags: "oauth,auth,tokens,patterns",
confidence: 0.9
})Configuration
| Parameter | Default | Description | |-----------|---------|-------------| | `model` | `gpt-5.3-codex` | Codex model to use | | `sandbox` | `workspace-write` | Sandbox mode | | `max_iterations` | `20` | Loop limit | | `auto_commit` | `true` | Commit on success | | `progress_c
Multi-agent coordination that survives context death. Break big tasks into small ones. Spawn agents to work in parallel. Learn from what works. swarmtools.ai · Documentation
Repo: joelhooks/swarm-tools
Other skills on swarm-tools.
- /release
Handles version bumps and npm releases for the swarm-tools monorepo (opencode-swarm-plugin, claude-code-swarm-plugin, swarm-mail, swarm-queue). Use when: creating changesets, bumping versions, preparing releases, checking release status, debugging publish failures, verifying npm
Open skill - /always-on-guidance
Always-on rule-oriented guidance for claude-plugin agents. Use to align behavior, tool usage, and model-specific defaults while avoiding deprecated bd/cass references. Related skills: swarm-coordination, testing-patterns.
Open skill - /openclaw-messaging
Send messages, system events, and agent notifications through the openclaw CLI. Use when an agent needs to notify a user (Telegram, Slack, Discord), trigger another agent, broadcast updates, send system events, or coordinate agent-to-agent communication via swarmmail. Covers all
Open skill - /swarm-coordination
Multi-agent coordination patterns for OpenCode swarm workflows. Use when work benefits from parallelization or coordination. Covers: decomposition, worker spawning, file reservations, progress tracking, and review loops.
Open skill - /always-on-guidance
Always-on rule-oriented guidance for claude-plugin agents. Use to align behavior, tool usage, and model-specific defaults while avoiding deprecated bd/cass references. Related skills: swarm-coordination, testing-patterns.
Open skill - /swarm-cli
Swarm CLI commands for workers - hivemind memory, hive tasks, swarmmail coordination. Use when working in a swarm context. Covers: swarm memory (find/store/get/stats), swarm cells (query/create/update/close), and coordination commands.
Open skill

