con 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 |