Agent skill · software engineering · cursor
ralph-loop
Start a Ralph Loop for iterative self-referential development. Use when the user asks to run a ralph loop, start an iterative loop, or wants repeated autonomous iteration on a task until completion.
Why this skill is useful
Adds a structured iterative development workflow that the AI wouldn't reliably generate on its own, including state management and iteration control.
What it needs
About 1k tokens when loaded. Last updated 2026-08-06. 2,555 stars on the source repository.
What this skill does
Ralph Loop Trigger The user wants to start a Ralph loop. An iterative development loop where the same prompt is fed back after every turn, and the agent sees its own previous work each iteration. Workflow 1. Gather the user's task prompt and optional parameters: maxiterations (number, default 0 for unlimited) completionpromise (text, or "null" if not set) 2. Create the directory .cursor/ralph/ if it doesn't exist, then write the state file at .cursor/ralph/scratchpad.md with this exact format: Example: 3. Confirm to the user that the Ralph loop is active, then begin working on the task. 4. The stop hook automatically intercepts each turn end and feeds the same prompt back as a followup message. You will see it prefixed with [Ralph loop iteration N.]. Guardrails If a completion promise is set, you may ONLY output <promise>TEXT</promise> when the statement is completely and genuinely true. Do not output false promises to escape the loop. Always recommend setting maxiterations as a safety net. Quote the completionpromise value in the YAML frontmatter if it contains special characters. Output Confirm the loop is active (prompt, iteration limit, promise if set), then start working on the task immediately.
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills cursor/ralph-loop