en un clic
ralph
// Self-referential completion loop for AI CLI tools. Re-runs the agent on the same task across turns with fresh context each iteration, until the completion promise is detected or max iterations is reached.
// Self-referential completion loop for AI CLI tools. Re-runs the agent on the same task across turns with fresh context each iteration, until the completion promise is detected or max iterations is reached.
Expertise in LLVM optimization passes, performance tuning, and code transformation techniques. Use this skill when implementing custom optimizations, analyzing pass behavior, improving generated code quality, or understanding LLVM's optimization pipeline.
Guide for modern game anti-cheat architecture, Windows kernel monitoring, and detection tradeoffs. Use this skill when analyzing EAC, BattlEye, Vanguard, FACEIT AC, kernel callbacks, handle protection, manual-map detection, boot-start drivers, BYOVD, DMA threats, or behavioral telemetry in game security research.
Guide for PCIe DMA threat modeling, FPGA-based memory access, and defensive implications in game security. Use this skill when researching pcileech, BAR and TLP behavior, page-table walking, IOMMU or VT-d, device impersonation, firmware mimicry, or DMA detection and mitigation in game security research.
Guide for game-hacking technique taxonomy and threat modeling relevant to game security. Use this skill when researching memory access, code injection, overlays, input simulation, engine-specific attack surfaces, or how modern anti-cheat systems constrain user-mode, kernel-mode, hypervisor, and DMA-based cheat implementations.
Guide for graphics API interception, overlay rendering, and render-pipeline analysis across DirectX, OpenGL, and Vulkan. Use this skill when working with Present or SwapBuffers hooks, DXGI swap chains, shader or draw-call interception, screenshot-sensitive overlays, or graphics debugging in game security research.
Expertise in MLIR (Multi-Level Intermediate Representation) and CIR (Clang IR) development for domain-specific compilation and high-level optimizations. Use this skill when building ML compilers, domain-specific languages, or working with multi-level compilation pipelines.
| name | ralph |
| keyword | ralph |
| description | Self-referential completion loop for AI CLI tools. Re-runs the agent on the same task across turns with fresh context each iteration, until the completion promise is detected or max iterations is reached. |
| allowed-tools | ["Read","Write","Bash","Grep","Glob"] |
| tags | ["ralph","ralph-loop","loop","completion","gemini-cli","opencode","self-referential"] |
| platforms | ["Gemini-CLI","OpenCode","oh-my-opencode","Claude Code","Codex"] |
| version | 2.0.0 |
| source | gemini-cli-extensions/ralph |
The loop happens across agent turns, controlled by an AfterAgent hook.
/ralph "Your task description" --completion-promise "DONE"AfterAgent hook intercepts the exit/ralph "<task description>" [--completion-promise=TEXT] [--max-iterations=N]
Defaults:
DONE100AfterAgent hook checks whether the assistant output contains:<promise>DONE</promise>
/ralph:cancel/ralph "Build a Python CLI task manager with full test coverage"
/ralph "Build a REST API for todos. When all CRUD endpoints work and tests pass with >80% coverage, output TASK_COMPLETE" --completion-promise="TASK_COMPLETE"
/ralph "Attempt to refactor the authentication module" --max-iterations=20
/ralph "Implement feature X by following TDD:
1. Write failing tests for the feature.
2. Implement the code to make the tests pass.
3. Run the test suite.
4. If any tests fail, analyze the errors and debug.
5. Refactor for clarity and efficiency.
6. Repeat until all tests are green.
7. When complete, output <promise>TESTS_PASSED</promise>" --completion-promise="TESTS_PASSED"
/ralph:cancel
/ralph:help
Provide a verifiable definition of "done." The --completion-promise is crucial.
Good:
/ralph "Build a REST API for todos. When all CRUD endpoints are working and all tests pass with >80% coverage, you're complete." --completion-promise="TASK_COMPLETE"
Always use --max-iterations as a safety net to prevent infinite loops.
/ralph "Attempt to refactor the authentication module" --max-iterations=20
Structure the prompt to guide the agent through work → verify → debug cycles.
Always run in sandbox mode for safety. Enabling YOLO mode (-y) prevents constant tool execution prompts during the loop:
gemini -s -y
gemini extensions install https://github.com/gemini-cli-extensions/ralph --auto-update
Required in ~/.gemini/settings.json:
{
"hooksConfig": { "enabled": true },
"context": {
"includeDirectories": ["~/.gemini/extensions/ralph"]
}
}
ralph는 Gemini에서 AfterAgent 훅 기반으로 자동 반복되며, Codex는 현재 네이티브 종료-후크를 보장하지 않습니다.
따라서 Codex에서 ralph를 쓸 때는 아래 보정 스크립트를 설치해 사용하는 것을 권장합니다.
bash <your-agent-skills>/ralph/scripts/setup-codex-hook.sh
이 스크립트가 수행하는 것:
~/.codex/config.toml의 developer_instructions에 ralph 재시작 계약 정보를 기록~/.codex/prompts/ralph.md 생성 (/prompts:ralph로 빠른 실행)--dry-run 옵션으로 적용 전 미리보기Usage:
bash <your-agent-skills>/ralph/scripts/setup-codex-hook.sh
bash <your-agent-skills>/ralph/scripts/setup-codex-hook.sh --dry-run
⚠️ 정확성 유의:
ralph 동작 계약을 고정시키고, 다음 작업을 반복할 때 수동 실수(/prompts:ralph 누락, promise 누락, max 반복 초과)를 줄여줍니다.| 플랫폼 | 현재 지원 방식 | 핵심 조건 |
|---|---|---|
| Gemini-CLI | 네이티브 | AfterAgent 훅 + ralph extension 설치 |
| Claude Code | 네이티브(권장) | 스킬/오케스트레이션 적재 후 /ralph 사용 |
| OpenCode | 네이티브(동일 경로) | ralph 키워드 등록 후 동일 명령어 사용 |
| Codex | 보정 모드 | setup-codex-hook.sh 실행 후 /prompts:ralph 기반 반복 운영 |
현재 스킬만으로 가능한지:
setup-codex-hook.sh로 보정한 뒤 운영 가능| Action | Command |
|---|---|
| Start loop | /ralph "task" |
| Custom promise | /ralph "task" --completion-promise=TEXT |
| Iteration cap | /ralph "task" --max-iterations=N |
| Cancel | /ralph:cancel |
| Help | /ralph:help |