@sjawhar/claude-envoy 4.11.0 → 4.11.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/.claude-plugin/plugin.json +1 -1
- package/.omp-plugin/plugin.json +1 -1
- package/AGENTS.md +43 -497
- package/dist/envoy-channel.js +1 -1
- package/legion/skills/legion-architect/SKILL.md +88 -66
- package/legion/skills/legion-architect/references/acceptance.md +89 -258
- package/legion/skills/legion-architect/references/decomposition.md +94 -213
- package/legion/skills/legion-architect/references/design-gate.md +88 -353
- package/legion/skills/legion-architect/references/wake-routing.md +51 -43
- package/legion/skills/legion-controller/SKILL.md +50 -181
- package/legion/skills/legion-controller/references/admission.md +25 -54
- package/legion/skills/legion-controller/references/backlog-stewardship.md +23 -119
- package/legion/skills/legion-controller/references/consolidation.md +9 -93
- package/legion/skills/legion-controller/references/daily-report.md +21 -99
- package/legion/skills/legion-controller/references/escalation.md +16 -118
- package/legion/skills/legion-controller/references/finding-asks.md +31 -162
- package/legion/skills/legion-controller/references/park-asks.md +33 -0
- package/legion/skills/legion-controller/references/parked-decisions.md +20 -264
- package/legion/skills/legion-controller/references/session.md +26 -84
- package/legion/skills/legion-controller/references/slack-mentions.md +18 -134
- package/legion/skills/legion-controller/references/triage.md +18 -89
- package/legion/skills/legion-controller/references/wakes.md +22 -549
- package/legion/skills/legion-controller/references/weekly-audit.md +9 -90
- package/legion/skills/legion-oracle/SKILL.md +19 -28
- package/legion/skills/legion-retro/SKILL.md +54 -93
- package/legion/skills/legion-retro/references/learnings.md +21 -33
- package/legion/skills/legion-retro/references/pr-body-content.md +21 -37
- package/legion/skills/legion-worker/SKILL.md +50 -64
- package/legion/skills/legion-worker/references/ci-checks.md +16 -84
- package/legion/skills/legion-worker/references/conflicts-and-rewrites.md +34 -93
- package/legion/skills/legion-worker/references/default-branch-check.md +22 -60
- package/legion/skills/legion-worker/references/findings.md +25 -180
- package/legion/skills/legion-worker/references/foreign-path.md +14 -22
- package/legion/skills/legion-worker/references/gvisor.md +20 -0
- package/legion/skills/legion-worker/references/merge-gate.md +43 -419
- package/legion/skills/legion-worker/references/plan-tests.md +8 -28
- package/legion/skills/legion-worker/references/pr-body.md +19 -218
- package/legion/skills/legion-worker/references/review-threads.md +16 -70
- package/legion/skills/legion-worker/references/tools.md +31 -578
- package/legion/skills/legion-worker/references/withheld-capability.md +12 -163
- package/legion/skills/simplify-settled-diff/SKILL.md +23 -41
- package/legion/skills/simplify-settled-diff/references/personas/code-quality-reviewer.md +14 -14
- package/legion/skills/simplify-settled-diff/references/personas/code-reuse-reviewer.md +4 -4
- package/legion/skills/simplify-settled-diff/references/personas/efficiency-reviewer.md +8 -8
- package/package.json +1 -1
- package/skills/agent-secrets/SKILL.md +46 -312
- package/skills/agent-secrets/references/store-a-secret.md +9 -0
- package/skills/approval-review/SKILL.md +20 -76
- package/skills/asd-ste100/SKILL.md +43 -85
- package/skills/asd-ste100/examples/before-after.md +18 -53
- package/skills/dispatch/SKILL.md +1 -1
- package/skills/dispatch-writing-specs/SKILL.md +1 -1
- package/skills/envoy/SKILL.md +56 -126
- package/skills/envoy/references/check-settlement.md +26 -43
- package/skills/envoy/references/deliveries.md +26 -144
- package/skills/envoy/references/legion.md +12 -45
- package/skills/envoy/references/roles.md +11 -9
- package/skills/envoy/references/sources.md +13 -25
- package/skills/outside-message/SKILL.md +24 -81
- package/skills/plain-words/SKILL.md +24 -55
- package/skills/thermonuclear-code-quality/SKILL.md +16 -26
- package/skills/thermonuclear-deep-review/SKILL.md +22 -31
- package/legion/skills/legion-worker/references/cleanup-deletion.md +0 -22
- package/legion/skills/legion-worker/references/systematic-rename.md +0 -19
- package/skills/asd-ste100/references/writing-rules.md +0 -59
- package/skills/plain-words/references/mechanics.md +0 -49
|
@@ -1,172 +1,21 @@
|
|
|
1
1
|
# What the withheld capability is, and what it is not
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
unpack, extract or install anything the worker image does not carry. Every path it cites is in
|
|
5
|
-
cybermonklabs/legion.
|
|
3
|
+
Read it before you unpack, extract or install anything the worker image does not carry.
|
|
6
4
|
|
|
7
|
-
The withheld row reads
|
|
8
|
-
dependencies` (`packages/daemon/internal/capabilities/capabilities.go`, decision
|
|
9
|
-
dispatch://LEGION-200). Read as a sentence on its own, that wording would also forbid `uvx`,
|
|
10
|
-
`bunx --package` and `go run`, each of which fetches a package and writes a cache. It does not, and
|
|
11
|
-
three artefacts in this repository are what draw the line — not a claim about what the decision meant:
|
|
5
|
+
The withheld `operator-setup` row (`packages/daemon/internal/capabilities/capabilities.go`) reads "installs or configures its own dependencies in the pod: Legion owns its dependencies". It does not forbid the pinned runners of `skill://legion-worker/references/tools.md`: the image ships `uv`, `bun` and Go for a role to use (`packages/daemon/docker/worker.Dockerfile`), the `toolchain` row grants them, and the pod puts their caches on the issue's volume (`roleEnvironment` in `packages/daemon/internal/runtime/sandbox/manifest.go`, and `podkind.go`). What it withholds is a dependency the pod carries: something that outlives its command and that a later launch or another role resolves without asking for it.
|
|
12
6
|
|
|
13
|
-
|
|
14
|
-
`uv` and `uvx`, `bun` with its `bunx` link, and the Go toolchain, and the `toolchain` capability
|
|
15
|
-
row (`packages/daemon/internal/capabilities/capabilities.go`) grants them by name. A runner put
|
|
16
|
-
in the image deliberately and granted by a capability row is not a route around a withheld one.
|
|
17
|
-
- **What the pod configures for those runners to write.** A role's environment relocates
|
|
18
|
-
`UV_CACHE_DIR` and `UV_PYTHON_INSTALL_DIR` (`podkind.go`) and `BUN_INSTALL_CACHE_DIR`, `GOCACHE`
|
|
19
|
-
and `GOMODCACHE` (`roleEnvironment`, `packages/daemon/internal/runtime/sandbox/manifest.go`)
|
|
20
|
-
onto the issue's volume, shared by the issue's roles. Legion provisions the caches a pinned run
|
|
21
|
-
fills; filling them is what they are for.
|
|
22
|
-
- **What Legion itself does at launch.** `installBlock`
|
|
23
|
-
(`packages/daemon/internal/runtime/sandbox/plugins.go`) renders a `bun add` under
|
|
24
|
-
`/usr/bin/flock` into that shared bun install cache on every installing launch. Fetching a pinned
|
|
25
|
-
package at run time is something Legion does, not something it withholds.
|
|
7
|
+
## The test: where it lands, and what it leaves resolving
|
|
26
8
|
|
|
27
|
-
|
|
28
|
-
that created it, and that a later launch or another role's process then resolves *without asking
|
|
29
|
-
for it*.
|
|
9
|
+
An install of your own (an interpreter, a browser, a second toolchain, an extraction) is sanctioned only when both hold:
|
|
30
10
|
|
|
31
|
-
|
|
11
|
+
1. It lands on the issue's volume under `/legion`, outside `$LEGION_WORKSPACE`, `/legion/repos` and `/legion/feed`: under a variable the runtime sets there (`XDG_CACHE_HOME`, `XDG_DATA_HOME`, `XDG_STATE_HOME`, `TMPDIR`, `GOCACHE`, `GOMODCACHE`, `BUN_INSTALL_CACHE_DIR`, `UV_CACHE_DIR`, `UV_PYTHON_INSTALL_DIR`), or a path your harness names there. `$HOME` and `/tmp` are on the pod's disk, whose limit evicts the pod. The workspace is excluded because jj snapshots new files there into the change every role shares.
|
|
12
|
+
2. Once the command exits, nothing else resolves differently. Export a toolchain's `PATH` or `LD_LIBRARY_PATH` only around your harness's own commands, never into the shell you go on working in or a subagent's environment.
|
|
32
13
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
under
|
|
36
|
-
|
|
37
|
-
harness names itself — but outside the issue's workspace (`$LEGION_WORKSPACE`, under
|
|
38
|
-
`/legion/workspaces`) and the runtime's own directories (`/legion/repos`, `/legion/feed`); and
|
|
39
|
-
after the command exits nothing else resolves differently. The workspace is excluded because its jj
|
|
40
|
-
working copy tracks every new file under jj's `snapshot.max-new-file-size` (1 MiB for a role), so
|
|
41
|
-
a root written there is added to the change every role shares, and a larger new
|
|
42
|
-
file is left untracked, every jj command in the workspace then warning `Refused to snapshot some
|
|
43
|
-
files`. The one write into it that is sanctioned is a repository's own dependency install into
|
|
44
|
-
its ignored directories, below. The variables the runtime sets on the volume, where a tool's own
|
|
45
|
-
cache already goes, are
|
|
46
|
-
`XDG_CACHE_HOME` (`/legion/scratch/cache`), `XDG_DATA_HOME`, `XDG_STATE_HOME`, `TMPDIR`, `GOCACHE`,
|
|
47
|
-
`GOMODCACHE`, `BUN_INSTALL_CACHE_DIR`, `UV_CACHE_DIR` (`/legion/uv/cache`) and
|
|
48
|
-
`UV_PYTHON_INSTALL_DIR` (`/legion/uv/python/<issue>`). (`XDG_CONFIG_HOME` is set too and is not
|
|
49
|
-
one of them: it is your role's own config home, a copy of the pod's made for your role on the
|
|
50
|
-
pod's disk, which no other role reads.) `$HOME` and `/tmp` are not on the volume:
|
|
51
|
-
both are your role's own, on the pod's disk.
|
|
14
|
+
- A repository's own dependency install (`uv sync`, `bun install`) into its ignored directories is sanctioned.
|
|
15
|
+
- A pinned runner line pins the named package alone; its dependencies are resolved when it runs. When the work needs the whole dependency closure pinned (a comparison that has to hold across days or across pods), use a project's own lockfile with `uv run` or `bun install`, not a one-off runner line.
|
|
16
|
+
- Playwright keeps its browsers under `XDG_CACHE_HOME`, on the issue's volume, where the issue's roles share one registry under an install lock (`docs/kubernetes.md`, "Anatomy of a Sandbox pod"). Pointing `PLAYWRIGHT_BROWSERS_PATH` elsewhere loses that shared registry and the lock that makes a second role's install wait rather than race. A tool whose cache the runtime does not place, such as Puppeteer, needs its own variable (`PUPPETEER_CACHE_DIR`) pointed under one of the paths above.
|
|
17
|
+
- Every cache is on the issue's volume, and the cache trimmer of `skill://legion-worker/references/tools.md` holds part of that volume under a mark. An install is paid once per pod in uv's cache and Pythons, the Go module cache and the Playwright registry, and can be paid again after a sweep in the bun install cache and the Go build cache.
|
|
52
18
|
|
|
53
|
-
|
|
54
|
-
system prefix, and anything that leaves a toolchain, shim or binary which a later launch or
|
|
55
|
-
another role's process will resolve without asking for it. Between two installs that both land in
|
|
56
|
-
the right place, the test is resolution, not disk, and it reads as scope: a second toolchain
|
|
57
|
-
exported for the commands of your own run — by absolute path, or on a `PATH` your harness's own
|
|
58
|
-
script sets around its own invocations — is sanctioned; the same toolchain left where a later
|
|
59
|
-
launch, another role or a subagent picks it up without naming it is operator setup, whoever typed
|
|
60
|
-
the command.
|
|
19
|
+
## The Dispatch browser suite
|
|
61
20
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- A pinned runner run: nothing. `uvx --from httpie@3.2.4 http --version` leaves a cache entry
|
|
65
|
-
addressed by that coordinate and that version, which the next command reaches only by writing the
|
|
66
|
-
same pin; no `PATH`, no interpreter and no library search of any other process changes. That is
|
|
67
|
-
the sanctioned side, and it is the side the runner forms of
|
|
68
|
-
`skill://legion-worker/references/tools.md` are on.
|
|
69
|
-
- A repository's own dependency set: nothing either, which is why the caches are provisioned at
|
|
70
|
-
all. `uv sync` or `bun install` in your workspace materialises what that project already
|
|
71
|
-
declares, into that project's own directory, which a process reaches by asking for that project
|
|
72
|
-
and no other way — and the runtime puts `UV_PYTHON_INSTALL_DIR` and the workspace itself on the
|
|
73
|
-
issue's volume exactly so every role of the issue's pod reuses it.
|
|
74
|
-
- An extraction prefix: whatever you leave resolving through it, which is yours to decide. Unpack
|
|
75
|
-
Debian packages under `$HOME`, export `LD_LIBRARY_PATH` in the shell you go on working in, and
|
|
76
|
-
you change what every later command in that shell — and every subagent that inherits the
|
|
77
|
-
environment — resolves `psql` or its libraries to, asked for or not, on a prefix nothing records,
|
|
78
|
-
pins or rebuilds: that fails both conditions, and it is the withheld capability. The harness
|
|
79
|
-
below is the shape that passes. The opposite shape is in the tree too, and superseded: telling
|
|
80
|
-
every subagent to prepend a directory to `PATH` because a subagent's shell starts without it
|
|
81
|
-
hands over an environment to processes that never named it. That is the difference between
|
|
82
|
-
standing a harness up and getting yourself a CLI.
|
|
83
|
-
|
|
84
|
-
The test is about what a command leaves for other processes, never about getting the same bytes
|
|
85
|
-
twice — because a pinned line does not promise the same bytes. What a pin binds is the named
|
|
86
|
-
distribution at that version; its dependency closure is resolved when the command runs. With
|
|
87
|
-
`UV_CACHE_DIR` emptied, `uvx -v --from httpie@3.2.4 http --version` logs `Selecting:
|
|
88
|
-
requests==2.34.2 [compatible]` and resolves `urllib3` and `certifi` from ranges, where the warm run
|
|
89
|
-
prints `3.2.4` at once off the cache that first run filled. When your work needs the closure pinned
|
|
90
|
-
too — a comparison that has to hold across days or across pods — that is a project's own lockfile
|
|
91
|
-
with `uv run` or `bun install` in a workspace, not a one-off runner line.
|
|
92
|
-
|
|
93
|
-
A pinned run whose tool then installs something of its own — an interpreter, a browser, a second
|
|
94
|
-
toolchain — is where the first condition does the work. `uv run --with pyyaml==6.0.2 --no-project`
|
|
95
|
-
passes both: the wheel lands in `UV_CACHE_DIR`, under `wheels-v6/pypi/pyyaml/6.0.2-…`, and
|
|
96
|
-
`UV_PYTHON_INSTALL_DIR` is never created, because the image's own `python3` served the run. The
|
|
97
|
-
interpreter is the other run: a project whose `.python-version` names an interpreter uv must fetch
|
|
98
|
-
puts that interpreter under `UV_PYTHON_INSTALL_DIR`, where every role of the issue's pod finds it, while
|
|
99
|
-
the cache holds no wheel. A browser download passes too, and for Playwright — the browser driver this
|
|
100
|
-
repository's own Dispatch suite installs (`playwright install`, `packages/dispatch`'s
|
|
101
|
-
`e2e:install`) — it passes as it stands, with nothing pointed anywhere: playwright-core resolves
|
|
102
|
-
its browser registry under `XDG_CACHE_HOME`, which the runtime has already put on the issue's
|
|
103
|
-
volume, so the issue's roles share one registry under the exclusive install lock that
|
|
104
|
-
`docs/kubernetes.md` writes down in "Anatomy of a Sandbox pod", the paragraph on sharing the cache
|
|
105
|
-
home — worth reading before an install, for the two things that follow from sharing. Pointing
|
|
106
|
-
`PLAYWRIGHT_BROWSERS_PATH` elsewhere is what costs you: that shared registry, and the lock that
|
|
107
|
-
makes a second role installing at the same time wait rather than race. The condition is for a tool
|
|
108
|
-
whose cache the runtime does not already place — Puppeteer is one, resolving its browser cache to
|
|
109
|
-
`join(homedir(), '.cache', 'puppeteer')` and so to your role's own home on the pod's disk whatever
|
|
110
|
-
`XDG_CACHE_HOME` says. For that one, point the tool's own cache variable (`PUPPETEER_CACHE_DIR`
|
|
111
|
-
here) at a directory under one of the paths above yourself, since an unset one leaves the download
|
|
112
|
-
wherever the tool defaults, which is nowhere this runtime chose.
|
|
113
|
-
|
|
114
|
-
Where it lands is what you pay. Under one of those variables it is on the issue's volume: it
|
|
115
|
-
outlives a role's relaunch in its pod, and every role of the issue is told the same path — under
|
|
116
|
-
every one of those variables but
|
|
117
|
-
`XDG_STATE_HOME`, which is `/legion/scratch/state/<role>`, a directory named for your role
|
|
118
|
-
(`roleEnvironment`) because Oh My Pi names its browser broker's lock from the state root and an
|
|
119
|
-
abstract socket name is one name across every role of the pod, which share its network. It is not
|
|
120
|
-
private: every role of the issue can write it, as it can every path above — though it does not
|
|
121
|
-
outlive the pod: the issue's disk is the pod's own and is deleted with it, so a later pod of the
|
|
122
|
-
issue starts without it. Under
|
|
123
|
-
`$HOME` — `/home/legion`, which no volume is mounted on — it is your role's own home, an overlay
|
|
124
|
-
over the image's whose writes land on the pod's disk (an `emptyDir` every role's home and `/tmp`
|
|
125
|
-
share): one copy per role, per pod, kept across the role's relaunches in that pod and gone when
|
|
126
|
-
the pod is replaced, and charged to the pod's ephemeral-storage limit, which every role of the pod
|
|
127
|
-
shares and which is smaller than the volume. Moving exactly these writes off that
|
|
128
|
-
filesystem is what `roleEnvironment` (`packages/daemon/internal/runtime/sandbox/manifest.go`)
|
|
129
|
-
exists for, because a pod whose caches pass its ephemeral-storage limit is evicted — so an install
|
|
130
|
-
under `$HOME` fails the first condition and is outside the sanctioned form, however little else it
|
|
131
|
-
changes. The three artefacts above are the whole of that line's ground. Disk is not: every cache is
|
|
132
|
-
already relocated onto the issue's volume, which has the room for them (`docs/kubernetes.md`, "The
|
|
133
|
-
tools a role's own work needs", carries the figure), and a sanctioned install is paid once per
|
|
134
|
-
issue pod, on the issue's own disk, by the issue's roles together.
|
|
135
|
-
|
|
136
|
-
**The worked case, and the one a role actually meets: the Dispatch e2e stack.** A spec a role
|
|
137
|
-
added or changed in `packages/dispatch` runs in the pod while it is written, as a development run,
|
|
138
|
-
one spec a command (`bun run e2e -- e2e/<one spec file>`) — a wall-clock spec, whose three
|
|
139
|
-
projects are out of the default selection, with a command that names its project:
|
|
140
|
-
`bun run e2e -- --project=chromium-alone e2e/heavy-bodies.e2e.ts --workers=1`.
|
|
141
|
-
`packages/dispatch/AGENTS.md` carries both of those as the three commands to copy as they stand.
|
|
142
|
-
The change's proof is CI's run at the head, never the pod's.
|
|
143
|
-
CI's `dispatch-browser` job runs one of two lanes, and neither is the whole suite on every pull
|
|
144
|
-
request. An unlabelled pull request gets the pull-request lane: `chromium`, `iphone`, `stub`
|
|
145
|
-
and `stub-phone`, held to the rows tagged `@pr`. The full lane - every project over every row,
|
|
146
|
-
the three `-alone` ones among them - runs on a pull request labelled `full-ci`, on the merge
|
|
147
|
-
queue and nightly, and the `alone` job that holds the wall-clock rows is gated on it
|
|
148
|
-
(`if: inputs.lane == 'full'` under `alone:` in `.github/workflows/dispatch-browser.yaml`), so no
|
|
149
|
-
unlabelled pull request runs a wall-clock row at all. So a `@pr` row is proved by the pull-request
|
|
150
|
-
lane, and any other row, every wall-clock row among them, by the full lane under `full-ci`, with
|
|
151
|
-
`dispatch-browser` as its check's `ci_check`
|
|
152
|
-
(`skill://legion-architect/references/design-gate.md#a-check-ci-proves`). One spec needs
|
|
153
|
-
the same stack as all the specs: a Postgres with pgvector. On a digest
|
|
154
|
-
carrying `legion-testpg`, use the pod's own server
|
|
155
|
-
(`skill://legion-worker/references/tools.md#the-database-your-tests-use`) and
|
|
156
|
-
unpack nothing. On a digest without it, the way
|
|
157
|
-
that stack is stood up here is Debian packages unpacked with `dpkg-deb -x` into one root on the
|
|
158
|
-
issue's volume — the five packages and the start sequence are in
|
|
159
|
-
`docs/solutions/testing/the-real-dispatch-stack-runs-inside-a-legion-pod-with-no-postgres-no-docker-and-no-root-INFRA-42.md`,
|
|
160
|
-
and
|
|
161
|
-
`docs/solutions/testing/a-browser-harness-in-an-issue-pod-lives-on-the-issue-volume-INFRA-43.md`
|
|
162
|
-
puts it on the volume, moves the caches with it, and writes it as one idempotent script the next
|
|
163
|
-
role re-runs. That passes both conditions, and the second is the one to get right: export the
|
|
164
|
-
root's `PATH` and `LD_LIBRARY_PATH` around the harness's own commands — `initdb`, `pg_ctl`, the
|
|
165
|
-
server, the Playwright run — rather than into the shell you go on working in. Handing the harness
|
|
166
|
-
to the next role is the same test passed again, and
|
|
167
|
-
`docs/solutions/legion/a-port-held-in-an-issue-pod-is-a-sibling-roles-harness-move-your-run-with-the-five-port-variables-and-your-own-database-and-never-stop-the-holder-LEGION-695.md`
|
|
168
|
-
is the illustration: it leaves the server running and records the `LD_LIBRARY_PATH`, `PATH` and
|
|
169
|
-
`DATABASE_URL` in its handoff's `trickyParts`, so what crosses to the next role is a note that
|
|
170
|
-
role sets deliberately rather than an environment it inherits. The suite shells out to `psql`,
|
|
171
|
-
and `psql` being in the image is what makes that harness work now without your extracting a
|
|
172
|
-
client for yourself at all.
|
|
21
|
+
A spec you add or change in `packages/dispatch` runs in the pod one spec a command (`bun run e2e -- e2e/<spec file>`), against the pod's own Postgres (*The database your tests use* in `skill://legion-worker/references/tools.md`). The change's proof is CI's `dispatch-browser` run at the head: an unlabelled pull request runs only the rows tagged `@pr`, and every other row runs under the label `full-ci`.
|
|
@@ -1,67 +1,49 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: simplify-settled-diff
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use when implementation is done and before review, to simplify recently changed code for clarity, reuse, quality and efficiency without changing its behavior."
|
|
4
4
|
argument-hint: "[blank to simplify current branch changes, or describe what to simplify]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Simplify recently changed code for clarity, reuse, quality
|
|
7
|
+
Simplify recently changed code for clarity, reuse, quality and efficiency while preserving exact behavior. Prefer readable, explicit code to compact code: fewer lines is not the goal.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Step 1: Scope
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
1. A scope the user names is the scope; do not widen it.
|
|
12
|
+
2. Otherwise, in git, the current branch against its base; without a usable base, `git diff HEAD`.
|
|
13
|
+
3. Outside git or without a diff, the files the user named or that were edited earlier in the conversation.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
If none of these gives a non-empty scope, ask the user what to simplify, with the host's question tool where it has one, else as numbered options in chat. Where the host lists a question tool that is not loaded, load it with the host's tool-discovery primitive before you fall back to chat. Never skip the question.
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
2. **Otherwise, in git**, use the current branch versus its base. Without a usable base, use staged and unstaged changes (`git diff HEAD`).
|
|
17
|
-
3. **Outside git or without a diff**, use files the user named or that were edited earlier in the conversation.
|
|
17
|
+
Every file of the scope is in the pass: documentation, workflow and configuration files as much as code, and a scope that holds no code at all still runs. Read generated, vendored and lockfile content for what it shows, and edit none of it. Size is no gate: callers own any size or cost threshold.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Step 2: Three reviewers in parallel
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Report the review, apply and verification outcomes together; do not open one task per reviewer.
|
|
24
|
-
|
|
25
|
-
## Step 2: Launch 3 review agents in parallel
|
|
26
|
-
|
|
27
|
-
Dispatch three generic subagents — code-reuse, code-quality, and efficiency reviewers — via the platform's subagent primitive (`Agent`/`Task` in Claude Code, `spawn_agent` in Codex) where available; otherwise run the reviews inline or serially. For each reviewer, read its prompt asset from this skill's directory and pass the **full file content** as the subagent's prompt, together with the resolved scope (the full diff or file set) so it has complete context:
|
|
21
|
+
Dispatch three subagents, each given the full text of its prompt file, read from this skill's directory and passed verbatim, and the whole resolved scope (the full diff or file set):
|
|
28
22
|
|
|
29
23
|
- `references/personas/code-reuse-reviewer.md`
|
|
30
24
|
- `references/personas/code-quality-reviewer.md`
|
|
31
25
|
- `references/personas/efficiency-reviewer.md`
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
**Bounded dispatch.** Launch only as many reviewers as the harness accepts at once, and read a concurrency or active-agent-limit error as backpressure: leave the reviewer queued and retry when a slot frees, rather than record it as a reviewer failure. Where a dispatch fails for a reason that survives correcting the call, run that reviewer's pass inline with the same prompt asset and say so in one line.
|
|
36
|
-
|
|
37
|
-
**Agent.** In Oh My Pi, dispatch each persona as the bundled reviewer, `task(agent="reviewer")`. Each runs as a job of its own, so `wait` for its result and read the findings from what it returns. Which model that agent runs on is the operator's configuration.
|
|
38
|
-
|
|
39
|
-
**Permission mode.** Omit the `mode` parameter on the dispatch call so the user's configured permission settings apply.
|
|
40
|
-
|
|
41
|
-
## Step 3: Fix issues
|
|
42
|
-
|
|
43
|
-
Proceed only after all three review outcomes are complete, whether returned by subagents or produced inline. Apply worthwhile findings directly; record false positives and low-value findings as skipped without asking the user.
|
|
44
|
-
|
|
45
|
-
Inspect beyond the resolved scope when needed to evaluate a finding, but edit only that scope and its necessary import/export seams. For a user-named file or directory scope, those seams must also be inside it; skip any fix that would edit outside the mutation boundary.
|
|
46
|
-
|
|
47
|
-
Each fix must preserve outputs, errors, side effects, and ordering. If that cannot be established, skip it.
|
|
48
|
-
|
|
49
|
-
**A defect you see is reported, never dropped.** A problem outside what this pass may change — a wrong procedure in a document, a workflow step that cannot work, a check that cannot fail — is written into the summary with its file, its line and what is wrong, and never recorded as out of scope. This pass applies only behaviour-preserving fixes, so the caller makes that fix outside the pass and proves it again. The pass that stays silent is the one that let the defect reach review.
|
|
27
|
+
In Oh My Pi, dispatch each as the bundled reviewer, `task(agent="reviewer")`, and `wait` for each result. Elsewhere use the host's subagent tool (`Agent`/`Task` in Claude Code, `spawn_agent` in Codex), or run the reviews inline. Omit the `mode` parameter, so the user's permission settings apply. A concurrency-limit error is backpressure: retry when a slot frees. A dispatch that fails for any other lasting reason runs that reviewer inline with the same prompt, and you say so in one line.
|
|
50
28
|
|
|
51
|
-
|
|
29
|
+
## Step 3: Fix
|
|
52
30
|
|
|
53
|
-
|
|
31
|
+
Start only after all three reviews are complete. Apply the worthwhile findings; record false positives and low-value findings as skipped, without asking the user.
|
|
54
32
|
|
|
55
|
-
|
|
33
|
+
- Read beyond the scope to judge a finding, but edit only the scope and its necessary import and export seams. For a scope the user named, those seams must be inside it too.
|
|
34
|
+
- Each fix keeps outputs, errors, side effects and ordering. If you cannot show that, skip it.
|
|
35
|
+
- Never thin or remove a safety check: trust-boundary validation, data-loss protection, security checks, accessibility affordances.
|
|
36
|
+
- An interface or data shape that existed only in an earlier iteration of this unshipped scope is not protected once you verify it has no deployed, persisted, public, external, dependent-branch or in-repo caller outside the scope. Remove it only when every caller update fits the scope.
|
|
37
|
+
- A plan the caller passed as context is not scope: keep each decision it marks `session-settled:`, including a duplication or a separation made on purpose.
|
|
56
38
|
|
|
57
|
-
|
|
39
|
+
**A defect you see is reported, never dropped.** A problem this pass may not change (a wrong procedure in a document, a workflow step that cannot work, a check that cannot fail) goes in the summary with its file, its line and what is wrong, never as out of scope. The caller fixes it outside the pass.
|
|
58
40
|
|
|
59
|
-
|
|
41
|
+
## Step 4: Verify
|
|
60
42
|
|
|
61
|
-
|
|
43
|
+
Only when a fix was applied: run the typecheck, lint or build of the packages the fixes touched, and the tests that cover the changed code, by name. Run no whole test suite. With no fix applied, record `no fix applied; head unchanged, no verification run` and go to Step 5.
|
|
62
44
|
|
|
63
|
-
If no test
|
|
45
|
+
Report a failure with the check name and its output. Fix a failure the simplification caused or revert that change; never relax an assertion, weaken a type or skip a test. If no test, lint or typecheck is configured, say so in the summary.
|
|
64
46
|
|
|
65
47
|
## Step 5: Summarize
|
|
66
48
|
|
|
67
|
-
|
|
49
|
+
Say what was already sound and what improved. Report applied counts by reuse, quality and efficiency; the skipped count; each defect reported but not fixed, with its file and line; and the check outcomes. Name the agent or model that produced each reviewer's findings. If nothing changed, say so. Lines removed is not the measure of success.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
You are the **Code Quality Reviewer**. You receive a recently changed set as a diff or resolved file set, and every file of it is yours to read: documentation, workflow and configuration files as much as code. Find hacky patterns,
|
|
1
|
+
You are the **Code Quality Reviewer**. You receive a recently changed set as a diff or a resolved file set, and every file of it is yours to read: documentation, workflow and configuration files as much as code. Find hacky patterns, and propose only fixes that keep behavior exactly. Report a defect you see in any file of the set (a wrong procedure in a document, a workflow step that cannot work, a check that cannot fail) with its file, its line and what is wrong; never drop it as out of scope. Review for:
|
|
2
2
|
|
|
3
|
-
1. **Redundant state**: state that duplicates existing state, cached values that could be derived, observers
|
|
4
|
-
2. **Parameter sprawl**:
|
|
5
|
-
3. **Copy-paste with slight variation**: first check whether an existing source of truth or verified platform guarantee
|
|
6
|
-
4. **Leaky abstractions**:
|
|
7
|
-
5. **Stringly-typed code**:
|
|
8
|
-
6. **Unnecessary wrapper elements
|
|
9
|
-
7. **Nested conditionals**: ternary, if/else
|
|
10
|
-
8. **Unnecessary comments**:
|
|
11
|
-
9. **Dead code, unused imports, unused exports**: verify project-wide non-use with configured analysis,
|
|
12
|
-
10. **Context-dependent vocabulary**: rename conversation- or iteration-bound and inconsistent terms toward
|
|
13
|
-
11. **Pre-release compatibility scaffolding**: remove forms superseded
|
|
3
|
+
1. **Redundant state**: state that duplicates existing state, cached values that could be derived, observers or effects that could be direct calls
|
|
4
|
+
2. **Parameter sprawl**: new parameters added to a function instead of generalizing or restructuring existing ones
|
|
5
|
+
3. **Copy-paste with slight variation**: first check whether an existing source of truth or a verified platform guarantee removes the duplication; otherwise consolidate only when behavior is preserved. A branch made reachable by removing a guard or filter is not dead. Replace serializers or coercions only after proving exact equivalence.
|
|
6
|
+
4. **Leaky abstractions**: internal details exposed that should be encapsulated, or existing abstraction boundaries broken
|
|
7
|
+
5. **Stringly-typed code**: raw strings where constants, enums (string unions) or branded types already exist in the codebase
|
|
8
|
+
6. **Unnecessary wrapper elements**: in component-tree UI frameworks only, wrappers with no layout or behavioral role
|
|
9
|
+
7. **Nested conditionals**: ternary, if/else or switch nesting 3 or more levels deep
|
|
10
|
+
8. **Unnecessary comments**: comments that restate the code, narrate changes or keep task history; keep non-obvious constraints and invariants
|
|
11
|
+
9. **Dead code, unused imports, unused exports**: verify project-wide non-use with the configured analysis, else a structural search. Account for re-exports, dynamic imports and framework-conventional exports; if uncertain, skip.
|
|
12
|
+
10. **Context-dependent vocabulary**: rename conversation- or iteration-bound and inconsistent terms toward the codebase's established vocabulary; keep precise domain terms
|
|
13
|
+
11. **Pre-release compatibility scaffolding**: remove forms superseded within the current branch only after verifying they were never deployed, persisted, public, external or consumed by a dependent branch; if uncertain, skip
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Do not reduce comprehension, inline named concepts, merge unrelated logic, or remove abstractions whose testability or extensibility purpose is not verified obsolete.
|
|
16
16
|
|
|
17
|
-
Return each finding as
|
|
17
|
+
Return each finding as its location (`file:line`), the issue, and the concrete fix. If there is nothing to flag, say so.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
You are the **Code Reuse Reviewer**. You receive a recently changed set as a diff or resolved file set, and every file of it is yours to read: documentation, workflow and configuration files as much as code. Find places where the new code duplicates something that already exists,
|
|
1
|
+
You are the **Code Reuse Reviewer**. You receive a recently changed set as a diff or a resolved file set, and every file of it is yours to read: documentation, workflow and configuration files as much as code. Find places where the new code duplicates something that already exists, and propose only fixes that keep behavior exactly. Report a defect you see in any file of the set (a wrong procedure in a document, a workflow step that cannot work, a check that cannot fail) with its file, its line and what is wrong; never drop it as out of scope. For each change:
|
|
2
2
|
|
|
3
3
|
1. **Existing utilities and helpers**: search for behavior-equivalent symbols that replace new functions or inline logic; name the symbol to use
|
|
4
|
-
2. **Standard-library or runtime primitives**: suggest built-
|
|
5
|
-
3. **Platform, framework
|
|
4
|
+
2. **Standard-library or runtime primitives**: suggest a built-in only when it is behavior-equivalent for the inputs in play. Skip swaps with UX, locale, sort-stability or serialization differences.
|
|
5
|
+
3. **Platform, framework or downstream guarantees**: flag code that hand-maintains a verified guarantee, and name the provider and the simplification. Remove only behavior that guarantee directly owns, keeping every output, error, side effect and ordering. Keep value transformations that run before downstream projection. Do not combine this with a serializer or coercion replacement without tests or direct comparisons covering every relevant value type. A newly reachable branch is not dead code.
|
|
6
6
|
|
|
7
|
-
Return each finding as
|
|
7
|
+
Return each finding as its location (`file:line`), the duplication or missed reuse, and the existing utility or built-in to use instead. If there is nothing to flag, say so.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
You are the **Efficiency Reviewer**. You receive a recently changed set as a diff or resolved file set, and every file of it is yours to read: documentation, workflow and configuration files as much as code. Find wasted work and resource problems,
|
|
1
|
+
You are the **Efficiency Reviewer**. You receive a recently changed set as a diff or a resolved file set, and every file of it is yours to read: documentation, workflow and configuration files as much as code. Find wasted work and resource problems, and propose only fixes that keep behavior exactly. Report a defect you see in any file of the set (a wrong procedure in a document, a workflow step that cannot work, a check that cannot fail) with its file, its line and what is wrong; never drop it as out of scope. Review for:
|
|
2
2
|
|
|
3
|
-
1. **Unnecessary work**: redundant computations, repeated file reads, duplicate network
|
|
4
|
-
2. **Missed concurrency**: independent operations run
|
|
5
|
-
3. **Hot-path bloat**: new blocking work added to startup or per-request
|
|
6
|
-
4. **Recurring no-op updates**: guard polling, event
|
|
7
|
-
5. **Unnecessary existence checks**:
|
|
3
|
+
1. **Unnecessary work**: redundant computations, repeated file reads, duplicate network or API calls, N+1 patterns
|
|
4
|
+
2. **Missed concurrency**: independent operations run in sequence that could run in parallel
|
|
5
|
+
3. **Hot-path bloat**: new blocking work added to startup or to a per-request or per-render hot path
|
|
6
|
+
4. **Recurring no-op updates**: guard polling, event and reducer updates; verify that wrappers keep the platform's no-change signal, such as a same-reference return
|
|
7
|
+
5. **Unnecessary existence checks**: checking that a file or resource exists before operating on it (a TOCTOU race); operate directly and handle the error
|
|
8
8
|
6. **Memory**: unbounded data structures, missing cleanup, event listener leaks
|
|
9
|
-
7. **Overly broad operations**: reading
|
|
9
|
+
7. **Overly broad operations**: reading a whole file when only a portion is needed, loading all items to find one
|
|
10
10
|
|
|
11
|
-
Return each finding as
|
|
11
|
+
Return each finding as its location (`file:line`), the inefficiency, and the concrete fix. If there is nothing to flag, say so.
|