summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/code-review-fat-slices.md5
-rw-r--r--docs/engineering/code-review.md2
-rw-r--r--skills/engineering/code-review/SKILL.md12
3 files changed, 13 insertions, 6 deletions
diff --git a/.changeset/code-review-fat-slices.md b/.changeset/code-review-fat-slices.md
new file mode 100644
index 0000000..4040fd2
--- /dev/null
+++ b/.changeset/code-review-fat-slices.md
@@ -0,0 +1,5 @@
+---
+"mattpocock-skills": patch
+---
+
+`code-review` now splits a big diff across several sub-agents per axis, Standards by file and Spec by functionality. Reports no longer have a 400-word limit.
diff --git a/docs/engineering/code-review.md b/docs/engineering/code-review.md
index 5ffb0d1..a74ee8a 100644
--- a/docs/engineering/code-review.md
+++ b/docs/engineering/code-review.md
@@ -1,6 +1,6 @@
## What it does
-`code-review` reviews the diff between your working tree and a fixed point you name (a commit, a branch, a tag, `main`, `HEAD~5`) along two axes. **Standards** asks whether the code follows how this repo writes code. **Spec** asks whether the code does what the originating issue or [spec](https://www.aihero.dev/ai-coding-dictionary/spec) asked for. Each axis runs in its own [sub-agent](https://www.aihero.dev/ai-coding-dictionary/subagent) so neither sees the other's reasoning.
+`code-review` reviews the diff between your working tree and a fixed point you name (a commit, a branch, a tag, `main`, `HEAD~5`) along two axes. **Standards** asks whether the code follows how this repo writes code. **Spec** asks whether the code does what the originating issue or [spec](https://www.aihero.dev/ai-coding-dictionary/spec) asked for. Each axis runs in its own [sub-agent](https://www.aihero.dev/ai-coding-dictionary/subagent) so neither sees the other's reasoning. A diff too big for one sub-agent's [smart zone](https://www.aihero.dev/ai-coding-dictionary/smart-zone) is split between several: Standards by file, and Spec by functionality.
The skill never merges or re-ranks the two axes. The report ends with a worst issue *per axis* and declines to name a single winner across them. A change can pass one axis and fail the other. Code that follows every convention but implements the wrong thing passes Standards and fails Spec. Code that does exactly what the [ticket](https://www.aihero.dev/ai-coding-dictionary/ticket) asked but breaks the repo's conventions does the reverse. A blended verdict lets the passing axis hide the failing one.
diff --git a/skills/engineering/code-review/SKILL.md b/skills/engineering/code-review/SKILL.md
index 6a5906e..2e7dae7 100644
--- a/skills/engineering/code-review/SKILL.md
+++ b/skills/engineering/code-review/SKILL.md
@@ -55,27 +55,29 @@ Each smell reads *what it is* → *how to fix*; match it against the diff:
- **Middle Man**: a class or function that mostly just delegates onward. → cut it, call the real target direct.
- **Refused Bequest**: a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.
-### 4. Spawn both sub-agents in parallel
+### 4. Spawn the sub-agents in parallel
-Issue both sub-agent calls together, in the foreground, and aggregate the reports they return.
+Split each axis into **fat slices**: as few as fit each sub-agent's **smart zone** (~150k tokens, including the code it reads around the diff). Slice Standards by file, and Spec by functionality.
+
+Issue every sub-agent call together, in the foreground, and aggregate the reports they return.
**Standards sub-agent prompt** should include:
- Both diff commands and the commit list.
- The list of standards-source files you found in step 3, **plus the smell baseline from step 3** pasted in full (the sub-agent has no other access to it).
-- The brief: "Report, per file/hunk where relevant, (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls: documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything tooling enforces. Under 400 words."
+- The brief: "Report, per file/hunk where relevant, (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls: documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything tooling enforces."
**Spec sub-agent prompt** should include:
- Both diff commands and the commit list.
- The path or fetched contents of the spec.
-- The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."
+- The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding."
If the spec is missing, skip the Spec sub-agent and note this in the final report.
### 5. Aggregate
-Present the two reports under `## Standards` and `## Spec` headings, verbatim or lightly cleaned. Do **not** merge or rerank findings, because the two axes are deliberately separate (see _Why two axes_).
+Present the reports under `## Standards` and `## Spec` headings, verbatim or lightly cleaned. Do **not** merge or rerank findings, because the two axes are deliberately separate (see _Why two axes_).
End with a one-line summary: total findings per axis, and the worst issue _within each axis_ (if any). Don't pick a single winner across axes: that's the reranking the separation exists to prevent.