Token导航 LogoToken导航TokenDH.com
AI 工具需要联网github未标认证来源可访问clear审计异常

ralph-loop拉尔夫·鲁普

Agent Skill

ralph-loop 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,456

周安装

144

GitHub Stars

46

下载量

1,152
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/belumume/claude-skills --skill ralph-loop

简介

ralph-loop 用于在 Claude Code 中循环执行任务,每次基于代码库累积变更继续工作,直到完成。

  • 适合有明确完成标准、需重复迭代或夜间自动完成的开发任务,如重构、迁移和测试驱动开发。
  • 通过固定提示词循环调用 Claude Code,每轮读取之前的工作并延续,直至满足终止条件。
  • 安装前需确认仓库权限、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • ralph-loop 属于AI 工具类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Ralph Wiggum Loop Mode

Named after the Simpsons character who "never stops despite being confused," this technique runs Claude Code in a loop where the prompt stays the same but the codebase accumulates changes. Each iteration reads previous work and continues until completion.

When to Use Ralph Mode

Ideal for:

  • Well-defined implementation tasks with clear completion criteria
  • Refactoring or migration work (e.g., React v16 to v19)
  • Test-driven development cycles (run until tests pass)
  • Batch processing or repetitive tasks
  • Overnight autonomous work sessions

Not ideal for:

  • Tasks requiring design decisions or human judgment
  • Exploratory work without clear end states
  • Tasks where requirements may change mid-execution
  • First-time implementations where you need to learn the code

Activation Protocol

Step 1: Validate Task Suitability

Before activating, confirm:

  • Task has clear, measurable completion criteria
  • Success can be verified programmatically (tests, build, specific file state)
  • The work is in a git-tracked directory
  • You understand what success looks like

Step 2: Create State File

Create .claude/ralph-loop.local.md with the following structure:

---
active: true
iteration: 0
max_iterations: 20
completion_promise: null
---

# Your Task Prompt Here

## Objective
[Clear statement of what needs to be accomplished]

## Completion Criteria
Complete when TODO.md shows [x] ALL_TASKS_COMPLETE

## Verification Commands
Run these to check progress:
- `[test command]`
- `[build command]`

## Context
- Read [relevant files] for specifications
- Follow [conventions file] for code style

Step 3: Create TODO.md (Recommended Completion Method)

Create TODO.md in your project root:

# Task Checklist

## Tasks
- [ ] Task 1
- [ ] Task 2
- [ ] Task 3

## Completion
- [ ] ALL_TASKS_COMPLETE

Step 4: Start the Loop

Simply run Claude normally. The Stop hook will detect the state file and keep the loop running until completion is detected.

claude

Two Completion Methods

Method 1: TODO.md Markers (Recommended)

The hook checks TODO.md for [x] ALL_TASKS_COMPLETE. This is more reliable because:

  • It's visible in the file system
  • It can be tracked in git
  • Claude can easily update it
  • You can see progress (X/Y tasks complete)

Method 2: Promise Tags (Legacy)

Set completion_promise in the state file and output <promise>YOUR_TEXT</promise> when complete.

---
active: true
iteration: 0
max_iterations: 20
completion_promise: "feature implemented"
---

When Claude outputs <promise>feature implemented</promise>, the loop ends.

Configuration Options

In .claude/ralph-loop.local.md frontmatter:

OptionDefaultDescription
activetrueSet to false to disable loop
iteration0Current iteration count (auto-incremented)
max_iterations20Safety cap (0 = unlimited)
completion_promisenullText to match for promise completion

During Execution

Iteration Status

Every iteration shows:

  • Current iteration number
  • Task progress (from TODO.md)
  • Completion criteria
  • Max iterations remaining

Checkpoint Notifications

Every 5 iterations, you'll see a checkpoint reminder to:

  • Review changes: git log --oneline -10
  • Verify progress is on track
  • Consider adjusting the prompt if stuck

Manual Intervention

To pause the loop:

# Edit the state file
# Change active: true → active: false

To stop immediately:

rm .claude/ralph-loop.local.md

To resume:

# Re-create or edit the state file
# Set active: true
claude

Safety Features

  • Iteration cap: Prevents infinite loops (default: 20)
  • Git tracking: Every change is revertible
  • Checkpoint notifications: Reminders to review progress
  • Clear completion criteria: Loop only exits on explicit success
  • Cost awareness: Track iterations to estimate API costs

Example: MetricFlow Phase 7-8

---
active: true
iteration: 0
max_iterations: 25
completion_promise: null
---

# MetricFlow Phase 7-8: Educator Agent

## Objective
Implement the Educator Agent that uses Claude API to generate educational
explanations for code metrics.

## Completion Criteria
Complete when TODO.md shows [x] ALL_TASKS_COMPLETE

## Verification Commands
- `cd backend && python -m pytest tests/test_educator.py -v`
- `cd backend && python -c "from app.agents.educator import EducatorAgent; print('OK')"`

## Context
- Read docs/plans/MASTER_PLAN.md sections 5.3 (Educator Agent)
- Follow CLAUDE.md for project conventions
- Analyzer and Pattern agents already complete (use their output formats)

## Instructions
1. Check TODO.md for current task list
2. Implement next incomplete task
3. Write tests as you go
4. Run verification after each change
5. Mark [x] ALL_TASKS_COMPLETE when done

And corresponding TODO.md:

# Phase 7-8: Educator Agent

## Tasks
- [ ] Create EducatorAgent class skeleton in backend/app/agents/educator.py
- [ ] Add Claude API client initialization
- [ ] Implement explain_complexity() method
- [ ] Implement explain_maintainability() method
- [ ] Implement explain_code_smells() method
- [ ] Add course concept mapping
- [ ] Write unit tests for all methods
- [ ] Integration test with Analyzer output

## Completion
- [ ] ALL_TASKS_COMPLETE

Troubleshooting

Loop won't start:

  • Check .claude/ralph-loop.local.md exists
  • Verify active: true is set in frontmatter

Loop won't stop:

  • Ensure TODO.md contains exactly [x] ALL_TASKS_COMPLETE (case-insensitive)
  • Or check completion_promise matches your output tag
  • Check max_iterations isn't set to 0 (unlimited)
  • Manual stop: rm.claude/ralph-loop.local.md

Stuck on same error:

  • Review the error pattern
  • Adjust the prompt with more specific guidance
  • Consider breaking task into smaller subtasks

Costs too high:

  • Reduce max_iterations
  • Use shorter checkpoint intervals for early review
  • Consider if task is too complex for Ralph mode

Tips for Success

  1. Clear prompts reduce iterations by 40-60% - be specific
  2. Start with small max_iterations (5-10) until confident
  3. Git commit after every checkpoint - easy rollback
  4. Use TODO.md completion - more reliable than promise tags
  5. Monitor first few iterations - catch bad patterns early
  6. Supervised autonomy - review at checkpoints for course projects

Cost Estimates

Task ComplexityIterationsEstimated Cost
Simple (single feature)5-10$5-15
Medium (multi-file changes)10-20$15-30
Complex (full phase)20-50$30-75

Quick Start Template

# 1. Create state file
mkdir -p .claude
cat > .claude/ralph-loop.local.md << 'EOF'
---
active: true
iteration: 0
max_iterations: 20
completion_promise: null
---

# Your Task

## Objective
[What you want to accomplish]

## Completion
Check TODO.md for [x] ALL_TASKS_COMPLETE
EOF

# 2. Create TODO.md
cat > TODO.md << 'EOF'
# Tasks
- [ ] First task
- [ ] Second task

## Completion
- [ ] ALL_TASKS_COMPLETE
EOF

# 3. Start Ralph loop
claude

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

26.21%
按下载量换算302

Gemini CLI

22.2%
按下载量换算256

Antigravity

19.33%
按下载量换算223

Codex

12.04%
按下载量换算139

OpenCode

7.09%
按下载量换算82

windsurf

3.23%
按下载量换算37

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills