mirror of
https://github.com/rot13maxi/opencode-ralph.git
synced 2026-05-27 14:27:40 +00:00
Enhanced Ralph Wiggum plugin with: - Iteration history tracking (ralph-history.local.json) - Mid-loop context injection via /ralph-context command - Loop status monitoring via /ralph-status command - Struggle detection (no file changes, high error rate, rapid iterations) - Operator guidance in continuation prompts - Tool usage and file modification tracking per iteration New commands: - /ralph-status: View current loop state, history summary, struggle indicators - /ralph-context: Inject hints/guidance mid-loop without stopping Fork of rot13maxi/opencode-ralph with significant enhancements.
1.7 KiB
1.7 KiB
| description |
|---|
| Inject context into the next Ralph loop iteration |
Ralph Context Command
Add context or hints that will be injected into the next Ralph loop iteration. This is useful when the AI is stuck and needs guidance without stopping the loop.
Instructions
Execute the following steps:
-
Parse the context from:
$ARGUMENTSThe entire argument string is the context to inject.
-
Check if
ralph-loop.local.mdexists to verify an active loop. -
If no active loop, output:
⚠️ No active Ralph loop found.
Start a loop first with:
/ralph-loop "Your task" --completion-promise "DONE" --max-iterations 20
-
If an active loop exists:
a. Create or append to
ralph-context.local.md:--- added_at: "<ISO_TIMESTAMP>" --- <CONTEXT_TEXT>b. Output confirmation:
✅ Context queued for next iteration!
📝 Added:
<CONTEXT_TEXT>
The AI will receive this context at the start of iteration <NEXT_ITERATION>.
Context is automatically cleared after being consumed.
💡 Tips:
- Be specific: "The bug is in utils/parser.ts line 42"
- Suggest approaches: "Try using the singleton pattern"
- Point to resources: "Check the API docs at /docs/api.md"
- If called with no arguments, display current pending context:
📝 Pending Context for Next Iteration:
<CONTEXT_TEXT if exists>
<or "No pending context">
Commands:
/ralph-context <text> - Add context
/ralph-clear-context - Clear pending context
Example Usage
/ralph-context Focus on fixing the authentication module first
/ralph-context The error is in line 42 of auth.ts - check the token validation
/ralph-context Try using async/await instead of callbacks