ralph

ralph is a skill for Codex from samqin123/Claude_skill_pool. It costs 61 tokens per session (791 once invoked), scanned A, original, Apache-2.0.

An autonomous coding loop that turns a Markdown PRD—a document describing a product and its requirements—into structured user stories, then works through them one at a time with a new agent each round.

In plain words
What is it for?
Use it to convert PRDs into implementation tasks, create a feature branch, implement stories in dependency order, run required checks, and track progress.
Why use it?
It breaks a large feature request into smaller deliverable tasks and keeps progress in files and Git history between rounds. This reduces the need to restate the whole project after each attempt.

Skill for Codex

Written for Codex: agents/openai.yaml present.

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 skills/samqin123/claude_skill_pool/ralph
Any agent
npx skills add samqin123/Claude_skill_pool --skill ralph
Clone the repo
git clone --depth 1 https://github.com/samqin123/Claude_skill_pool

Made for: Codex.

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/skills/samqin123/claude_skill_pool/ralph.svg)](https://agentmods.dev/skills/samqin123/claude_skill_pool/ralph)
Your own site
<a href="https://agentmods.dev/skills/samqin123/claude_skill_pool/ralph"><img src="https://agentmods.dev/badge/skills/samqin123/claude_skill_pool/ralph.svg" alt="Measured on agentmods" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 791 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.00061 $0.00791
Opus 5 $0.00030 $0.00396
Sonnet 5 $0.00012 $0.00158
Haiku 4.5 $0.00006 $0.00079

Measured 5d ago against content hash dd7a3ea8d891, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 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.

package/full-dev-脚手架/.codex/skills/ralph/SKILL.md · 81 lines

What it actually says

Ralph - Autonomous Agent Loop

Overview

将 PRD 转为结构化 prd.json,然后循环生成全新 Agent 实例逐个完成 User Story,每轮实例只有 Git 历史 + prd-progress.txt + prd.json 作为上下文记忆。

Workflow

Phase 1: PRD Conversion (if markdown provided)

  1. 读取 PRD — 解析用户提供的 Markdown PRD 文件。
  2. 归档上一次运行 — 若 prd.json 已存在且 branchName 不同,归档到 .claude/archive/YYYY-MM-DD-[feature]/
  3. 生成 prd.json — 按以下格式:
{
  "project": "[Project Name]",
  "branchName": "ralph/[feature-kebab-case]",
  "description": "[Description]",
  "userStories": [
    {
      "id": "US-001",
      "title": "[Story title]",
      "description": "As a [user], I want [feature] so that [benefit]",
      "acceptanceCriteria": ["Criterion 1", "Typecheck passes"],
      "priority": 1,
      "passes": false,
      "notes": ""
    }
  ]
}

Story 规则

  • 每个 Story 必须单轮可完成(2-3 句话能描述的变更)。
  • 按依赖排序:schema → backend → UI → dashboard。
  • 每个 Story 必须包含 "Typecheck passes"。
  • UI Story 额外包含 "Verify in browser"。

Phase 2: Ralph Execution

  1. 预检 — 确认 amp CLI、jq 已安装,Git 工作目录干净,prd.json 有效。
  2. 创建/切换分支 — 从 prd.json 读取 branchName
  3. 执行循环bash .claude/scripts/ralph.sh [max_iterations](默认 10 轮):
    • 生成全新 Agent 实例 + .claude/scripts/prompt.md
    • Agent 选取最高优先级未完成 Story
    • 实现 → 质量检查(typecheck/lint/test)→ 通过则提交
    • 更新 prd.json(passes: true)+ 追加 prd-progress.txt
    • 循环直到全部通过或达到最大轮数

Memory Between Iterations

唯一的跨轮记忆:

  • Git 历史(之前的提交)
  • prd-progress.txt(学习日志)
  • prd.json(完成状态)

每轮都是全新实例,无隐式状态泄漏。

Key Files

文件 用途
.claude/scripts/ralph.sh Bash 循环脚本
.claude/scripts/prompt.md 每轮 Agent 的指令
prd.json User Story 及完成状态
prd-progress.txt 追加式学习日志
.claude/archive/ 历史运行归档

Guardrails

  • Story 必须小到单轮可完成,否则强制拆分。
  • 不提交未通过质量检查的代码。
  • Git 工作目录必须干净才能启动。
  • 支持断点续传(重新运行即从未完成处继续)。
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 81 lines · 61 tokens per session scan A dd7a3ea8d891

Subscribe to this mod's changes

ralph is a skill published in the GitHub repository samqin123/Claude_skill_pool (2 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 61 tokens to every session and 791 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens