@omacode/micromanager 0.0.0-stage → 0.1.1
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/LICENSE +201 -0
- package/README.md +27 -2
- package/evolver/mm_evolve/__init__.py +1 -0
- package/evolver/mm_evolve/entry.py +3 -0
- package/evolver/mm_evolve/evaluator.py +119 -0
- package/evolver/mm_evolve/llm.py +76 -0
- package/evolver/mm_evolve/run.py +89 -0
- package/evolver/mm_evolve/spec.py +62 -0
- package/evolver/pyproject.toml +21 -0
- package/evolver/uv.lock +772 -0
- package/package.json +55 -4
- package/skills/THIRD_PARTY.md +58 -0
- package/skills/code-review/SKILL.md +46 -0
- package/skills/deliberate/SKILL.md +39 -0
- package/skills/diagnosing-bugs/SKILL.md +75 -0
- package/skills/receiving-code-review/SKILL.md +36 -0
- package/skills/research/SKILL.md +18 -0
- package/skills/tdd/SKILL.md +56 -0
- package/skills/tdd/mocking.md +59 -0
- package/skills/tdd/tests.md +77 -0
- package/skills/verification-before-completion/SKILL.md +50 -0
- package/src/agenda.ts +56 -0
- package/src/agents.ts +74 -0
- package/src/ask.ts +243 -0
- package/src/backends.ts +144 -0
- package/src/backlog.ts +436 -0
- package/src/bench.ts +163 -0
- package/src/board.ts +1 -0
- package/src/brief.ts +151 -0
- package/src/browser.ts +624 -0
- package/src/budget.ts +73 -0
- package/src/catalog.ts +214 -0
- package/src/checkchange.ts +180 -0
- package/src/checkpoint.ts +99 -0
- package/src/cli.ts +117 -0
- package/src/compact.ts +162 -0
- package/src/config.ts +340 -0
- package/src/context/capture.ts +1 -0
- package/src/context/digest.ts +1 -0
- package/src/context/embed.ts +1 -0
- package/src/context/index.ts +2 -0
- package/src/context/ledger.ts +1 -0
- package/src/context/manager.ts +1 -0
- package/src/context/memory.ts +1 -0
- package/src/context/policy.ts +1 -0
- package/src/context/prices.ts +1 -0
- package/src/context/recall.ts +1 -0
- package/src/context/rules.ts +1 -0
- package/src/context/search.ts +1 -0
- package/src/context/status.ts +1 -0
- package/src/context/store.ts +1 -0
- package/src/context/summary.ts +1 -0
- package/src/context/tokens.ts +1 -0
- package/src/context/tools.ts +1 -0
- package/src/continuation.ts +122 -0
- package/src/contract.ts +342 -0
- package/src/contractround.ts +225 -0
- package/src/control.ts +1 -0
- package/src/dataset.ts +133 -0
- package/src/decide.ts +690 -0
- package/src/eval.ts +66 -0
- package/src/evolver.ts +369 -0
- package/src/followups.ts +50 -0
- package/src/forms.ts +191 -0
- package/src/gate.ts +90 -0
- package/src/grants.ts +239 -0
- package/src/graph.ts +74 -0
- package/src/guard/index.ts +1 -0
- package/src/guard/wire.ts +1 -0
- package/src/helpers.ts +105 -0
- package/src/hooks.ts +199 -0
- package/src/integration.ts +4 -0
- package/src/jev.ts +141 -0
- package/src/journal.ts +1 -0
- package/src/look.ts +390 -0
- package/src/memory.ts +1 -0
- package/src/native.ts +2455 -0
- package/src/nogit.ts +112 -0
- package/src/outcomes.ts +210 -0
- package/src/pick.ts +112 -0
- package/src/pipelines.ts +252 -0
- package/src/plan.ts +449 -0
- package/src/plugin.ts +3187 -0
- package/src/policy.ts +84 -0
- package/src/pools.ts +1 -0
- package/src/profile.ts +186 -0
- package/src/progress.ts +1 -0
- package/src/redact.ts +1 -0
- package/src/registry.ts +207 -0
- package/src/roles.ts +1 -0
- package/src/routing.ts +1 -0
- package/src/runner.ts +1506 -0
- package/src/sandbox.ts +4 -0
- package/src/scheduler.ts +200 -0
- package/src/session.ts +269 -0
- package/src/shell/decide.ts +1 -0
- package/src/shell/index.ts +2 -0
- package/src/shell/sandbox.ts +1 -0
- package/src/shell/wire.ts +1 -0
- package/src/skills.ts +111 -0
- package/src/state.ts +1 -0
- package/src/store.ts +1 -0
- package/src/switcher.ts +1 -0
- package/src/tools.ts +480 -0
- package/src/trials.ts +247 -0
- package/src/usage.ts +1 -0
- package/src/wait.ts +180 -0
- package/src/watchdog.ts +498 -0
- package/src/worktree/git.ts +378 -0
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omacode/micromanager",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "An OpenCode v2 plugin that orchestrates sub-agents, with Jev making the decisions",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"author": "Tobias Rentschler <tobias-rentschler@gmx.de>",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/RentschlerTobias/Omacode.git",
|
|
12
|
+
"directory": "packages/micromanager"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/RentschlerTobias/Omacode#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/RentschlerTobias/Omacode/issues"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=22.12.0"
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": "./src/plugin.ts",
|
|
23
|
+
"./guard": "./src/guard/index.ts",
|
|
24
|
+
"./shell": "./src/shell/index.ts",
|
|
25
|
+
"./context": "./src/context/index.ts"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"src",
|
|
29
|
+
"skills",
|
|
30
|
+
"evolver/pyproject.toml",
|
|
31
|
+
"evolver/uv.lock",
|
|
32
|
+
"evolver/mm_evolve"
|
|
33
|
+
],
|
|
34
|
+
"keywords": [
|
|
35
|
+
"opencode",
|
|
36
|
+
"opencode-plugin",
|
|
37
|
+
"subagents",
|
|
38
|
+
"orchestration"
|
|
39
|
+
],
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"prepack": "node ../../scripts/copy-license.mjs",
|
|
45
|
+
"postpack": "node ../../scripts/copy-license.mjs --remove"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@omacode/context": "0.1.1",
|
|
49
|
+
"@omacode/core": "0.1.1",
|
|
50
|
+
"@omacode/guard": "0.1.1",
|
|
51
|
+
"@omacode/sandbox": "0.1.1",
|
|
52
|
+
"@omacode/state": "0.1.1",
|
|
53
|
+
"@omacode/tui": "0.1.1",
|
|
54
|
+
"@anthropic-ai/sandbox-runtime": "0.0.81",
|
|
55
|
+
"playwright-core": "^1.64.1"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Third-party skills
|
|
2
|
+
|
|
3
|
+
Adapted copies of MIT-licensed skills; each SKILL.md names its source file and commit in its frontmatter. The
|
|
4
|
+
adaptations turn them into leaf skills for micromanager workers: a worker does its own task, never starts other
|
|
5
|
+
agents, and puts what it would ask the user into its report.
|
|
6
|
+
|
|
7
|
+
| Skill | Source |
|
|
8
|
+
|---|---|
|
|
9
|
+
| research, tdd (with tests.md, mocking.md unchanged), diagnosing-bugs, code-review | mattpocock/skills |
|
|
10
|
+
| verification-before-completion, receiving-code-review | obra/superpowers |
|
|
11
|
+
|
|
12
|
+
## mattpocock/skills
|
|
13
|
+
|
|
14
|
+
MIT License
|
|
15
|
+
|
|
16
|
+
Copyright (c) 2026 Matt Pocock
|
|
17
|
+
|
|
18
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
19
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
20
|
+
in the Software without restriction, including without limitation the rights
|
|
21
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
22
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
23
|
+
furnished to do so, subject to the following conditions:
|
|
24
|
+
|
|
25
|
+
The above copyright notice and this permission notice shall be included in all
|
|
26
|
+
copies or substantial portions of the Software.
|
|
27
|
+
|
|
28
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
29
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
30
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
31
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
32
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
33
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
34
|
+
SOFTWARE.
|
|
35
|
+
|
|
36
|
+
## obra/superpowers
|
|
37
|
+
|
|
38
|
+
MIT License
|
|
39
|
+
|
|
40
|
+
Copyright (c) 2025 Jesse Vincent
|
|
41
|
+
|
|
42
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
43
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
44
|
+
in the Software without restriction, including without limitation the rights
|
|
45
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
46
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
47
|
+
furnished to do so, subject to the following conditions:
|
|
48
|
+
|
|
49
|
+
The above copyright notice and this permission notice shall be included in all
|
|
50
|
+
copies or substantial portions of the Software.
|
|
51
|
+
|
|
52
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
53
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
54
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
55
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
56
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
57
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
58
|
+
SOFTWARE.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: Review a change along two axes, Spec (does it do what the task asked?) and Standards (does it follow the repo's documented standards?). Use when a micromanager note starts with "[micromanager] review of task".
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
source: https://github.com/mattpocock/skills/blob/24fe0ef7737efae15c87225755e9f6f5965e4888/skills/engineering/code-review/SKILL.md
|
|
7
|
+
adapted: for a micromanager reviewer, which reviews both axes itself; the plugin gives the diff and the spec, and wants JSON
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Code Review
|
|
11
|
+
|
|
12
|
+
You review one task's change. The plugin gives you the task, its acceptance points (the spec) and the diff, and it has
|
|
13
|
+
already run the checks. Do the review yourself; never start other agents. Answer in the JSON format the note asks for.
|
|
14
|
+
|
|
15
|
+
## Spec axis
|
|
16
|
+
|
|
17
|
+
- Acceptance points the change misses or only half meets.
|
|
18
|
+
- Behaviour the change adds that the task did not ask for (scope creep).
|
|
19
|
+
- Points that look met but where the implementation looks wrong.
|
|
20
|
+
|
|
21
|
+
Quote the acceptance point for each finding.
|
|
22
|
+
|
|
23
|
+
## Standards axis
|
|
24
|
+
|
|
25
|
+
Anything the repo documents about how code is written (`CODING_STANDARDS.md`, `CONTRIBUTING.md`, an AGENTS or
|
|
26
|
+
CLAUDE file). On top of that, this smell baseline (Fowler, _Refactoring_, ch. 3). The repo overrides it, and each
|
|
27
|
+
smell is a judgement call, never a hard violation; skip what tooling enforces:
|
|
28
|
+
|
|
29
|
+
- **Mysterious Name**: a name that does not reveal what it does or holds. → rename it.
|
|
30
|
+
- **Duplicated Code**: the same logic shape in more than one hunk or file. → extract the shared shape.
|
|
31
|
+
- **Feature Envy**: a function that reaches into another object's data more than its own. → move it there.
|
|
32
|
+
- **Data Clumps**: the same few fields or params travel together. → bundle them into one type.
|
|
33
|
+
- **Primitive Obsession**: a primitive standing in for a domain concept. → give the concept its own small type.
|
|
34
|
+
- **Repeated Switches**: the same switch or if-cascade on the same type recurs. → one map or polymorphism.
|
|
35
|
+
- **Shotgun Surgery**: one logical change forces scattered edits. → gather what changes together.
|
|
36
|
+
- **Divergent Change**: one module edited for unrelated reasons. → split it.
|
|
37
|
+
- **Speculative Generality**: abstraction or hooks for needs the task does not have. → delete it.
|
|
38
|
+
- **Message Chains**: long `a.b().c().d()` navigation. → hide the walk behind one method.
|
|
39
|
+
- **Middle Man**: something that mostly delegates onward. → call the real target.
|
|
40
|
+
- **Refused Bequest**: an implementer that ignores most of what it inherits. → composition instead.
|
|
41
|
+
|
|
42
|
+
## Evidence
|
|
43
|
+
|
|
44
|
+
A finding blocks the task only with evidence: a file and line, a command and its output, or a concrete input that
|
|
45
|
+
breaks it. A finding without evidence is advisory; mark the point as met and put the advice under "fixes". Keep the
|
|
46
|
+
two axes apart: a change can meet the spec and break the standards, or the other way round.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deliberate
|
|
3
|
+
description: Run a planning discussion with the user, one question at a time and without suggested answers. Use when the micromanager plugin opens a planning session or a note starts with "[planning session".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Deliberate
|
|
7
|
+
|
|
8
|
+
The user owns the design. Your job is to make the open decisions visible and let the user reason them through,
|
|
9
|
+
one at a time, until nothing is silently assumed. Code keeps the list of questions and tells you which one is
|
|
10
|
+
next; follow those notes exactly.
|
|
11
|
+
|
|
12
|
+
## Asking
|
|
13
|
+
|
|
14
|
+
- Ask exactly one question per turn: an answer can change the next question.
|
|
15
|
+
- Give one to three sentences of context, in plain words. If a term may be new to the user, add a short
|
|
16
|
+
"Concept:" line (what it is) or "Why this matters:" line (what it changes in this project).
|
|
17
|
+
- Give no options and no recommendation. People take the suggestion, so a suggestion decides for them.
|
|
18
|
+
- Do not answer the question yourself, and do not lead the user towards your preferred answer.
|
|
19
|
+
- Never ask the user for facts: what the code does, which libraries exist, how something is configured. The
|
|
20
|
+
agents look those up.
|
|
21
|
+
- Then stop and wait.
|
|
22
|
+
|
|
23
|
+
## Reading the answer
|
|
24
|
+
|
|
25
|
+
- Take the answer in the user's words; record nothing they did not say.
|
|
26
|
+
- Give feedback on their reasoning when it helps: a failure mode they missed, a contradiction with an earlier
|
|
27
|
+
decision, a trust boundary. No praise, no hype.
|
|
28
|
+
- Only when the user is stuck or asks for help: explain the concept, or show two or three approaches with their
|
|
29
|
+
trade-offs, without picking one. Then hand the decision back: "Which would you take, and why?"
|
|
30
|
+
|
|
31
|
+
## The checkpoint
|
|
32
|
+
|
|
33
|
+
When the questions are done, show the user's decisions apart from what was assumed without asking. Mark the
|
|
34
|
+
assumptions as proposals they can question. Ask them to answer "confirm" or "discuss".
|
|
35
|
+
|
|
36
|
+
## The user's shortcuts
|
|
37
|
+
|
|
38
|
+
"skip" or "decide it yourself" (the question becomes an assumption), "wait what" (ask it again with the missing
|
|
39
|
+
context), "back to D1" (reopen a question), "light" / "normal" / "frequent" (how many questions), "stop".
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: diagnosing-bugs
|
|
3
|
+
description: Diagnosis loop for hard bugs and performance regressions. Use when a micromanager task is a bug with an unknown cause, or something is broken, throwing, failing or slow.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
source: https://github.com/mattpocock/skills/blob/24fe0ef7737efae15c87225755e9f6f5965e4888/skills/engineering/diagnosing-bugs/SKILL.md
|
|
7
|
+
adapted: for a micromanager worker; what it would ask the user goes into the report; no human-in-the-loop script
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Diagnosing Bugs
|
|
11
|
+
|
|
12
|
+
A discipline for hard bugs. Skip phases only when explicitly justified. You work alone in one task: where the
|
|
13
|
+
original would ask the user, you stop and report `STATUS: NEEDS_CONTEXT` with exactly what you need.
|
|
14
|
+
|
|
15
|
+
When exploring the codebase, read `GLOSSARY.md` (if it exists) and check ADRs in the area you're touching.
|
|
16
|
+
|
|
17
|
+
## Redact
|
|
18
|
+
|
|
19
|
+
Redact every secret in commands, outputs and captured artifacts you show: write `<REDACTED>` in its place. Build
|
|
20
|
+
loops against env vars, so the credential stays in the environment. Quote only the lines that carry the signal.
|
|
21
|
+
|
|
22
|
+
## Phase 1: Build a feedback loop
|
|
23
|
+
|
|
24
|
+
**This is the skill.** If you have a **tight** pass/fail signal for the bug (one that goes red on _this_ bug), you
|
|
25
|
+
will find the cause. Without one, no amount of staring at code will save you. Spend most of your effort here.
|
|
26
|
+
|
|
27
|
+
Ways to construct one, in roughly this order:
|
|
28
|
+
1. **Failing test** at whatever seam reaches the bug: unit, integration, e2e.
|
|
29
|
+
2. **HTTP script** against a running dev server.
|
|
30
|
+
3. **CLI invocation** with a fixture input, diffing stdout against a known-good snapshot.
|
|
31
|
+
4. **Headless browser script** that drives the UI and asserts on DOM, console or network.
|
|
32
|
+
5. **Replay a captured trace** through the code path in isolation.
|
|
33
|
+
6. **Throwaway harness**: a minimal subset of the system that exercises the bug path with one call.
|
|
34
|
+
7. **Property / fuzz loop** for "sometimes wrong output".
|
|
35
|
+
8. **Bisection harness** (`git bisect run`) when the bug appeared between two known states.
|
|
36
|
+
9. **Differential loop**: the same input through old vs new version, diff the outputs.
|
|
37
|
+
|
|
38
|
+
Then tighten it: faster (narrow the scope), sharper (assert the specific symptom), more deterministic (pin time,
|
|
39
|
+
seed randomness, isolate the filesystem). For flaky bugs, raise the reproduction rate until it is debuggable.
|
|
40
|
+
|
|
41
|
+
**If you cannot build a loop**, stop and report `STATUS: NEEDS_CONTEXT`: list what you tried and what you need
|
|
42
|
+
(an environment that reproduces it, a redacted artifact, or permission for temporary instrumentation). Do not
|
|
43
|
+
hypothesise without a loop.
|
|
44
|
+
|
|
45
|
+
**Done** when you can name **one command** you have **already run**, that drives the real bug path and asserts the
|
|
46
|
+
reported symptom (red-capable), gives the same verdict every run, takes seconds, and runs unattended.
|
|
47
|
+
|
|
48
|
+
## Phase 2: Reproduce and minimise
|
|
49
|
+
|
|
50
|
+
Run the loop and watch it go red with the failure the task describes, not a nearby one. Then cut inputs, callers,
|
|
51
|
+
config and steps one at a time, re-running after each cut, until every remaining element is load-bearing.
|
|
52
|
+
|
|
53
|
+
## Phase 3: Hypothesise
|
|
54
|
+
|
|
55
|
+
Write **3–5 ranked, falsifiable hypotheses** before testing any: "If X is the cause, then changing Y makes the bug
|
|
56
|
+
disappear." A hypothesis without a prediction is discarded. Put the ranked list in your report.
|
|
57
|
+
|
|
58
|
+
## Phase 4: Instrument
|
|
59
|
+
|
|
60
|
+
Each probe maps to one prediction; change one variable at a time. Prefer a debugger or REPL, then targeted logs at
|
|
61
|
+
the boundaries that tell hypotheses apart. Tag every debug log with a unique prefix such as `[DEBUG-a4f2]`. For
|
|
62
|
+
performance, measure a baseline first and bisect; logs are usually the wrong tool.
|
|
63
|
+
|
|
64
|
+
## Phase 5: Fix and regression test
|
|
65
|
+
|
|
66
|
+
Write the regression test before the fix, at a seam that exercises the real bug pattern. Watch it fail, fix, watch it
|
|
67
|
+
pass, then re-run the Phase 1 loop on the original scenario. If no correct seam exists, say so in the report: that is
|
|
68
|
+
a finding.
|
|
69
|
+
|
|
70
|
+
## Phase 6: Cleanup
|
|
71
|
+
|
|
72
|
+
- The original repro no longer reproduces.
|
|
73
|
+
- The regression test passes, or the missing seam is reported.
|
|
74
|
+
- Every `[DEBUG-...]` line is removed (grep the prefix); throwaway harnesses are deleted.
|
|
75
|
+
- The report states the hypothesis that turned out right.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: receiving-code-review
|
|
3
|
+
description: Use when a micromanager fix round brings review findings, before changing anything - requires checking each finding against the code, not blind implementation or performative agreement.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
source: https://github.com/obra/superpowers/blob/8ca22dba9a94f28898bbce59f2537ff4d87c747d/skills/receiving-code-review/SKILL.md
|
|
7
|
+
adapted: for a micromanager worker; findings come from a reviewer of another model family through the plugin
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Receiving Code Review
|
|
11
|
+
|
|
12
|
+
Review findings ask for technical evaluation, not agreement. Verify before implementing.
|
|
13
|
+
|
|
14
|
+
## For each finding
|
|
15
|
+
|
|
16
|
+
1. **Read** all findings first; they may be related.
|
|
17
|
+
2. **Restate** what each one asks for, in your own words.
|
|
18
|
+
3. **Verify** it against the code: is it true here? Run the input or command it names.
|
|
19
|
+
4. **Decide**: correct for this codebase, or wrong? The reviewer saw only the diff and the task.
|
|
20
|
+
5. **Fix** the correct ones one at a time, blocking issues first, then simple fixes, then complex ones; run the
|
|
21
|
+
checks after each.
|
|
22
|
+
|
|
23
|
+
## When a finding is wrong
|
|
24
|
+
|
|
25
|
+
Do not implement it. Say why in your report under `OPEN`, with evidence: the command, the line, the reason
|
|
26
|
+
(it breaks existing behaviour, the reviewer lacks context, the feature is unused, it contradicts a decision in the
|
|
27
|
+
brief). If you cannot tell whether a finding is right, say what you would need to check it.
|
|
28
|
+
|
|
29
|
+
## When it is unclear
|
|
30
|
+
|
|
31
|
+
If a finding is unclear, fix nothing that depends on it and report `STATUS: NEEDS_CONTEXT` naming the unclear
|
|
32
|
+
items. Partial understanding means a wrong fix.
|
|
33
|
+
|
|
34
|
+
## No performance
|
|
35
|
+
|
|
36
|
+
No "You're absolutely right!", no thanks, no praise. State what you changed and where, or why you did not.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research
|
|
3
|
+
description: Answer a research question from primary sources and cite every claim. Use when a micromanager task asks you to research something, or a note starts with "[micromanager] research for task".
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
source: https://github.com/mattpocock/skills/blob/24fe0ef7737efae15c87225755e9f6f5965e4888/skills/engineering/research/SKILL.md
|
|
7
|
+
adapted: for a micromanager worker, which reads itself instead of starting a background agent
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Research
|
|
11
|
+
|
|
12
|
+
You are one reader of a research task. Do the reading yourself; never start other agents.
|
|
13
|
+
|
|
14
|
+
1. Investigate the question against **primary sources**: official docs, source code, specs, first-party APIs, the
|
|
15
|
+
paper itself. Not a secondary write-up of them. Follow every claim back to the source that owns it.
|
|
16
|
+
2. Give the URL for every finding, the exact page, not the site's home page. A finding without a URL is left out.
|
|
17
|
+
3. Say what stayed unclear or where the sources disagree, with both URLs.
|
|
18
|
+
4. Change no files. If the brief says you are one of several readers, keep to your angle; the others cover the rest.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd
|
|
3
|
+
description: Test-driven development. Use when a micromanager task is built test-first, the brief mentions frozen tests or a red stage, or you fix a bug and need a regression test.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
source: https://github.com/mattpocock/skills/blob/24fe0ef7737efae15c87225755e9f6f5965e4888/skills/engineering/tdd/SKILL.md
|
|
7
|
+
adapted: for a micromanager worker; the seams come from the brief, nobody is asked; tests.md and mocking.md unchanged
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Test-Driven Development
|
|
11
|
+
|
|
12
|
+
TDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good
|
|
13
|
+
test is, where tests go, the anti-patterns, and the rules of the loop. Consult every section before and during the
|
|
14
|
+
loop, not after.
|
|
15
|
+
|
|
16
|
+
When exploring the codebase, read `GLOSSARY.md` (if it exists) so test names and interface vocabulary match the
|
|
17
|
+
project's domain language, and respect ADRs in the area you're touching.
|
|
18
|
+
|
|
19
|
+
## What a good test is
|
|
20
|
+
|
|
21
|
+
Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests
|
|
22
|
+
shouldn't. A good test reads like a specification: "user can checkout with valid cart" tells you exactly what
|
|
23
|
+
capability exists, and it survives refactors because it doesn't care about internal structure.
|
|
24
|
+
|
|
25
|
+
See [tests.md](tests.md) for examples and [mocking.md](mocking.md) for mocking guidelines.
|
|
26
|
+
|
|
27
|
+
## Seams: where tests go
|
|
28
|
+
|
|
29
|
+
A **seam** is the public boundary you test at: the interface where you observe behavior without reaching inside.
|
|
30
|
+
Tests live at seams, never against internals.
|
|
31
|
+
|
|
32
|
+
**Test only at the seams the brief names.** The task's acceptance points and its description say what the public
|
|
33
|
+
interface is. Test there. If the brief names no seam and the interface is unclear, do not invent one: report
|
|
34
|
+
`STATUS: NEEDS_CONTEXT` and say which seam you would need decided.
|
|
35
|
+
|
|
36
|
+
## Anti-patterns
|
|
37
|
+
|
|
38
|
+
- **Implementation-coupled**: mocks internal collaborators, tests private methods, or verifies through a side
|
|
39
|
+
channel (querying the database instead of using the interface). The tell: the test breaks when you refactor but
|
|
40
|
+
behavior hasn't changed.
|
|
41
|
+
- **Tautological**: the assertion recomputes the expected value the way the code does (`expect(add(a, b)).toBe(a + b)`,
|
|
42
|
+
a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and
|
|
43
|
+
can never disagree with the code. Expected values must come from an independent source of truth: a known-good
|
|
44
|
+
literal, a worked example, the spec.
|
|
45
|
+
- **Imagined behavior**: tests for things the acceptance points do not ask for. Test what the task promises, nothing
|
|
46
|
+
speculative.
|
|
47
|
+
|
|
48
|
+
## Rules of the loop
|
|
49
|
+
|
|
50
|
+
- **Red before green.** Write the failing test first, run it, and see it fail for the right reason: the missing
|
|
51
|
+
behavior, not a typo or an import error. Then write only enough code to pass it.
|
|
52
|
+
- **Frozen tests stay frozen.** When the brief says tests are frozen, the plugin checks their content: make them
|
|
53
|
+
pass by changing the code, never the tests. If a frozen test is wrong, report it (`STATUS: BLOCKED`) instead of
|
|
54
|
+
editing it.
|
|
55
|
+
- **One slice at a time.** One seam, one test, one minimal implementation per cycle.
|
|
56
|
+
- **Refactoring is not part of the loop.** It belongs to the review stage, not the red → green cycle.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# When to Mock
|
|
2
|
+
|
|
3
|
+
Mock at **system boundaries** only:
|
|
4
|
+
|
|
5
|
+
- External APIs (payment, email, etc.)
|
|
6
|
+
- Databases (sometimes - prefer test DB)
|
|
7
|
+
- Time/randomness
|
|
8
|
+
- File system (sometimes)
|
|
9
|
+
|
|
10
|
+
Don't mock:
|
|
11
|
+
|
|
12
|
+
- Your own classes/modules
|
|
13
|
+
- Internal collaborators
|
|
14
|
+
- Anything you control
|
|
15
|
+
|
|
16
|
+
## Designing for Mockability
|
|
17
|
+
|
|
18
|
+
At system boundaries, design interfaces that are easy to mock:
|
|
19
|
+
|
|
20
|
+
**1. Use dependency injection**
|
|
21
|
+
|
|
22
|
+
Pass external dependencies in rather than creating them internally:
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
// Easy to mock
|
|
26
|
+
function processPayment(order, paymentClient) {
|
|
27
|
+
return paymentClient.charge(order.total);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Hard to mock
|
|
31
|
+
function processPayment(order) {
|
|
32
|
+
const client = new StripeClient(process.env.STRIPE_KEY);
|
|
33
|
+
return client.charge(order.total);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**2. Prefer SDK-style interfaces over generic fetchers**
|
|
38
|
+
|
|
39
|
+
Create specific functions for each external operation instead of one generic function with conditional logic:
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
// GOOD: Each function is independently mockable
|
|
43
|
+
const api = {
|
|
44
|
+
getUser: (id) => fetch(`/users/${id}`),
|
|
45
|
+
getOrders: (userId) => fetch(`/users/${userId}/orders`),
|
|
46
|
+
createOrder: (data) => fetch('/orders', { method: 'POST', body: data }),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// BAD: Mocking requires conditional logic inside the mock
|
|
50
|
+
const api = {
|
|
51
|
+
fetch: (endpoint, options) => fetch(endpoint, options),
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The SDK approach means:
|
|
56
|
+
- Each mock returns one specific shape
|
|
57
|
+
- No conditional logic in test setup
|
|
58
|
+
- Easier to see which endpoints a test exercises
|
|
59
|
+
- Type safety per endpoint
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Good and Bad Tests
|
|
2
|
+
|
|
3
|
+
## Good Tests
|
|
4
|
+
|
|
5
|
+
**Integration-style**: Test through real interfaces, not mocks of internal parts.
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// GOOD: Tests observable behavior
|
|
9
|
+
test("user can checkout with valid cart", async () => {
|
|
10
|
+
const cart = createCart();
|
|
11
|
+
cart.add(product);
|
|
12
|
+
const result = await checkout(cart, paymentMethod);
|
|
13
|
+
expect(result.status).toBe("confirmed");
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Characteristics:
|
|
18
|
+
|
|
19
|
+
- Tests behavior users/callers care about
|
|
20
|
+
- Uses public API only
|
|
21
|
+
- Survives internal refactors
|
|
22
|
+
- Describes WHAT, not HOW
|
|
23
|
+
- One logical assertion per test
|
|
24
|
+
|
|
25
|
+
## Bad Tests
|
|
26
|
+
|
|
27
|
+
**Implementation-detail tests**: Coupled to internal structure.
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
// BAD: Tests implementation details
|
|
31
|
+
test("checkout calls paymentService.process", async () => {
|
|
32
|
+
const mockPayment = jest.mock(paymentService);
|
|
33
|
+
await checkout(cart, payment);
|
|
34
|
+
expect(mockPayment.process).toHaveBeenCalledWith(cart.total);
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Red flags:
|
|
39
|
+
|
|
40
|
+
- Mocking internal collaborators
|
|
41
|
+
- Testing private methods
|
|
42
|
+
- Asserting on call counts/order
|
|
43
|
+
- Test breaks when refactoring without behavior change
|
|
44
|
+
- Test name describes HOW not WHAT
|
|
45
|
+
- Verifying through external means instead of interface
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// BAD: Bypasses interface to verify
|
|
49
|
+
test("createUser saves to database", async () => {
|
|
50
|
+
await createUser({ name: "Alice" });
|
|
51
|
+
const row = await db.query("SELECT * FROM users WHERE name = ?", ["Alice"]);
|
|
52
|
+
expect(row).toBeDefined();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// GOOD: Verifies through interface
|
|
56
|
+
test("createUser makes user retrievable", async () => {
|
|
57
|
+
const user = await createUser({ name: "Alice" });
|
|
58
|
+
const retrieved = await getUser(user.id);
|
|
59
|
+
expect(retrieved.name).toBe("Alice");
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Tautological tests**: Expected value restates the implementation, so the test passes by construction.
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
// BAD: Expected value is recomputed the way the code computes it
|
|
67
|
+
test("calculateTotal sums line items", () => {
|
|
68
|
+
const items = [{ price: 10 }, { price: 5 }];
|
|
69
|
+
const expected = items.reduce((sum, i) => sum + i.price, 0);
|
|
70
|
+
expect(calculateTotal(items)).toBe(expected);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// GOOD: Expected value is an independent, known literal
|
|
74
|
+
test("calculateTotal sums line items", () => {
|
|
75
|
+
expect(calculateTotal([{ price: 10 }, { price: 5 }])).toBe(15);
|
|
76
|
+
});
|
|
77
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification-before-completion
|
|
3
|
+
description: Use when about to report a micromanager task as done, fixed or passing - requires running the verification commands and reading their output before any success claim; evidence before assertions always.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
source: https://github.com/obra/superpowers/blob/8ca22dba9a94f28898bbce59f2537ff4d87c747d/skills/verification-before-completion/SKILL.md
|
|
7
|
+
adapted: for a micromanager worker; the evidence goes into the report's EVIDENCE line
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Verification Before Completion
|
|
11
|
+
|
|
12
|
+
**Core principle:** evidence before claims, always. The plugin runs the task's checks after you anyway; a report that
|
|
13
|
+
claims more than you ran costs a fix round.
|
|
14
|
+
|
|
15
|
+
## The Iron Law
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If you haven't run the verification command in this answer, you cannot claim it passes.
|
|
22
|
+
|
|
23
|
+
## The gate
|
|
24
|
+
|
|
25
|
+
Before `STATUS: DONE` or any claim of success:
|
|
26
|
+
1. **Identify** the command that proves the claim (the acceptance point's "checked with" command, if it has one).
|
|
27
|
+
2. **Run** the full command, fresh.
|
|
28
|
+
3. **Read** the full output: exit code, number of failures.
|
|
29
|
+
4. **Verify**: does the output confirm the claim? If not, report the actual state with the evidence.
|
|
30
|
+
5. Only then claim it, and put the command and its result in `EVIDENCE`.
|
|
31
|
+
|
|
32
|
+
## What a claim needs
|
|
33
|
+
|
|
34
|
+
| Claim | Requires | Not sufficient |
|
|
35
|
+
|-------|----------|----------------|
|
|
36
|
+
| Tests pass | test output: 0 failures | an earlier run, "should pass" |
|
|
37
|
+
| Linter clean | linter output: 0 errors | a partial check |
|
|
38
|
+
| Build succeeds | build command: exit 0 | linter passing |
|
|
39
|
+
| Bug fixed | the original symptom tested: passes | code changed, assumed fixed |
|
|
40
|
+
| Regression test works | red-green cycle seen | it passes once |
|
|
41
|
+
| Acceptance met | each point checked, one by one | tests passing |
|
|
42
|
+
|
|
43
|
+
## Red flags: stop
|
|
44
|
+
|
|
45
|
+
- "should", "probably", "seems to";
|
|
46
|
+
- satisfaction before verification ("Done!", "Perfect!");
|
|
47
|
+
- a partial check taken for the whole;
|
|
48
|
+
- any wording that implies success without a command you ran in this answer.
|
|
49
|
+
|
|
50
|
+
If you cannot run the command (no shell in this task), say so in `EVIDENCE` and use `DONE_WITH_CONCERNS`.
|
package/src/agenda.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
}
|