Signed-off-by: Dmytro Stanchiev <git@dmytros.dev>
This commit is contained in:
2026-04-19 17:50:34 -04:00
parent 64088cb9bc
commit 07e1c0dd5e
31 changed files with 1573 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
export const RALPH_LOOP_TEMPLATE = `You are starting a Ralph Loop - a self-referential development loop that runs until task completion.
## How Ralph Loop Works
1. You will work on the task continuously
2. When you believe the task is FULLY complete, output: \`<promise>{{COMPLETION_PROMISE}}</promise>\`
3. If you don't output the promise, the loop will automatically inject another prompt to continue
4. Maximum iterations: Configurable (default 100)
## Rules
- Focus on completing the task fully, not partially
- Don't output the completion promise until the task is truly done
- Each iteration should make meaningful progress toward the goal
- If stuck, try different approaches
- Use todos to track your progress
## Exit Conditions
1. **Completion**: Output your completion promise tag when fully complete
2. **Max Iterations**: Loop stops automatically at limit
3. **Cancel**: User runs \`/cancel-ralph\` command
## Your Task
Parse the arguments below and begin working on the task. The format is:
\`"task description" [--completion-promise=TEXT] [--max-iterations=N] [--strategy=reset|continue]\`
Default completion promise is "DONE" and default max iterations is 100.`
export const CANCEL_RALPH_TEMPLATE = `Cancel the currently active Ralph Loop.
This will:
1. Stop the loop from continuing
2. Clear the loop state file
3. Allow the session to end normally
Check if a loop is active and cancel it. Inform the user of the result.`
export const RALPH_LOOP_COMMANDS: Record<string, unknown> = {
"ralph-loop": {
name: "ralph-loop",
description: "(builtin) Start self-referential development loop until completion",
template: `<command-instruction>\n${RALPH_LOOP_TEMPLATE}\n</command-instruction>\n\n<user-task>\n$ARGUMENTS\n</user-task>`,
},
"ulw-loop": {
name: "ulw-loop",
description: "(builtin) Start ultrawork loop - continues until completion with ultrawork mode",
template: `<command-instruction>\n${RALPH_LOOP_TEMPLATE}\n</command-instruction>\n\n<user-task>\n$ARGUMENTS\n</user-task>`,
},
"cancel-ralph": {
name: "cancel-ralph",
description: "(builtin) Cancel active Ralph Loop",
template: `<command-instruction>\n${CANCEL_RALPH_TEMPLATE}\n</command-instruction>`,
},
}