Package Exports
- opencode-manifold
- opencode-manifold/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (opencode-manifold) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Open Manifold
Multi-agent development system for opencode with persistent knowledge.
A Lead Dev agent walks through a task plan, a deterministic plugin state machine orchestrates a Senior/Junior/Debug loop, and all decisions are logged to a persistent Manifold/ folder that compounds knowledge across the project.
Core principle: Deterministic orchestration + scoped LLM execution + persistent knowledge = agents that learn and don't repeat mistakes.
Two Ways to Install
Option A — npm package (Recommended)
- Add
"opencode-manifold"to youropencode.jsonplugins array:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-manifold"]
}- Run opencode. The plugin auto-installs and generates all required files on first session.
Option B — Local plugin files
- Clone this repository
- Copy
src/into your project's.opencode/plugins/directory:cp -r src ~/.config/opencode/plugins/opencode-manifold/ # OR copy into your project: mkdir -p .opencode/plugins cp -r src .opencode/plugins/opencode-manifold
- Add to your
opencode.json:{ "plugin": ["/path/to/.opencode/plugins/opencode-manifold"] }
- Run opencode. The plugin generates all required files on first session.
Quick Start
- Install using one of the methods above
- Create a plan — any format (markdown, TODO list, email, meeting notes)
- Point the Lead Dev agent at your plan file and tell it to execute
The Lead Dev will:
- Extract tasks from your plan
- Dispatch each to the multi-agent system
- Log all decisions to
Manifold/
Architecture
User → points to plan file (any format)
│
Lead Dev
Reads plan, extracts tasks, dispatches via dispatch_task tool
│
▼
Plugin State Machine (TypeScript, zero LLM cost)
│
├── Phase 1: Clerk research
│ ├── codebase-index search + wiki lookback + graph entries
│ ├── Composes scoped prompt
│ └── Creates task log file
│
├── Phase 2: Senior/Junior/Debug loop
│ ├── Spawn Senior Dev → implementation
│ ├── Spawn Junior Dev → review (first word: COMPLETE or QUESTIONS)
│ ├── Loop up to 3×, then escalate to Debug
│ └── Debug → one loop with Senior+Debug, then escalate to Clerk retry
│
├── Phase 3: Clerk logging
│ ├── Appends design decisions to task log
│ ├── Updates index.md, appends log.md, updates graph entries
│ └── Returns to Lead Dev
│
└── Phase 4: Test (optional)
├── If test defined → run, check output
└── If no test → completeAgents
| Agent | Model | Role |
|---|---|---|
lead-dev |
good tool calling + planning | Reads plan, dispatches tasks |
clerk |
conceptualizing + large context | Researches context, composes prompts, logs results |
senior-dev |
coding | Implementation specialist |
junior-dev |
cheap/small coding | Review agent |
debug |
coding + troubleshooting | Fresh perspective after 3 failed loops |
The sr/jr/debug loop enables cost-efficient workflows: a strong sr-dev paired with a cheaper junior for review, and a different model for debug (fresh perspective). The key is diversity between sr and debug, not raw power. Junior's role as reviewer means a smaller/cheaper model works well — the sr/jr loop catches most issues, and debug's different reasoning approach breaks deadlocks.
Example Configurations
| Budget | Senior Dev | Junior Dev | Debug |
|---|---|---|---|
| Cost-effective | MiniMax-2.7 | Qwen-3.5 122B-A10B | GLM 5.1 |
| Balanced | GLM 5.1 | Minimax-2.7 | GPT 5.4 mini |
| Premium | Claude Opus | GPT 5.4 | Gemini 3.1 pro |
Models change frequently. These examples prioritize sr/debug diversity and cost gradient.
Manifold Folder Structure
Manifold/
├── .obsidian/ # Makes it an Obsidian vault
├── index.md # Catalog of all tasks
├── log.md # Chronological append-only log
├── plans.json # Plan registry
├── schema.md # Wiki conventions
├── settings.json # User-tunable parameters
├── state.json # State machine persistence
├── tasks/ # Individual task logs
│ ├── share-cart-001.md
│ └── ...
└── graph/ # Document graph
├── src_middleware_auth_ts.md
└── ...Settings
Located at Manifold/settings.json:
| Setting | Default | Description |
|---|---|---|
maxLoops |
3 | Senior↔Junior loops before Debug escalation |
maxRetries |
1 | Retry attempts per agent call |
maxResults |
10 | Codebase-index search results |
recentTaskCount |
3 | Recent task logs to read for context |
clerkRetryEnabled |
true | Clerk gets second pass after Debug fails |
timeout |
300 | Max seconds per agent call |
testCommand |
null | Default test command |
Session Resumption
If a session crashes mid-loop:
- The Lead Dev reads the plan file
- Completed tasks are marked in
index.md - Lead Dev picks up from the first unmarked task
- The existing task log (created in Phase 1) shows partial work
No mid-loop state recovery needed — restart the task, the Clerk's research phase accounts for what was already done.
FAQ
Q: Do I need to configure agents? A: No. On first run, the plugin auto-generates agent definitions, skills, and configuration from built-in templates.
Q: Can I customize agents and skills?
A: Yes. Edit the files in .opencode/agents/ and .opencode/skills/ after they're generated.
Q: What is the Clerk's role? A: The Clerk has full project sight. It researches context (codebase-index, wiki, graph), composes scoped prompts for workers, and maintains the wiki.
Q: What happens if Debug also fails? A: The Clerk gets one retry with full failure context. If that also fails, the task escalates to you.
Q: Can I define tests for tasks?
A: Yes. Add test: <command> in the task description or set testCommand in settings.json.
License
GPL 3+. See LICENSE file.