@omacode/micromanager 0.1.1 → 1.0.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 (213) hide show
  1. package/README.md +7 -4
  2. package/THIRD_PARTY.md +100 -0
  3. package/decider/.python-version +1 -0
  4. package/decider/README.md +35 -0
  5. package/decider/decider/__init__.py +1 -0
  6. package/decider/decider/server.py +327 -0
  7. package/decider/pyproject.toml +34 -0
  8. package/decider/uv.lock +1255 -0
  9. package/dist/agenda.js +51 -0
  10. package/dist/agents.js +58 -0
  11. package/dist/artifact/handoff.js +281 -0
  12. package/dist/ask.js +200 -0
  13. package/dist/backends.js +219 -0
  14. package/dist/backlog.js +414 -0
  15. package/dist/bench.js +427 -0
  16. package/dist/board.js +1 -0
  17. package/dist/brief.js +202 -0
  18. package/dist/browser.js +679 -0
  19. package/dist/budget.js +61 -0
  20. package/dist/catalog.js +187 -0
  21. package/dist/checkchange.js +145 -0
  22. package/dist/checkpoint.js +94 -0
  23. package/dist/cli.js +764 -0
  24. package/dist/comfy-gate.js +258 -0
  25. package/dist/compact.js +142 -0
  26. package/dist/config.js +344 -0
  27. package/dist/context/capture.js +1 -0
  28. package/dist/context/digest.js +1 -0
  29. package/dist/context/embed.js +1 -0
  30. package/dist/context/index.js +2 -0
  31. package/dist/context/ledger.js +1 -0
  32. package/dist/context/manager.js +1 -0
  33. package/dist/context/memory.js +1 -0
  34. package/dist/context/policy.js +1 -0
  35. package/dist/context/prices.js +1 -0
  36. package/dist/context/recall.js +1 -0
  37. package/dist/context/rules.js +1 -0
  38. package/dist/context/search.js +1 -0
  39. package/dist/context/status.js +1 -0
  40. package/dist/context/store.js +1 -0
  41. package/dist/context/summary.js +1 -0
  42. package/dist/context/tokens.js +1 -0
  43. package/dist/context/tools.js +1 -0
  44. package/dist/continuation.js +184 -0
  45. package/dist/contract.js +294 -0
  46. package/dist/contractround.js +178 -0
  47. package/dist/control.js +1 -0
  48. package/dist/creative-tools.js +237 -0
  49. package/dist/dataset.js +175 -0
  50. package/dist/decide.js +676 -0
  51. package/dist/decider.js +171 -0
  52. package/dist/design-shell.js +448 -0
  53. package/dist/design.js +1410 -0
  54. package/dist/desktop.js +44 -0
  55. package/dist/egress.js +156 -0
  56. package/dist/eval.js +60 -0
  57. package/dist/evolver.js +302 -0
  58. package/dist/features.js +193 -0
  59. package/dist/followups.js +32 -0
  60. package/dist/forms.js +195 -0
  61. package/dist/gate.js +108 -0
  62. package/dist/gatebox.js +46 -0
  63. package/dist/grants.js +189 -0
  64. package/dist/graph.js +65 -0
  65. package/dist/guard/index.js +1 -0
  66. package/dist/guard/wire.js +1 -0
  67. package/dist/helpers.js +85 -0
  68. package/dist/hooks.js +158 -0
  69. package/dist/image-models.js +117 -0
  70. package/{src/integration.ts → dist/integration.js} +1 -2
  71. package/dist/journal.js +1 -0
  72. package/dist/look.js +363 -0
  73. package/dist/memory.js +1 -0
  74. package/dist/mode.js +97 -0
  75. package/dist/native.js +3348 -0
  76. package/dist/nogit.js +259 -0
  77. package/dist/outcomes.js +148 -0
  78. package/dist/permission.js +35 -0
  79. package/dist/pick.js +89 -0
  80. package/dist/pipelines.js +262 -0
  81. package/dist/plan.js +641 -0
  82. package/dist/plandoc.js +211 -0
  83. package/dist/plugin.js +4736 -0
  84. package/dist/policy.js +58 -0
  85. package/dist/pools.js +1 -0
  86. package/dist/preview.js +274 -0
  87. package/dist/profile.js +165 -0
  88. package/dist/progress.js +1 -0
  89. package/dist/promote.js +313 -0
  90. package/dist/redact.js +1 -0
  91. package/dist/registry.js +179 -0
  92. package/dist/riskscore.js +126 -0
  93. package/dist/roles.js +1 -0
  94. package/dist/routing.js +1 -0
  95. package/dist/runner.js +1892 -0
  96. package/{src/sandbox.ts → dist/sandbox.js} +1 -2
  97. package/dist/sandboxgate.js +90 -0
  98. package/dist/scheduler.js +170 -0
  99. package/dist/services-main.js +131 -0
  100. package/dist/services.js +265 -0
  101. package/dist/session.js +241 -0
  102. package/dist/setup.js +423 -0
  103. package/dist/shell/decide.js +1 -0
  104. package/dist/shell/index.js +2 -0
  105. package/dist/shell/sandbox.js +1 -0
  106. package/dist/shell/wire.js +1 -0
  107. package/dist/skills.js +103 -0
  108. package/dist/state.js +1 -0
  109. package/dist/store.js +1 -0
  110. package/dist/switcher.js +1 -0
  111. package/dist/synth.js +418 -0
  112. package/dist/tools.js +477 -0
  113. package/dist/trials.js +223 -0
  114. package/dist/usage.js +1 -0
  115. package/dist/wait.js +167 -0
  116. package/dist/watchdog.js +476 -0
  117. package/dist/web-guidance.js +43 -0
  118. package/dist/which.js +20 -0
  119. package/dist/worktree/git.js +545 -0
  120. package/dist/writeguard.js +311 -0
  121. package/package.json +36 -17
  122. package/skills/deck/SKILL.md +98 -0
  123. package/skills/design/SKILL.md +150 -0
  124. package/skills/image/SKILL.md +66 -0
  125. package/skills/orchestrator/SKILL.md +107 -0
  126. package/skills/video/SKILL.md +97 -0
  127. package/skills/web/SKILL.md +60 -0
  128. package/src/agenda.ts +0 -56
  129. package/src/agents.ts +0 -74
  130. package/src/ask.ts +0 -243
  131. package/src/backends.ts +0 -144
  132. package/src/backlog.ts +0 -436
  133. package/src/bench.ts +0 -163
  134. package/src/board.ts +0 -1
  135. package/src/brief.ts +0 -151
  136. package/src/browser.ts +0 -624
  137. package/src/budget.ts +0 -73
  138. package/src/catalog.ts +0 -214
  139. package/src/checkchange.ts +0 -180
  140. package/src/checkpoint.ts +0 -99
  141. package/src/cli.ts +0 -117
  142. package/src/compact.ts +0 -162
  143. package/src/config.ts +0 -340
  144. package/src/context/capture.ts +0 -1
  145. package/src/context/digest.ts +0 -1
  146. package/src/context/embed.ts +0 -1
  147. package/src/context/index.ts +0 -2
  148. package/src/context/ledger.ts +0 -1
  149. package/src/context/manager.ts +0 -1
  150. package/src/context/memory.ts +0 -1
  151. package/src/context/policy.ts +0 -1
  152. package/src/context/prices.ts +0 -1
  153. package/src/context/recall.ts +0 -1
  154. package/src/context/rules.ts +0 -1
  155. package/src/context/search.ts +0 -1
  156. package/src/context/status.ts +0 -1
  157. package/src/context/store.ts +0 -1
  158. package/src/context/summary.ts +0 -1
  159. package/src/context/tokens.ts +0 -1
  160. package/src/context/tools.ts +0 -1
  161. package/src/continuation.ts +0 -122
  162. package/src/contract.ts +0 -342
  163. package/src/contractround.ts +0 -225
  164. package/src/control.ts +0 -1
  165. package/src/dataset.ts +0 -133
  166. package/src/decide.ts +0 -690
  167. package/src/eval.ts +0 -66
  168. package/src/evolver.ts +0 -369
  169. package/src/followups.ts +0 -50
  170. package/src/forms.ts +0 -191
  171. package/src/gate.ts +0 -90
  172. package/src/grants.ts +0 -239
  173. package/src/graph.ts +0 -74
  174. package/src/guard/index.ts +0 -1
  175. package/src/guard/wire.ts +0 -1
  176. package/src/helpers.ts +0 -105
  177. package/src/hooks.ts +0 -199
  178. package/src/jev.ts +0 -141
  179. package/src/journal.ts +0 -1
  180. package/src/look.ts +0 -390
  181. package/src/memory.ts +0 -1
  182. package/src/native.ts +0 -2455
  183. package/src/nogit.ts +0 -112
  184. package/src/outcomes.ts +0 -210
  185. package/src/pick.ts +0 -112
  186. package/src/pipelines.ts +0 -252
  187. package/src/plan.ts +0 -449
  188. package/src/plugin.ts +0 -3187
  189. package/src/policy.ts +0 -84
  190. package/src/pools.ts +0 -1
  191. package/src/profile.ts +0 -186
  192. package/src/progress.ts +0 -1
  193. package/src/redact.ts +0 -1
  194. package/src/registry.ts +0 -207
  195. package/src/roles.ts +0 -1
  196. package/src/routing.ts +0 -1
  197. package/src/runner.ts +0 -1506
  198. package/src/scheduler.ts +0 -200
  199. package/src/session.ts +0 -269
  200. package/src/shell/decide.ts +0 -1
  201. package/src/shell/index.ts +0 -2
  202. package/src/shell/sandbox.ts +0 -1
  203. package/src/shell/wire.ts +0 -1
  204. package/src/skills.ts +0 -111
  205. package/src/state.ts +0 -1
  206. package/src/store.ts +0 -1
  207. package/src/switcher.ts +0 -1
  208. package/src/tools.ts +0 -480
  209. package/src/trials.ts +0 -247
  210. package/src/usage.ts +0 -1
  211. package/src/wait.ts +0 -180
  212. package/src/watchdog.ts +0 -498
  213. package/src/worktree/git.ts +0 -378
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: image
3
+ description: Build and check an image set with the ComfyUI adapter. Use when a task needs pictures, illustrations or placeholders, or when an image set has to pass its checks before it is used.
4
+ license: Apache-2.0
5
+ metadata:
6
+ source: own
7
+ verified_against: ComfyUI 0.3.x with ComfyUI-GGUF, a Z-Image-Turbo int8 render on 2026-11-16
8
+ ---
9
+
10
+ # Image
11
+
12
+ An image set is a spec first: slots with prompts, sizes and seeds, and a checkpoint per set or per slot. The adapter
13
+ writes one ComfyUI graph per slot, queues them one at a time because the GPU is one device, and collects the files into
14
+ the job. Your job is the prompts and the checkpoint choice, not the graph.
15
+
16
+ ## Pick the model with `image_models`
17
+
18
+ Before the first picture, call `image_models`. It lists the models ready on this machine's ComfyUI in the user's
19
+ order, what each is good at, its licence, the files to load and the settings it was made for. Take the first ready
20
+ one that fits the request (a photo: Z-Image-Turbo; an illustration or an edit: FLUX.2-klein; text inside the image:
21
+ Qwen-Image), and follow its caution: Qwen-Image-2.1 is licensed for non-commercial research and evaluation only, so
22
+ use it only when the user has said the picture is not for commercial use, and ask otherwise. Load only the files it
23
+ names; the ComfyUI gate checks every model a workflow loads and asks the user about anything not cleared.
24
+
25
+ ## The checkpoint is decided by its hash
26
+
27
+ A workflow can load any checkpoint on disk, so a name proves nothing. Before anything is generated the adapter hashes
28
+ the model file and asks the registry:
29
+
30
+ - a **blocklisted** hash is refused by name and reason;
31
+ - a **known** hash runs, but only where its licence permits the territory (EU by default);
32
+ - an **unknown** hash is refused with an offer to register it. `registerModel({ hash, name, license, territory })`
33
+ writes the licence and territory that allow it from then on — never a silent allow.
34
+
35
+ So when a model is new to the machine, hash it, read its licence from the publisher, and register it. Do not rename a
36
+ file to look like something it is not: the hash is what is checked.
37
+
38
+ ## Two kinds of checkpoint, two graphs
39
+
40
+ - **A full checkpoint** (one file) loads through `CheckpointLoaderSimple`; the set names that file and nothing else.
41
+ - **Split files** — a diffusion model plus a text encoder and a VAE, which is how most current models ship and how the
42
+ GGUF quantizations work — need `UNETLoader`/`UnetLoaderGGUF`, `CLIPLoader` and `VAELoader`. Name the encoder and the
43
+ VAE as the slot's first two `refs`, in that order; the adapter refuses a split slot whose refs are missing rather
44
+ than guessing a file. A `.gguf` unet needs the ComfyUI-GGUF custom node, and the adapter says so by name when the
45
+ server does not list it.
46
+
47
+ ComfyUI resolves a loader name in its own folders (`diffusion_models/`, `text_encoders/`, `vae/`), so the file names in
48
+ the spec are those, not a path on disk.
49
+
50
+ ## Checks
51
+
52
+ - **count / files / size** — every slot produced a file at the size it asked for;
53
+ - **prompt** — the prompt's content words reach the workflow's positive text;
54
+ - **provenance** — the checkpoint's name, hash, licence and territory are on the record and the workflow still loads
55
+ that checkpoint;
56
+ - **style** — the colours of the set are compared, in a deterministic way, not by taste;
57
+ - **placeholder** — a slot with no checkpoint at all gets a labelled checkerboard file instead of a refusal, and this
58
+ check names it.
59
+
60
+ The vision review needs a local model; with none configured it is skipped with a reason (D13/D21), and the report says
61
+ so. A skipped check is an absence, never a pass.
62
+
63
+ ## Cost
64
+
65
+ The first render of a model loads gigabytes onto the GPU: a 768×768 picture took about two minutes on the first call
66
+ and seconds after that. One slot at a time is deliberate — two renders at once would fight over the same device.
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: orchestrator
3
+ description: Run a pure multi-agent orchestration session using the 7 research-backed agent patterns, complexity-tiered model routing, background parallel lanes, and optional post-green optimization. Use when the user invokes /orchestrator, asks you to work strictly as orchestrator, or wants exploration, planning, building, optimization, and verification delegated across subagents.
4
+ license: Apache-2.0
5
+ metadata:
6
+ source: own
7
+ ---
8
+
9
+ # Orchestrator
10
+
11
+ You are the architect and coordinator, not the builder. Every line of reading, writing, testing and reviewing you
12
+ do yourself is context lost from the one job that needs the whole picture: deciding what runs, on what model, in
13
+ what shape. The sections below are the workflow: role discipline, model routing, task-to-topology patterns.
14
+
15
+ ## 1. Pure orchestrator role & non-blocking discipline
16
+
17
+ - Delegate, never do: exploration, research, planning, implementation, optimization and verification all go to
18
+ subagents. No bulk file reads, edits, or test runs in the main session; your context holds the task graph, the
19
+ worker reports, and the decisions.
20
+ - Before dispatching any writer, read the repo's pre-existing state through a quick `explore` worker: `git status`,
21
+ uncommitted changes, unfamiliar edits. Never overwrite or revert user changes you did not cause — route around
22
+ them and say so in the briefs.
23
+ - Launch parallel and long-running subagents with `background: true` so the user's TUI stays responsive and the
24
+ user can steer mid-run.
25
+ - Never poll, sleep, or re-check a running background worker, and never duplicate a running worker's work in your
26
+ own context. After dispatching, end the turn concisely and wait for the completion notifications.
27
+
28
+ ## 2. Complexity-tiered model routing
29
+
30
+ - Look up exact `providerID/modelID` strings once via `tools.opencode.models` when uncertain; never guess model IDs.
31
+ - **Standard / affordable pool** — `opencode-go` Flash & mid-tier; the default for 80–90% of subagents:
32
+ - Low–medium work (`explore`, `research`, mechanical edits, docs, test runs, verification):
33
+ `opencode-go/deepseek-v4.1-flash`, `opencode-go/minimax-m3.1-flash`, `opencode-go/glm-5.3-flash`,
34
+ `opencode-go/mimo-v2.6-flash`.
35
+ - Medium work (`tui`/TSX, multi-file logic, refactors, audits):
36
+ `opencode-go/qwen3.8-flash`, `opencode-go/mimo-v2.6-pro`, `opencode-go/deepseek-v4-pro`,
37
+ `opencode-go/qwen3.7-plus`.
38
+ - **Excluded expensive `opencode-go` models** — never select unless the user explicitly asks:
39
+ `opencode-go/kimi-k3.1-pro`, `opencode-go/kimi-k3`, `opencode-go/qwen4-max`, `opencode-go/step-5`,
40
+ `opencode-go/gemini-4-argon`, `opencode-go/grok-4.7`, `opencode-go/glm-5.4`.
41
+ - **Frontier / heavy reserve** — ONLY for tricky concurrency, complex state machines, subtle invariants, or
42
+ Frontier Plan Councils where Flash models are unreliable: `kimi-code-plan-global/k3.1-pro` (`kimi.ai` coding
43
+ plan) and `google/gemini-4-carbon`. If one hits a rate or quota limit, fall back cleanly to the other.
44
+
45
+ ## 3. Task-to-topology routing: the 7 research-backed patterns
46
+
47
+ **Guardrail — avoid the sequential penalty and over-fragmentation.** Never split a small bug fix (1–2 files) or a
48
+ tightly coupled sequential chain (step N+1 mutates step N's code) across multiple chained builders: serial handoffs
49
+ degrade accuracy by −39% to −70%. Coalesce coupled sequential steps into **one cohesive worker lane**; one
50
+ capable worker beats a pipeline of fragments.
51
+
52
+ **Pattern 1 — Separate builder and verifier.** Never rely on same-session self-review for non-trivial changes.
53
+ Dispatch a read-only verifier subagent in a **fresh context** and a **different model family** than the builder —
54
+ that is what defeats self-preference bias. Skip LLM review rituals when the change is tiny and deterministic
55
+ tests/typechecks already prove correctness.
56
+
57
+ **Pattern 2 — Split work into parallel lanes with strictly disjoint `files[]`.** Fan out parallel `background:
58
+ true` writers **only** along provably non-overlapping file lists, and state the boundary in each brief:
59
+ `You MAY ONLY edit: [...]`. Define shared types and schemas first so lanes converge without touching each other's
60
+ files — overlapping edits drop success ~30%. If two lanes share a file, they are not parallel: coalesce or chain
61
+ them.
62
+
63
+ **Pattern 3 — Best of N with automated evals.** On a hard algorithmic bug or tricky implementation **that has a
64
+ fast, objective test or benchmark**: spawn 2–3 diverse cheap Flash workers in isolated worktrees or temp dirs,
65
+ run the automated check, pick the winner, discard the rest. Never run Best-of-N without an objective evaluator —
66
+ without one there is no basis to pick, and the loop just costs N×.
67
+
68
+ **Pattern 4 — Council of models (pool-selectable).** When **no automated test exists yet** (system architecture,
69
+ design trade-offs, UX):
70
+
71
+ 1. *Scout once* with 1 cheap Flash `explore` worker to gather the repo facts, so each proposer does not pay N×
72
+ tool-exploration overhead.
73
+ 2. *Propose in parallel* across 2–3 **distinct model families** from the active pool: Frontier families when the
74
+ decision is high-stakes and available; diverse Flash families when budget-constrained. Give every proposer the
75
+ identical scout brief.
76
+ 3. *Synthesize blind*: present the proposals as `Proposal A / B / C` without model labels, compare on merit, and
77
+ merge into one crisp plan with disjoint `files[]` lanes before dispatching any builder. When scoring or
78
+ evaluating existing artifacts (rather than proposing), a 3-family Flash jury is >7× cheaper and sufficient.
79
+
80
+ **Pattern 5 — Team of specialist reviewers.** For complex or multi-dimensional diffs, run 2–3 parallel read-only
81
+ Flash reviewers, each with **one orthogonal lens** — *Correctness & state invariants*, *Security / sandbox /
82
+ secrets*, *Simplicity & hot-path performance*, *UX* — instead of handing duplicates the same generic checklist.
83
+ Orthogonal lenses find ~35% more defects.
84
+
85
+ **Pattern 6 — Pass instructions verbatim + structured handoffs.** Every worker brief carries a
86
+ `User constraints (verbatim):` block — the user's own wording, exclusions, and placeholders (`PERSON_n`,
87
+ `SECRET_n`, …) untouched; paraphrase is where constraints die. Below it, hand over the concrete upstream results:
88
+ `FILES` (paths with line refs), `INTERFACES` (types and signatures already decided), `DECISIONS` (settled
89
+ trade-offs). Workers must never burn turns re-reading the repo you already explored.
90
+
91
+ **Pattern 7 — Super Team loop (+ optional post-green optimization step).** Reserve the full loop — *Scout → Blind
92
+ Council → Parallel Lanes + Verifier → Optional Post-Green Optimizer → Specialist Reviewers* — for high-complexity
93
+ builds, and no smaller task. Cap it at **max 2 review-fix iterations**, each driven by concrete stopping criteria
94
+ (`file:line` findings or named failing tests); after the cap, escalate to the user instead of looping.
95
+
96
+ - **Optional post-green optimization pass:** once the functional checks are green and optimization is desired, run
97
+ a dedicated optimizer worker against the green state: eliminate redundant passes, quadratic (O(n²)) scans,
98
+ needless allocations, or dead code. Accept its change **only if all tests and typechecks remain green and
99
+ complexity or latency measurably improved**; discard it cleanly and keep the green state if not.
100
+
101
+ ## Picking a topology
102
+
103
+ - Tiny, deterministic fix → one worker plus the tests; no ceremony.
104
+ - Multi-file build with independent pieces → Pattern 2 lanes + Pattern 1 verifier.
105
+ - Hard problem with an objective evaluator → Pattern 3.
106
+ - Hard decision with no test → Pattern 4, then dispatch by Pattern 2.
107
+ - High-complexity build → Pattern 7, which contains the others.
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: video
3
+ description: Build and check a short video with the video adapter (HyperFrames), including math animations made with Manim. Use when a task produces a video, an explainer clip, an animation for a website or a talk, or when a video has to pass its checks.
4
+ license: Apache-2.0
5
+ metadata:
6
+ source: own
7
+ verified_against: hyperframes 0.9.54 (render, check, lint, snapshot), manim 0.22.1, packages/artifact/src/adapters/video.ts
8
+ ---
9
+
10
+ # Video
11
+
12
+ A video is data first: a `VideoSpec` (version 2) of scenes, each a few seconds long. The video adapter writes it as a
13
+ HyperFrames project, renders it to one file, and checks the file's frames and sound. Your job is the spec and the
14
+ material the scenes show (pictures, clips, Manim animations), not the HTML.
15
+
16
+ ## What the spec says
17
+
18
+ A complete `video.json`; every field below except `audio` and `output` is required:
19
+
20
+ ```json
21
+ {
22
+ "kind": "video",
23
+ "version": 2,
24
+ "job": "pythagoras",
25
+ "brief": "A 12-second explainer of the Pythagorean theorem for the project website",
26
+ "engine": "hyperframes",
27
+ "fps": 30,
28
+ "size": { "width": 1280, "height": 720 },
29
+ "scenes": [
30
+ { "id": "intro", "title": "Pythagoras", "duration": 3, "captions": ["Why a² + b² = c²"] },
31
+ { "id": "proof", "title": "The squares", "duration": 6, "asset": "clips/Squares.mp4", "captions": ["Rearrange the four triangles"] },
32
+ { "id": "outro", "title": "That's it", "duration": 3, "captions": ["a² + b² = c²"] }
33
+ ],
34
+ "output": { "format": "mp4", "quality": "medium" }
35
+ }
36
+ ```
37
+
38
+ - `scenes[]`: `id` (letters, digits, `.`, `_`, `-`; unique), `duration` in seconds (> 0), and optionally `title`,
39
+ `captions` (lines shown on screen, in the pixels, not a subtitle track), `asset` (a picture or a clip, relative to
40
+ the job directory: `.mp4`, `.webm`, `.mov` play muted in a loop, anything else is shown as an image) and
41
+ `acceptance` (one line each: what the scene has to show, for the review).
42
+ - The film lasts exactly as long as the scenes together. A clip starts with its scene; one longer than its scene is
43
+ cut, a shorter one holds its last frame until the scene ends. A clip plays muted (the film's sound is `audio`).
44
+ - `audio`: `{ "src": "music/bed.mp3", "volume": 0.6 }`, one bed under the whole film (0 to 1).
45
+ - `output.format`: `webm` (the default, no patent questions) or `mp4` (plays everywhere, also in Safari);
46
+ `quality`: `low`, `medium` or `high`. The file is `video.webm` or `video.mp4` in the job directory.
47
+ - Every asset and the audio bed must exist before the build: a missing file is a refusal, not a placeholder.
48
+ - The render runs offline: system fonts only, nothing fetched.
49
+
50
+ Build with `make_artifact` (`spec: video.json`). The video needs HyperFrames and ffmpeg; if one is missing the tool says
51
+ so: offer `install_feature` for HyperFrames, and give the user the terminal command for ffmpeg (it needs sudo).
52
+
53
+ ## Math animations with Manim
54
+
55
+ Manim makes the clip, the video adapter puts it in a scene. Render into the job directory, then name the file as the
56
+ scene's `asset`:
57
+
58
+ ```bash
59
+ manim render -qm --media_dir media scenes.py Squares # -ql while trying, -qh for the final
60
+ mkdir -p clips && cp media/videos/scenes/720p30/Squares.mp4 clips/
61
+ ```
62
+
63
+ - `-ql` 480p15, `-qm` 720p30, `-qh` 1080p60: match the video's `size` and `fps` where you can.
64
+ - LaTeX is not installed: `Tex` and `MathTex` fail. Use `Text` (Unicode works: `Text("a² + b² = c²")`), shapes and
65
+ `MathTex`-free animations, or tell the user LaTeX is needed (`sudo pacman -S texlive-core` or their distribution's
66
+ equivalent) before you use it.
67
+ - Keep a Manim scene about as long as the video scene it fills: a longer clip is cut, a shorter one holds its last
68
+ frame.
69
+ - Set the Manim background to the video's (`self.camera.background_color = "#101014"` in `construct`), so the clip
70
+ does not sit in a black box.
71
+ - If `manim` is not found, offer `install_feature` with part `manim`.
72
+
73
+ ## What the video must survive
74
+
75
+ - **count, duration** — every scene is in the project, and the file lasts as long as the scenes together.
76
+ - **lint, runtime** — the engine's lint finds no error, the page logs no console error.
77
+ - **snapshot** — one frame per scene, taken from its middle.
78
+ - **black, freeze, flash** — no run of black frames, no cut that shows the previous frame again, no frame much
79
+ brighter than both neighbours (a flash).
80
+ - **silence** — skipped for a film without an audio bed (nothing to measure), checked with one.
81
+ - **transcript, vlm** — skipped: no local speech or vision model is configured, and a cloud model is not called for a
82
+ check. Say so in the report; a skip is never a pass.
83
+
84
+ Fix the spec or the material when a check fails, never the check. Look at the snapshots before you call it done.
85
+
86
+ ## A video on a website
87
+
88
+ Build the video first, then copy the file into the site and point at it (see the web skill):
89
+
90
+ ```html
91
+ <video src="media/pythagoras.mp4" poster="media/pythagoras.jpg" controls preload="none" playsinline width="1280" height="720">
92
+ A short explainer of the Pythagorean theorem.
93
+ </video>
94
+ ```
95
+
96
+ `preload="none"` and a `poster` keep the page inside its weight budget (the browser loads the film only on play); use
97
+ `mp4` for a site, which every browser plays. A poster can be one of the video's snapshots.
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: web
3
+ description: Build and check a website with the site adapter. Use when a task produces a web page, a landing page, a small site or a web app's static pages, or when a site has to pass its checks before it is shown.
4
+ license: Apache-2.0
5
+ metadata:
6
+ source: own
7
+ verified_against: playwright-core 1.64, axe-core 4.14, Chromium 155
8
+ ---
9
+
10
+ # Website
11
+
12
+ A site is data first: a `SiteSpec` (version 2) names the pages, where the site lives and how it is built. The site
13
+ adapter serves it from its own directory, opens every page in a real browser at three widths and runs axe on it. Your
14
+ job is the pages and the spec, not the checks.
15
+
16
+ ## What the spec says
17
+
18
+ - `pages[]`, each with `path` (relative to what is served, e.g. `index.html`, `docs/intro.html`) and `title`.
19
+ - `root`: the directory with the site's sources, relative to the job; without it the job directory itself.
20
+ - `build` (only for a built site): `script`, the npm script that builds it (`build`, not a command line), and `out`, the
21
+ directory it writes, relative to `root`. Install the packages before the checks: the build runs without a network.
22
+ - `budget.kb`: the most a page may weigh with everything it loads; 1500 KB without one.
23
+ - `brand.colors` (hex) and `brand.fonts`: what a reviewer holds the pages against.
24
+
25
+ Start static: plain HTML, CSS and a little JavaScript need no build and are checked exactly like a built site.
26
+
27
+ **How to write the HTML, CSS and JavaScript:** when the `modern-web-guidance` skill is available, search its guides
28
+ before you write a component, a layout, a form, a dialog or an animation, and follow what they say. Aim for features
29
+ that are Baseline widely available; when a guide says a feature is new, use its fallback. Without the skill, the user
30
+ can add it with `/setup` (Modern Web Guidance).
31
+
32
+ ## Videos and animations in a page
33
+
34
+ A film or a Manim animation is made first with the video skill (`make_artifact` with a `video.json`), then copied into
35
+ the site (e.g. `media/`) and embedded with `<video src="media/clip.mp4" poster="media/clip.jpg" controls
36
+ preload="none" playsinline>` plus a sentence of fallback text. `preload="none"` with a poster keeps the page inside its
37
+ weight budget: the browser fetches the film only when it is played. Use mp4 for a site (every browser plays it), give
38
+ the element a width and height so the layout does not jump, and never autoplay with sound. A short muted loop
39
+ (`muted autoplay loop playsinline`) is fine for a small decorative animation, but then its full size counts against
40
+ the budget.
41
+
42
+ ## What the site must survive
43
+
44
+ - **pages** — every page in the spec exists.
45
+ - **links** — every local `href`, `src` and `srcset` lands on a file (`about` may mean `about.html`, a directory means
46
+ its `index.html`). Links to other sites are listed, not followed: the checks run offline.
47
+ - **build** — `npm run <script>` exits zero.
48
+ - **load, console, requests** — each page loads at 390, 768 and 1280 px, throws nothing, logs no error, and everything
49
+ it asks for is there. A font or script from a CDN fails offline: ship it with the site.
50
+ - **overflow** — nothing is wider than the window; the phone width is where this fails.
51
+ - **a11y** — axe finds nothing `serious` or `critical`: alt text on images, labels on inputs, enough contrast, a
52
+ `lang` on `<html>`. `moderate` findings are reported in the passing text; fix them when they are cheap.
53
+ - **weight** — each page stays inside its budget.
54
+ - **snapshot, blank** — a screenshot of every page at every width, and none of them empty.
55
+
56
+ ## When something fails
57
+
58
+ Fix the page, not the check. An overflow wants a layout that wraps (`max-width: 100%`, `flex-wrap`, no fixed widths),
59
+ not `overflow: hidden` on `body`; a contrast failure wants darker text, not a bigger font. If a check is `skipped` or
60
+ fails because no browser could run, say so in the report: an absence is never a pass.
package/src/agenda.ts DELETED
@@ -1,56 +0,0 @@
1
- // The agenda: what could happen next, built from the job state alone (design.md §8). The decision model picks
2
- // among these proposals; without it, or below its floor, the first one wins (the tutor's Agenda.next).
3
-
4
- import { allDone, DEFAULT_PRIORITY, readyTasks, type Job, type Task } from "./state.ts"
5
-
6
- export type Action = "answer_blocked" | "fix" | "gate" | "review" | "dispatch" | "replan" | "verify" | "ask_user" | "wrap"
7
-
8
- export interface Proposal {
9
- readonly action: Action
10
- readonly taskId?: string
11
- readonly label: string // short English text, also used as the option's meaning for the decision model
12
- }
13
-
14
- // Order is priority: unblock work first, then finish what is running, then start new work.
15
- // A stalled job replans before it starts more work on the plan that stalled.
16
- const ORDER: readonly Action[] = ["answer_blocked", "fix", "gate", "review", "replan", "dispatch", "verify", "ask_user", "wrap"]
17
-
18
- // Ready tasks: priority first, then in-progress parent, then fewer dependencies, then id (Task Master's order).
19
- export function orderReady(job: Job, tasks: readonly Task[]): Task[] {
20
- const active = new Set(job.tasks.filter((t) => t.status === "running" || t.status === "passed").map((t) => t.parent).filter(Boolean))
21
- return [...tasks].sort((a, b) =>
22
- (a.priority ?? DEFAULT_PRIORITY) - (b.priority ?? DEFAULT_PRIORITY) ||
23
- Number(active.has(b.parent)) - Number(active.has(a.parent)) ||
24
- a.dependsOn.length - b.dependsOn.length ||
25
- a.id.localeCompare(b.id, undefined, { numeric: true }),
26
- )
27
- }
28
-
29
- export function buildAgenda(job: Job, stallLimit = 3): Proposal[] {
30
- if (job.phase !== "execute") return []
31
- const out: Proposal[] = []
32
- for (const t of job.tasks) {
33
- if (t.status === "blocked") out.push({ action: "answer_blocked", taskId: t.id, label: `answer the question of blocked task ${t.id}` })
34
- if (t.status === "fixing") out.push({ action: "fix", taskId: t.id, label: `fix task ${t.id} after a failed check` })
35
- if (t.status === "gating") out.push({ action: "gate", taskId: t.id, label: `run the checks of task ${t.id}` })
36
- if (t.status === "reviewing") out.push({ action: "review", taskId: t.id, label: `review task ${t.id}` })
37
- }
38
- const running = job.tasks.some((t) => t.status === "running")
39
- for (const t of orderReady(job, readyTasks(job))) {
40
- out.push({ action: "dispatch", taskId: t.id, label: `start task ${t.id}: ${t.title}` })
41
- }
42
- const replansLeft = job.counters.replans < job.budget.replansMax
43
- if (job.counters.stalls >= stallLimit && replansLeft) out.push({ action: "replan", label: "the job is stalled: rewrite the plan" })
44
- if (allDone(job)) out.push({ action: "verify", label: "every task is done: verify the whole job" })
45
- const stuck = !running && out.length === 0 && job.tasks.some((t) => t.status === "escalated" || t.status === "cancelled")
46
- // Nothing can go on past an escalated task: a replan first while one is left, then the user.
47
- if (stuck && replansLeft && job.tasks.some((t) => t.status === "escalated")) out.push({ action: "replan", label: "escalated tasks block the rest: rewrite the plan" })
48
- else if (stuck) out.push({ action: "ask_user", label: "nothing can proceed: ask the user" })
49
- if (out.length === 0 && !running) out.push({ action: "wrap", label: "nothing left to do: wrap up" })
50
- return out.sort((a, b) => ORDER.indexOf(a.action) - ORDER.indexOf(b.action))
51
- }
52
-
53
- // The rules fallback: the highest-priority proposal.
54
- export function nextProposal(agenda: readonly Proposal[]): Proposal | undefined {
55
- return agenda[0]
56
- }
package/src/agents.ts DELETED
@@ -1,74 +0,0 @@
1
- // Turns the role matrix into OpenCode agents. v2 does not load agent markdown files, so the agents are
2
- // created in the plugin (ctx.agent.transform), each copied from the built-in "build" agent so it inherits the
3
- // user's base rules (external directories, .env files), with the role's rules appended.
4
-
5
- import { SUMMARIZER_SYSTEM } from "./context/summary.ts"
6
- import { MICROMANAGER, ROLES, micromanagerSystem, type Rule } from "./roles.ts"
7
-
8
- // The context manager's summarizer (src/context/summary.ts): no tools, it only reads the transcript it is given.
9
- export const SUMMARIZER_AGENT = "summarizer"
10
-
11
- export interface AgentInfo {
12
- id: string
13
- name: string
14
- mode: "primary" | "subagent" | "all"
15
- hidden: boolean
16
- description?: string
17
- system?: string
18
- permissions: Rule[]
19
- [key: string]: unknown
20
- }
21
-
22
- export interface AgentDraft {
23
- get(id: string): AgentInfo | undefined
24
- update(id: string, update: (agent: AgentInfo) => void): void
25
- }
26
-
27
- export function agentsFrom(base: AgentInfo): AgentInfo[] {
28
- const copy = (): AgentInfo => ({ ...base, permissions: [...base.permissions] })
29
- const roles = ROLES.map((role) => ({
30
- ...copy(),
31
- id: role.agent,
32
- name: role.agent[0]!.toUpperCase() + role.agent.slice(1), // "Coder", "Reviewer", …
33
- mode: "subagent" as const,
34
- hidden: true, // only the micromanager delegates to them; build and plan never see them
35
- description: role.description,
36
- system: role.system,
37
- permissions: [...base.permissions, ...role.rules],
38
- }))
39
- const micromanager: AgentInfo = {
40
- ...copy(),
41
- id: MICROMANAGER.agent,
42
- name: "Micromanager",
43
- mode: "primary",
44
- hidden: false,
45
- description: MICROMANAGER.description,
46
- system: micromanagerSystem(),
47
- permissions: [...base.permissions, ...MICROMANAGER.rules],
48
- }
49
- const summarizer: AgentInfo = {
50
- ...copy(),
51
- id: SUMMARIZER_AGENT,
52
- name: "Summarizer",
53
- mode: "subagent",
54
- hidden: true,
55
- description: "Compresses a long session's earlier turns for the context manager. Started by the plugin only.",
56
- system: SUMMARIZER_SYSTEM,
57
- permissions: [...base.permissions, { action: "*", resource: "*", effect: "deny" }],
58
- }
59
- return [micromanager, ...roles, summarizer]
60
- }
61
-
62
- export function installAgents(draft: AgentDraft): string[] {
63
- const base = draft.get("build")
64
- if (!base) throw new Error('no built-in "build" agent to copy the base rules from')
65
- const agents = agentsFrom(base)
66
- for (const agent of agents) {
67
- // update() on an unknown id creates it (seen on opencode 2.0.18)
68
- draft.update(agent.id, (target) => {
69
- for (const key of Object.keys(target)) delete target[key]
70
- Object.assign(target, agent)
71
- })
72
- }
73
- return agents.map((a) => a.id)
74
- }