@ask-llm/plugin 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/.claude-plugin/plugin.json +20 -0
  2. package/.mcp.json +3 -0
  3. package/LICENSE +21 -0
  4. package/README.md +135 -0
  5. package/agents/antigravity-reviewer.md +139 -0
  6. package/agents/brainstorm-coordinator.md +305 -0
  7. package/agents/codex-reviewer.md +194 -0
  8. package/agents/codex-verifier.md +149 -0
  9. package/agents/fable-reviewer.md +44 -0
  10. package/agents/gemini-reviewer.md +130 -0
  11. package/agents/ollama-reviewer.md +131 -0
  12. package/agents/sol-reviewer.md +60 -0
  13. package/codex-pair-defaults.json +4 -0
  14. package/dist/antigravity-run.d.ts +3 -0
  15. package/dist/antigravity-run.d.ts.map +1 -0
  16. package/dist/antigravity-run.js +32 -0
  17. package/dist/antigravity-run.js.map +1 -0
  18. package/dist/codex-run.d.ts +3 -0
  19. package/dist/codex-run.d.ts.map +1 -0
  20. package/dist/codex-run.js +32 -0
  21. package/dist/codex-run.js.map +1 -0
  22. package/dist/index.d.ts +7 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +39 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/ollama-run.d.ts +3 -0
  27. package/dist/ollama-run.d.ts.map +1 -0
  28. package/dist/ollama-run.js +32 -0
  29. package/dist/ollama-run.js.map +1 -0
  30. package/dist/run.d.ts +3 -0
  31. package/dist/run.d.ts.map +1 -0
  32. package/dist/run.js +32 -0
  33. package/dist/run.js.map +1 -0
  34. package/hooks/hooks.json +55 -0
  35. package/package.json +104 -0
  36. package/pi/extensions/codex-pair.ts +870 -0
  37. package/pi/extensions/index.ts +13 -0
  38. package/pi/extensions/provider-tools.ts +241 -0
  39. package/pi/tsconfig.json +10 -0
  40. package/prompts/review.txt +75 -0
  41. package/scripts/codex-pair-debounce-worker.mjs +103 -0
  42. package/scripts/codex-pair-log.mjs +271 -0
  43. package/scripts/codex-pair-prompt-drain.mjs +81 -0
  44. package/scripts/codex-pair-session.mjs +194 -0
  45. package/scripts/codex-pair-stop-gate.mjs +271 -0
  46. package/scripts/codex-pair-watch.mjs +1525 -0
  47. package/scripts/lib/broker-lifecycle.mjs +575 -0
  48. package/scripts/lib/broker-rpc.mjs +203 -0
  49. package/scripts/lib/broker-transport.mjs +407 -0
  50. package/scripts/lib/broker.mjs +537 -0
  51. package/scripts/lib/debounce-state.mjs +208 -0
  52. package/scripts/lib/parser.d.mts +12 -0
  53. package/scripts/lib/parser.mjs +229 -0
  54. package/scripts/lib/process.mjs +39 -0
  55. package/scripts/lib/prompt.d.mts +8 -0
  56. package/scripts/lib/prompt.mjs +41 -0
  57. package/scripts/lib/session-registry.mjs +162 -0
  58. package/scripts/lib/state.d.mts +58 -0
  59. package/scripts/lib/state.mjs +733 -0
  60. package/scripts/lib/stop-gate.mjs +134 -0
  61. package/skills/antigravity-review/SKILL.md +49 -0
  62. package/skills/brainstorm/SKILL.md +105 -0
  63. package/skills/brainstorm-all/SKILL.md +43 -0
  64. package/skills/codex-image/SKILL.md +120 -0
  65. package/skills/codex-pair/SKILL.md +315 -0
  66. package/skills/codex-pair-ack/SKILL.md +64 -0
  67. package/skills/codex-pair-pause/SKILL.md +62 -0
  68. package/skills/codex-pair-resume/SKILL.md +52 -0
  69. package/skills/codex-review/SKILL.md +52 -0
  70. package/skills/codex-verify/SKILL.md +110 -0
  71. package/skills/compare/SKILL.md +151 -0
  72. package/skills/fable-review/SKILL.md +42 -0
  73. package/skills/gemini-review/SKILL.md +40 -0
  74. package/skills/multi-review/SKILL.md +182 -0
  75. package/skills/ollama-review/SKILL.md +40 -0
  76. package/skills/sol-review/SKILL.md +41 -0
@@ -0,0 +1,151 @@
1
+ ---
2
+ name: compare
3
+ description: This skill should be used when the user asks to "compare LLMs", "see how each provider answers", "side-by-side response", "what do Gemini, Codex, Ollama, and Antigravity think", or wants raw responses from multiple providers without synthesis. Unlike /brainstorm (which synthesizes findings) or /multi-review (which validates code reviews), /compare just shows each provider's answer side-by-side.
4
+ ---
5
+
6
+ <!-- PORTABLE-CONTRACT:START -->
7
+ ## Portable contract
8
+
9
+ Send the exact same bounded prompt to two to four selected providers concurrently. Preserve input order in the result, show each response verbatim without synthesis or adjudication, and show every provider failure instead of silently dropping it. Never invoke raw provider CLIs when a canonical Ask LLM bridge is available.
10
+ <!-- PORTABLE-CONTRACT:END -->
11
+
12
+ ## Host adapters
13
+
14
+ ### Pi adapter
15
+
16
+ Use one native `ask-multi` call. Put the common prompt in `prompt` and two to four unique names in `providers`; its implementation, not model-emitted sibling calls, guarantees concurrent bounded dispatch and stable ordering.
17
+
18
+ <!-- HOST-ADAPTER:CLAUDE-CODE:START -->
19
+ ### Claude Code adapter
20
+
21
+ The existing detailed workflow below is the Claude Code adapter. Its Agent, MCP, hook, `CLAUDE_PLUGIN_ROOT`, and `AskUserQuestion` mechanics apply only on Claude Code; they do not override the Pi adapter above.
22
+
23
+
24
+
25
+ # Compare Provider Responses Side-by-Side
26
+
27
+ Send the same question to multiple LLM providers and present their responses verbatim, side-by-side. No synthesis, no consensus highlighting, no validation pipeline — just raw outputs so the user can compare directly.
28
+
29
+ This is the right tool when:
30
+ - You want to see how each provider phrases the same answer (style, depth, confidence)
31
+ - You want a sanity check before picking one provider's recommendation
32
+ - You want to evaluate which provider best fits a specific kind of question
33
+ - You explicitly want to AVOID Claude synthesizing or weighting the responses
34
+
35
+ If you want consensus extraction → use `/brainstorm` instead.
36
+ If you're reviewing a code diff → use `/multi-review` instead.
37
+
38
+ ## Instructions
39
+
40
+ ### Phase 1: Parse the request
41
+
42
+ Extract from the user's message:
43
+ 1. **The question/prompt** to send to all providers (the meaningful payload)
44
+ 2. **Optional provider filter** — if the user says "compare gemini and codex", only those two; otherwise default to all four (gemini, codex, ollama, antigravity)
45
+ 3. **Optional context files** — if the user references files (`@path/to/file`), Read each referenced file and inline its contents into the shared provider prompt under a clearly labeled `<context_file path="...">` block. `@file` expansion is Gemini-only; passing the literal path to Codex, Ollama, or Antigravity silently drops the context. For a file too large to inline safely, include the relevant excerpts and state what was omitted.
46
+
47
+ If the question is missing or ambiguous, ask the user to clarify before dispatching.
48
+
49
+ ### Phase 2: Dispatch in parallel via a single foreground Bash call
50
+
51
+ Use the **ADR-050 dispatch pattern** (direct backgrounding + per-PID wait, NOT subshells, NOT `run_in_background: true`):
52
+
53
+ ```bash
54
+ set +e
55
+ workdir=$(mktemp -d /tmp/ask-llm-compare-XXXXXX)
56
+ trap 'rm -rf "$workdir"' EXIT
57
+
58
+ GMCPT_TIMEOUT_MS=480000 node ${CLAUDE_PLUGIN_ROOT}/dist/run.js "$PROMPT" > "$workdir/gemini.out" 2> "$workdir/gemini.err" &
59
+ gem_pid=$!
60
+
61
+ GMCPT_TIMEOUT_MS=480000 node ${CLAUDE_PLUGIN_ROOT}/dist/codex-run.js "$PROMPT" > "$workdir/codex.out" 2> "$workdir/codex.err" &
62
+ codex_pid=$!
63
+
64
+ GMCPT_TIMEOUT_MS=480000 node ${CLAUDE_PLUGIN_ROOT}/dist/ollama-run.js "$PROMPT" > "$workdir/ollama.out" 2> "$workdir/ollama.err" &
65
+ ollama_pid=$!
66
+
67
+ GMCPT_TIMEOUT_MS=480000 node ${CLAUDE_PLUGIN_ROOT}/dist/antigravity-run.js "$PROMPT" > "$workdir/antigravity.out" 2> "$workdir/antigravity.err" &
68
+ antigravity_pid=$!
69
+
70
+ gemini_rc=0; wait $gem_pid || gemini_rc=$?
71
+ codex_rc=0; wait $codex_pid || codex_rc=$?
72
+ ollama_rc=0; wait $ollama_pid || ollama_rc=$?
73
+ antigravity_rc=0; wait $antigravity_pid || antigravity_rc=$?
74
+
75
+ dump_provider() {
76
+ provider="$1"
77
+ rc="$2"
78
+ echo "===== ${provider} (rc=${rc}) ====="
79
+ cat "$workdir/${provider}.out" 2>/dev/null
80
+ if [ "$rc" -ne 0 ] || [ ! -s "$workdir/${provider}.out" ]; then
81
+ echo "===== ${provider} stderr ====="
82
+ sed -n '1,20p' "$workdir/${provider}.err" 2>/dev/null
83
+ fi
84
+ }
85
+
86
+ dump_provider gemini "$gemini_rc"
87
+ dump_provider codex "$codex_rc"
88
+ dump_provider ollama "$ollama_rc"
89
+ dump_provider antigravity "$antigravity_rc"
90
+ ```
91
+
92
+ Set the Bash tool's `timeout` parameter to **600000ms** (10 minutes, the max). Default 2-minute Bash timeouts will SIGKILL the providers mid-response — this is the same bug class that ADR-050 fixed for the brainstorm-coordinator.
93
+
94
+ If the user asked for a subset of providers (e.g., "compare gemini and codex"), drop the dispatch lines for excluded providers and their corresponding wait and `dump_provider` lines.
95
+
96
+ ### Phase 3: Read the captured output
97
+
98
+ The Bash call dumps every provider response and relevant stderr before its EXIT trap removes the unique work directory. Parse those labeled blocks directly from the Bash result. If a provider's output is empty or its exit code is non-zero, surface the captured stderr — DO NOT silently drop a provider. Never reuse fixed files under `/tmp`; overlapping sessions must remain isolated.
99
+
100
+ ### Phase 4: Present side-by-side
101
+
102
+ Output structure:
103
+
104
+ ```markdown
105
+ ## Comparison: <one-line restatement of the question>
106
+
107
+ ### Gemini
108
+ > <verbatim provider response, do NOT paraphrase>
109
+
110
+ ### Codex
111
+ > <verbatim provider response>
112
+
113
+ ### Ollama
114
+ > <verbatim provider response>
115
+
116
+ ### Antigravity
117
+ > <verbatim provider response>
118
+
119
+ ### Where they differ
120
+ - One bullet per substantive disagreement (1-2 sentences each)
121
+ - If they all agree, say "All providers gave substantively the same answer."
122
+ - Do NOT take a position on who's right — present the differences neutrally
123
+ ```
124
+
125
+ If a provider failed:
126
+
127
+ ```markdown
128
+ ### Gemini
129
+ **Failed** (exit 1): <first 3 lines of stderr>
130
+ ```
131
+
132
+ ### Output discipline
133
+
134
+ - **Quote responses verbatim**: do not paraphrase, summarize, or condense. The user invoked `/compare` because they want raw output.
135
+ - **Stay neutral in the "Where they differ" section**: surface the disagreement, do not adjudicate it. If the user wants a recommendation, they will ask follow-up questions.
136
+ - **Keep your own commentary minimal**: a one-line question restatement at the top, the verbatim sections in the middle, the differences callout at the end. That's it.
137
+ - **Do not call `/brainstorm` or `/multi-review` instead** — `/compare` is intentionally simpler. If the user wanted synthesis they would have asked for it.
138
+
139
+ ## Sub-Agent Background Job Lifecycle (must read)
140
+
141
+ Sub-agents in Claude Code cannot own background processes that outlive their turn. The ADR-050 lesson applies here exactly as it did for the brainstorm-coordinator:
142
+
143
+ - ❌ Do not use `run_in_background: true` on the dispatch Bash call
144
+ - ❌ Do not use `(cmd &) && wait` — the subshell detaches the child and `wait` returns immediately
145
+ - ❌ Do not split the dispatch across multiple Bash calls
146
+ - ✅ Single foreground blocking Bash call with direct backgrounding (`cmd & pid=$!`) and per-PID `wait`
147
+ - ✅ `timeout: 600000` on the Bash tool call
148
+
149
+ Without these, providers that take longer than the surrounding turn will be SIGKILLed mid-response and you will silently get 0-byte outputs.
150
+
151
+ <!-- HOST-ADAPTER:CLAUDE-CODE:END -->
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: fable-review
3
+ description: Request a review of the current code changes from the Fable model. Use when the user asks for a Fable review, says "review with Fable", wants Fable's independent perspective on a diff, or invokes /fable-review.
4
+ ---
5
+
6
+ <!-- PORTABLE-CONTRACT:START -->
7
+ ## Portable contract
8
+
9
+ Gather a bounded diff and context brief, run the independent Fable reviewer in a read-only isolated context, source-verify its findings, and disclose that the resolved runtime model cannot be independently inspected.
10
+ <!-- PORTABLE-CONTRACT:END -->
11
+
12
+ ## Host adapters
13
+
14
+ ### Pi adapter
15
+
16
+ Unsupported and intentionally not loaded or advertised by the Pi manifest. Do not start a nested Pi/Fable session. Independent Fable review remains a Claude Code capability.
17
+
18
+ <!-- HOST-ADAPTER:CLAUDE-CODE:START -->
19
+ ### Claude Code adapter
20
+
21
+ The existing detailed workflow below is the Claude Code adapter. Its Agent, MCP, hook, `CLAUDE_PLUGIN_ROOT`, and `AskUserQuestion` mechanics apply only on Claude Code; they do not override the Pi adapter above.
22
+
23
+
24
+
25
+ # Fable Code Review
26
+
27
+ Request a read-only, precision-first review in an isolated Fable context.
28
+
29
+ ## Workflow
30
+
31
+ 1. Use Bash to read `CLAUDE_CODE_SUBAGENT_MODEL`. If it is set to anything other than `inherit`, `fable`, or a `claude-fable-*` model ID, abort before launching: this environment variable has higher precedence than the skill's model request.
32
+ 2. Run `git status --short`, `git diff`, and `git diff --cached`.
33
+ 3. Include untracked files the user wants reviewed with `git add -N <path>` so their contents appear in the diff without staging them.
34
+ 4. If the combined diff is empty, report that there are no changes to review.
35
+ 5. Read the root and file-scoped `CLAUDE.md` files plus any ADRs cited by changed code.
36
+ 6. Launch the `fable-reviewer` agent with the per-invocation model set to `fable`, plus the diff and a compact context brief containing the changed files, applicable conventions, referenced ADRs, and the user's requested review focus.
37
+ 7. If the Agent tool reports a fallback or model-availability error, abort instead of returning its findings as a Fable review.
38
+ 8. Return the agent's validated findings without adding unverified issues. State that Fable was requested but the resolved model was not independently verified, because Claude Code does not expose the resolved subagent model to skills and an organization `availableModels` policy can silently fall back to the inherited model.
39
+
40
+ The `fable-reviewer` agent's `model: fable` frontmatter and the launch-time `model: "fable"` argument both request Fable. Do not substitute another reviewer or route this skill through an external MCP provider. Never claim the runtime-selected model was verified when Claude Code did not expose it.
41
+
42
+ <!-- HOST-ADAPTER:CLAUDE-CODE:END -->
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: gemini-review
3
+ description: Get a second opinion from Gemini on your current code changes. Analyzes staged/unstaged diffs and returns prioritized findings. Use when user asks to "review with Gemini", "Gemini code review", or "ask Gemini to check my code".
4
+ ---
5
+
6
+ <!-- PORTABLE-CONTRACT:START -->
7
+ ## Portable contract
8
+
9
+ Gather the relevant staged, unstaged, and untracked code changes; build a bounded context brief; request a Gemini review; verify each reported finding against source; and return only prioritized, source-supported findings. Preserve provider fallback, timeout, and explicit failure disclosure.
10
+ <!-- PORTABLE-CONTRACT:END -->
11
+
12
+ ## Host adapters
13
+
14
+ ### Pi adapter
15
+
16
+ Call the native `ask-gemini` tool and apply only the `Portable contract` section of `../../agents/gemini-reviewer.md`; ignore that file's frontmatter and Claude Code adapter.
17
+
18
+ <!-- HOST-ADAPTER:CLAUDE-CODE:START -->
19
+ ### Claude Code adapter
20
+
21
+ The existing detailed workflow below is the Claude Code adapter. Its Agent, MCP, hook, `CLAUDE_PLUGIN_ROOT`, and `AskUserQuestion` mechanics apply only on Claude Code; they do not override the Pi adapter above.
22
+
23
+
24
+
25
+ # Gemini Code Review
26
+
27
+ Review current code changes by delegating to the `gemini-reviewer` agent.
28
+
29
+ ## Instructions
30
+
31
+ 1. Gather the diff to review:
32
+ - Run `git diff` to get unstaged changes
33
+ - Run `git diff --cached` to get staged changes
34
+ - Combine both into a single diff
35
+
36
+ 2. If the diff is empty, inform the user there are no changes to review.
37
+
38
+ 3. Launch the `gemini-reviewer` agent with the diff content. The agent handles the Gemini prompt structure and output formatting.
39
+
40
+ <!-- HOST-ADAPTER:CLAUDE-CODE:END -->
@@ -0,0 +1,182 @@
1
+ ---
2
+ name: multi-review
3
+ description: This skill should be used when the user asks to "review my code with multiple providers", "get reviews from Antigravity and Codex", "multi-provider review", "review changes", or wants independent code reviews from both Antigravity and Codex in parallel.
4
+ ---
5
+
6
+ <!-- PORTABLE-CONTRACT:START -->
7
+ ## Portable contract
8
+
9
+ Build one Context Brief and bounded diff, dispatch the same review contract concurrently to the selected providers, then independently verify every finding against repository source. Classify findings as VERIFIED, REJECTED, or UNVERIFIABLE; preserve size consent at 50KB/150KB; never silently drop a failed provider; and report included/excluded context.
10
+ <!-- PORTABLE-CONTRACT:END -->
11
+
12
+ ## Host adapters
13
+
14
+ ### Pi adapter
15
+
16
+ Use one native `ask-multi` call for concurrent provider dispatch, then perform source verification in the current host context. Do not use the Claude runner binaries or raw provider CLIs.
17
+
18
+ <!-- HOST-ADAPTER:CLAUDE-CODE:START -->
19
+ ### Claude Code adapter
20
+
21
+ The existing detailed workflow below is the Claude Code adapter. Its Agent, MCP, hook, `CLAUDE_PLUGIN_ROOT`, and `AskUserQuestion` mechanics apply only on Claude Code; they do not override the Pi adapter above.
22
+
23
+
24
+
25
+ # Multi-Provider Code Review
26
+
27
+ Run independent code reviews from Antigravity and Codex in parallel, **verify** each finding against the source, then present combined consensus / unique / rejected sections so the user sees what really matters and what was a false positive. (Gemini is one command away via the `gemini-reviewer` agent or `/gemini-review` if you want it in the mix.)
28
+
29
+ ## Why verification matters
30
+
31
+ Confidence scores are not an oracle. In a real session on 2026-04-17, Gemini returned two findings at 95/100 confidence that were factually wrong (a `z.enum([])` claim that ignored an existing fallback, and an "MCP SDK doesn't support outputSchema" claim that was contradicted by the actual `.d.ts`). Both would have caused a mis-fix if accepted at face value. **Always verify before presenting.**
32
+
33
+ ## Two kinds of verification — pick the right skill
34
+
35
+ This skill verifies **review findings** — the bugs each provider claims it found. Phase 3 reads the file at the cited line and checks whether each finding is real before presenting it.
36
+
37
+ That is different from verifying **assistant claims** — the statements the assistant made in its prior turn ("I added retry logic," "I bumped the threshold to 16384"). For that, use `/codex-verify`. It dispatches the `codex-verifier` agent, decomposes the assistant's last message into atomic claims, and proves or disproves each with deterministic evidence. It returns a CONFIDENCE grade on a five-point ladder (`PERFECT | VERIFIED | PARTIAL | FEEDBACK | FAILED`) — `PARTIAL` and `FAILED` are first-class verdicts, surfacing gaps in your verification harness rather than hiding them under a confident-looking number.
38
+
39
+ | Question | Skill |
40
+ |---|---|
41
+ | "Are there bugs in this diff?" | `/multi-review` (finds new issues, verifies each finding before presenting) |
42
+ | "Did the assistant actually do what it claimed?" | `/codex-verify` (decomposes the assistant's claims, proves each against state) |
43
+
44
+ The two skills compose. Run both when you want both questions answered; do not merge their outputs.
45
+
46
+ ## Instructions
47
+
48
+ ### Phase 1: Gather and prepare the diff
49
+
50
+ 1. Get the working-tree state:
51
+ - `git status --short` to see what's modified/added/deleted
52
+ - For untracked files the user wants reviewed, run `git add -N <files>` so they appear in `git diff` (intent-to-add)
53
+ - Combine `git diff` (unstaged) and `git diff --cached` (staged) into a single diff
54
+
55
+ 2. **Filter the diff** — exclude noise that providers don't need:
56
+ - Pathspec exclusions: `:!docs/` `:!apps/docs/` `:!*.md` `:!yarn.lock` `:!*.lock` `:!*.png` `:!*.jpg` `:!*.svg`
57
+ - Example: `git diff -- ':!docs/' ':!*.md' ':!yarn.lock'`
58
+ - The user's own ADR/docs additions are not what they want providers to review
59
+
60
+ 3. **Size-check the diff:**
61
+ - Measure: `wc -c diff.patch`
62
+ - **< 50KB**: send as-is
63
+ - **50–150KB**: warn the user "this is a large diff, providers may take 5–15 min" and continue
64
+ - **> 150KB**: tell the user, ask whether to truncate (head -c 150000) or split by package, do NOT silently send a giant payload
65
+ - **Empty**: stop and inform the user "no changes to review"
66
+
67
+ 4. **Create a Context Brief** — a compact manifest that makes the handoff reproducible. Put it before the diff in every reviewer prompt; do not use it as an excuse to paste more raw files by default.
68
+
69
+ ```markdown
70
+ ## Context Brief
71
+
72
+ Intent:
73
+ - User request:
74
+ - Review mode: multi-review
75
+ - Providers: <list the actual providers selected for this run>
76
+
77
+ Scope:
78
+ - Base ref:
79
+ - Changed files:
80
+ - Included files/docs:
81
+ - Excluded files/docs and reason:
82
+ - Diff bytes:
83
+
84
+ Repository signals:
85
+ - Relevant package/workspace:
86
+ - CLAUDE.md files read:
87
+ - ADRs/docs read:
88
+
89
+ Risk focus:
90
+ - Security:
91
+ - Data loss:
92
+ - Concurrency/state:
93
+ - API/contract:
94
+ - Tests/build:
95
+
96
+ Open questions:
97
+ - Items not verified before dispatch:
98
+ ```
99
+
100
+ Keep the brief tiny for simple diffs. Escalate detail when the diff is over 50KB, spans more than 5 files, crosses package boundaries, includes untracked files, references ADRs/specs, or depends on conversation context the external providers cannot see.
101
+
102
+ ### Phase 2: Dispatch (with fallback)
103
+
104
+ **Preferred: launch both reviewer agents in parallel** using the Agent tool in a single message:
105
+ - `antigravity-reviewer` agent with the Context Brief + diff content
106
+ - `codex-reviewer` agent with the Context Brief + diff content
107
+ - Each agent performs its own multi-phase pipeline: Context → Prompt → Validation → Report
108
+
109
+ > `antigravity-reviewer` requires `agy` installed + logged in and the Antigravity MCP server registered. If it's unavailable it will say so — present the codex-only result and note "antigravity skipped (agy not available)" rather than failing the whole review. To include Gemini instead/as well, also launch the `gemini-reviewer` agent.
110
+
111
+ **Fallback when reviewer agents are unavailable** (e.g., plugin not installed in this Claude Code session): dispatch directly via the project's `dist/antigravity-run.js` and `dist/codex-run.js` runner binaries using the **ADR-050 dispatch pattern** (single foreground blocking Bash call, direct backgrounding, per-PID `wait`, 25-min timeout):
112
+
113
+ ```bash
114
+ GMCPT_TIMEOUT_MS=1500000 node ${CLAUDE_PLUGIN_ROOT}/dist/antigravity-run.js "$REVIEW_PROMPT" < diff.patch > /tmp/mr-antigravity.out 2> /tmp/mr-antigravity.err &
115
+ agy_pid=$!
116
+
117
+ GMCPT_TIMEOUT_MS=1500000 node ${CLAUDE_PLUGIN_ROOT}/dist/codex-run.js "$REVIEW_PROMPT" < diff.patch > /tmp/mr-codex.out 2> /tmp/mr-codex.err &
118
+ codex_pid=$!
119
+
120
+ agy_rc=0; wait $agy_pid || agy_rc=$?
121
+ codex_rc=0; wait $codex_pid || codex_rc=$?
122
+ ```
123
+
124
+ Set the Bash tool's `timeout` parameter to **600000ms** (10-min max). For diffs > 50KB, expect both providers to take real wall time — this is normal.
125
+
126
+ Do NOT use raw `agy -p`, `gemini -p`, or `codex exec` — those bypass the project's quota/recovery handling, Codex stdin handling (ADR-042), and PATH resolution (ADR-047). Use the runner binaries.
127
+
128
+ ### Phase 3: Verify each finding before presenting
129
+
130
+ For every finding from either provider at confidence ≥ 80:
131
+
132
+ 1. Read the file at the cited line (use the Read tool)
133
+ 2. Check whether the claim is actually true:
134
+ - "X function doesn't exist" → verify via Grep
135
+ - "Y line crashes when Z" → trace the actual code path
136
+ - "ADR-NNN is contradicted" → read the ADR
137
+ 3. Mark each finding as one of:
138
+ - **VERIFIED** — claim holds against source
139
+ - **REJECTED** — false positive (with brief explanation of what the provider missed)
140
+ - **UNVERIFIABLE** — cannot confirm without runtime / external info; present as-is with a note
141
+
142
+ ### Phase 4: Resilient failure handling
143
+
144
+ When a provider fails (timeout, capacity exhaustion, exit code ≠ 0, 0-byte output):
145
+ - Do NOT silently drop it from the synthesis
146
+ - Surface the failure inline: "Antigravity failed (exit 1): <first 3 lines of stderr>"
147
+ - If both providers failed, say so explicitly and surface both stderr — don't pretend you have findings
148
+ - A single-provider review is still useful — present what you have, note what's missing
149
+
150
+ ### Phase 5: Present the synthesis
151
+
152
+ ```markdown
153
+ ## Multi-Provider Review
154
+
155
+ **Context used:**
156
+ - Included: <files / packages>
157
+ - Excluded: <files / patterns and reason>
158
+ - Diff bytes: <N>
159
+
160
+ **Verified by both providers (highest confidence):**
161
+ - ⟨finding⟩ — Antigravity: 92, Codex: 88. Verified at <file>:<line>.
162
+
163
+ **Verified by Antigravity only:**
164
+ - ⟨finding⟩ — Confidence 85. Verified at <file>:<line>.
165
+
166
+ **Verified by Codex only:**
167
+ - ⟨finding⟩ — Confidence 90. Verified at <file>:<line>.
168
+
169
+ **Rejected (false positives caught during verification):**
170
+ - ⟨finding⟩ — Provider claimed X at <file>:<line>, but source shows Y. Skipped.
171
+
172
+ **Unverifiable:**
173
+ - ⟨finding⟩ — Cannot confirm without runtime; flagging for user attention.
174
+
175
+ **Provider stats:**
176
+ - Antigravity: ⟨N⟩ findings, ⟨V⟩ verified, ⟨R⟩ rejected. Status: ⟨ok | failed: ⟨reason⟩⟩
177
+ - Codex: ⟨N⟩ findings, ⟨V⟩ verified, ⟨R⟩ rejected. Status: ⟨ok | failed: ⟨reason⟩⟩
178
+ ```
179
+
180
+ If you have to truncate either provider's response or skip verification due to time pressure, **say so** in the output. Hidden compromises mislead the user.
181
+
182
+ <!-- HOST-ADAPTER:CLAUDE-CODE:END -->
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: ollama-review
3
+ description: Get a second opinion from a local Ollama LLM on your current code changes. Analyzes staged/unstaged diffs and returns prioritized findings. No API keys needed. Use when user asks to "review with Ollama", "local code review", or "review offline".
4
+ ---
5
+
6
+ <!-- PORTABLE-CONTRACT:START -->
7
+ ## Portable contract
8
+
9
+ Gather the relevant staged, unstaged, and untracked code changes; build a bounded context brief; request a local Ollama review; verify each reported finding against source; and return only prioritized, source-supported findings. Never imply external data transfer and surface unavailable local models actionably.
10
+ <!-- PORTABLE-CONTRACT:END -->
11
+
12
+ ## Host adapters
13
+
14
+ ### Pi adapter
15
+
16
+ Call the native `ask-ollama` tool and apply only the `Portable contract` section of `../../agents/ollama-reviewer.md`; ignore that file's frontmatter and Claude Code adapter.
17
+
18
+ <!-- HOST-ADAPTER:CLAUDE-CODE:START -->
19
+ ### Claude Code adapter
20
+
21
+ The existing detailed workflow below is the Claude Code adapter. Its Agent, MCP, hook, `CLAUDE_PLUGIN_ROOT`, and `AskUserQuestion` mechanics apply only on Claude Code; they do not override the Pi adapter above.
22
+
23
+
24
+
25
+ # Ollama Code Review
26
+
27
+ Review current code changes by delegating to the `ollama-reviewer` agent.
28
+
29
+ ## Instructions
30
+
31
+ 1. Gather the diff to review:
32
+ - Run `git diff` to get unstaged changes
33
+ - Run `git diff --cached` to get staged changes
34
+ - Combine both into a single diff
35
+
36
+ 2. If the diff is empty, inform the user there are no changes to review.
37
+
38
+ 3. Launch the `ollama-reviewer` agent with the diff content. The agent handles the Ollama prompt structure and output formatting.
39
+
40
+ <!-- HOST-ADAPTER:CLAUDE-CODE:END -->
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: sol-review
3
+ description: Review the current code changes specifically with OpenAI GPT-5.6 Sol. Use when the user asks for a Sol review, says "review with Sol", wants a model-pinned Codex review, or invokes /sol-review.
4
+ ---
5
+
6
+ <!-- PORTABLE-CONTRACT:START -->
7
+ ## Portable contract
8
+
9
+ Gather a bounded diff and context brief, request a read-only Codex review explicitly pinned to `gpt-5.6-sol` with `reasoningEffort: "high"`, verify findings against source, and disclose any model or transport fallback. Do not silently substitute another provider.
10
+ <!-- PORTABLE-CONTRACT:END -->
11
+
12
+ ## Host adapters
13
+
14
+ ### Pi adapter
15
+
16
+ Call `ask-codex` with `model: "gpt-5.6-sol"`, `reasoningEffort: "high"`, and `sandbox: "read-only"`; apply only the portable contract in `../../agents/sol-reviewer.md` and disclose fallback metadata.
17
+
18
+ <!-- HOST-ADAPTER:CLAUDE-CODE:START -->
19
+ ### Claude Code adapter
20
+
21
+ The existing detailed workflow below is the Claude Code adapter. Its Agent, MCP, hook, `CLAUDE_PLUGIN_ROOT`, and `AskUserQuestion` mechanics apply only on Claude Code; they do not override the Pi adapter above.
22
+
23
+
24
+
25
+ # Sol Code Review
26
+
27
+ Run a read-only, precision-first review explicitly pinned to GPT-5.6 Sol at high reasoning effort.
28
+
29
+ ## Workflow
30
+
31
+ 1. Run `git status --short`, `git diff`, and `git diff --cached`.
32
+ 2. Include untracked files the user wants reviewed with `git add -N <path>` so their contents appear in the diff without staging them.
33
+ 3. If the combined diff is empty, report that there are no changes to review.
34
+ 4. Read the root and file-scoped `CLAUDE.md` files plus any ADRs cited by changed code.
35
+ 5. Preflight the transport: check whether an `ask-codex` MCP tool is available in the current session (the name may be plugin-namespaced, e.g. `mcp__plugin_ask-llm_codex__ask-codex`). Subagents do not always inherit the session's MCP servers, so treat availability here as advisory only. If no MCP tool resolves, confirm the `codex` CLI is on `PATH` (`command -v codex`); if neither transport exists, stop and tell the user to install one instead of launching the agent.
36
+ 6. Launch the `sol-reviewer` agent with the diff and a compact context brief containing the changed files, applicable conventions, referenced ADRs, the user's requested review focus, and the preflight result (which transport to expect).
37
+ 7. Return the agent's validated findings without adding unverified issues.
38
+
39
+ The reviewer must call `ask-codex` with `model: "gpt-5.6-sol"` and `reasoningEffort: "high"`, or, when no `ask-codex` MCP tool is available in the subagent context, use the sanctioned CLI fallback defined in the agent (`codex exec -m gpt-5.6-sol -c model_reasoning_effort="high" -s read-only --ignore-user-config --ignore-rules --skip-git-repo-check`). This explicit pin distinguishes `/sol-review` from `/codex-review`, which follows the configured Codex default. Both fallback kinds must be disclosed in the report: a Terra quota fallback means the requested Sol review did not complete on Sol, and a CLI transport fallback means the review ran through `codex exec` rather than MCP.
40
+
41
+ <!-- HOST-ADAPTER:CLAUDE-CODE:END -->