--- name: review-circus description: >- Review a diff, branch, ticket, or whole codebase with the mightymodels persona reviewers. One AskUserQuestion gate sets depth (quick runs its reviewers on sonnet, standard and deep on opus), persona emphasis, and scope; the `review_*` tools record the run, `review_metrics` and qualitylens's signals tools measure, merge-vader and uncle-bob report, and the tool reads their reports and merges overlapping findings, presented by id through AskUserQuestion. Only the findings the user picks go to remediation, risk first, through the `task_*` tools; an abridged PR comment is always posted. Not for fixing CI (stick-the-landing) or mid-sprint work (agents-assemble). when_to_use: >- Use for "run the review circus", "review the sprint", "full review pass", "both reviewers on this", and for a quick single-persona pass: "quick merge-vader on this branch", "uncle-bob this module", "is this safe to merge". argument-hint: "[diff | branch | ticket | codebase]" allowed-tools: - AskUserQuestion - mcp__plugin_mightymodels_mighty-mcp__review_start - mcp__plugin_mightymodels_mighty-mcp__review_override - mcp__plugin_mightymodels_mighty-mcp__review_metrics - mcp__plugin_mightymodels_mighty-mcp__review_add - mcp__plugin_mightymodels_mighty-mcp__review_gate - mcp__plugin_mightymodels_mighty-mcp__review_dispose - mcp__plugin_mightymodels_mighty-mcp__review_report - mcp__plugin_mightymodels_mighty-mcp__review_resolve - mcp__plugin_mightymodels_mighty-mcp__task_start - mcp__plugin_mightymodels_mighty-mcp__task_verify - mcp__plugin_mightymodels_mighty-mcp__task_mark - mcp__plugin_mightymodels_mighty-mcp__task_show - mcp__plugin_mightymodels_mighty-mcp__task_ready --- > **Codex runtime adapter (MightyModels fork):** When running under Codex, interpret Claude's `Agent` tool as native `spawn_agent` with `agent_type` mapped via the repository's `AGENTS.md` (or `docs/CODEX.md` when installed as a plugin). Reuse an existing agent through the native follow-up messaging tool rather than literal `SendMessage`. Call actual tools exposed by the MightyModels MCP server, not hardcoded `mcp__plugin_mightymodels_mighty-mcp__*` names. Read required companion skills explicitly; Claude `skills:` preloading, `allowed-tools:` and automatic model routing are not Codex permission controls. `${CLAUDE_SKILL_DIR}` means this SKILL.md's directory; `$ARGUMENTS` means the user's invocation arguments. Do not bypass the existing task-start, owned-file, independent fact-checking or review gates when a tool is unavailable. No Astra model is configured. > **Codex required user-input contract (all skills):** In Default mode, a question that gates further action MUST be asked in ordinary chat; end the turn until the user explicitly replies. The native `request_user_input` popup may auto-resolve and is only for optional feedback in Default mode. In Plan mode, a genuinely blocking native question may be used when the host exposes it, but require a real explicit answer. Empty input, timeout, cancellation, interruption, and automatic resolution never count as consent. Preserve the pending decision and persist only the user's actual answer using available MightyModels tools. This is Codex-only; the Claude `AskUserQuestion` steps below remain unchanged. > **Codex-only review models and depth:** The Codex MCP launcher sets `MIGHTYMODELS_RUNTIME=codex`; `review_start` now persists `gpt-6.1-sol` as the model for either reviewer at quick, standard, or deep depth. The two reviewer profiles are pinned to Sol at high reasoning; depth changes reviewer count, history window and evidence depth, **not model**. `review_override` to Fable is disabled server-side and must not be invoked. Dispatch named native reviewers with their pinned model, not Claude model aliases. When an older review run reports `sonnet`, `opus`, or `fable`, stop rather than claim its persisted model accurately reflects a Codex dispatch. Do not rewrite historical records or silently substitute other models. # review-circus Two reviewers with different worldviews, and this session's primary as the ringmaster: it sets the profile, measures, dispatches, normalizes, and routes what the user chooses to fix. It never reviews code itself and never invents a finding. An empty run means the reviewers have not reported, not that the primary should improvise. Run the commands from the repository root. `${CLAUDE_SKILL_DIR}` is this skill's directory, which Claude Code substitutes in this file as an absolute path. Subagents do not inherit it, so every path a dispatch carries is absolute. - `review_metrics` measures structure (fan-in, fan-out, cycles, sizes) into the run directory. Only this session's primary calls it. - Git history (churn, coupling, hotspots) is measured by qualitylens with the `signals_*` tools; the personas dispatch it, this skill does not call them. Read `references/profiles.md` and `references/review-state.md` before the first run in a session, and `agents-assemble/references/contracts.md` for the severity table. Dispatch every worker through prompting-subagents. ## 1. Profile **Argument:** the scope to review (diff, branch, ticket with its slug, or codebase), given when the skill was started: "$ARGUMENTS". Empty quotes mean none was given, and the scope is settled as below. The profile is the scope, the depth and the emphasis of the review. Say what each depth costs (profiles.md): quick is one persona on sonnet, standard and deep run their reviewers on opus. Then record the profile with `review_start`, carrying only what the conversation has already settled. The tool puts each of `scope`, `depth` and `emphasis` that the call leaves out to the user and starts the run with the answers: ```json {"scope": "ticket", "slug": "SLUG", "base": "main"} ``` An answer starting `needs input` means no one could be asked through the tool: put each question it names to the user in one `AskUserQuestion` dialog, then call again with those arguments. A refusal naming a missing argument means: ask the user for it, then call again. It answers with the run id, the run directory, and each persona's model. Every later step names the run with `run_id`. A run may spend one override on its heavier-weighted reviewer (the first persona, merge-vader, on equal weights), moving it to fable. Ask for it only when the user wants the strongest reviewer, with `review_override`: ```json {"run_id": "20261005-103000"} ``` The answer names the reviewer and says to dispatch it with effort high. A ticket's reviewer keys change no review. ## 2. Measure When uncle-bob is in the run, call `review_metrics` with the `run_id`. It measures the repository into `uncle-bob-metrics.json` in the run directory and returns the path relative to the repository root; make it absolute before it goes into uncle-bob's dispatch, because uncle-bob holds no state tool and only reads the file. Pass `package_depth` 2 when the repository is one top-level package. When the languages are ones it does not parse (it reads Python, JavaScript, and TypeScript), skip it and say so in the dispatch. At standard and deep, pick the history window the personas hand qualitylens per profiles.md (`baseline_ref` BASE_REF for branch and ticket scope). At standard and deep, a code-scout surface triage also runs first: diff stat, risk hotspots (auth, input handling, CI config, dependency manifests), tests covering the changed area. Quick skips both unless the persona names a specific gap. ## 3. Dispatch the personas Dispatch each persona in the run, in parallel, with prompting-subagents' reviewer template and the model the run recorded. Each persona preloads its doctrine as a skill of its own (`becoming-merge-vader`, `becoming-uncle-bob`) and is passed no doctrine path. The packet carries `${CLAUDE_SKILL_DIR}/references/profiles.md`, `${CLAUDE_SKILL_DIR}/references/idiom-evidence.md`, the run directory, the depth and the persona's role (the heavier weight leads), the metrics path `review_metrics` returned, the signals history window (which the persona hands qualitylens), and for a ticket, ticket.yml, the issue, and the plan (merge-vader's conformance check needs them). The `${CLAUDE_SKILL_DIR}` paths are absolute once substituted. For a ticket, the packet also names every brief that holds a `## FINDINGS` section (`rg --no-config -l '^## FINDINGS' .mightymodels/SLUG/briefs`): the fact-checker's Medium, Low and advisory findings, which agents-assemble recorded when it let the task go on. A persona opens the line of each and reports the ones that stand as findings of its own. A recorded finding no persona confirms does not reach the gate, because `review_add` takes findings from the persona reports and from nowhere else. Personas gather their own evidence through code-scout and qualitylens, merge-vader through web-scout too, and nothing else. Write each response unchanged to `RUNDIR/MERGE-VADER-REPORT.md` or `RUNDIR/UNCLE-BOB-REPORT.md`, the files `review_add` reads. Wait for every persona in the run. ## 4. Record the reports Call `review_add` once per persona in the run: ```json {"run_id": "20261005-103000", "persona": "merge-vader"} ``` `review_add` reads that persona's report itself, so no step retypes a finding. When it refuses a quality finding at Medium or above for lacking typed evidence (idiom-evidence.md), lower it to Low or find the evidence, never relabel it a defect. A security question a reviewer left UNKNOWN-BLOCKED belongs in its report as a High finding in the `security` dimension whose Fix is to answer it, since CLEAR is impossible while it stands. Overlapping findings merge in the tool, and a two-level severity gap is flagged for the user. When `review_add` answers that findings are `back to undecided`, show the gate again and call `review_dispose` for them again before any remediation continues. ## 5. The finding gate Always, when any finding exists. Show the user the `review_gate` answer: findings in gate order (severity, security first, then persona weight, then finding number), the order `review_report` and `review_gate` both return, with sources, location, any severity conflict, and the decision so far. Then call `review_dispose` with the `run_id` and no `decisions`. The tool asks the user which of up to ten undecided findings to fix, then what to do with each one left unchecked (defer, accept-risk or dismiss; accept-risk and dismiss need a reason, defer does not), and records the answers. A severity conflict is settled here by the decision the user makes about it. Call again while the answer shows findings still undecided: ```json {"run_id": "20261005-103000"} ``` The answer says which findings are still undecided. An answer starting `needs input` means no one could be asked through the tool: put the question it names to the user in one `AskUserQuestion` dialog, then call again with `decisions` (several findings may go in one call): ```json {"run_id": "20261005-103000", "by": "user", "decisions": {"F1": {"decision": "fix"}, "F2": {"decision": "accept-risk", "reason": "..."}}} ``` Nothing the user did not pick is remediated. ## 6. Comment the PR, always Pass or fail, one finding or twenty: render the report and the abridged comment, check the comment, and post it. `review_report` returns text and writes no file, so the primary writes the full report (the call without `shape`) to `RUNDIR/report.md` and this call's answer to `RUNDIR/pr-comment.md`: ```json {"run_id": "20261005-103000", "shape": "comment"} ``` ```bash python3 "${CLAUDE_PLUGIN_ROOT}/skills/open-ticket/scripts/humanize_tracker_body.py" fix RUNDIR/pr-comment.md --shape comment gh pr comment --body-file RUNDIR/pr-comment.md ``` Reword whatever `fix` still reports; the finding ids stay so the thread links back to the report. Without `gh` or a PR, keep the file and surface the command. With nothing chosen for fixing, the session ends here with the verdict `review_report` returned. ## 7. Remediate, risk first Remediation needs a ticket, because its tasks live in the ticket. In a codebase or branch run without one, offer open-ticket with the chosen findings as the rollup, and stop. Order: gate order, the order `review_gate` returned. For each finding `Fn` chosen for fixing: 1. `task_start` with `slug`, `task_id` the next `R` that `task_show` does not list, `by` `engineer`, `owned` the files the Fix touches and `acceptance` the finding's `Verify:` outcome sentence as one short sentence (shortened to 255 characters at most). The `R` is the task's own and not the finding's: a sprint residual may hold `R1` already, so `F1` can be fixed under `R2`. 2. Dispatch an **engineer**: the residual variant for a single-concern merge-vader finding with usable Fix and Verify lines; the full template for uncle-bob findings, findings both personas raised, and anything Critical or High security. Either way the dispatch carries SLUG, that `R` as the task id, and the persona's own id (`MV-n`, `UB-n`) in a slot of its own as the finding: a finding id is never the task id. A residual carries `Fix:`, `Outcome:` (the finding's `Verify:` outcome sentence, verbatim) and `Verify:` (the scoped tests or checks the primary names, never the outcome sentence). The engineer runs them and names each test it ran with its output quoted. 3. `task_verify` with `slug`, `task_id` that `R`, the fix `commit` and `verdict` `verified`, then `review_resolve` with `run_id`, `finding` `Fn`, `result` `fixed` and `commit`. 4. Failed or blocked: `task_mark` with `slug`, `task_id` that `R`, `to` `failed`, `blocked` or `superseded` and a `reason` (a task the gate blocked already is `blocked`), then the owner's question unless `auto-escalate` is on, `task_start` on that `R` with `by` `architect`, and **architect** once, then whats-broken, as in agents-assemble. Record `review_resolve` with `result` `failed` or `blocked` and a `reason` when a finding stops. A finding whose reviewer wrote an Architect escalation line (a design decision beyond its Fix) is a question for the user first. On their yes, dispatch architect in diagnose-replan mode; its revised plan goes back to agents-assemble as new tasks, not into this loop. Before every push: `task_ready`, as stick-the-landing does, then push (only the primary pushes) and dispatch gitty-up with the PR number to watch CI. ## 8. Close Re-render with `review_report` in both shapes, rewrite the two files, and replace the PR comment (`gh pr comment --edit-last --body-file RUNDIR/pr-comment.md`) so it shows each finding's outcome by id. The human review comes after this session; say so, and stop.