open-ralph-loopOpenCode-native Ralph Loop plugin for Lisa PRDs
0
5
近 7 天 2
20.0
生态多维模型
3 个月前
2026-05-19
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["open-ralph-loop@0.1.0"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["open-ralph-loop@0.1.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D open-ralph-loopopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Open Ralph Loop is an OpenCode plugin that executes Lisa PRDs one story at a time.
Lisa plans. Ralph does.
What It Does
Open Ralph adds /ralph-loop to OpenCode. It:
- Resolves a Lisa JSON PRD.
- Creates or reuses the matching progress file.
- Starts an OpenCode-native loop in the current session.
- Continues when the session goes idle until the PRD is complete or max iterations is reached.
- Stops only when the assistant prints
<promise>COMPLETE</promise>and everyuserStories[].passesvalue istrue.
No nested opencode run subprocess is used.
Install
Add the plugin to your OpenCode config:
{
"plugin": ["open-ralph-loop"]
}
Restart OpenCode. On startup, the plugin installs these commands into ~/.config/opencode/commands/ if missing:
/ralph-loop/cancel-ralph/ralph-status
PRD Resolution
Open Ralph reads Lisa output directly.
Supported inputs:
/ralph-loop docs/specs/my-feature.json
/ralph-loop lisa/my-feature.json
/ralph-loop my-feature
/ralph-loop
Resolution order for a slug such as my-feature:
docs/specs/my-feature.jsonlisa/my-feature.json
Progress files:
docs/specs/my-feature.json->docs/specs/my-feature-progress.txtlisa/my-feature.json->lisa/my-feature-progress.txt
Story ordering:
- If
priorityexists, the lowest numeric value wins. - Otherwise Lisa categories are used in order:
setup,core,integration,polish. - Ties use the original array order.
Commands
/ralph-loop <spec-or-slug>
Starts a loop for a PRD path or feature slug.
/cancel-ralph
Cancels the active loop by deleting .opencode/ralph-loop.local.md.
/ralph-status
Shows active loop state, PRD path, progress path, iteration count, and next story hint.
State
Runtime state is stored in:
.opencode/ralph-loop.local.md
This file is intentionally ignored by git. Delete it to cancel a loop manually.
PRD Shape
Open Ralph expects Lisa JSON:
{
"project": "user-authentication",
"branchName": "ralph/user-authentication",
"description": "User authentication",
"userStories": [
{
"id": "US-001",
"category": "setup",
"title": "Database schema for users",
"description": "As a developer, I want user tables created",
"acceptanceCriteria": ["Migration creates users table"],
"passes": false,
"notes": ""
}
]
}
Development
npm run typecheck
The plugin entrypoint is src/index.ts.
License
MIT