Ralph iteration 1: work in progress
This commit is contained in:
44
.opencode/command/ralph.md
Normal file
44
.opencode/command/ralph.md
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
description: Run Open Ralph Wiggum loops in this repository
|
||||
---
|
||||
|
||||
Run Open Ralph Wiggum in the current repository with OpenCode as the default agent.
|
||||
|
||||
**Input**: The argument after `/ralph` is the Ralph task prompt. Optional Ralph flags may be included.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Require task input**
|
||||
|
||||
If no argument is provided, ask:
|
||||
> "What task should Ralph run? Include success criteria and completion promise if you have one."
|
||||
|
||||
Stop after asking.
|
||||
|
||||
2. **Install Ralph locally in `.opencode`**
|
||||
|
||||
```bash
|
||||
npm install --prefix ".opencode" @th0rgal/ralph-wiggum
|
||||
```
|
||||
|
||||
3. **Run Ralph loop**
|
||||
|
||||
If the user did not provide iteration bounds, use:
|
||||
```bash
|
||||
npx --prefix ".opencode" ralph "<input>" --agent opencode --max-iterations 10
|
||||
```
|
||||
|
||||
If the user included explicit flags (for example `--max-iterations`, `--tasks`, `--model`), preserve them and append `--agent opencode` only when agent is not specified.
|
||||
|
||||
4. **After run, show control commands**
|
||||
|
||||
```bash
|
||||
npx --prefix ".opencode" ralph --status
|
||||
npx --prefix ".opencode" ralph --add-context "Focus on <area>"
|
||||
```
|
||||
|
||||
**Guardrails**
|
||||
|
||||
- Do not add `open-ralph-wiggum` to OpenCode plugin config.
|
||||
- Keep the run scoped to this repository.
|
||||
- Prefer bounded loops with `--max-iterations`.
|
||||
41
.opencode/package-lock.json
generated
Normal file
41
.opencode/package-lock.json
generated
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": ".opencode",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"@opencode-ai/plugin": "1.2.6",
|
||||
"@th0rgal/ralph-wiggum": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@opencode-ai/plugin": {
|
||||
"version": "1.2.6",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@opencode-ai/sdk": "1.2.6",
|
||||
"zod": "4.1.8"
|
||||
}
|
||||
},
|
||||
"node_modules/@opencode-ai/sdk": {
|
||||
"version": "1.2.6",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@th0rgal/ralph-wiggum": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@th0rgal/ralph-wiggum/-/ralph-wiggum-1.2.1.tgz",
|
||||
"integrity": "sha512-8Xe6luwnKTArT9eBzyAx1newz+InGTBm9pCQrG4yiO9oYVHC0WZN3f1sQIpKwQbbnKQ4YJXdoraaatd0B4yDcA==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"ralph": "bin/ralph.js"
|
||||
}
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "4.1.8",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
47
.opencode/skills/open-ralph-wiggum/SKILL.md
Normal file
47
.opencode/skills/open-ralph-wiggum/SKILL.md
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
name: open-ralph-wiggum
|
||||
description: Run autonomous Ralph loops in the current repository using OpenCode as the default agent.
|
||||
license: MIT
|
||||
compatibility: Requires Node.js/npm and OpenCode CLI configured with a working model.
|
||||
metadata:
|
||||
author: th0rgal
|
||||
source: https://github.com/Th0rgal/open-ralph-wiggum
|
||||
---
|
||||
|
||||
Use Open Ralph Wiggum to run repeatable autonomous coding loops from OpenCode.
|
||||
|
||||
**Input**: The user message after this skill should include the task prompt for Ralph. Optional Ralph flags can be passed as part of the message.
|
||||
|
||||
**Steps**
|
||||
|
||||
1. **Validate a task prompt exists**
|
||||
|
||||
If no task prompt is provided, ask for one clear prompt and stop.
|
||||
|
||||
2. **Ensure Ralph CLI is available in this repo**
|
||||
|
||||
Run:
|
||||
```bash
|
||||
npm install --prefix ".opencode" @th0rgal/ralph-wiggum
|
||||
```
|
||||
|
||||
3. **Run Ralph with OpenCode agent (default)**
|
||||
|
||||
Use local binary via `npx` so no global install is required:
|
||||
```bash
|
||||
npx --prefix ".opencode" ralph "<user prompt>" --agent opencode --max-iterations 10
|
||||
```
|
||||
|
||||
If the user already included `--max-iterations`, keep their value.
|
||||
|
||||
4. **Report result and next controls**
|
||||
|
||||
Mention how to monitor or steer loop if still running:
|
||||
- `npx --prefix ".opencode" ralph --status`
|
||||
- `npx --prefix ".opencode" ralph --add-context "<hint>"`
|
||||
|
||||
**Guardrails**
|
||||
|
||||
- Do not register Ralph as an OpenCode plugin. It is a CLI wrapper, not a plugin.
|
||||
- Keep execution in the current repository.
|
||||
- Do not use unlimited iterations by default; always set `--max-iterations` unless user explicitly asks otherwise.
|
||||
Reference in New Issue
Block a user