ralph

ralph is a command for Claude Code from samqin123/Claude_skill_pool. It costs 12 tokens per session (1,537 once invoked), scanned A, original, Apache-2.0.

An autonomous coding command that repeatedly starts fresh AI agents to implement one user story at a time from a product requirements document (PRD). It can convert the PRD into `prd.json`, a structured task file, before running.

In plain words
What is it for?
Use it with a Markdown PRD, an existing `prd.json`, or no argument when the task file is already in the project.
Why use it?
It reduces the need to supervise every implementation step manually. It also tracks progress and can archive the previous run when switching to another feature branch.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/samqin123/claude_skill_pool/ralph
Clone the repo
git clone --depth 1 https://github.com/samqin123/Claude_skill_pool

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ralph

README.md
[![agentmods](https://agentmods.dev/badge/commands/samqin123/claude_skill_pool/ralph.svg)](https://agentmods.dev/commands/samqin123/claude_skill_pool/ralph)
Your own site
<a href="https://agentmods.dev/commands/samqin123/claude_skill_pool/ralph"><img src="https://agentmods.dev/badge/commands/samqin123/claude_skill_pool/ralph.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,537 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00012 $0.01537
Opus 5 $0.00006 $0.00768
Sonnet 5 $0.00002 $0.00307
Haiku 4.5 $0.00001 $0.00154

Measured 4d ago against content hash 18ba28d4de8d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ralph scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

package/full-dev-脚手架/.claude/commands/ralph.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ralph - Autonomous Agent Loop

Ralph implements PRDs by repeatedly spawning fresh AI instances to complete user stories one by one.


Phase 1: PRD Conversion (if markdown PRD provided)

Step 1: Check Input

Check if the user provided a path to a PRD file. If not, look for prd.json in the project root.

User input formats:

  • /ralph tasks/prd-my-feature.md - Convert PRD and run Ralph
  • /ralph prd.json - Run Ralph with existing prd.json
  • /ralph - Run Ralph (looks for prd.json)

Step 2: Archive Previous Run (if needed)

Check if prd.json exists with a different branchName. If so:

  1. Read current prd.json and extract branchName
  2. Check if it differs from the new feature's branch
  3. If different AND prd-progress.txt has content:
    • Create archive folder: .claude/archive/YYYY-MM-DD-[feature-name]/
    • Copy current prd.json and prd-progress.txt to archive
    • Reset prd-progress.txt with fresh header

Step 3: Convert to prd.json

Parse the PRD and generate prd.json in the project root:

{
  "project": "[Project Name from PRD or auto-detected]",
  "branchName": "ralph/[feature-name-kebab-case]",
  "description": "[Feature description from PRD]",
  "userStories": [
    {
      "id": "US-001",
      "title": "[Story title]",
      "description": "As a [user], I want [feature] so that [benefit]",
      "acceptanceCriteria": [
        "Criterion 1",
        "Criterion 2",
        "Typecheck passes"
      ],
      "priority": 1,
      "passes": false,
      "notes": ""
    }
  ]
}

Conversion Rules

  1. Each user story becomes one JSON entry
  2. IDs: Sequential (US-001, US-002, etc.)
  3. Priority: Based on dependency order (schema → backend → UI)
  4. All stories: passes: false and empty notes
  5. branchName: Derive from feature name, kebab-case, prefixed with ralph/
  6. Always add: "Typecheck passes" to every story
  7. For UI stories: Add "Verify in browser using dev-browser skill"

Read the full file on GitHub · 227 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 227 lines · 12 tokens per session scan A 18ba28d4de8d

Subscribe to this mod's changes

ralph is a command published in the GitHub repository samqin123/Claude_skill_pool (2 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 12 tokens to every session and 1,537 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.