Scope and partition. Get the file list (git diff --name-only,
inline — small). Group files into review chunks of max ~10 files
each, organized by logical coherence:
- Same domain or entity
- Same architectural layer (schemas, core logic, routers, triggers,
frontend)
- Files that import each other belong in the same chunk
For each file in scope, capture a per-file diff:
git diff -- <path> > /tmp/hawk-review-large-pr-chunk-<n>-<file-slug>.patch 2>&1
Never capture or read the concatenated multi-file diff — large
PRs are exactly the case Big-output discipline exists for.
Per-chunk triage and fan-out. For each chunk, run the same
pattern as code-audit:
a. Triage (always — this is a large PR; right-sizing the
specialist subset per chunk is the whole point of partitioning).
Call Agent(subagent_type="audit-triage", prompt=<chunk scope, signals>).
Triage decision is internal; record it in the chunk report
header but do not surface to the user unless asked. If triage's
reply doesn't parse, fall back to tier=standard for that
chunk and continue.
b. Fan out specialists in parallel for the triaged subset.
Use the concrete agent names — install-time prefix rewriting
depends on it:
Agent(subagent_type="audit-logic", prompt=<chunk user prompt>)
Agent(subagent_type="audit-security", prompt=<chunk user prompt>)
Agent(subagent_type="audit-simplification",prompt=<chunk user prompt>)
Agent(subagent_type="audit-research", prompt=<chunk user prompt>)
Agent(subagent_type="audit-architecture", prompt=<chunk user prompt>)
Skip any role not in the triage subset.
Do NOT call Agent(subagent_type="code-audit", …) — that's
a skill, not a subagent. The audit-* names above are the only
callable specialists.
The chunk user prompt contains:
- Per-file
rg -n slices from the chunk's capture files (not
the raw concatenated diff)
- Relevant
.agents/standards/ content pasted inline
- Relevant
.agents/common-mistakes/ content pasted inline
- One-line context:
Chunk N of M; files: <count>; layer: <layer>.
c. Merge per chunk the same way code-audit merges (dedupe by
path:line, attach overlapping reasoning).
Wave semantics. Cap concurrency at 3–4 chunks per wave
(one wave = (1 triage + N specialists) × 3–4 chunks running
concurrently). Wait for every chunk in the current wave to
return before starting the next wave. Streaming-style replacement
("queue the next chunk as soon as one finishes") is not allowed —
it makes per-wave error handling and progress reporting unreliable.