claude-ralph-mode: Command for Claude Code

.claude/commands/prd.md

prd is a command for Claude Code from argile-ai/claude-ralph-mode. It costs 0 tokens per session (861 once invoked), scanned A, original, MIT.

A command for converting plan.md into prd.json, a machine-readable product requirements document for the Ralph workflow.

In plain words
What is it for?
Use it after generating and validating a plan to create repository branch details, user stories, descriptions, and acceptance criteria for execution.
Why use it?
It avoids manually rewriting a validated plan into structured user stories and acceptance checks.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is argile-ai/claude-ralph-mode's own configuration. It tells Claude Code how to work on claude-ralph-mode itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-ralph-mode configures →

Reuse

Borrowing it

Nothing to install: this file belongs to argile-ai/claude-ralph-mode. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/argile-ai/claude-ralph-mode/main/.claude/commands/prd.md
Clone the repo
git clone --depth 1 https://github.com/argile-ai/claude-ralph-mode

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 prd

README.md
[![agentmods](https://agentmods.dev/badge/commands/argile-ai/claude-ralph-mode/prd.svg)](https://agentmods.dev/commands/argile-ai/claude-ralph-mode/prd)
Your own site
<a href="https://agentmods.dev/commands/argile-ai/claude-ralph-mode/prd"><img src="https://agentmods.dev/badge/commands/argile-ai/claude-ralph-mode/prd.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 861 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00861
Opus 5 $0.00000 $0.00430
Sonnet 5 $0.00000 $0.00172
Haiku 4.5 $0.00000 $0.00086

Measured 8d ago against content hash 22a6c7eb09c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

prd 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 8d 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.

.claude/commands/prd.md · 177 lines

How it starts

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

PRD - Convert Plan to JSON

Convert a validated plan.md into an executable prd.json for Ralph.


The Job

  1. Read the plan from plan.md
  2. Read repository configuration from ralph.config.json
  3. Parse user stories and convert to JSON format
  4. Generate prd.json with proper structure
  5. Display summary and next steps

Step 1: Validate Prerequisites

Check that these files exist:

  • plan.md - The implementation plan (generated by /ralph)
  • ralph.config.json - Project configuration

If plan.md doesn't exist, instruct the user to run /ralph <feature> first.


Step 2: Parse Plan

Extract from plan.md:

  • Project name (from H1 heading)
  • Feature description (from intro paragraph)
  • User stories (from ## User Stories section)

For each user story, extract:

  • ID (US-001, US-002, etc.)
  • Title
  • Repository name
  • Description
  • Acceptance criteria (as array)

Step 3: Generate PRD JSON

Create prd.json with this structure:

{
  "project": "[Project Name]",
  "description": "[Feature Description]",
  "repositories": {
    "[repo-key]": {
      "branchName": "feature/[feature-slug]"
    }
  },
  "userStories": [
    {
      "id": "US-001",
      "title": "[Story Title]",
      "repo": "[repo-key]",
      "description": "[Full description]",
      "acceptanceCriteria": [
        "Criterion 1",
        "Criterion 2",
        "Tests pass"
      ],
      "priority": 1,
      "passes": false,
      "fork": false,
      "notes": ""
    }
  ]
}

Step 4: Repository Mapping

Map story repositories to config keys:

  • Read repositories from ralph.config.json
  • Match story repository names to config keys
  • Use the repository path for execution

Example mapping:

  • Story says backend -> maps to config key backend -> path ./backend
  • Story says frontend -> maps to config key frontend -> path ./frontend

Step 5: Branch Naming

Generate branch names automatically:

  • Convert feature name to kebab-case
  • Prefix with feature/
  • Example: "User Authentication" -> feature/user-authentication

Read the full file on GitHub · 177 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. 8d ago First seen · 177 lines · 0 tokens per session scan A 22a6c7eb09c3

Subscribe to this mod's changes

prd is a command published in the GitHub repository argile-ai/claude-ralph-mode (11 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 861 tokens. 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-30.