config/claude/skills/ralph/SKILL.md
Autonomously work through all project tasks. Finds the next incomplete task, implements it, runs the full post-task pipeline (verify, docs, CI/CD, commit, PR, review, CI, merge), then moves to the next task. Keeps going until all tasks are done. Triggers on "ralph", "work on tasks", "run tasks", "autopilot", or "do the work".
npx skillsauth add cryptofish7/dotfiles ralphInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Autonomous task runner. Discovers a project's task list, spawns a Task Runner subagent for each task, merges results, and moves on — until everything is done.
You are the task sequencer, not the task executor. Your only job is to discover tasks, determine execution order, spawn a Task Runner subagent for each task, merge PRs, update the task tracker, and present results. You never write code, run tests, create branches, open PRs, or do code review — all of that happens inside each Task Runner's fresh context window.
What ralph does directly:
Autonomy: Do NOT use EnterPlanMode, AskUserQuestion, or any other mechanism that pauses for user input. You are the decision-maker. The only time you stop and ask the user is when you've exhausted retries or hit a genuinely ambiguous requirement that can't be resolved from project docs.
Progress tracking: The user sees live progress via Ctrl+T. Create milestones on-demand (not all up front) with pipeline stage tasks immediately following each milestone — this ensures stages appear directly under their parent in the flat task list. See the Pipeline Visualization section below for the full protocol.
The Ctrl+T task list is a flat list ordered by creation ID. To make stages appear directly under their parent milestone, follow this creation-order protocol strictly.
✓ [1/5] Add core types
⟳ [2/5] Implement engine
✓ → Plan
⟳ → Implement "[implementer] Writing code and tests"
→ Verify
→ Audit
→ Commit & PR
→ Review
→ CI
→ Merge
For parallel batches, milestones interleave in creation order — create milestone A + 8 stages, then milestone B + 8 stages.
→ <stage> tasks — this ensures consecutive IDs and correct display order.deleted), then mark the milestone completed.| # | Subject | Agent | activeForm when in_progress |
|---|---------|-------|-----------------------------|
| 1 | → Plan | planner | [planner] Analyzing code and producing plan |
| 2 | → Implement | implementer | [implementer] Writing code and tests |
| 3 | → Verify | (self) | Running lint, typecheck, tests |
| 4 | → Audit | (parallel) | [docs] [ci-cd] [smoke-test] Auditing in parallel |
| 5 | → Commit & PR | (self) | Committing and opening PR |
| 6 | → Review | code-reviewer | [code-reviewer] Reviewing PR |
| 7 | → CI | (self) | Waiting for CI checks |
| 8 | → Merge | orchestrator | Merging PR and cleaning up |
Find the project's task source by checking these locations in order:
docs/TASKS.md or TASKS.md in the project root — look for markdown checkboxes (- [ ])gh issue list --state open --limit 50 and use the resultsParse all incomplete tasks and present them to the user:
Found N incomplete tasks in [source]:
1. [task title / description]
2. ...
Proceed with the task list in order. If the ordering seems wrong (e.g., a task depends on another that comes later), reorder as needed.
Build working context before starting any development:
CLAUDE.md (check project root and docs/CLAUDE.md) for commands, conventions, and workflow rules. Capture the full CLAUDE.md content — you'll pass it to each Task Runner.pyproject.toml, package.json, Makefile, or similarEnsure you're on the default branch with a clean working tree:
git checkout main && git pull origin main
If the default branch is not main, detect it from git remote show origin or gh repo view --json defaultBranchRef.
For each incomplete task, in order:
--- Task [N/total]: [task title] ---
subject: "[N/total] <task title>", activeForm: "[N/total] <task title>". Capture its ID.→ Plan (activeForm: [planner] Analyzing code and producing plan)→ Implement (activeForm: [implementer] Writing code and tests)→ Verify (activeForm: Running lint, typecheck, tests)→ Audit (activeForm: [docs] [ci-cd] [smoke-test] Auditing in parallel)→ Commit & PR (activeForm: Committing and opening PR)→ Review (activeForm: [code-reviewer] Reviewing PR)→ CI (activeForm: Waiting for CI checks)→ Merge (activeForm: Merging PR and cleaning up)in_progress.Spawn a Task Runner using the Task tool with subagent_type=general-purpose. Pass it the Task Runner Prompt (see below), filling in the placeholders — including the [STAGE_TASK_IDS] placeholder with the 8 stage task IDs from Step 1.
When the Task Runner returns, parse its result:
pending first). If the retry also fails, log and skip to the next task.Mark stage 8 (Merge) as in_progress with activeForm Merging PR and cleaning up.
gh pr merge --squash --delete-branch
git checkout main && git pull origin main
If the merge fails due to a conflict (unlikely in sequential mode):
Resolving merge conflict (rebase)git fetch origin main && git rebase origin/maingit push --force-with-leasegh pr checks --watch --fail-fastMark stage 8 (Merge) as completed.
deleted) — this removes the pipeline detail from Ctrl+T, leaving only the clean milestone entry.completed.- [ ] to - [x] for the completed task. Commit and push directly to main with chore: mark task N complete.gh issue close <number> --comment "Completed in PR #<pr-number>".Before starting the task loop, analyze the task list for independence. Only use this mode when tasks are clearly independent.
Dependency heuristic:
Parallel flow:
Group independent tasks into batches.
Create all milestones and stages for the batch in order (critical for display). For each task in the batch, sequentially:
[N/total] <task title>→ <stage> tasksin_progressThis ensures each milestone's stages appear directly beneath it in Ctrl+T.
For each task in the batch, create worktrees:
git worktree add .worktrees/<task-slug> -b <type>/<task-slug> main
Add .worktrees/ to .gitignore if not already present.
Spawn Task Runners in parallel (multiple Task tool calls in a single message). Each gets its worktree path as the working directory and its own set of stage task IDs in the prompt.
Wait for all Task Runners to complete. Collect READY/FAILURE/BLOCKED results.
Merge PRs sequentially (prevention + redo strategy). For each READY task:
in_progress with activeForm Merging PR and cleaning upgh pr merge --squash --delete-branch → pull maingit rebase origin/main — if git auto-resolves, force-push (--force-with-lease), wait for CI, merge. Update Merge stage activeForm: Resolving merge conflict (rebase)git rebase --abort, close the PR, spawn a fresh Task Runner on updated main. The new runner re-implements the task from scratch. Max 1 redo per task.completedcompletedBatch-update TASKS.md for all merged tasks in a single commit.
Clean up worktrees:
git worktree remove .worktrees/<task-slug>
git worktree prune
After all tasks are complete, present a summary:
All N tasks completed.
| # | Task | PR | Status |
|---|------|----|--------|
| 1 | [title] | #[number] | Merged |
| 2 | [title] | #[number] | Merged |
...
If any tasks were skipped or need user attention, list them separately.
When spawning a Task Runner, use the Task tool with subagent_type=general-purpose and pass the following prompt. Replace bracketed placeholders with actual values.
You are a Task Runner. Execute the full development pipeline for a single task.
## Your Task
[task description from the task list]
## Project Context
[CLAUDE.md content, verbatim]
## Working Directory
[project root path, or worktree path if parallel]
## Subagent Roster
You may spawn sub-subagents for complex work:
| Subagent | How to spawn | Purpose | Writes code? |
|----------|-------------|---------|-------------|
| Planner | Task tool (subagent_type=Explore) | Analyze code, produce implementation plan | No |
| Implementer | Task tool (subagent_type=general-purpose) | Execute approved plan, write code + tests | Yes |
| Code reviewer | code-reviewer agent | Review PR for bugs, security, style | No |
| Debugger | debugger agent | Diagnose and fix errors, CI failures | Yes |
For simple tasks (1-3 files, straightforward change), you MAY skip sub-subagents and implement directly. For complex tasks (multi-file, architectural, new feature), use Planner then Implementer.
## Progress Tracking
The orchestrator has pre-created 8 pipeline stage tasks for you. Update them as you progress through each step so the user can see real-time status via `Ctrl+T`.
**Stage task IDs (in order):** [STAGE_TASK_IDS]
Stages: Plan, Implement, Verify, Audit, Commit & PR, Review, CI, Merge.
Update each stage with `TaskUpdate(taskId=<id>, status="in_progress")` when starting and `status="completed"` when done. Use the activeForm values from the Pipeline stages table. On retry, include agent name and count (e.g., `[debugger] Fixing test failures (retry 1/3)`).
Never create or delete tasks — the orchestrator owns the task lifecycle.
## Pipeline
Execute these steps in order. Do not skip steps. Do not ask the user for input — you are autonomous.
### Step 1: Create a feature branch
```bash
git checkout -b <type>/<short-slug>
Use a descriptive branch name: feat/core-types, fix/timestamp-bug, etc.
→ Mark stage 1 (Plan) as in_progress with activeForm [planner] Analyzing code and producing plan
Spawn a Planner subagent (Task tool, subagent_type=Explore) with the task description, project file structure, and relevant docs. It reads code and returns an implementation plan.
Review the plan yourself. Check for completeness, gaps, and alignment with the task. If lacking, re-plan with more specific instructions.
→ Mark stage 1 (Plan) as completed
→ Mark stage 2 (Implement) as in_progress with activeForm [implementer] Writing code and tests
Spawn an Implementer subagent (Task tool, subagent_type=general-purpose) with the approved plan and CLAUDE.md conventions. It writes all code and tests.
After the subagent completes, verify:
git diff --stat to review what changedIf verification fails:
[debugger] Fixing test failures (retry 1/3)[implementer] Fixing lint errors (retry 1/3)
Do not proceed until all checks pass.→ Mark stage 2 (Implement) as completed
→ Mark stage 3 (Verify) as in_progress with activeForm Running lint, typecheck, tests
Run the project's lint, format, typecheck, and test commands. Fix any failures. On retry, update activeForm with the retry count and agent if applicable.
→ Mark stage 3 (Verify) as completed
→ Mark stage 4 (Audit) as in_progress with activeForm [docs] [ci-cd] [smoke-test] Auditing in parallel
Spawn these as parallel Task subagents (subagent_type=general-purpose). Each gets the relevant skill instructions and directive: "Execute autonomously. Do not ask the user for approval."
~/.claude/skills/docs-consolidator/SKILL.md and pass its contents~/.claude/skills/ci-cd-pipeline/SKILL.md and pass its contents~/.claude/skills/smoke-test/SKILL.md and pass its contentsSkip any if the skill is unavailable. Wait for all to complete.
→ Mark stage 4 (Audit) as completed
→ Mark stage 5 (Commit & PR) as in_progress with activeForm Committing and opening PR
Stage and commit everything. Use conventional commit prefixes (feat:, fix:, chore:, docs:, ci:, refactor:, test:).
git push -u origin <branch-name>
gh pr create --fill
→ Mark stage 5 (Commit & PR) as completed
→ Mark stage 6 (Review) as in_progress with activeForm [code-reviewer] Reviewing PR
Spawn the code-reviewer agent to review the PR.
Handling results:
[implementer] Fixing review findings→ Mark stage 6 (Review) as completed
→ Mark stage 7 (CI) as in_progress with activeForm Waiting for CI checks
Run gh pr checks --watch --fail-fast to monitor CI.
Handling results:
gh run view <run-id> --log-failed, spawn debugger agent, fix, commit, push. Update activeForm: [debugger] Fixing CI failure (retry 1/3). Max 3 CI retries.→ Mark stage 7 (CI) as completed
When complete, report your result in this exact format (one line, no markdown):
READY: PR #<number>, review passed, CI passed. Branch: <branch-name>. Files changed: <count>.
If you could not complete the task:
FAILURE: <reason>. Last successful step: <step number>.
If the task is blocked by something outside your control:
BLOCKED: <reason>.
---
## Guidelines
- Start working immediately after discovering tasks. Don't ask the user to confirm the task list.
- One task = one Task Runner = one branch = one PR.
- Default to sequential execution. Only use parallel worktrees when tasks are clearly independent.
- Maximum 1 retry per failed task (spawn a new Task Runner). If the retry also fails, log and move on.
- If a task is too vague to implement, ask the user for clarification rather than guessing.
- When updating TASKS.md on main, use a minimal commit — don't open a PR for tracker updates.
- Skip audit subagents (docs-consolidator, ci-cd-pipeline, smoke-test) if those skills aren't installed. Don't fail the pipeline over optional steps.
- Respect the project's CLAUDE.md conventions and commands. Read it before doing anything.
- **Context conservation**: Ralph consumes minimal context per task because each Task Runner gets a fresh context window. Keep your own messages short — task description, result parsing, merge commands, tracker updates.
testing
Generate and maintain a local deploy script (scripts/deploy.sh). Discovers project services, deploys them locally, and health-checks each one. Use when the user asks to "smoke test", "deploy locally", "test local deploy", "update deploy script", "run deploy", or "run smoke test".
testing
Audit installed skills and agents for bloat, overlap, and improvement opportunities. Use when the user wants to review, audit, list, or improve their skills and agents. Triggers on "review skills", "audit skills", "list skills", "skill review", "improve skills".
development
Set up the autonomous post-task workflow for a project. Injects the standard development pipeline into AGENTS.md and installs all required skills and agents (docs-consolidator, ci-cd-pipeline, smoke-test, bug-bash-update, code-reviewer, debugger). Use at the start of a new project. Triggers on "setup workflow", "init workflow", "add workflow", or "set up project workflow".
tools
Analyze the current conversation for learnings and persist approved insights. Triggers on "reflect", "retrospective", "session review", "what did we learn", "conversation review".