Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计异常

ralph-loop拉尔夫·鲁普

Agent Skill

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

总安装

490

周安装

20

GitHub Stars

2

下载量

158
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/benjaming/ai-skills --skill ralph-loop

简介

ralph-loop 创建自主迭代的任务处理循环,基于明确验收标准持续优化执行过程。

  • 适用于 Codex、Claude、Cursor、Gemini CLI,适用于 backlog 处理与 spec-driven 开发场景。
  • 包含任务系统、进度日志与知识积累机制,实现经验复用与效率持续提升。
  • 初始化前需定义清晰终止条件与验收准则,避免无限循环或目标漂移。
  • ralph-loop 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Ralph Loop Creator

Create autonomous iterative loops that process a backlog of tasks with clear acceptance criteria. Named after the Ralph Wiggum pattern for spec-driven autonomous development.

Overview

A Ralph loop consists of:

  • Task System - Native Claude Code task management with dependency tracking
  • Prompt (prompt.md) - Instructions for each iteration
  • Runner (ralph.sh) - Bash script that loops until completion
  • Progress (progress.txt) - Execution log
  • Knowledge (knowledge.md) - Accumulated learnings

Quick Start

To create a new Ralph loop, gather requirements then run the init script:

python ~/.claude/skills/ralph-loop/scripts/init_ralph.py <output-dir>

Workflow

Step 1: Gather Requirements

Before creating a loop, clarify these parameters with the user using AskUserQuestion:

Loop Goal:

  • What is the global objective of this loop?
  • What domain/codebase does it operate on?

Task Structure:

  • What kind of tasks/items will be tracked?
  • What dependencies exist between tasks?
  • What metadata should each task have?

Iteration Process:

  • What steps should each iteration perform?
  • What tools/commands are needed?
  • What files should be read/written?

Acceptance Criteria:

  • How to validate a task is completed?
  • What checks should pass before marking done?
  • Should there be automated validation (tests, builds, typechecks)?

Exit Conditions:

  • When should the loop terminate? (all tasks done, specific marker, max iterations)
  • What completion marker to use? Default: <promise>COMPLETE</promise>

Step 2: Select or Create Template

Available templates in ~/.claude/skills/ralph-loop/templates/:

TemplateUse Case
migration.mdMigrating components, APIs, dependencies
exploration.mdCodebase analysis, documentation generation
testing.mdTest generation, coverage improvement
refactoring.mdCode cleanup, pattern enforcement
custom.mdBlank template for unique workflows

Step 3: Generate Loop Files

After gathering requirements, generate the loop structure:

python ~/.claude/skills/ralph-loop/scripts/init_ralph.py \
  --template migration \
  --output ./my-loop \
  --goal "Migrate React components from styled-components to Tailwind"

Or interactively:

python ~/.claude/skills/ralph-loop/scripts/init_ralph.py ./my-loop

Step 4: Create Tasks Using Task System

After generating the loop, create tasks using the native Task tools:

TaskCreate:
  subject: "Migrate Button component"
  description: "Convert Button from styled-components to Tailwind CSS classes"
  activeForm: "Migrating Button component"

Set up dependencies between tasks:

TaskUpdate:
  taskId: "2"
  addBlockedBy: ["1"]  # Task 2 waits for Task 1

Step 5: Run the Loop

cd <output-dir>
./ralph.sh [max-iterations]

Default max iterations: 50

File Structure

<output-dir>/
├── ralph.sh          # Executable bash loop
├── prompt.md         # Iteration instructions (uses Task tools)
├── progress.txt      # Execution log
├── knowledge.md      # Accumulated learnings
└── logs/             # Per-run log files

Task System Integration

The Ralph loop uses Claude Code's native Task management system:

Tools:

  • TaskCreate - Create new tasks with subject, description, activeForm
  • TaskList - View all tasks with status/owner/blockers
  • TaskGet - Fetch full task details by ID
  • TaskUpdate - Change status, set dependencies, mark complete

Status values: pending, in_progress, completed

Dependencies:

  • blocks - Tasks that cannot start until this one completes
  • blockedBy - Tasks that must complete before this one can start

Benefits over JSON backlog:

  • Native dependency tracking
  • Status validation (can't mark complete if tests fail)
  • Parallel agent coordination via owner field
  • Progress spinner shows activeForm text

Prompt Template Structure

# Ralph Agent: {Goal}

## Configuration
- List paths, files, tools

## Your Task (One Iteration)

### Step 1: Load Context
Use TaskList to get all tasks, read knowledge.md

### Step 2: Determine State
Check if all tasks are completed → output <promise>COMPLETE</promise>

### Step 3: Select Target
Use TaskList to find first task with:
- status: "pending"
- blockedBy: empty (no unresolved dependencies)
Use TaskUpdate to set status: "in_progress"

### Step 4-N: Execute
Task-specific steps using TaskGet for full details

### Final Step: Update
Use TaskUpdate to set status: "completed"
Update progress.txt and knowledge.md

## Completion
When all tasks completed: <promise>COMPLETE</promise>

Creating Initial Tasks

After generating the loop, create tasks for the backlog. Example for a migration loop:

# Create first task
TaskCreate:
  subject: "Migrate Button component"
  description: "Convert Button.tsx from styled-components to Tailwind. Update imports, replace styled() calls with className props using Tailwind utilities."
  activeForm: "Migrating Button component"

# Create dependent task
TaskCreate:
  subject: "Migrate Modal component"
  description: "Convert Modal.tsx. Depends on Button migration since Modal uses Button internally."
  activeForm: "Migrating Modal component"

# Set dependency
TaskUpdate:
  taskId: "2"
  addBlockedBy: ["1"]

Tip: Use TaskUpdate with addBlockedBy to ensure tasks run in correct order.

Best Practices

  1. One task per iteration - Keep iterations focused
  2. Clear acceptance criteria - Define what "done" means
  3. Use dependencies - Set blockedBy for ordered tasks
  4. Incremental commits - Commit after each successful task
  5. Knowledge accumulation - Document learnings for future iterations
  6. Fail fast - Stop on errors, don't silently continue
  7. Idempotent operations - Safe to re-run if interrupted

Troubleshooting

IssueSolution
Loop never completesCheck completion marker in prompt.md matches ralph.sh
Tasks skippedVerify status field updates in prompt.md
Context overflowReduce prompt.md size, move details to knowledge.md
Permission errorsEnsure ralph.sh has execute permissions

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.11%
按下载量换算55

Claude

30.2%
按下载量换算48

Cursor

19.27%
按下载量换算30

Gemini CLI

9.57%
按下载量换算15

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills