agentleFS
bis-codebis-code/claude-toolkit/.claude/skills/ralph/SKILL.md

ralph

Skill8 starsChanged 6 months agoMITView on GitHub

Interactive feature builder with subagent delegation and approval gates.

45 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ultrawork, cancel and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • zephyrpersonalSkill

    ultrawork

    Obsessive task completion mode (Sisyphus Mode) - activates maximum intensity work with todo continuation enforcement

    Also in 7 projects that use this

  • woosikkimSkill

    cancel

    Clear any stale OMC-Slim state

    Also in 7 projects that use this

  • ibahgatSkill

    ralplan

    Create a strict, quality-first execution plan with explicit gates and rollback-ready sequencing.

    Also in 5 projects that use this

  • Jurel89Skill

    ultraqa

    QA cycling loop — build/lint/test, fix, retry up to 5 cycles

    Also in 3 projects that use this

  • JokerRunSkill

    compound-engineering

    Compound Engineering workflow for AI-assisted development. Use when planning features, executing work, reviewing code, or codifying learnings. Follows the Plan → Work → Review → Compound loop where each unit of engineering makes subsequent work easier. Triggers on: plan this feature, implement this, review this code, compound learnings, create implementation plan, systematic development.

    Also in 3 projects that use this

  • Jurel89Skill

    ai-slop-cleaner

    Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. 0 are common, 12 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 41 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No args — ask the user what to build

    line 18
  2. Very specific:

    Read $ARGUMENTS and determine the input mode.

    line 24
  3. Distinctive:

    No args → ask the user which issues or what to build

    line 33
  4. Very specific:

    Write prd.json following tools/ralph/prd.json.example schema

    line 46
  5. Very specific:

    Read .claude-toolkit.json for project config (test/lint commands, MCP servers)

    line 53
  6. Distinctive:

    Read CLAUDE.md for project conventions

    line 55
  7. Very specific:

    Create a feature branch if on main: ralph/<slug>

    line 59
  8. Very specific:

    Domain Agent Discovery: If the story's labels match a filename in .claude/agents/ (e.g., label billing matches billing.md), also spawn that …

    line 86
  9. Distinctive:

    APPROVAL GATE: Ask the user to approve, revise, or skip this story.

    line 125
  10. Distinctive:

    If the agent reports failures after implementation, retry once with the error context.

    line 160
  11. Distinctive:

    If the story touches auth, payments, user data, or secrets:

    line 175
  12. Distinctive:

    APPROVAL GATE: Ask the user to approve, request fixes, or skip.

    line 186
  13. Very specific:

    When all stories are either passes: true or stuck: true:

    line 229
  14. Distinctive:

    Final QA: Run the full test suite and linter.

    line 231
  15. Distinctive:

    Final approval: Ask user if they want to push to remote.

    line 244
  16. Distinctive:

    Max 2 retries per story: before marking as stuck

    line 248
  17. Very specific:

    prd.json corruption: If prd.json becomes invalid JSON, warn and restore from the last known good state

    line 249
  18. Distinctive:

    Agent failures: If a Task agent fails, log the error and retry once.

    line 250
  19. Distinctive:

    Test failures: Never commit with failing tests.

    line 251

“Common” is measured: kept by at least 6 in 10 of the 41 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/ralph

Orchestrates feature development across multiple user stories. Spawns specialized subagents for exploration, planning, implementation, and review — with human approval gates between phases.

Replaces the old ralph.sh bash loop with an interactive, token-efficient approach that runs inside the user's session.

Arguments: $ARGUMENTS

  • --issues N,N — build from specific GitHub issues
  • --label X — build from issues with that label
  • --prd path/to/prd.json — use an existing PRD
  • --auto — auto-approve gates (CI mode, skip approval prompts)
  • No args — ask the user what to build

Step 1: Initialize

Parse arguments

Read $ARGUMENTS and determine the input mode.

Generate or load PRD

If no prd.json exists (and --prd not provided):

  1. Fetch issues via gh CLI:
    • --issues N,N → gh issue view <N> --json number,title,body,labels,milestone
    • --label X → gh issue list --label "X" --state open --json number,title,body,labels
    • No args → ask the user which issues or what to build
  2. Decompose issues into user stories with strategy mapping:

    Story typeStrategy
    Simple feature, <= 3 criteriatdd-workflow
    Database/schema changesmigration-safety
    Touches multiple modulescross-module
    Payment/subscription logicbilling-security
    AI/LLM prompt changesai-prompt-design
    Multi-step user flowuser-flow
  3. Order stories: backend before frontend, migrations before code, core before UI
  4. Write prd.json following tools/ralph/prd.json.example schema
  5. APPROVAL GATE: Show the PRD to the user (story count, order, strategies). Wait for approval before proceeding. In --auto mode, skip this gate.

If prd.json exists (or --prd provided): read it directly.

Project configuration

  • Read .claude-toolkit.json for project config (test/lint commands, MCP servers)
  • Scan .claude/agents/ for available domain agents (filenames map to labels)
  • Read CLAUDE.md for project conventions

Branch and state

  • Create a feature branch if on main: ralph/<slug>
  • Initialize progress.txt if not present:
    # Progress Log
    Started: <date>
    ---

Step 2: Story Loop

Process each story in priority order where passes == false and stuck != true.

For each story, run five phases:


Phase 1: Understand

Explore the codebase area relevant to this story.

Task(subagent_type="planner"):
  "Explore the codebase to understand: <story title>.
   Focus on: <acceptance criteria summary>.
   Return: affected files, existing patterns, relevant tests, dependencies."

Domain Agent Discovery: If the story's labels match a filename in .claude/agents/ (e.g., label billing matches billing.md), also spawn that domain agent:

Task(subagent_type=<matched-agent>):
  "Provide domain-specific context for: <story title>.
   Story details: <acceptance criteria>."

Contract Truth Verification (blockchain projects only): If the story has a blockchain or solidity label, or the project has a blockchain domain agent, spawn a verification step:

Task(subagent_type=<blockchain-domain-agent>):
  "List what the smart contract interface actually supports.
   Compare against the story requirements: <acceptance criteria>.
   Flag any mismatches — features the contract doesn't support,
   missing functions, or incompatible return types."

This prevents hallucinating features the contract doesn't support. Any mismatches must be resolved before proceeding to Phase 2.

Summarize findings in < 500 words. This summary is passed forward to Phase 2.


Phase 2: Plan

Generate an implementation plan.

Task(subagent_type="planner"):
  "Plan implementation for: <story title>.
   Context from exploration: <Phase 1 summary>.
   Acceptance criteria: <list>.
   Constraints: TDD mandatory, conventional commits, one story only.
   Return: ordered steps, files to change, test strategy, risks."

Present the plan to the user.

APPROVAL GATE: Ask the user to approve, revise, or skip this story.

  • Approve → proceed to Phase 3
  • Revise → re-run Phase 2 with feedback
  • Skip → mark story as skipped, move to next

In --auto mode: auto-approve.


Phase 3: Implement

Execute the approved plan using TDD.

For standard stories:

Task(subagent_type="tdd-guide"):
  "Implement the following plan with strict TDD (test first):
   Plan: <approved plan from Phase 2>.
   Test command: <from .claude-toolkit.json or auto-detected>.
   Lint command: <from .claude-toolkit.json or auto-detected>.
   Acceptance criteria: <list>.
   IMPORTANT: Write failing tests first, then implement, then refactor.
   Commit with conventional format referencing issue #N."

For complex stories (cross-module, migration-safety, or stories that failed once with tdd-guide):

Task(subagent_type="planner"):
  "Implement this plan. The story is complex — consider architecture implications.
   Plan: <approved plan from Phase 2>.
   Test/lint commands: <from config>.
   Acceptance criteria: <list>.
   TDD is mandatory. Commit with conventional format referencing issue #N."

If the agent reports failures after implementation, retry once with the error context. If still failing after 2 total attempts, mark the story as stuck.


Phase 4: Review

Review the changes made in Phase 3.

Task(subagent_type="code-reviewer"):
  "Review the changes for story: <title>.
   Focus on: correctness, error handling, test coverage, style.
   Changed files: <list from Phase 3>."

If the story touches auth, payments, user data, or secrets:

Task(subagent_type="security-reviewer"):
  "Security review for story: <title>.
   Focus on: OWASP top 10, auth bypass, data exposure.
   Changed files: <list from Phase 3>."

Present review findings to the user.

APPROVAL GATE: Ask the user to approve, request fixes, or skip.

  • Approve → proceed to Phase 5
  • Fix → re-run Phase 3 with review feedback, then re-review
  • Skip → mark story as skipped

In --auto mode: auto-approve if no CRITICAL findings. If CRITICAL findings exist, pause and present to user regardless.


Phase 5: Commit & Update State

  1. Commit (if not already committed by tdd-guide):
    git add <specific files>
    git commit -m "<type>(<scope>): <description>
    
    Closes #<issue>
    
    Co-Authored-By: Claude <noreply@anthropic.com>"
  2. Update prd.json: Set passes: true for the completed story, increment iterations.
  3. Append to progress.txt:
    ## [Date] - [Story ID]: [Title]
    - Implemented: <summary>
    - Files changed: <list>
    - Tests: <what was added>
    ---
  4. Save deep-think checkpoint (if MCP available):
    checkpoint(operation="save", name="<story-id>")

On stuck stories: Set stuck: true and stuckReason in prd.json. Log the reason in progress.txt. Move to next story.


Step 3: Completion

When all stories are either passes: true or stuck: true:

  1. Final QA: Run the full test suite and linter.
  2. Print summary table:
    Story    | Status    | Iterations
    ---------|-----------|----------
    US-001   | DONE      | 1
    US-002   | DONE      | 2
    US-003   | STUCK     | 2 (reason)
  3. Stuck stories: Suggest creating GitHub issues for any stuck stories:
    gh issue create --title "<story title>" --body "<context>" --label "claude-ready"
  4. Final approval: Ask user if they want to push to remote.

Error Handling

  • Max 2 retries per story before marking as stuck
  • prd.json corruption: If prd.json becomes invalid JSON, warn and restore from the last known good state
  • Agent failures: If a Task agent fails, log the error and retry once. If it fails again, mark story as stuck with the error context.
  • Test failures: Never commit with failing tests. Either fix or mark stuck.

State Management

FilePurpose
prd.jsonStory definitions, status, strategy assignments
progress.txtHuman-readable log, codebase patterns section
Deep-think checkpointsReasoning state per story (if MCP available)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.