ralph
БесплатноБез исполняемых скриптовНе проверенAgent-agnostic autonomous loop creator. Use when asked to 'use ralph', 'ralph this', 'reverse ralph', 'decompose a feature', or '/ralph decompose'. Forward…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
Ralph - Agent-Agnostic Autonomous Loop Creator
Ralph creates autonomous coding loops that implement features by breaking them into small user stories and completing them one at a time. Each iteration spawns a fresh headless agent with clean context. Memory persists via git, progress.txt, and prd.json. Ralph is not tied to any single AI agent — the user chooses which agent and model powers each loop.
Workflow
Step 1: Understand the Feature
If the user tagged a markdown file via @, read it as the feature spec. Otherwise, ask the user to describe the feature.
Ask clarifying questions if needed:
- What problem does this solve?
- What are the key user actions?
- What's out of scope?
- How do we know it's done?
Step 2: Configure the Loop
Ask the user four questions to configure the loop:
2a. Which AI agent?
Present this list and ask the user to choose:
claude— Claude Codedroid— Factory Droidcodex— OpenAI Codexopencode— OpenCodegemini— Gemini CLIcopilot— GitHub Copilotcc-compatible— Claude Code-compatible binary (user provides binary name, e.g.,zai,minimax,kimi)custom— Fully custom command (user provides entire command template with$PROMPT_FILEas placeholder)
Headless command templates per agent (used when generating the loop script):
# claude — Claude Code
claude -p "$(cat "$PROMPT_FILE")" --dangerously-skip-permissions --model $MODEL
# droid — Factory Droid
droid exec --skip-permissions-unsafe -f "$PROMPT_FILE" --output-format text -m $MODEL
# codex — OpenAI Codex
codex exec --yolo -m $MODEL "$(cat "$PROMPT_FILE")"
# opencode — OpenCode
opencode run --yolo -m $MODEL "$(cat "$PROMPT_FILE")"
# gemini — Gemini CLI
gemini -p "$(cat "$PROMPT_FILE")" --yolo -m $MODEL
# copilot — GitHub Copilot
copilot -p "$(cat "$PROMPT_FILE")" --yolo --model $MODEL
# cc-compatible — Same as Claude Code with user-provided binary name
$BINARY -p "$(cat "$PROMPT_FILE")" --dangerously-skip-permissions --model $MODEL
# custom — User provides entire command template
# User's template must include $PROMPT_FILE where the prompt file path should go
If the user selects cc-compatible, ask for the binary name (e.g., zai). If the user selects custom, ask for the full command template and instruct them to use $PROMPT_FILE where the prompt file path belongs.
2b. Which model?
Ask the user for the model identifier (free text input). Examples:
- Claude Code:
opus,claude-opus-4-6,sonnet,claude-sonnet-4-5-20250929 - Factory Droid:
claude-opus-4-6,o3 - OpenAI Codex:
o3,o4-mini - OpenCode:
anthropic/claude-opus-4-6,openai/o3(format:provider/model) - Gemini CLI:
gemini-2.5-pro,gemini-2.0-flash - GitHub Copilot:
claude-sonnet-4-5,gpt-4o
If the user says "default" or leaves it blank, omit the model flag entirely (use the agent's built-in default).
2c. Loop name?
Suggest a name based on the feature in kebab-case (e.g., add-task-priorities). The user can accept or provide a different name. This becomes the filename: .ralph/<loop-name>.sh
2d. Auto-push and create PR?
Ask the user: "Should Ralph automatically push the branch and create a PR when the loop finishes?"
- Yes — When the loop ends (all stories complete or max iterations reached), the script will push the branch to
originand create a pull request viagh pr create. The base branch (e.g.,mainormaster) is auto-detected at generation time by checking which branch exists on the remote. - No — The script only runs locally. All commits stay local. The user pushes and creates PRs themselves.
If the user says yes, detect the base branch now (at generation time) by checking:
- Does
refs/remotes/origin/mainexist? → usemain - Does
refs/remotes/origin/masterexist? → usemaster - Neither → default to
main
Bake the resolved base branch directly into the generated script as DEFAULT_BRANCH="main" (or "master").
Step 3: Create prd.json
Generate a prd.json file in the project root:
{
"project": "[Project Name]",
"branchName": "ralph/[feature-name-kebab-case]",
"description": "[Feature description]",
"userStories": [
{
"id": "US-001",
"title": "[Story title]",
"description": "As a [user], I want [feature] so that [benefit]",
"acceptanceCriteria": [
"Criterion 1",
"Criterion 2",
"Typecheck passes"
],
"priority": 1,
"passes": false,
"notes": ""
}
]
}
Step 4: Generate and Run the Loop
- Create
.ralph/directory in the project root if it doesn't exist - Check
.gitignore— add.ralph/,.ralph-archive/, and.ralph-last-branchif missing (create.gitignoreif it doesn't exist) - Read
scripts/ralph.sh(the reference template in this skill) to understand the loop structure - Generate
.ralph/<loop-name>.shusing the reference template's structure, with
Установить ralph в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл ralph?
Agent-agnostic autonomous loop creator. Use when asked to 'use ralph', 'ralph this', 'reverse ralph', 'decompose a feature', or '/ralph decompose'. Forward mode implements features end-to-end; decompose mode breaks existing features into atomic user stories for reimplementation.
Как установить скилл ralph?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ralph запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic