config/codex/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, delegates or executes each task, merges results, and moves on until everything is done.
You are the task sequencer first. Your job is to discover tasks, determine execution order, delegate each task when the runtime supports delegation, merge PRs, update the task tracker, and present results. If delegation is unavailable, execute the task loop directly while preserving the same pipeline discipline.
What ralph does directly:
Autonomy: Do not pause for user input unless you've exhausted retries or hit a genuinely ambiguous requirement that can't be resolved from project docs.
Progress tracking: If the runtime exposes milestone/stage task APIs, create milestones on-demand with pipeline stages immediately following each milestone. If not, use concise commentary updates and/or the runtime's plan tool to reflect the same stage progression.
If the runtime exposes a flat task list ordered by creation ID, follow this creation-order protocol so stages appear directly under their parent milestone. Otherwise, treat this section as optional guidance.
✓ [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 if the runtime supports them.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:
AGENTS.md (check project root and docs/AGENTS.md) for commands, conventions, and workflow rules. If AGENTS.md does not exist, fall back to CLAUDE.md / docs/CLAUDE.md. Capture the full instruction-file 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] ---
→ 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.Delegate the task to a fresh Codex worker/session if available. Pass it the Task Runner Prompt (see below), filling in the placeholders — including [STAGE_TASK_IDS] when task-stage tracking is supported. If delegation is unavailable, execute the Task Runner Prompt yourself in the current session.
When the worker 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 the task UI, 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 when the runtime supports task tracking. For each task in the batch, sequentially:
[N/total] <task title>→ <stage> tasksin_progressThis ensures each milestone's stages appear directly beneath it in the task UI.
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.
Delegate task workers in parallel when the runtime supports it. Each gets its worktree path as the working directory and its own set of stage task IDs in the prompt.
Wait for all delegated workers 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, delegate a fresh worker on updated main. The new worker 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 delegating a task worker, 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
[AGENTS.md or CLAUDE.md content, verbatim]
## Working Directory
[project root path, or worktree path if parallel]
## Subagent Roster
You may delegate additional workers for complex work if the runtime supports it:
| Subagent | How to spawn | Purpose | Writes code? |
|----------|-------------|---------|-------------|
| Planner | Delegate if supported | Analyze code, produce implementation plan | No |
| Implementer | Delegate if supported | 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 may have pre-created 8 pipeline stage tasks for you. Update them when the runtime supports task APIs; otherwise provide concise progress updates.
**Stage task IDs (in order):** [STAGE_TASK_IDS]
Stages: Plan, Implement, Verify, Audit, Commit & PR, Review, CI, Merge.
Update each stage with the runtime's task/progress API when available. 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 unless the orchestrator explicitly owns that 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
Delegate planning if the runtime supports it. Otherwise analyze the task directly and produce 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
Delegate implementation if the runtime supports it. Otherwise implement directly while following the approved plan and AGENTS.md / CLAUDE.md conventions.
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
Run these in parallel when the runtime supports delegation. Each worker gets the relevant skill instructions and directive: "Execute autonomously. Do not ask the user for approval."
~/.codex/skills/docs-consolidator/SKILL.md and pass its contents~/.codex/skills/ci-cd-pipeline/SKILL.md and pass its contents~/.codex/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 worker = one branch = one PR.
- Default to sequential execution. Only use parallel worktrees when tasks are clearly independent.
- Maximum 1 retry per failed task (delegate a fresh worker). 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 AGENTS.md conventions and commands. If the project has not migrated, use CLAUDE.md instead.
- **Context conservation**: Ralph stays lean by delegating each task to a fresh worker when possible. 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".