opencode-manifold 0.5.14 → 0.5.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,8 @@ A Lead Dev agent walks through a task plan, a deterministic plugin state machine
6
6
 
7
7
  **Core principle:** Deterministic orchestration + scoped LLM execution + persistent knowledge = agents that learn and don't repeat mistakes.
8
8
 
9
+ > **v2 Update:** The orchestration state machine now lives in plugin TypeScript code, not agent prompts. Agents are pure workers — the plugin decides when to call whom. This eliminates the "agent ignores protocol" problem and makes the system reliable.
10
+
9
11
  ---
10
12
 
11
13
  ## Requirements
@@ -72,115 +74,119 @@ Open Manifold requires:
72
74
  1. **Install** using one of the methods above
73
75
  2. **Run `/manifold-init`** in the opencode TUI to set up agents, skills, and the Manifold directory
74
76
  3. **Create a plan** — any format (markdown, TODO list, email, meeting notes)
75
- 4. **Point the Lead Dev agent** at your plan file and tell it to execute
76
-
77
- The Lead Dev will:
78
- - Extract tasks from your plan
79
- - Dispatch each to the multi-agent system
80
- - Log all decisions to `Manifold/`
77
+ 4. **Run `/manifold-plan <path>`** the Planner agent interviews you to clarify the plan
78
+ 5. **Answer the questions** and run `/manifold-plan-answers`
79
+ 6. **Run `/manifold-decompose <plan>`** — Todo agent breaks it into tasks
80
+ 7. **Run `/manifold-execute <tasks>`** the plugin orchestrates Clerk → Senior → Junior loop
81
+ 8. **Run `/manifold-continue`** for each subsequent task
82
+
83
+ The plugin code (not agents) handles all orchestration:
84
+ - Clerk researches, returns findings
85
+ - Senior Dev implements
86
+ - Junior Dev reviews (strict COMPLETE/QUESTIONS)
87
+ - Loop repeats up to 3×, then Debug intervenes
88
+ - All decisions logged to `Manifold/`
81
89
 
82
90
  ---
83
91
 
84
- ## Architecture: The Circuit Board Model
85
-
86
- Think of a plan as a circuit board design:
92
+ ## Architecture: Plugin-Driven Orchestration
87
93
 
88
- | Agent | Role | Question |
89
- |-------|------|----------|
90
- | **Manifold** | Board Designer | "What is this board's intended function?" |
91
- | **Clerk** | Systems Integrator | "How does this board interface with existing system?" |
92
- | **Todo** | Process Engineer | "What's the assembly sequence?" |
94
+ In Manifold v2, the **plugin TypeScript code** is the conductor. Agents are pure musicians who play what they're told. This eliminates prompt-drift and protocol-ignoring.
93
95
 
94
- This ensures every plan is:
95
- - Clearly understood (Manifold clarifies)
96
- - Architecturally sound (Clerk validates fitment)
97
- - Actionably decomposed (Todo sequences)
98
- - Double-checked (Manifold + Clerk review)
96
+ | Component | Role |
97
+ |-----------|------|
98
+ | **Plugin Code** | Orchestrator — decides when to call whom, manages state, enforces loops |
99
+ | **Planner** | Interview agent — asks clarifying questions, refines plan |
100
+ | **Todo** | Decomposer breaks refined plan into tasks |
101
+ | **Clerk** | Researcher — searches codebase, returns structured findings |
102
+ | **Senior Dev** | Implementer — receives scoped prompt, produces code |
103
+ | **Junior Dev** | Reviewer — strict COMPLETE/QUESTIONS parsing |
104
+ | **Debug** | Strategist — fresh perspective after 3 failed loops |
105
+ | **Manifold/** | Persistent knowledge — task logs, index, graph |
99
106
 
100
107
  ---
101
108
 
102
109
  ## Architecture
103
110
 
104
- ### Planning Phase (Pre-Dispatch)
111
+ ### Planning Phase (Plugin-Orchestrated)
105
112
 
106
113
  ```
107
- User → points to plan file (any format)
114
+ User → /manifold-plan <plan-file>
115
+
116
+ ▼ Plugin creates session, invokes Planner
117
+ Planner → analyzes plan → returns JSON questions
118
+
119
+ ▼ Plugin presents questions in chat
120
+ User → answers (numbered list)
108
121
 
109
- Manifold (Phase 0: Ingest Clarity)
110
- Validates requirements are clear
111
- Assesses if input is granular
112
-
113
- Clerk (Phase 1: Research) — ALWAYS runs first
114
- Searches codebase, wiki, graph
115
- Answers: "How does this fit?"
116
-
117
- Todo (Phase 2: Decomposition) — Only if not granular
118
- Creates task list with context awareness
119
- Applies purity tags
120
-
121
- Manifold (Phase 3: Design Review)
122
- │ Validates task list satisfies plan intent
123
- │ Kickback to Todo if needed
124
-
125
- Clerk (Phase 4: Interface Validation)
126
- │ Validates fitment against codebase
127
- │ Kickback to Todo if needed
128
-
129
- User Approval
130
-
122
+ Plugin invokes Planner with Q&A
123
+ Planner returns refined plan markdown
124
+
125
+ ▼ Plugin saves to Manifold/plans/<slug>-plan.md
126
+ User /manifold-decompose <plan>
127
+
128
+ Plugin invokes Todo agent
129
+ Todo → decomposes into task list
130
+
131
+ Plugin saves to Manifold/plans/<slug>-tasks.md
132
+ User reviews approves → /manifold-execute
131
133
  ```
132
134
 
133
- ### Implementation Phase
135
+ ### Implementation Phase (Plugin State Machine)
134
136
 
135
137
  ```
136
- Plugin State Machine (TypeScript, zero LLM cost)
137
-
138
- ├── Phase 1: Clerk research (per task)
139
- │ ├── codebase-index search + wiki lookback + graph entries
140
- │ ├── Composes scoped prompt
141
- │ └── Creates task log file
142
-
143
- ├── Phase 2: Senior/Junior/Debug loop
144
- │ ├── Spawn Senior Dev → implementation
145
- │ ├── Spawn Junior Dev → review (first word: COMPLETE or QUESTIONS)
146
- │ ├── Loop up to 3×, then escalate to Debug
147
- │ └── Debug → one loop with Senior+Debug, then escalate to Clerk retry
138
+ Plugin Code (TypeScript, deterministic)
148
139
 
149
- ├── Phase 3: Clerk logging
150
- │ ├── Appends design decisions to task log
151
- ├── Updates index.md, appends log.md, updates graph entries
152
- └── Returns to Manifold
140
+ ├── For each task:
141
+ │ ├── Create session invoke Clerk
142
+ │ └── Clerk researches returns findings
143
+
144
+ │ ├── Extract scoped prompt from Clerk output
145
+ │ │
146
+ │ ├── Dev Loop (up to 3 iterations):
147
+ │ │ ├── Create session → invoke Senior Dev with scoped prompt
148
+ ��� │ ├── Create session → invoke Junior Dev with implementation
149
+ │ │ ├── Parse response: COMPLETE → done, QUESTIONS → loop
150
+ │ │ └── Feed Junior feedback to Senior on next iteration
151
+ │ │
152
+ │ ├── If loops exhausted:
153
+ │ │ ├── Create session → invoke Debug for fresh perspective
154
+ │ │ ├── One final Senior attempt with Debug suggestion
155
+ │ │ └── Final Junior review → if still fails, escalate
156
+ │ │
157
+ │ ├── Log result to Manifold/tasks/<id>.md
158
+ │ ├── Update index.md, log.md, graph/
159
+ │ └── Save orchestrator state
153
160
 
154
- └── Phase 4: Test (optional)
155
- ├── If test defined → run, check output
156
- └── If no test → complete
161
+ └── User runs /manifold-continue for next task
157
162
  ```
158
163
 
159
164
  ---
160
165
 
161
166
  ## Agents
162
167
 
163
- | Agent | Model | Role |
164
- |-------|-------|------|
165
- | `manifold` | good tool calling + planning | Board Designer orchestrates planning and dispatch |
166
- | `clerk` | conceptualizing + large context | Systems Integrator researches codebase, validates integration |
167
- | `todo` | planning | Process Engineer decomposes plans into task lists |
168
- | `senior-dev` | coding | Implementation specialist |
169
- | `junior-dev` | cheap/small coding | Review agent |
170
- | `debug` | coding + troubleshooting | Fresh perspective after 3 failed loops |
168
+ | Agent | Model | Role | Called By |
169
+ |-------|-------|------|-----------|
170
+ | `planner` | planning | Interview Agent asks clarifying questions, refines plans | Plugin (interview phase) |
171
+ | `todo` | planning | Process Engineer decomposes refined plans into tasks | Plugin (decomposition phase) |
172
+ | `clerk` | conceptualizing + large context | Researchersearches codebase, returns structured findings | Plugin (per task) |
173
+ | `senior-dev` | coding | Implementation specialist | Plugin (per loop) |
174
+ | `junior-dev` | cheap/small coding | Review agent — strict COMPLETE/QUESTIONS | Plugin (per loop) |
175
+ | `debug` | coding + troubleshooting | Fresh perspective after 3 failed loops | Plugin (escalation) |
176
+ | `manifold` | good tool calling + planning | User-facing guide — explains system, presents results | User |
171
177
 
172
178
  ### Agent Specialization
173
179
 
174
- **Planning Phase:**
175
- - **Manifold** handles clarity assessment, design review, and final validation
176
- - **Clerk** researches codebase integration (always runs first, even for granular inputs)
177
- - **Todo** decomposes with full architectural awareness
180
+ **Planning Phase (Plugin-orchestrated):**
181
+ - **Planner** analyzes plan, generates questions, produces refined document
182
+ - **Todo** decomposes with full architectural awareness from Clerk research
183
+ - Plugin presents questions to user and manages the flow
178
184
 
179
- **Implementation Phase:**
180
- - **Clerk** composes scoped prompts and maintains wiki
181
- - **Senior Dev** implements
182
- - **Junior Dev** reviews
183
- - **Debug** breaks deadlocks after 3 failed loops
185
+ **Implementation Phase (Plugin-orchestrated):**
186
+ - **Clerk** researches codebase, returns structured findings (no orchestration)
187
+ - **Senior Dev** implements scoped prompt (no self-managed loops)
188
+ - **Junior Dev** reviews — strict first-word parsing by plugin code
189
+ - **Debug** provides fresh perspective when loop is stuck
184
190
 
185
191
  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.
186
192