--- name: subagent description: "Author, compile, calibrate, and run read-only adversarial reviewer subagents (supagents or host roles)." license: MIT metadata: kind: task author: Médéric HURIER (Fmind) source: github.com/fmind/dot/tree/main/skills/subagent created: "2026-09-09" updated: "2026-11-30" --- # Adversarial Reviewer Subagents Keep producers dynamic (built-in subagents + skills) and domain rules single-sourced in `skills/`. Encode quality gates as **7 static, clean-context, read-only reviewer `supagents`** representing orthogonal adversarial postures and permission tiers, never 1:1 skill mirrors. Pass matching `SKILL.md`/reference paths for stack-specific checks (Skill-as-Rubric), or add project-local `-review-*` roles only where a repo needs a standing domain or stakeholder persona. Project `AGENTS.md`/`DESIGN.md`/`SECURITY.md` override defaults without weakening security or `Output Contract`; reviewers stay single-lens while the coordinator arbitrates via the 5 North Stars in [balancing](references/balancing.md). ## Core Reviewer Roles Active global roles compile from two partials (`_reviewer.md` air-gapped `inherit` and `_reviewer_web.md` `inherit` + public web lookup; host model IDs and permission limits live in [cross-harness-agents](../agent-harnesses/references/cross-harness-agents.md#permission-limits)): - **`fmind-review-code`**: correctness, no stubs/silenced checks, failure atomicity, contracts, test strength, diff simplicity, plus supplied domain skills. - **`fmind-review-design`**: architecture boundaries, alternatives/rollback, spec fit, YAGNI/`DELETIONS`, minimal owned code, and end-to-end completeness. - **`fmind-review-security`**: exploits, authn/authz, IAM/CI/AI/MCP/hook boundaries, secrets, supply-chain pins, privacy, and license/ToS compliance. - **`fmind-review-human`**: busy-reader cognitive load, concept-first clarity, anti-slop, cuts/`DELETIONS`, README/doc parity, and runbook safety. - **`fmind-review-visuals`**: rendered decks, charts, diagrams, and web UI captures (geometry, scales, CVD, tokens, WCAG AA, UI states). - **`fmind-review-project`**: lean `AGENTS.md` (<1,000t), minimal repo governance/CI, `.agents/skills/` disclosure, local supagents, and `docs/` vs `openspec/` lanes. - **`fmind-review-factcheck`** (`_reviewer_web`): live primary-source URL/version/quote checks and arithmetic, unit, FinOps, or pricing reconciliation. ## Risk-Gated Triggering & Coordinator Loop Centralize triggering here and in global `AGENTS.md` instead of scattering role menus across domain skills: 1. **Skip (`Tier 0`, `0` tokens)**: small local edits (`< ~50` LOC, no contract/boundary change), refactors proven by linters/tests, and short 1:1 replies. 1. **Preflight (`0` tokens)**: confirm no local `.agents/agents/fmind-review-*` or `.github/agents/fmind-review-*` shadows global roles (`dot context --check`) and run local linters, tests, scanners, and renders first. On interactive trusted repos, pass absolute paths to the diff/targets directly; on headless or untrusted runs, bundle frozen diffs, manifests, gate logs, and renders into a temp dir ([headless-review](../agent-harnesses/references/headless-review/GUIDE.md)). 1. **Invoke with absolute paths (`Tier 1` to `Tier 2`)**: - **Tier 1 (`1` role, default)**: run `code`, `human`, `visuals`, or `project` before PR, push, or delivery. Pass absolute paths to relevant `SKILL.md`/references and `AGENTS.md`/`DESIGN.md`/`SECURITY.md` (copy external skills into `$render_dir` on sandboxed headless runs). - **Tier 2 (`2` roles max, rarely `3` on whole-repo audits)**: escalate only for rendered visuals (`human` + `visuals`), trust boundaries (`security`), multi-module/spec/architecture changes (`design`), or external claims/math (`factcheck`, isolated in `/var/tmp` with sanitized extracts on secret-bearing repos). - Clean-context `agy` CLI reviewers strip CWD and bind `read_file` only; unreadable targets fail closed (`BLOCK`; pass `--model` explicitly on headless `agy --agent`). 1. **Triage skeptically & stop**: treat findings as hypotheses, never orders. Re-read `loc:` in live files, drop fabricated/linter-cleared/out-of-scope items, fix verified `P0`s (`BLOCK`), arbitrate verified `P1`s (`REVISE`) per [balancing](references/balancing.md), take quick `P2`/`DELETIONS` once, and cap at `2` rounds (round 2 checks only the fix diff with only the blocking lens; never re-review for `P2`/`DELETIONS`). 1. **Ratchet recurring `P1`s**: promote defect patterns flagged `>= 2` times into deterministic gates via [lesson-learned](../skillify/references/lesson-learned.md). ## Author, Compile & Calibrate Follow [authoring](references/authoring.md) (standalone starter: [template](templates/reviewer.md)), run `supagents build --strict --project && supagents clean --project --no-input && supagents check --strict --project`, audit with `fmind-review-design` passing `references/authoring.md`, and calibrate live per [calibration](references/calibration.md). ## Gotchas - `agy` snapshots custom agents at startup: test edits in a fresh or headless session (`mise run test:supagents:live` in `fmind/dot`). - In `fmind/dot`, global sources live in `dot_agents/supagents/`, follow the repo `AGENTS.md` supagents gate, keep discovery `< 2,000` tok, retire old roles in `.chezmoiremove`, and run `mise run apply`. ## Documentation - [Authoring](references/authoring.md) · [Balancing](references/balancing.md) · [Calibration](references/calibration.md) · [Template](templates/reviewer.md) · [agent-supagents](https://github.com/fmind/agent-supagents) · Companions: [full-review](../full-review/SKILL.md), [humanize](../humanize/SKILL.md), [cross-harness-agents](../agent-harnesses/references/cross-harness-agents.md), [headless-review](../agent-harnesses/references/headless-review/GUIDE.md).