Ralph Wiggum
Scannednpx machina-cli add skill chris-hendrix/claudehub/ralph-wiggum --openclawRalph Engineering Workflow
The Ralph engineering workflow executes tasks through a structured agent pipeline. Each task follows the same sequence: research, code, verify, review.
Task Execution Flow
For each task from TASKS.md:
- Find task - Locate first unchecked
- [ ]item - Research - Use
researcheragent to gather context - Code - Use
coderagent to implement + write tests - Verify - Use
verifieragent to run all checks - Review - Use
revieweragent to assess quality - Complete - Mark
[x]in TASKS.md, append to PROGRESS.md
Cleanup Phase
A dedicated Cleanup phase runs after all feature phases and before Final Verification. It contains a single triage task that reads ALL of PROGRESS.md, identifies every unaddressed item (failures, blocks, reviewer caveats, deferred work), and creates individual fix tasks in TASKS.md. Each fix task goes through the full agent sequence (researcher → coder → verifier → reviewer). One triage pass only — remaining issues are caught by Final Verification. See references/context-files.md for format and examples.
Agent Sequence
researcher → coder → verifier → reviewer
Each agent receives context from the previous. The session orchestrates the handoff.
File Locations
All Ralph files live in .ralph/:
| File | Purpose |
|---|---|
ARCHITECTURE.md | Technical approach (services, schema, APIs, components) |
TASKS.md | Tasks with checkboxes at task level (- [ ] Task 1.1:), NOT on steps |
VERIFICATION.md | How to verify (test commands, env setup, feature flags) |
PROGRESS.md | Learnings and results from each iteration |
CONFIG.md | Branch description and isolation mode (worktree vs branch) |
screenshots/ | Visual proof from manual testing (tracked) |
logs/ | Flat session logs: {timestamp}-{branch}-{task}.jsonl (gitignored) |
For context file formats (loaded each iteration), see references/context-files.md.
Task Granularity
When creating TASKS.md (via /ralph:plan-deep), you'll be asked to choose task granularity:
| Granularity | Description | Best For |
|---|---|---|
| Small | Smallest chunks of verifiable work. Each task is highly focused (e.g., "Create schema", "Add endpoints", "Write tests" as separate tasks) | Catching issues early, maintaining steady progress, clear milestones |
| Medium (Recommended) | Balanced task sizes. Each task covers a complete feature component (e.g., "Implement auth service with tests") | Good balance between granularity and task count |
| Large | Fewer, larger tasks. Each task covers significant functionality (e.g., "Implement complete authentication system") | Less overhead, fewer tasks to track |
Medium granularity is recommended because:
- Each task covers a complete feature component, reducing overhead
- Good balance between progress tracking and task count
- Fewer context switches between tasks
- Still granular enough to isolate issues and resume after interruptions
See references/context-files.md for concrete examples of the same feature at different granularities.
Branch Naming
Format: ralph/yyyymmdd-hhmm-short-description
Examples:
ralph/20260126-1430-user-authralph/20260127-0915-payment-flow
Branch creation depends on the isolation mode chosen during planning (stored in .ralph/CONFIG.md):
- Branch mode: Branch is created by
/ralph:runbefore execution starts. Planning docs are written on the current branch and carry over when the ralph branch is created. - Worktree mode: A worktree is created during planning via
EnterWorktree. Planning docs are written directly in the worktree./ralph:rundetects the worktree and skips branch creation.
# Branch creation (used by /ralph:run in branch mode)
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
git checkout $DEFAULT_BRANCH && git pull
git checkout -b ralph/$(date +%Y%m%d-%H%M)-short-description
Tracking Progress Remotely
Generate a compare URL to view all commits made during a Ralph run. Display this URL whenever showing status or confirming execution start.
REPO_URL=$(git remote get-url origin | sed 's/\.git$//' | sed 's/git@github.com:/https:\/\/github.com\//')
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "${REPO_URL}/compare/${DEFAULT_BRANCH}...${CURRENT_BRANCH}"
Example: https://github.com/org/repo/compare/main...ralph/20260128-1123-feature
Task Completion Criteria
A task is complete ONLY when BOTH conditions are met:
- Verifier reports all checks PASS
- Reviewer assessment is APPROVED
NEEDS_WORK is NOT complete. Implement all reviewer feedback immediately and re-verify until APPROVED.
Test failures are NOT complete. Fix all failures immediately and re-verify until passing.
Only BLOCKED (fundamental architectural issues) defers to next iteration.
Session Instructions
When spawned by the Ralph orchestrator:
- Read
.ralph/TASKS.mdand find first- [ ]task - Read
.ralph/ARCHITECTURE.mdfor context - Read
.ralph/VERIFICATION.mdfor check commands - Read last 50 lines of
.ralph/PROGRESS.mdfor learnings - Execute agent sequence: researcher → coder → verifier → reviewer
- If all checks pass and review APPROVED:
- Mark task
[x]in TASKS.md - Append iteration report to PROGRESS.md
- Mark task
- If checks fail: fix NOW and re-verify until passing
- If review returns NEEDS_WORK: implement ALL feedback NOW and re-verify until APPROVED
- If review returns BLOCKED: keep task
[ ], append details to PROGRESS.md
Commit Modes
| Mode | Behavior |
|---|---|
no-commit | Leave changes uncommitted |
commit | Commit on success |
commit-push | Commit and push on success (default) |
Commit message format: "Ralph: Task X.Y - [task name]"
Testing Types — The Agent Does ALL of Them
There is no human in the loop. Every check in VERIFICATION.md — automated or manual — is performed by the agent. If the environment isn't ready, the agent sets it up. If a service isn't running, the agent starts it.
| Type | Purpose | Agent Action |
|---|---|---|
| Unit tests | Test isolated functions | Run test commands |
| Integration tests | Test components together | Start services (Docker, DB) if needed, then run tests |
| E2E tests (automated) | Scripted regression tests | Start the app, run E2E suite |
| Manual testing (FE) | Visual/UX verification | Open browser with Playwright (installed locally), navigate, interact, screenshot |
| Manual testing (BE) | API endpoint verification | Curl endpoints, verify responses, test error cases |
| Linting | Code style/errors | Run linter |
| Type checking | Static type verification | Run type checker |
| Feature flags | Gate feature availability | Enable flags locally, mock if needed |
For detailed guidance on each testing type, see references/testing-types.md. For Playwright installation and usage, see references/playwright.md.
E2E tests ≠ Manual testing. E2E tests prove code runs; manual testing proves it looks/works right. When E2E is required, manual browser testing with screenshots is also required.
Screenshots
During manual testing with Playwright, capture screenshots as visual proof:
Location: .ralph/screenshots/ (tracked in git)
Naming: iteration-{NNN}-{description}.png
When to capture: Key states, before/after actions, error states, final success.
Environment Validation
Before starting Ralph execution, validate AND fix the environment so all verification steps can run:
- Parse VERIFICATION.md for test commands
- For each test suite, run ONE existing test to verify runner works. If it doesn't, install dependencies / fix config until it does.
- For URLs/endpoints listed, verify they're reachable. If they're not, start the services yourself.
- If manual verification requires browser, check Playwright is installed. If not, install it (see
references/playwright.md). - If feature flags mentioned, verify required flags are enabled locally. If not, enable or mock them.
- Report what works, what was fixed, and what's still broken
The goal is a working environment, not just a report. Fix problems, don't just list them.
Use the ralph-validator agent to perform this check.
Source
git clone https://github.com/chris-hendrix/claudehub/blob/main/plugins/ralph/skills/ralph-wiggum/SKILL.mdView on GitHub Overview
Ralph drives engineering tasks through a fixed agent pipeline: researcher, coder, verifier, and reviewer. Tasks are progressed from the TASKS.md backlog to completion with progress tracked in PROGRESS.md, plus a Cleanup phase that triangulates unaddressed issues into new tasks.
How This Skill Works
For each task, Ralph finds the first unchecked item in TASKS.md, then passes context to the researcher to gather context, to the coder to implement and write tests, to the verifier to run checks, and to the reviewer to assess quality. After all feature phases, a dedicated Cleanup phase triages PROGRESS.md for unaddressed items and creates fix tasks in TASKS.md; Final Verification consolidates remaining gaps.
When to Use It
- Starting a new feature or bugfix that has a defined backlog in TASKS.md and requires repeatable handoffs between specialized roles.
- When you need verifiable, test-backed changes with explicit checkpoints (research, code, verify, review).
- In projects that require detailed progress tracking via TASKS.md and PROGRESS.md, including history of iterations.
- During multi-actor collaborations where context must be handed off between researcher, coder, verifier, and reviewer in sequence.
- Before release, to ensure unaddressed issues are surfaced and formalized for fix tasks via the Cleanup phase.
Quick Start
- Step 1: Open TASKS.md and locate the first unchecked item (- [ ]).
- Step 2: Trigger Ralph so the researcher, coder, verifier, and reviewer run in sequence, passing context along the chain.
- Step 3: When the task completes, mark it as [x] in TASKS.md, update PROGRESS.md, and run Cleanup if needed.
Best Practices
- Adopt Medium granularity for tasks to balance progress and task count.
- Ensure each agent receives complete context from the previous step to minimize handoff gaps.
- Run the dedicated Cleanup phase after feature work to surface and formalize unaddressed issues.
- Keep TASKS.md and PROGRESS.md up-to-date to reflect status and learnings from iterations.
- Use the .ralph directory (ARCHITECTURE.md, TASKS.md, PROGRESS.md, etc.) to organize context and run histories.
Example Use Cases
- Example 1: A new API endpoint is added by locating the first unchecked TASK in TASKS.md, researched by the researcher, implemented and tested by the coder, verified by the verifier, and reviewed by the reviewer before marking complete.
- Example 2: After a sprint, the Cleanup phase scans PROGRESS.md for failures or blocks and creates targeted fix tasks in TASKS.md that repeat the full agent sequence.
- Example 3: A feature spans multiple components; Ralph ensures context is shared between researcher and coder, then verified and reviewed before closing the task.
- Example 4: Final Verification is prepared by summarizing completed tasks and ensuring all checklists in VERIFICATION.md align with the outcomes tracked in PROGRESS.md.
- Example 5: All Ralph files are stored under .ralph/ with standardized file names (e.g., ARCHITECTURE.md, TASKS.md, PROGRESS.md) for reproducibility and onboarding.