devloom 1.0.0 → 1.1.0

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.
Files changed (140) hide show
  1. package/.ai/core.dsl +44 -0
  2. package/.ai/skills.dsl +39 -0
  3. package/.ai/verify.dsl +97 -0
  4. package/.ai/workflow.dsl +81 -0
  5. package/.opencode/themes/devloom-night-owl.json +103 -0
  6. package/GUIDE.md +547 -114
  7. package/README.md +557 -109
  8. package/SECURITY.md +93 -0
  9. package/agents/devloom-developer-flash.md +27 -0
  10. package/agents/devloom-developer-senior.md +28 -0
  11. package/agents/devloom-developer.md +18 -56
  12. package/agents/devloom-documenter-flash.md +24 -0
  13. package/agents/devloom-documenter.md +14 -57
  14. package/agents/devloom-orchestrator.md +232 -356
  15. package/agents/devloom-planner-flash.md +30 -0
  16. package/agents/devloom-planner-senior.md +31 -0
  17. package/agents/devloom-planner.md +32 -0
  18. package/agents/devloom-qa-flash.md +28 -0
  19. package/agents/devloom-qa.md +18 -84
  20. package/agents/devloom-security-senior.md +31 -0
  21. package/agents/devloom-security.md +30 -0
  22. package/agents/devloom-verifier.md +29 -0
  23. package/agents/devloom-vision.md +109 -0
  24. package/agents/devloom-visual-critic.md +98 -0
  25. package/agents/devloom-visual-director.md +80 -0
  26. package/commands/devloom-agents.md +49 -0
  27. package/commands/devloom-auto.md +11 -0
  28. package/commands/devloom-context.md +82 -0
  29. package/commands/devloom-deepseek.md +11 -0
  30. package/commands/devloom-free.md +11 -0
  31. package/commands/devloom-go-economy.md +11 -0
  32. package/commands/devloom-go-flash.md +11 -0
  33. package/commands/devloom-go.md +11 -0
  34. package/commands/devloom-init.md +28 -50
  35. package/commands/devloom-loop-status.md +25 -0
  36. package/commands/devloom-loop.md +36 -0
  37. package/commands/devloom-mimo.md +11 -0
  38. package/commands/devloom-plan.md +13 -0
  39. package/commands/devloom-refresh.md +22 -0
  40. package/commands/devloom-resume.md +30 -49
  41. package/commands/devloom-save.md +69 -0
  42. package/commands/devloom-status.md +9 -18
  43. package/commands/devloom.md +99 -67
  44. package/dist/agents.d.ts +30 -0
  45. package/dist/agents.d.ts.map +1 -0
  46. package/dist/agents.js +139 -0
  47. package/dist/agents.js.map +1 -0
  48. package/dist/bootstrap.d.ts +56 -0
  49. package/dist/bootstrap.d.ts.map +1 -0
  50. package/dist/bootstrap.js +116 -0
  51. package/dist/bootstrap.js.map +1 -0
  52. package/dist/constraints.d.ts +5 -0
  53. package/dist/constraints.d.ts.map +1 -0
  54. package/dist/constraints.js +45 -0
  55. package/dist/constraints.js.map +1 -0
  56. package/dist/context.d.ts +42 -0
  57. package/dist/context.d.ts.map +1 -0
  58. package/dist/context.js +636 -0
  59. package/dist/context.js.map +1 -0
  60. package/dist/guard.d.ts +19 -0
  61. package/dist/guard.d.ts.map +1 -0
  62. package/dist/guard.js +418 -0
  63. package/dist/guard.js.map +1 -0
  64. package/dist/loop.d.ts +64 -0
  65. package/dist/loop.d.ts.map +1 -0
  66. package/dist/loop.js +164 -0
  67. package/dist/loop.js.map +1 -0
  68. package/dist/plugin.d.ts.map +1 -1
  69. package/dist/plugin.js +101 -1
  70. package/dist/plugin.js.map +1 -1
  71. package/dist/tui-agents.d.ts +61 -0
  72. package/dist/tui-agents.d.ts.map +1 -0
  73. package/dist/tui-agents.js +89 -0
  74. package/dist/tui-agents.js.map +1 -0
  75. package/dist/tui.d.ts +6 -0
  76. package/dist/tui.d.ts.map +1 -0
  77. package/dist/tui.js +92 -0
  78. package/dist/tui.js.map +1 -0
  79. package/dist/worktree.d.ts +46 -0
  80. package/dist/worktree.d.ts.map +1 -0
  81. package/dist/worktree.js +272 -0
  82. package/dist/worktree.js.map +1 -0
  83. package/package.json +46 -6
  84. package/patterns/changelog-drafter.md +38 -0
  85. package/patterns/ci-sweeper.md +40 -0
  86. package/patterns/daily-triage.md +37 -0
  87. package/patterns/dependency-sweeper.md +40 -0
  88. package/patterns/design-audit.md +63 -0
  89. package/patterns/issue-triage.md +37 -0
  90. package/patterns/post-merge-cleanup.md +34 -0
  91. package/patterns/pr-babysitter.md +37 -0
  92. package/patterns/registry.yaml +52 -0
  93. package/postinstall.mjs +259 -63
  94. package/project/README.md +29 -0
  95. package/protocol/agent-contracts.md +27 -0
  96. package/protocol/artifact-system.md +53 -0
  97. package/protocol/model-routing.md +185 -0
  98. package/protocol/orchestrator-core.md +43 -0
  99. package/protocol/project-system.md +45 -0
  100. package/protocol/rules.md +18 -0
  101. package/protocol/verification-policy.md +48 -0
  102. package/scripts/loop-run.mjs +205 -0
  103. package/scripts/model-capabilities.mjs +169 -0
  104. package/scripts/plugin-cache.mjs +269 -0
  105. package/scripts/profile.mjs +691 -0
  106. package/scripts/visual-benchmark.mjs +149 -0
  107. package/scripts/worktree.mjs +445 -0
  108. package/skills/build/development.md +33 -0
  109. package/skills/build/live-docs.md +38 -0
  110. package/skills/build/simplify.md +50 -0
  111. package/skills/build/vision-analysis.md +98 -0
  112. package/skills/design/app-design.md +31 -0
  113. package/skills/design/design-grounding.md +30 -0
  114. package/skills/design/design-system.md +27 -0
  115. package/skills/design/game-design.md +35 -0
  116. package/skills/design/motion-design.md +34 -0
  117. package/skills/design/visual-direction.md +32 -0
  118. package/skills/design/web-design.md +33 -0
  119. package/skills/loop/changelog-drafter.md +32 -0
  120. package/skills/loop/ci-sweeper.md +24 -0
  121. package/skills/loop/constraints.md +21 -0
  122. package/skills/loop/dependency-sweeper.md +24 -0
  123. package/skills/loop/design-audit.md +67 -0
  124. package/skills/loop/issue-triage.md +27 -0
  125. package/skills/loop/post-merge-cleanup.md +24 -0
  126. package/skills/loop/pr-babysitter.md +26 -0
  127. package/skills/loop/triage.md +25 -0
  128. package/skills/loop/verifier.md +20 -0
  129. package/skills/meta/skill-discovery.md +23 -0
  130. package/skills/plan/planning.md +27 -0
  131. package/skills/plan/verification-planning.md +40 -0
  132. package/skills/review/security-review.md +63 -0
  133. package/skills/ship/documentation.md +11 -0
  134. package/skills/verify/app-verification.md +19 -0
  135. package/skills/verify/quality-assurance.md +17 -0
  136. package/skills/verify/visual-critique.md +30 -0
  137. package/skills/verify/visual-quality-gate.md +29 -0
  138. package/skills/verify/visual-regression.md +25 -0
  139. package/agents/devloom-analyst.md +0 -83
  140. package/agents/devloom-architect.md +0 -88
package/README.md CHANGED
@@ -1,50 +1,102 @@
1
1
  # DevLoom
2
2
 
3
- **Autonomous Development Weaver for OpenCode**
3
+ **Autonomous Software Delivery System for OpenCode**
4
4
 
5
5
  DevLoom combines *Developer* + *Loom* — the loom being the ancient machine that
6
- weaves individual threads into finished fabric. DevLoom does the same for software:
7
- it takes a single natural-language prompt and weaves together requirements,
8
- architecture, code, tests, and documentation into a complete, working feature.
6
+ weaves individual threads into finished fabric. It transforms a single prompt
7
+ into verified, documented, production-ready software not just generated code.
8
+
9
+ > Generating code is not success. Passing verification is not success.
10
+ > Success is achieved only when all acceptance gates have passed.
9
11
 
10
12
  ---
11
13
 
14
+ ## Highlights
15
+
16
+ - **17 agents, hard-delegation enforced** — Orchestrator routes; Planner, Developer, QA, Verifier, Security, Documenter, Vision, plus the read-only Visual Director (design direction) and Visual Critic (independent visual review) execute. Orchestrator has `edit/write/patch: deny` at the OpenCode permission level — code production is IMPOSSIBLE without `task()` delegation. Sub-agents have `task: deny` to prevent delegation chains.
17
+ - **Complexity-based tiering** — Classifies prompts as senior/standard, calls variant agents by name. No global state.
18
+ - **Protocol compliance** — Inline RULES + guard injection per turn. Never skippable.
19
+ - **Pipeline continuity** — Sessions tracked via `state.sessions`, task_id reused across turns.
20
+ - **Loop detection** — Tracks retry counts per agent per ticket. Warns at 2+ retries, blocks at 3+. Detects delegation chains and phase stalls.
21
+ - **Peer review gate** — Multi-model consensus for high-risk changes.
22
+ - **Architecture atlas** — Auto-generated codebase map on plugin init.
23
+ - **Queue-over-preempt** — New prompts queue behind active work.
24
+ - **Tier degradation** — Auto-fallback on model failure: senior→standard→skip.
25
+ - **Agent listing** — `/devloom-agents` shows all agents and their current model assignments.
26
+ - **Background dispatch** — Independent lanes run via `task(..., background: true)` for parallel work.
27
+
12
28
  ## How It Works
13
29
 
14
- The **Orchestrator** interprets your prompt, delegates to five specialist
15
- sub-agents, and loops until every task passes QA and the final build succeeds —
16
- no human intervention required after the initial prompt.
17
-
18
- ```
19
- /devloom "Build a REST API for user management with JWT auth"
20
-
21
-
22
- DEVLOOM ORCHESTRATOR
23
-
24
- ├── @devloom-analyst .opencode/devloom/requirements.md
25
- ├── @devloom-architect → .opencode/devloom/plan.md
26
-
27
- └── For each task in plan.md:
28
- ├── @devloom-developer (weaves the code)
29
- ├── @devloom-qa (inspects the weave)
30
- │ └── QA_FAIL developer re-weaves → QA re-inspects
31
- └── marks task [x] on QA_PASS
32
-
33
- ├── @devloom-documenter (updates README + API docs)
34
- └── Final quality gate (build + full test suite)
35
- └── All green → DEVLOOM_DONE
36
- ```
37
-
38
- ### Agent Roster
39
-
40
- | Agent | Mode | Role |
41
- |---|---|---|
42
- | `devloom-orchestrator` | `primary` | Loop controller, phase manager, quality gate |
43
- | `devloom-analyst` | `subagent` | Prompt `.opencode/devloom/requirements.md` |
44
- | `devloom-architect` | `subagent` | Requirements `.opencode/devloom/plan.md` |
45
- | `devloom-developer` | `subagent` | Task implementation |
46
- | `devloom-qa` | `subagent` | Tests, lint, regression checks, verdict |
47
- | `devloom-documenter` | `subagent` | README + API doc updates |
30
+ ```
31
+ /devloom "<prompt>"
32
+ |
33
+ v
34
+ ORCHESTRATOR (never implements — routes only)
35
+ |
36
+ +-- CLASSIFY: complex? senior tier. Standard? Base agent.
37
+ | Then call the right variant by name.
38
+ |
39
+ +-- TRIAGE: pick minimal chain for intent
40
+ | featureplanner > developer > qa > documenter
41
+ | bug → developer (root-cause) > qa (regression)
42
+ | small → developer > qa
43
+ |
44
+ +-- CONDITIONAL ADD-ONS (only when touched)
45
+ | image → vision first
46
+ | UI/API/CRUD verifier / security
47
+ |
48
+ +-- DEFECT LOOP: max 3 cycles, then BLOCKED
49
+ +-- DEVLOOM_DONE: all chain gates pass
50
+ ```
51
+
52
+ ### Agents
53
+
54
+ | Agent | Role | Skill |
55
+ |-------|------|-------|
56
+ | Orchestrator | Triage, route, state, gate (hard-denied write/edit/patch) | |
57
+ | Planner | Requirements + CleanArch plan + evidence path | `plan/planning` + `plan/verification-planning` |
58
+ | Developer | Implement / fix + simplify | `build/development` + `build/simplify` |
59
+ | QA | Tests, lint, review, regression + simplify | `verify/quality-assurance` + `build/simplify` |
60
+ | Verifier | Runtime checks by scope + peer review | `verify/app-verification` |
61
+ | Security | CRUD/exposure forensic review | `review/security-review` |
62
+ | Documenter | Docs + state updates | `ship/documentation` |
63
+ | Vision | Image/screenshot analysis | `build/vision-analysis` |
64
+ | Visual Director | Read-only visual design direction + project design memory (never implements frontend code) | `design/visual-direction` + domain design skill |
65
+ | Visual Critic | Independent read-only visual review of rendered output (never edits code) | `verify/visual-critique` |
66
+
67
+ Each agent has variant files: `-senior` (strongest models) or `-flash` (cheapest), plus base (standard tier). Protocol rules are inlined in every agent — no external LOAD needed beyond the skill files.
68
+
69
+ ---
70
+
71
+ ## Visual Intelligence Pipeline
72
+
73
+ For substantial graphical work, DevLoom routes through an extra visual loop:
74
+
75
+ ```
76
+ planner (marks VISUAL_REQUIRED=true)
77
+ → visual-director (classifies visual domain + defines direction;
78
+ persists .opencode/devloom/context/design.md)
79
+ → developer (implements against design.md as the visual contract;
80
+ functionality overrides aesthetics)
81
+ → visual-critic (independent screenshot review — fresh context, no
82
+ implementation rationale)
83
+ → developer correction (max 3 visual cycles, integrated with DevLoom's
84
+ existing defect-loop circuit breakers)
85
+ → qa → verifier (visual, responsive, motion, a11y + functional scopes)
86
+ → documenter
87
+ ```
88
+
89
+ - **Small UI bug**: developer → qa → verifier — no visual agents. Backend work never routes through visual agents.
90
+ - **Design memory**: `.opencode/devloom/context/design.md` with sections Visual Concept, Personality, UX Goal, Color Roles, Typography, Spacing, Grid/Layout, Surface, Shape Language, Components, Iconography, Motion, Interaction, Responsive, Accessibility, DO/DON'T (games add HUD Information Priority + Gameplay Attention Rules). Read before subsequent visual work; updated only when direction intentionally changes.
91
+ - **Visual complexity** is orchestration metadata: `none` / `standard` / `high` — separate from the engineering tier (senior/standard).
92
+ - **New skills**: `design/visual-direction`, `design/design-grounding`, `design/web-design`, `design/app-design`, `design/game-design`, `design/motion-design`, `design/design-system`; `verify/visual-critique`, `verify/visual-quality-gate`, `verify/visual-regression`.
93
+ - **Verifier scopes gained**: `visual` (render + screenshot + critique integration + design-direction alignment), `responsive` (1440×1000, 1024×900, 390×844 or project targets: overflow, clipping, nav, readability, reflow, control usability), `motion` (key transitions, feedback, prefers-reduced-motion, no motion breakage).
94
+ - **Completion gates**: FUNCTIONAL + QA + VISUAL + RESPONSIVE + ACCESSIBILITY for graphical work. `visual_validation_verified` requires actual rendered evidence when tooling supports it; if images cannot be inspected, DevLoom reports `VISUAL_VERIFICATION_LIMITED` instead of a false pass. Backend-only changes do not require visual gates.
95
+ - **Chrome MCP (optional)**: browser-renderable work uses the Chrome MCP when configured (screenshots, DOM/a11y snapshot, viewport resize, device emulation, console/network, JS eval, Lighthouse). It is discovered, never assumed; Playwright MCP is not a substitute. Without it, DevLoom falls back to structural/runtime verification and says so — it never fabricates visual checks.
96
+ - **One-time multimodal path check**: Chrome screenshot → actual image → vision-capable model. If real images cannot reach the model (e.g. a given MiMo endpoint), screenshot validation is not marked passed.
97
+ - **OpenDesign MCP (optional)**: if an `opendesign` MCP is configured, visual-director may use it for design grounding (typography/spacing/density/palette/motion/interaction relationships + explicit DON'T rules). Never a hard dependency; DevLoom works normally without it, and never clones another product.
98
+ - **Optional max-quality visual mode (documented, NOT default)**: 3 concepts → select 1 → 2 isolated implementations → blind visual-critic comparison → winner → max 2–3 refinement cycles → verifier gates. Only for high-value deliverables.
99
+ - **Anti-generic-aesthetic rules**: avoid card soup, pill soup, default purple gradients, meaningless glassmorphism, arbitrary glow, decorative blobs, giant text without compositional purpose, generic cyan sci-fi HUDs/hexagons/scanlines, and dark SaaS dashboards disguised as game UI. Quality = hierarchy, composition, typography, spacing, proportion, coherence, domain fit, interaction quality.
48
100
 
49
101
  ---
50
102
 
@@ -70,9 +122,6 @@ cd devloom
70
122
  npm install && npm run build && node postinstall.mjs
71
123
  ```
72
124
 
73
- All methods run the post-install script that copies agents, commands, and skills
74
- to your OpenCode global config directory.
75
-
76
125
  **Per-project via `opencode.json`:**
77
126
 
78
127
  ```json
@@ -82,6 +131,49 @@ to your OpenCode global config directory.
82
131
  }
83
132
  ```
84
133
 
134
+ The plugin auto-bootstraps `.opencode/devloom/project/`, generates the
135
+ Architecture Atlas (`context/atlas.md`), and creates `.opencode/devloom/.tmp/`
136
+ for temporary files — all on OpenCode startup.
137
+
138
+ ### Theme
139
+
140
+ DevLoom ships a custom **Night Owl** theme for OpenCode's TUI. Deep indigo
141
+ background with vibrant cyan, purple, and orange accents — designed for long
142
+ coding sessions and low eye strain.
143
+
144
+ ```json
145
+ # ~/.config/opencode/tui.json or .opencode/tui.json
146
+ {
147
+ "$schema": "https://opencode.ai/tui.json",
148
+ "theme": "devloom-night-owl"
149
+ }
150
+ ```
151
+
152
+ The theme file is at `.opencode/themes/devloom-night-owl.json` in the project
153
+ root. OpenCode loads it automatically when you open the devloom directory.
154
+
155
+ ### Drift protection (always-on)
156
+
157
+ Long sessions make models "forget" prompt-only rules. DevLoom enforces the
158
+ flow deterministically at three levels — no reminders needed:
159
+
160
+ - **Level 1: OpenCode permissions (hardest)** — The orchestrator's `edit`/`write`/`patch` are denied at the OpenCode permission level. Calls fail with permission errors — the model has no way to bypass this. Sub-agents have `task: deny` so they cannot create delegation chains.
161
+ - **Level 2: Plugin guard** (`tool.execute.before`): if the orchestrator somehow attempts a write outside `.opencode/devloom/`, the plugin blocks it with an error telling it to delegate via `task()`. State persistence stays allowed.
162
+ - **Level 3: Per-turn injection** (`chat.message` + system transform): compliance requirements + protocol rules + live pipeline state injected into ALL devloom agents every turn.
163
+ - **Compaction guard** (`experimental.session.compacting`): the compaction summary is forced to preserve the routing rule and current pipeline state, so the flow survives context compression.
164
+ - **Session persistence**: session→agent mapping is written to `.opencode/devloom/.sessions.json` so the guard survives plugin reloads (e.g. after `opencode --continue`).
165
+
166
+ ### Anti-loop protection
167
+
168
+ Agents that get stuck waste tokens. DevLoom tracks retry counts and stops runaway chains:
169
+
170
+ - **Per-agent retry counter** — `state.loopCounts[agentName]` tracks how many times the orchestrator re-delegated to the same agent for the current ticket.
171
+ - **WARN at 2 retries** — injected into the orchestrator's state summary as `loop_risk=[WARN:devloom-developer=2x]`.
172
+ - **HARD STOP at 3 retries** — orchestrator prompt enforces: mark ticket blocked, report BLOCKED, never attempt a 4th retry.
173
+ - **Phase stall detection** — if the same phase is re-entered 3+ times with no state advancement, report BLOCKED and ask for task decomposition.
174
+ - **Delegation chain detection** — if a sub-agent responds by calling `task()` instead of completing its work, STOP. Sub-agents have `task: deny` at the permission level as a hard guarantee.
175
+ - **Cost circuit breaker** — if a single ticket exceeds 2M tokens, pause and report.
176
+
85
177
  ---
86
178
 
87
179
  ## Usage
@@ -96,6 +188,18 @@ Check progress mid-run:
96
188
  /devloom-status
97
189
  ```
98
190
 
191
+ List all agents and their current models:
192
+
193
+ ```
194
+ /devloom-agents
195
+ ```
196
+
197
+ Persist current state and pause for the next user command:
198
+
199
+ ```
200
+ /devloom-save
201
+ ```
202
+
99
203
  Resume an interrupted execution:
100
204
 
101
205
  ```
@@ -116,117 +220,461 @@ opencode run "/devloom Add OpenTelemetry tracing to all HTTP handlers"
116
220
 
117
221
  ---
118
222
 
223
+ ## The Completion Gate
224
+
225
+ DevLoom considers a task complete only when **all** of these pass:
226
+
227
+ | Gate | What It Checks |
228
+ |------|----------------|
229
+ | `build` | Compilation succeeds |
230
+ | `lint` | No lint errors |
231
+ | `unit_tests` | All unit tests pass |
232
+ | `integration_tests` | All integration tests pass |
233
+ | `e2e_tests` | All end-to-end tests pass |
234
+ | `all_routes_visited` | Every discovered route was visited |
235
+ | `all_buttons_tested` | Every button was clicked |
236
+ | `all_forms_tested` | Every form was verified |
237
+ | `all_links_verified` | Every link was navigated |
238
+ | `all_user_journeys_passed` | All user journeys executed successfully |
239
+ | `all_api_endpoints_verified` | Every endpoint validated |
240
+ | `accessibility_verified` | ARIA, keyboard, contrast all pass |
241
+ | `responsive_layout_verified` | No layout defects |
242
+ | `visual_validation_verified` | Rendering correct |
243
+ | `performance_validation_verified` | Performance baseline met |
244
+ | `security_validation_verified` | No security issues |
245
+ | `no_open_defects` | Defect registry is clean |
246
+
247
+ If any gate fails, DevLoom automatically returns to the repair phase.
248
+
249
+ ---
250
+
251
+ ## Autonomous Operation
252
+
253
+ DevLoom never stops after code generation. It continues through:
254
+
255
+ 1. **Verification** -- Every route, form, button, link, and API endpoint is tested
256
+ 2. **Defect Discovery** -- All defects logged to persistent registry
257
+ 3. **Root Cause Analysis** -- Symptoms are traced to their source
258
+ 4. **Repair** -- Minimal fixes applied to root causes only
259
+ 5. **Re-Verification** -- Full regression suite after every fix
260
+ 6. **Recovery** -- Self-healing from build/test/network failures
261
+
262
+ Human intervention is always the last resort.
263
+
264
+ ---
265
+
266
+ ## Loop Engineering
267
+
268
+ **Stop prompting the agent. Design the loop that prompts the agent.**
269
+
270
+ DevLoom's loop engineering system moves beyond one-shot prompts to recurring,
271
+ cadence-driven agent execution. A configured loop runs a pattern on a schedule,
272
+ with automatic circuit-breaking via token budget limits.
273
+
274
+ ### Loop patterns (7 built-in)
275
+
276
+ | Pattern | Purpose |
277
+ |---------|---------|
278
+ | `daily-triage` | Review new issues, classify, route to planner |
279
+ | `pr-babysitter` | Check open PRs for CI status, staleness, conflicts |
280
+ | `ci-sweeper` | Retry or investigate failed CI jobs |
281
+ | `dependency-sweeper` | Scan for outdated/vulnerable dependencies |
282
+ | `changelog-drafter` | Generate changelog from recent commits |
283
+ | `post-merge-cleanup` | Clean up merged branches, update tickets |
284
+ | `issue-triage` | Triage issue queue with classification and routing |
285
+
286
+ ### Safety levels
287
+
288
+ | Level | Behavior |
289
+ |-------|----------|
290
+ | L1 (report-only) | Observe and report — no file modifications |
291
+ | L2 (assisted) | Fix with worktree isolation + verifier approval |
292
+ | L3 (unattended) | Full autonomous fix-and-close cycle |
293
+
294
+ ### Usage
295
+
296
+ Start a loop tick manually:
297
+
298
+ ```bash
299
+ node .opencode/devloom/scripts/loop-run.mjs --pattern daily-triage
300
+ ```
301
+
302
+ In OpenCode, start a background loop:
303
+
304
+ ```
305
+ /devloom-loop start daily-triage --cadence "0 8 * * 1-5" --level L2
306
+ ```
307
+
308
+ Each tick respects the token budget circuit breaker — if a run exceeds its
309
+ budget, the loop pauses and logs the overage before the next scheduled tick.
310
+
311
+ ---
312
+
313
+ ## Defect Registry
314
+
315
+ All discovered defects are tracked in `.opencode/devloom/defects.json`:
316
+
317
+ ```json
318
+ {
319
+ "defects": [
320
+ {
321
+ "id": "BUG-001",
322
+ "severity": "high",
323
+ "location": "/customers",
324
+ "type": "route",
325
+ "status": "open"
326
+ }
327
+ ]
328
+ }
329
+ ```
330
+
331
+ Defects flow through: `open -> analyzed -> fixed -> verified -> closed`.
332
+ The same defect is never rediscovered -- the registry prevents duplication.
333
+
334
+ ---
335
+
119
336
  ## Model Configuration
120
337
 
121
- By default all agents use **deepseek-v4-flash-free** (the fastest free model).
338
+ DevLoom provides seven selectable model profiles plus auto-detection. Each
339
+ maps every agent to a specific model optimized for its role.
340
+
341
+ ### Profile comparison
342
+
343
+ | Profile | Quality | Cost | Best for |
344
+ |---------|---------|------|----------|
345
+ | **go** | Highest | Premium | Production delivery, complex features |
346
+ | **go-economy** | High | Lower | Daily development, budget-conscious |
347
+ | **deepseek** | High | Lower | DeepSeek-only stack |
348
+ | **go-flash** | Good | Cheapest paid | High-volume, simple tasks |
349
+ | **free** | Good | Zero | Evaluation, learning, hobby projects |
350
+ | **glm** | High | Lower | GLM-only stack |
351
+ | **mimo** | High | Low/Fast | MiMo V2.6 multimodal all-role stack |
352
+
353
+ ### go profile (max quality)
122
354
 
123
- ### Per-project override
355
+ Uses the strongest OpenCode Go models per role.
124
356
 
125
- Create `.opencode/devloom/config.json` in your project root. Every time you run
126
- a DevLoom command, it reads this file and overrides the global defaults:
357
+ ```json
358
+ {
359
+ "models": {
360
+ "orchestrator": "opencode-go/deepseek-v4-flash",
361
+ "planner": "opencode-go/qwen3.7-max",
362
+ "developer": "opencode-go/kimi-k2.7-code",
363
+ "qa": "opencode-go/deepseek-v4-pro",
364
+ "verifier": "opencode-go/deepseek-v4-pro",
365
+ "security": "opencode-go/glm-5.2",
366
+ "documenter": "opencode-go/qwen3.7-plus",
367
+ "vision": "opencode-go/qwen3.6-plus",
368
+ "visual-director": "opencode-go/glm-5.2",
369
+ "visual-critic": "opencode-go/glm-5.3-flash"
370
+ }
371
+ }
372
+ ```
373
+
374
+ ### go-economy profile
127
375
 
128
376
  ```json
129
377
  {
130
378
  "models": {
131
- "orchestrator": "opencode/big-pickle",
132
- "analyst": "opencode/deepseek-v4-flash-free",
133
- "architect": "opencode/deepseek-v4-flash-free",
134
- "developer": "opencode/deepseek-v4-flash-free",
135
- "qa": "opencode/deepseek-v4-flash-free",
136
- "documenter": "opencode/deepseek-v4-flash-free"
379
+ "orchestrator": "opencode-go/deepseek-v4-flash",
380
+ "planner": "opencode-go/deepseek-v4-pro",
381
+ "developer": "opencode-go/deepseek-v4-pro",
382
+ "qa": "opencode-go/deepseek-v4-flash",
383
+ "verifier": "opencode-go/deepseek-v4-flash",
384
+ "security": "opencode-go/deepseek-v4-pro",
385
+ "documenter": "opencode-go/qwen3.7-plus",
386
+ "vision": "opencode-go/qwen3.6-plus",
387
+ "visual-director": "opencode-go/deepseek-v4-pro",
388
+ "visual-critic": "opencode-go/glm-5.3-flash"
137
389
  }
138
390
  }
139
391
  ```
140
392
 
141
- **All models MUST use the `opencode/` or `opencode-go/` prefix.** If you forget
142
- the prefix, DevLoom adds it automatically and warns you.
393
+ ### deepseek profile
143
394
 
144
- ### Interactive setup (first run)
395
+ Uses only DeepSeek models for consistent provider affinity (vision uses cheapest vision-capable DeepSeek model):
145
396
 
146
- If no `config.json` exists, Phase 0 detects available models and asks whether
147
- to use **Free** (`opencode/`) or **Go** (`opencode-go/`) tier, then assigns
148
- the best available model per agent role.
397
+ ```json
398
+ {
399
+ "models": {
400
+ "orchestrator": "opencode-go/deepseek-v4-pro",
401
+ "planner": "opencode-go/deepseek-v4-pro",
402
+ "developer": "opencode-go/deepseek-v4-pro",
403
+ "qa": "opencode-go/deepseek-v4-pro",
404
+ "verifier": "opencode-go/deepseek-v4-flash",
405
+ "security": "opencode-go/deepseek-v4-pro",
406
+ "documenter": "opencode-go/deepseek-v4-flash",
407
+ "vision": "opencode-go/deepseek-v4-flash-vision-exp",
408
+ "visual-director": "opencode-go/deepseek-v4-pro",
409
+ "visual-critic": "opencode-go/deepseek-v4-flash-vision-exp"
410
+ }
411
+ }
412
+ ```
149
413
 
150
- ### Global override
414
+ ### go-flash profile
151
415
 
152
- Edit the agent files directly at `~/.config/opencode/agents/`:
416
+ All agents on DeepSeek V4 Flash for maximum throughput at minimum cost:
153
417
 
154
- ```bash
155
- sed -i 's|^model:.*|model: opencode/deepseek-v4-flash-free|' \
156
- ~/.config/opencode/agents/devloom-*.md
418
+ ```json
419
+ {
420
+ "models": {
421
+ "orchestrator": "opencode-go/deepseek-v4-flash",
422
+ "planner": "opencode-go/deepseek-v4-flash",
423
+ "developer": "opencode-go/deepseek-v4-flash",
424
+ "qa": "opencode-go/deepseek-v4-flash",
425
+ "verifier": "opencode-go/deepseek-v4-flash",
426
+ "security": "opencode-go/deepseek-v4-flash",
427
+ "documenter": "opencode-go/deepseek-v4-flash",
428
+ "vision": "opencode-go/qwen3.6-plus",
429
+ "visual-director": "opencode-go/deepseek-v4-flash",
430
+ "visual-critic": "opencode-go/glm-5.3-flash"
431
+ }
432
+ }
157
433
  ```
158
434
 
159
- ---
435
+ ### free profile
160
436
 
161
- ## Skills
437
+ Uses only OpenCode Free models (zero cost). The profile auto-picks the best
438
+ available free model per agent role using a candidate chain.
162
439
 
163
- Each DevLoom agent loads domain-specific skills at startup that guide its workflow:
440
+ The orchestrator leads with `big-pickle` (strong free-tier routing). Role fallback order:
441
+ - **orchestration**: big-pickle → muse-spark-1.3-contributor-free →
442
+ mimo-v2.5-free → muse-spark-1.2-contributor-free → nemotron-3.5-lightning-free → nemotron-3-ultra-free → ling-3.0-flash-fin-free
443
+ - **implementation / verification**: big-pickle → muse-spark-1.3-contributor-free →
444
+ nemotron-3.5-lightning-free → mimo-v2.5-free → nemotron-3-ultra-free → ling-3.0-flash-fin-free
445
+ - **planning**: nemotron-3-ultra-free → muse-spark-1.3-contributor-free → muse-spark-1.2-contributor-free →
446
+ big-pickle → nemotron-3.5-lightning-free → ling-3.0-flash-fin-free
447
+ - **documentation**: muse-spark-1.3-contributor-free → muse-spark-1.2-contributor-free → nemotron-3-ultra-free →
448
+ mimo-v2.5-free → ling-3.0-flash-fin-free
449
+ - **vision** (vision-capable models only): mimo-v2.5-free → go multimodal fallbacks
450
+ (deepseek-v4-flash-vision-exp, minimax-m3, mimo-v2.5-pro — ordered by cost, cheapest first)
451
+ - **visual-director / visual-critic**: resolve through the same vision candidate
452
+ chain (they are vision-capable roles)
164
453
 
165
- | Agent | Skills |
166
- |---|---|
167
- | **analyst** | `skill-discovery`, `requirements-analysis` |
168
- | **architect** | `skill-discovery`, `architecture-planning`, `api-design` |
169
- | **developer** | `skill-discovery`, `incremental-development`, `test-driven-development`, `frontend-development`, `backend-development`, `api-design` |
170
- | **qa** | `skill-discovery`, `quality-assurance`, `code-review`, `security-review`, `performance-review`, `debugging` |
171
- | **documenter** | `skill-discovery`, `documentation` |
172
- | **orchestrator** | `skill-discovery` |
454
+ ### mimo profile
455
+
456
+ All 10 roles mapped to MiMo V2.6 Flash — a multimodal all-role stack, so the
457
+ same model also covers vision and visual-critic (no separate vision provider):
458
+
459
+ ```json
460
+ {
461
+ "models": {
462
+ "orchestrator": "opencode-go/mimo-v2.6-flash",
463
+ "planner": "opencode-go/mimo-v2.6-flash",
464
+ "developer": "opencode-go/mimo-v2.6-flash",
465
+ "qa": "opencode-go/mimo-v2.6-flash",
466
+ "verifier": "opencode-go/mimo-v2.6-flash",
467
+ "security": "opencode-go/mimo-v2.6-flash",
468
+ "documenter": "opencode-go/mimo-v2.6-flash",
469
+ "vision": "opencode-go/mimo-v2.6-flash",
470
+ "visual-director": "opencode-go/mimo-v2.6-flash",
471
+ "visual-critic": "opencode-go/mimo-v2.6-flash"
472
+ }
473
+ }
474
+ ```
173
475
 
174
- Skills auto-detect the task type (FE, BE, security, docs, etc.) and load the
175
- right workflow. All skills are in `skills/` and are copied to
176
- `~/.config/opencode/skills/` during install.
476
+ The actual id is the first available candidate from the chain
477
+ `mimo/mimo-v2.6-flash` `xiaomi/mimo-v2.6-flash` `opencode-go/mimo-v2.6-flash`,
478
+ checked against `opencode models`. If no MiMo V2.6 Flash candidate is available,
479
+ profile activation FAILS with a diagnostic listing the attempted candidates and
480
+ compatible models found — it never silently substitutes unrelated models (a
481
+ same-family fallback such as `mimo-v2.6-pro` is allowed but always reported
482
+ under "Fallbacks applied"). Tier overrides are locked for `mimo` (like
483
+ `go-flash` and `free`). Switch with `/devloom-mimo` (`profile.mjs set mimo`).
484
+
485
+ ### Model-routing table (go)
486
+
487
+ Each of the 10 agents is assigned a model optimized for its role:
488
+
489
+ | Agent | Role | Standard Tier | Senior Tier |
490
+ |---|---|---|---|
491
+ | `orchestrator` | Triage, routing, state, gate | `deepseek-v4-flash` | `deepseek-v4-flash` |
492
+ | `planner` | Requirements + CleanArch plan | `qwen3.7-max` | `glm-5.2` |
493
+ | `developer` | Implementation + root-cause fixes | `glm-5.3-flash` | `kimi-k3` |
494
+ | `qa` | Tests, lint, code review, regression | `v4-flash` | `v4-pro` |
495
+ | `verifier` | Runtime app checks + peer review | `v4-flash` | `v4-pro` |
496
+ | `security` | CRUD/exposure forensic review | `v4-flash` | `glm-5.2` |
497
+ | `documenter` | Docs + state updates | `v4-flash` | `qwen3.7-plus` |
498
+ | `vision` | Image analysis (multimodal) | `qwen3.6-plus` | `qwen3.6-plus` |
499
+ | `visual-director` | Visual direction + design memory | `glm-5.3-flash` | `glm-5.2` |
500
+ | `visual-critic` | Independent visual review (multimodal) | `glm-5.3-flash` | `glm-5.3-flash` |
501
+
502
+ ### Tier system (complexity-based agent selection)
503
+
504
+ The orchestrator automatically classifies each prompt by complexity and calls the
505
+ correct variant sub-agent by name — no global state switching. Each variant has
506
+ a fixed model in its agent file, so parallel worktrees never conflict.
507
+
508
+ | Tier | When | Agent Variant | Model |
509
+ |------|------|--------------|-------|
510
+ | **senior** | Complex feature, architecture, security audit, debugging | `-senior` suffix (planner, developer, security) | GLM-5.2, Kimi K3 |
511
+ | **standard** | Everything else (default) | Base agents (no suffix) | deepseek-v4-flash, qwen3.7-max, kimi-k2.7-code |
512
+
513
+ ### Provider-agnostic model IDs
514
+
515
+ Model IDs are validated as `provider/model` — any OpenCode provider works, and
516
+ the model segment may itself contain slashes (e.g. `lmstudio/google/gemma-...`):
517
+
518
+ | Correct | Wrong |
519
+ |---|---|
520
+ | `mimo/mimo-v2.6-flash` | `mimo-v2.6-flash` |
521
+ | `opencode-go/deepseek-v4-pro` | `deepseek-v4-pro` |
522
+
523
+ Availability is checked against `opencode models`: a well-formed but
524
+ unavailable model still fails validation. Bare ids without a provider
525
+ (`deepseek-v4-flash`, `invalid-no-provider`) are invalid. Unavailable models
526
+ fail validation or fall back per profile policy.
527
+
528
+ ### First-run interactive setup
529
+
530
+ If no `config.json` exists, Phase 0 detects available models (`opencode models`),
531
+ asks which profile to use (**go**, **go-economy**, **mimo**, or **free**), then
532
+ assigns the best model per agent role for the chosen profile.
533
+
534
+ ### Profile & sidebar visibility
535
+
536
+ OpenCode installs npm plugins into a package cache (`~/.cache/opencode/packages`)
537
+ with `ignoreScripts`, so the DevLoom plugin code there can go stale. The DevLoom
538
+ `postinstall` and the `/devloom-refresh` command re-copy the current plugin code
539
+ (including the `config` hook that injects all 17 DevLoom agents + the active
540
+ profile into the OpenCode sidebar) into that cache, rebuilding `dist/` from
541
+ source first so the cache never receives stale compiled code.
542
+
543
+ - After installing or updating DevLoom, run `/devloom-refresh` once, then
544
+ **restart opencode** (or continue with `opencode --continue`) to pick up the
545
+ refreshed plugin.
546
+ - The sidebar header shows the active profile (`DevLoom - free`,
547
+ `DevLoom - go`, ...) and every agent row shows its resolved model
548
+ (`orchestrator: opencode/big-pickle`, ...). The orchestrator
549
+ agent description also carries the profile label:
550
+ `DevLoom Orchestrator: autonomous multi-agent delivery (profile: go-flash)`,
551
+ extended to `(profile: go, tier: senior)` with a senior tier override.
552
+ - The sidebar shows only the 10 base agents — all `-flash` and `-senior`
553
+ variants are hidden for every profile. The variants stay registered so
554
+ orchestrator `task()` routing keeps working; they are simply not listed.
555
+ - Switching profiles (`/devloom-go`, `/devloom-go-flash`, `/devloom-mimo`,
556
+ `/devloom-free`, ...)
557
+ updates the installed agent files immediately; restart opencode to see the
558
+ updated profile and models in the sidebar.
177
559
 
178
560
  ---
179
561
 
180
- ## Persistent State
562
+ ## OpenCode Go Optimization
181
563
 
182
- DevLoom uses `.opencode/devloom/` in your project root as shared state:
564
+ DevLoom is **purpose-built for OpenCode Go** -- the premium model tier that
565
+ delivers the highest-quality results from the OpenCode platform.
183
566
 
184
- | File | Purpose |
185
- |---|---|
186
- | `requirements.md` | User story, functional requirements, acceptance criteria |
187
- | `plan.md` | Ordered task checklist, updated as tasks complete |
188
- | `config.json` | Model assignments per agent role (local override) |
189
- | `state.json` | Execution state for resume support |
190
- | `errors.md` | Tasks skipped after repeated failures |
567
+ ### Why go?
191
568
 
192
- All files are plain Markdown/JSON inspect and edit them directly.
569
+ Each agent in the pipeline has different cognitive demands. DevLoom assigns
570
+ role-optimized models via the tier system (senior/standard):
193
571
 
194
- ---
572
+ | Agent | Standard | Senior (complex) |
573
+ |-------|----------|-------------------|
574
+ | Orchestrator | `deepseek-v4-flash` (fast, reliable routing) | `deepseek-v4-flash` |
575
+ | Planner | `qwen3.7-max` (strong reasoning) | `glm-5.2` (deep analysis) |
576
+ | Developer | `kimi-k2.7-code` (code-specialized) | `kimi-k3` (newest gen) |
577
+ | QA | `v4-flash` (fast review) | `v4-pro` (thorough verification) |
578
+ | Verifier | `v4-flash` (fast checks) | `v4-pro` (deep inspection) |
579
+ | Security | `v4-flash` (light review) | `glm-5.2` (forensic depth) |
580
+ | Documenter | `v4-flash` (fast docs) | `qwen3.7-plus` (quality docs) |
581
+ | Vision | `qwen3.6-plus` (low-cost multimodal) | `qwen3.6-plus` |
195
582
 
196
- ## Troubleshooting
583
+ ### Token architecture
197
584
 
198
- ### Agents not found after install
199
- ```bash
200
- ls ~/.config/opencode/agents/ | grep devloom
201
- ```
202
- If empty, re-run: `node $(npm root -g)/devloom/postinstall.mjs`
585
+ DevLoom eliminates redundant protocol loading at the architectural level:
586
+
587
+ 1. **Inline RULES** Every agent has protocol rules embedded in its own file body. No external LOAD needed.
588
+ 2. **Single skill LOAD** — Agents load exactly one file: their skill. No protocol/DSL LOADs.
589
+ 3. **Guard injection** Compliance + state summary injected per turn (already in context).
590
+ 4. **Tier degradation** — If a model fails twice, auto-fallback: senior→standard→skip agent.
591
+
592
+ **Pipeline token cost (planner→dev→qa→verifier→doc, one turn):**
593
+ - Before: ~24KB of LOADed protocol files
594
+ - After: ~8KB of inline rules + skill LOAD
595
+ - Savings: **~65%**
596
+
597
+ Run `opencode models` to see what's currently available in your environment.
598
+
599
+ ---
203
600
 
204
- ### ProviderModelNotFoundError
205
- An agent file is missing the `opencode/` prefix. DevLoom auto-fixes this when
206
- loading config.json, but if you edit agent files manually, always use the full
207
- prefix (e.g. `opencode/deepseek-v4-flash-free`, not `deepseek-v4-flash-free`).
601
+ ## Skills
208
602
 
209
- ### The weave stops before DEVLOOM_DONE
210
- Increase `max_steps` in `~/.config/opencode/agents/devloom-orchestrator.md` (default 200).
603
+ DevLoom ships focused skills per agent. Each skill folds in the relevant engineering standards — SOLID, clean code, clean architecture, TDD, UI/UX (WCAG-AA), and forensic root-cause discipline (no workarounds):
604
+
605
+ | Category | Skill | Agent |
606
+ |----------|-------|-------|
607
+ | `plan/` | planning | planner |
608
+ | `plan/` | verification-planning | planner (evidence path before non-trivial changes) |
609
+ | `build/` | development | developer |
610
+ | `build/` | simplify | developer, qa (behavior-preserving simplification) |
611
+ | `build/` | vision-analysis | vision |
612
+ | `verify/` | quality-assurance | qa |
613
+ | `verify/` | app-verification | verifier |
614
+ | `verify/` | visual-critique, visual-quality-gate, visual-regression | visual-critic, verifier |
615
+ | `design/` | visual-direction | visual-director (always) |
616
+ | `design/` | design-grounding, web-design, app-design, game-design, motion-design, design-system | visual-director (domain-dependent; loads only when routed) |
617
+ | `review/` | security-review | security (CRUD/exposure/auth audit) |
618
+ | `ship/` | documentation | documenter |
619
+ | `meta/` | skill-discovery | orchestrator |
211
620
 
212
621
  ---
213
622
 
214
- ## Demo
623
+ ## Project Workspace
624
+
625
+ Every initialized project gets a persistent workspace at `.opencode/devloom/project/`.
626
+
627
+ - English-only artifacts for cross-agent consistency
628
+ - Minified JSON for AI-only state files
629
+ - Jira-style local board with stories, tasks, bugs, decisions, and reports
630
+ - Single active ticket by default; unfinished work is always persisted
631
+ - Optional GitHub Project mirror only when the user explicitly enables it
632
+ - Existing legacy project files are normalized in place on `init`, `run`, and `resume`
633
+ - Opening OpenCode in a DevLoom project also normalizes the workspace automatically
634
+
635
+ ---
215
636
 
216
- A working example of what DevLoom produces is available in the [`demo/`](demo/) folder. It was generated from the prompt:
637
+ ## Architecture Reference
217
638
 
218
639
  ```
219
- /devloom Build a very simple full-stack Task List web app.
640
+ devloom/
641
+ +-- src/ # Plugin source (TypeScript)
642
+ +-- agents/ # 17 agents: 10 base + 7 tier variants
643
+ | +-- devloom-orchestrator.md
644
+ | +-- devloom-planner.md / -senior / -flash
645
+ | +-- devloom-developer.md / -senior / -flash
646
+ | +-- devloom-qa.md / -flash
647
+ | +-- devloom-verifier.md
648
+ | +-- devloom-security.md / -senior
649
+ | +-- devloom-documenter.md / -flash
650
+ | +-- devloom-vision.md
651
+ | +-- devloom-visual-director.md
652
+ | +-- devloom-visual-critic.md
653
+ +-- commands/ # 17 command files + profile.mjs
654
+ +-- skills/ # 21 skill files + 10 loop skills
655
+ | +-- plan/ planning, verification-planning
656
+ | +-- build/ development, simplify, vision-analysis, live-docs
657
+ | +-- verify/ quality-assurance, app-verification,
658
+ | | visual-critique, visual-quality-gate, visual-regression
659
+ | +-- design/ visual-direction, design-grounding, web-design,
660
+ | | app-design, game-design, motion-design, design-system
661
+ | +-- review/ security-review
662
+ | +-- ship/ documentation
663
+ | +-- meta/ skill-discovery
664
+ | +-- loop/ 10 loop engineering skills
665
+ +-- protocol/ # Shared protocols + rules.md
666
+ +-- .opencode/themes/ # DevLoom Night Owl theme
667
+ +-- __tests__/ # 228 Jest tests
668
+ +-- postinstall.mjs # Auto-installs 17 agents, 16 commands, 21 skills, theme
220
669
  ```
670
+ ---
221
671
 
222
- The app is a full-stack Task List with an Express + SQLite backend and vanilla JS frontend, including integration tests.
672
+ ## Acknowledgements
223
673
 
224
- ```bash
225
- cd demo
226
- npm install
227
- npm start
228
- # Open http://localhost:3000
229
- ```
674
+ DevLoom's skill structure and lifecycle-driven workflow drew inspiration from
675
+ [addyosmani/agent-skills](https://github.com/addyosmani/agent-skills) and the
676
+ broader pattern of packaging senior-engineering workflows as agent-readable
677
+ skills.
230
678
 
231
679
  ---
232
680