.agents/skills/deep-review/references/codex/main.md
Deep mode in Codex, end to end. Every spawned agent receives a self-contained prompt.
Inspect the collaboration tools already exposed in the session before spawning. Use deferred-tool discovery only when the session explicitly says collaboration tools are deferred.
Bind these capabilities from the real schemas:
Set context inheritance explicitly to none. If inheritance cannot be disabled, disclose weakened independence in the report. If spawning is unavailable, stop and offer light mode.
Define one release(agent) operation from the documented lifecycle:
Do not select the algorithm merely from whether a close verb exists. Slot reuse is the capability that matters.
Codex packs related dimensions to fit the normal three usable subagent slots:
| Group | Dimensions |
|---|---|
quality | ai-coding-bad-habits, code-style, reuse-architecture, business-logic, ux |
correctness | logic, performance, security, compatibility |
release | release-risk |
process | workflow, skill-freshness, observability |
Pruning removes dimensions; empty groups disappear. Start release, correctness, and quality
first so the largest evidence passes begin immediately; queue process. Use a fast tier for
process and a balanced tier elsewhere.
Extension-only dimensions form an extras group and join the same queue. Never drop it.
Follow ../scoping.md. Produce {changes}, a ≤ 200-word scope summary, and PR
metadata in PR mode.
Apply SKILL.md pruning, detect sibling extension packs, and collect built-in plus extension paths.
Dimension files may route to surface-specific references; agents read only the routes matching the
diff.
For every non-empty group, instantiate ../review-prompt.md with
{dimensions}, {dimension_files}, {scope_summary}, and {changes}. Set the discovered
inheritance control to none.
Maintain:
pendingWork: not-yet-spawned review, review-retry, verify, and verify-retry itemsactive: spawned work keyed by agent idreportPoolreleaseChecksmissingSourcesworkflowFeedbackneedsContextSeed pendingWork in this order: release, correctness, quality, process, extras. Fill every
usable slot.
Whenever an agent completes:
release(agent).active.bun run .agents/skills/deep-review/scripts/validate-output.ts <review|verify>, passing the
response on stdin or through a task-scoped temp file.pendingWork. On invalid verify
output, prepend a retry for the unresolved original ids.pendingWork.The loop ends only when active and pendingWork are both empty.
Append missing_sources, release_checks, and workflow_feedback before partitioning findings.
verify: false findings → reportPool../verify-prompt.md,
including only the required verification addendaCompare input and output ids one-to-one. Missing, duplicate, or invented ids invalidate those entries; prepend a fresh verify item for unresolved original ids.
severity_override and the nature/exposure overrides before cross-checking invariants:
effective P0 must block release, effective P2 must not, and effective release-risk or
exposed_legacy findings must not be auto-fixes. Only a mismatch in the effective values returns
that id to the verify queue.workflow_feedbackconfirmed → apply overrides and append to reportPoolfalse_positive → statistics onlyneed_more_context → needsContextThe main agent never re-verifies a candidate.
After the queue drains, if at least two confirmed findings remain, spawn one fresh agent using
../consolidate-prompt.md. Pass confirmed findings after overrides and
in report order.
Validate with validate-output.ts consolidate. Reject invented ids, self-maps, cycles, or roots
that occur after their duplicates; retry consolidation until valid. Apply the map only after those
checks. Zero or one confirmed finding skips consolidation.
Render strictly per ../report-template.md, including aggregated missing
sources and workflow feedback, optional consolidation, statistics, and PR-mode merge verdict. Run
the pre-send self-check.
When non-empty, use request_user_input once:
"Safe to fix now" has N low-risk findings — apply them all in one pass?
with Fix all / Not now; free text covers partial picks. Apply tests where need_test: true.
Ask one finding at a time for confirmed can_auto_fix: false items and needsContext, ordered P0 →
P1 → P2 and blocking first. Exclude legacy hand-offs. Skip low-likelihood, non-blocking items on
repeat review unless requested.
When legacy hand-offs exist, ask once whether to create all, some, or no Linear issues. Create
nothing before approval. On approval, use the linear skill and include location, culprit,
scenario, likelihood, and verification evidence.
PR #123 / pr 123 / pull request 123; a bare #123 is not.