Token导航 LogoToken导航

Agent Skill · 研究检索

ralph-loop(拉尔夫·鲁普)

ralph-loop 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

ralph-loop 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 52,216。

总安装 563周安装 23GitHub Stars 25下载 182核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ralph-loop(拉尔夫·鲁普)
来源仓库:https://github.com/oimiragieo/agent-studio
仓库路径:skills/ralph-loop
安装命令:
npx skills add https://github.com/oimiragieo/agent-studio --skill ralph-loop
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/oimiragieo/agent-studio --skill ralph-loop

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

ralph-loop 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。适用于特定流程优化或信息筛选类任务场景。通过 npx skills add 命令从 GitHub 仓库安装并使用。安装前需确认权限范围、维护状态及是否触发联网或文件操作。

建议结合原始 README 核验具体用法和功能边界。

来源仓库内路径:skills/ralph-loop

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/oimiragieo/agent-studio --skill ralph-loop;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

ralph-loop 怎么安装?

在终端执行 npx skills add https://github.com/oimiragieo/agent-studio --skill ralph-loop。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

ralph-loop 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

ralph-loop 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

ralph-loop 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

ralph-loop 用的人多吗?

公开数据是累计安装 563 次,近一周安装 23 次,下载 182 次,GitHub 25 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

ralph-loop 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
ralph-loop

拉尔夫·鲁普 · 本页

56325接触敏感数据未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Ralph Loop

Autonomous iteration loop for Claude Code with dual-mode support. Named after the Ralph Wiggum technique popularized in the Claude Code community (Dec 2025 - Feb 2026).

Purpose

Enable Claude Code to work autonomously on well-defined tasks until genuine completion, without manual re-prompting. The skill provides:

  1. Dual-mode architecture — Standalone mode (Stop hook) or multi-agent mode (router-managed iteration)
  2. RALPH_ACTIVE env var guard — Stop hook only activates when RALPH_ACTIVE=1 is set, preventing host/router trapping
  3. State persistence — JSON state file tracks iteration count, timestamps, findings
  4. Circuit breaker — Detects repeated failures and exits gracefully
  5. Verification-first exit — Completion signal only accepted when validation commands pass
  6. Guardrails — Accumulated lessons from past failures prevent repeated mistakes

When to Use

  • Well-defined tasks with clear, testable success criteria
  • Iterative work (get tests passing, fix lint errors, audit codebase)
  • Overnight or background autonomous runs
  • Multi-phase audits with structured findings logs

When NOT to Use

  • Subjective goals ("make the code better")
  • One-off fixes that don't need iteration
  • Tasks requiring human judgment at each step
  • Exploratory research without clear deliverables

Architecture — Two Modes

Mode 1: Standalone (Stop Hook)

For single-session use. The Stop hook keeps the session alive until completion. Requires RALPH_ACTIVE=1 env var (set by the launcher scripts).

User runs ralph-audit.sh/bat (sets RALPH_ACTIVE=1)
    |
    v
Claude works on task (reads PROMPT.md)
    |
    v
Claude attempts to exit
    |
    v
Stop hook intercepts (ralph-stop-hook.cjs)
    |
    +-- RALPH_ACTIVE != '1'? --> YES --> exit(0) immediately (no-op)
    |
    +-- Completion signal found? --> YES --> Clear state, exit(0)
    |
    +-- Max iterations reached? --> YES --> Clear state, exit(0)
    |
    +-- NO --> Increment iteration, save state, re-inject prompt, block exit

Mode 2: Router-Managed (Multi-Agent) -- Primary mode for agent-studio

This is the primary mode within agent-studio. The router manages iteration by spawning and re-spawning QA agents via Task(). No Stop hook is involved -- the router itself controls the loop lifecycle. The state file at .claude/context/runtime/ralph-state.json within agent-studio tracks iteration progress.

Router receives /ralph-loop command
    |
    v
Router spawns QA agent with audit prompt via Task()
    |
    v
QA agent completes, reports findings via TaskUpdate()
    |
    v
Router checks audit state file (.claude/context/runtime/ralph-state.json)
    |
    +-- RALPH_AUDIT_COMPLETE_NO_FINDINGS? --> Done
    |
    +-- RALPH_ITERATION_COMPLETE? --> Spawn another QA agent
    |
    +-- Max iterations? --> Report and stop

Why two modes: Stop hooks fire on the host session, not on subagents. In multi-agent setups (like agent-studio), the Stop hook would trap the router. The RALPH_ACTIVE guard ensures the hook is a no-op unless explicitly activated by a standalone launcher. In agent-studio, Mode 2 is used exclusively -- the router orchestrates iteration without any Stop hook registration.

Components

Skill Bundle (included in this skill directory)

FileRelative PathPurpose
Main scriptscripts/main.cjsCLI for status/reset/config of ralph loop state
Pre-execute hookhooks/pre-execute.cjsInput validation before skill execution
Post-execute hookhooks/post-execute.cjsOutput validation after skill execution
Input schemaschemas/input.schema.jsonInput validation schema
Output schemaschemas/output.schema.jsonOutput contract schema
Implementation templatetemplates/implementation-template.mdPROMPT.md and launcher templates
Skill rulerules/ralph-loop.mdSkill-specific rules

Project-Level Files (set up per-project by the user)

These files are NOT part of the skill bundle. They live in the hosting project's .claude/ directory and must be created/configured by the user or via the implementation template.

FileProject PathPurpose
Stop hook.claude/hooks/ralph-stop-hook.cjsLoop controller (stdin -> transcript check -> re-inject)
Prompt.claude/ralph/PROMPT.mdAudit/task instructions re-injected each iteration
State.claude/context/runtime/ralph-state.jsonIteration count, timestamps, findings count (auto-created)
Guardrails.claude/ralph/guardrails.mdLearned lessons from past failures
Launcher (bash).claude/ralph/ralph-audit.shUnix/macOS launcher script (sets RALPH_ACTIVE=1)
Launcher (bat).claude/ralph/ralph-audit.batWindows launcher script (sets RALPH_ACTIVE=1)
Settings.claude/settings.jsonStop hook registration (Mode 1 only)

Usage

Standalone Mode (Stop Hook)

# From your project's workspace root — sets RALPH_ACTIVE=1 automatically
.claude/ralph/ralph-audit.sh      # Unix/macOS
.claude\ralph\ralph-audit.bat     # Windows

Manual Standalone Start

# Must set RALPH_ACTIVE=1 yourself for the Stop hook to activate
export RALPH_ACTIVE=1
claude --print-output-format text < .claude/ralph/PROMPT.md

Multi-Agent Mode (Router-Managed)

Use the /ralph-loop command within agent-studio, or have the router spawn QA agents with the audit prompt. The router manages iteration; no Stop hook is involved.

Custom Prompt

Create a custom PROMPT.md with:

  1. Mission — What the agent must accomplish
  2. Scope — Specific areas to audit/fix
  3. Validation commands — Commands that must pass
  4. Completion condition — The exact completion signal string

Completion Signals

SignalMeaning
RALPH_AUDIT_COMPLETE_NO_FINDINGSAll validations pass, zero open findings
RALPH_ITERATION_COMPLETE: N findings remainProgress made, N findings still open

Stop Hook Protocol

The stop hook (ralph-stop-hook.cjs) follows this protocol:

  1. GUARD 0: Check RALPH_ACTIVE env var — if not '1', exit 0 immediately (no stdin read, no file checks, no-op). This is the critical protection that prevents the hook from trapping the host/router session.
  2. Read stdin (Claude Code transcript JSON)
  3. Check stop_hook_active guard (prevent infinite re-triggering)
  4. Check if ralph-state.json exists (no state = no active loop)
  5. Check transcript for RALPH_AUDIT_COMPLETE_NO_FINDINGS

- Found → clear state file, exit 0 (allow exit)

  1. Load state from ralph-state.json, increment iteration
  2. Check for progress signal (RALPH_ITERATION_COMPLETE)
  3. Check circuit breaker (findings count stuck for N iterations)
  4. Check max iterations (default: 25)

- Reached → clear state, exit 0 (force stop)

  1. Save updated state
  2. Read PROMPT.md and write to stdout as JSON {decision: 'block', reason: <prompt>}
  3. Exit 0 (with block decision in stdout)

Exit Codes

CodeMeaning
0Allow exit (complete, max iterations, or error)
2Block exit, stdout fed back as next prompt

Configuration

Environment Variables

VariableDefaultDescription
RALPH_ACTIVE(unset)Must be 1 to activate the Stop hook. Set by launcher scripts. Without this, the hook is a no-op.
RALPH_MAX_ITERATIONS25Maximum loop iterations
RALPH_COMPLETION_SIGNALRALPH_AUDIT_COMPLETE_NO_FINDINGSString that signals completion
RALPH_CIRCUIT_BREAKER_THRESHOLD3Consecutive iterations with unchanged findings count before circuit breaker trips

State File Schema

{
  "iteration": 3,
  "startedAt": "2026-02-28T10:00:00Z",
  "lastRunAt": "2026-02-28T10:15:00Z",
  "lastFindingsCount": 5
}

TDD State Schema (for TDD-mode loops)

When using ralph-loop for TDD workflows, use a separate TDD-specific state file at .claude/context/runtime/tdd-state.json. This schema tracks per-scenario RED/GREEN evidence across session interruptions:

{
  "scenarios": [
    {
      "id": "sc-001",
      "description": "routing-guard blocks Write on creator paths",
      "status": "pending|red|green|refactored"
    }
  ],
  "completedScenarios": [
    {
      "id": "sc-001",
      "evidenceCommand": "node --test tests/hooks/routing-guard.test.cjs",
      "redEvidence": "AssertionError: expected exit code 2, got 0",
      "greenEvidence": "✓ routing-guard blocks Write (4ms)",
      "passedAt": "2026-03-12T10:00:00Z"
    }
  ],
  "currentScenario": "sc-002",
  "evidenceLog": [
    {
      "scenarioId": "sc-001",
      "phase": "red|green|refactored",
      "output": "<verbatim test runner output>",
      "timestamp": "2026-03-12T09:58:00Z"
    }
  ]
}

TDD Session Resumption: On each loop iteration, before picking a scenario:

const tddState = JSON.parse(
  fs.readFileSync('.claude/context/runtime/tdd-state.json', 'utf-8') || '{}'
);
const completedIds = (tddState.completedScenarios || []).map(s => s.id);
const remaining = (tddState.scenarios || []).filter(s => !completedIds.includes(s.id));
if (remaining.length === 0) {
  // All scenarios complete — emit RALPH_AUDIT_COMPLETE_NO_FINDINGS
  console.log('RALPH_AUDIT_COMPLETE_NO_FINDINGS');
  process.exit(0);
}
const nextScenario = remaining[0];

Critical rule: Never re-execute scenarios already in completedScenarios. The evidenceLog is append-only — each phase (red/green/refactored) adds a new entry. Circuit breaker trips if currentScenario is unchanged for 3+ iterations.

Integration with TDP: When spawning the developer agent for a TDD loop iteration, extract the red evidence from evidenceLog and inject verbatim into the spawn prompt (see tdd skill — Test-Driven Prompting pattern).

Writing Effective Prompts

Structure

# Mission

One-line directive.

## Before Doing Anything

Step 1: Read previous findings (if exists)
Step 2: Load context/skills

## Scope

Numbered list of areas to audit/fix.

## Validation Commands

Commands that must pass for completion.

## Findings Log

Where to write findings (path + format).

## Completion Condition

Exact signal strings and when to use each.

Best Practices

  1. Binary criteria — "All tests pass" not "code is good"
  2. Validation commands — Include runnable commands (pnpm test, pnpm lint)
  3. Findings format — Structured findings with severity, file, status
  4. Idempotent — Prompt must work correctly on any iteration (read state first)
  5. Context management — Include token-saver invocation for long sessions

Guardrails Pattern

The guardrails.md file accumulates "Signs" — lessons learned from failures:

### Sign: [Name]

- **Trigger**: When this applies
- **Instruction**: What to do
- **Added after**: What failure taught this

Agents should read guardrails.md at the start of each iteration and add new Signs when they encounter novel failure modes.

Enforcement Hooks

Input validated against schemas/input.schema.json before execution. Output contract defined in schemas/output.schema.json.

Anti-Patterns

Anti-PatternWhy It FailsCorrect Approach
No max iterationsInfinite loop burns tokensAlways set maxIterations (default 25)
Vague completion criteriaAgent claims "done" prematurelyUse binary pass/fail validation commands
No state persistenceProgress lost on context resetWrite findings to file, read at iteration start
Stop hook without RALPH_ACTIVE guardTraps host/router session in multi-agent setupsCheck RALPH_ACTIVE=1 before any other logic
Running standalone mode from routerRouter gets trapped by Stop hookUse router-managed iteration (Mode 2) instead
No guardrailsSame mistakes repeated each iterationMaintain guardrails.md with learned Signs

Iron Laws

  1. NO LOOP WITHOUT VERIFICATION — Completion signal must be backed by passing validation commands
  2. NO LOOP WITHOUT MAX ITERATIONS — Every loop must have a safety cap
  3. NO LOOP WITHOUT STATE FILE — Progress must be persisted to survive context resets
  4. NO LOOP WITHOUT GUARDRAILS — Failures must be recorded to prevent repetition
  5. RALPH_ACTIVE GUARD FIRST — Stop hook must check RALPH_ACTIVE=1 env var before reading stdin, checking files, or any other logic. This is the primary protection against trapping the host/router.

Memory Protocol (MANDATORY)

Before starting:

Read .claude/context/memory/learnings.md using the Read tool.

Check for:

  • Previously run ralph loops and their outcomes
  • Known audit patterns and failure modes
  • User preferences for iteration limits

After completing:

  • Loop completed successfully → Append summary to learnings.md
  • New guardrail discovered → Add Sign to .claude/ralph/guardrails.md
  • Architecture decision → Append to decisions.md
ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

平台分布

Codex

36.33%
按下载量换算66

Claude

29.04%
按下载量换算53

Cursor

16.34%
按下载量换算30

Gemini CLI

8.48%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills