ralph.template

ralph.template is a command for coding agents from evan043/claude-cli-advanced-starter-pack. It costs 0 tokens per session (2,069 once invoked), scanned A, original, MIT.

A repeated test-and-fix workflow that runs a test command, addresses failures, and repeats until tests pass or a limit is reached. TDD means writing tests around requirements before or alongside the code.

In plain words
What is it for?
Use it with an automatically detected or supplied test command, with optional limits, Playwright browser tests, or requirement-first BDD mode.
Why use it?
It reduces the manual effort of rerunning tests and handling failures one cycle at a time.

Command

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/evan043/claude-cli-advanced-starter-pack/ralph.template
Clone the repo
git clone --depth 1 https://github.com/evan043/claude-cli-advanced-starter-pack

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.template

README.md
[![agentmods](https://agentmods.dev/badge/commands/evan043/claude-cli-advanced-starter-pack/ralph.template.svg)](https://agentmods.dev/commands/evan043/claude-cli-advanced-starter-pack/ralph.template)
Your own site
<a href="https://agentmods.dev/commands/evan043/claude-cli-advanced-starter-pack/ralph.template"><img src="https://agentmods.dev/badge/commands/evan043/claude-cli-advanced-starter-pack/ralph.template.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 2,069 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.1 $0.00000 $0.02069
Opus 5 $0.00000 $0.01035
Sonnet 5 $0.00000 $0.00414
Haiku 4.5 $0.00000 $0.00207

Measured 5d ago against content hash 607e23937189, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

ralph.template 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 5d 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.

templates/commands/ralph.template.md · 265 lines

How it starts

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

Codex Runtime Compatibility

This prompt was authored for Claude-style slash workflows. In Codex runtime, adapt tool calls as follows:

  • AskUserQuestion => ask the user directly in chat.
  • WebSearch/WebFetch => use available web tools (search_query, open, find) and cite links.
  • Read/Write => use shell/filesystem tools in this workspace.
  • Claude-only MCP calls (for example Playwright MCP names) => use available equivalents or clearly state fallback.
  • Keep intent and output format identical; only adapt execution mechanics.

description: Ralph Loop - Continuous test-fix cycle until all tests pass model: sonnet argument-hint: [test command or 'auto']

/ralph - Ralph Loop (Continuous Test-Fix Cycle)

"I'm helping!" - Ralph Wiggum

Run tests continuously, fixing failures automatically until all tests pass or max iterations reached.

Quick Start

/ralph                    # Auto-detect test command, run loop
/ralph npm test           # Use specific test command
/ralph --max 5            # Limit to 5 iterations
/ralph --playwright       # Run Playwright E2E tests
/ralph --bdd              # Enable BDD mode (requirement-first workflow)
/ralph --stop             # Stop current Ralph loop

BDD Mode (--bdd)

When --bdd flag is used, Ralph enforces a Behavior-Driven Development workflow:

  1. Check for requirements: Scans for REQUIREMENTS.md or *.feature files
  2. Parse scenarios: Extracts Gherkin-style Given/When/Then from requirements
  3. Verify test coverage: Ensures BDD scenarios have corresponding test stubs
  4. Block implementation: Prevents code changes if scenarios lack tests
  5. Standard Ralph loop: Once tests exist, runs the normal test-fix cycle

Supported BDD frameworks: jest-cucumber, Cucumber, pytest-bdd, Behave

The BDD hook (ralph-bdd-mode) runs before the standard Ralph enforcer, creating a two-layer workflow: BDD scenarios → test stubs → implementation → Ralph test-fix loop.

Read the full file on GitHub · 265 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. 5d ago First seen · 265 lines · 0 tokens per session scan A 607e23937189

Subscribe to this mod's changes

ralph.template is a command published in the GitHub repository evan043/claude-cli-advanced-starter-pack (61 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,069 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.