@ask-llm/plugin 0.13.0 → 0.15.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.
@@ -1,16 +1,19 @@
1
1
  {
2
2
  "name": "ask-llm",
3
- "version": "0.13.0",
4
- "description": "AI-to-AI collaboration — review code, brainstorm ideas, and debate plans across Codex, Antigravity, Ollama, and Gemini",
3
+ "version": "0.15.0",
4
+ "description": "AI-to-AI collaboration — review code and debate plans across Codex, Grok, Antigravity, Ollama, and Gemini",
5
5
  "author": {
6
6
  "name": "Anton Lykhoyda",
7
7
  "url": "https://github.com/Lykhoyda"
8
8
  },
9
9
  "repository": "https://github.com/Lykhoyda/ask-llm",
10
10
  "license": "MIT",
11
+ "mcpServers": "./.mcp.json",
11
12
  "keywords": [
12
13
  "gemini",
13
14
  "codex",
15
+ "grok",
16
+ "xai",
14
17
  "ollama",
15
18
  "antigravity",
16
19
  "code-review",
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "ask-llm",
3
+ "displayName": "Ask LLM",
4
+ "version": "0.15.0",
5
+ "description": "Portable AI-to-AI review and pairing workflows for Cursor Agent with explicit provider transports.",
6
+ "author": {
7
+ "name": "Anton Lykhoyda"
8
+ },
9
+ "license": "MIT",
10
+ "keywords": [
11
+ "cursor",
12
+ "codex",
13
+ "grok",
14
+ "pair-programming",
15
+ "code-review"
16
+ ],
17
+ "skills": [
18
+ "./skills/codex-pair",
19
+ "./skills/grok-pair"
20
+ ],
21
+ "agents": [],
22
+ "commands": [],
23
+ "hooks": {},
24
+ "mcpServers": "./mcp.json"
25
+ }
package/.mcp.json CHANGED
@@ -1,3 +1,8 @@
1
1
  {
2
- "mcpServers": {}
2
+ "mcpServers": {
3
+ "codex": {
4
+ "command": "npx",
5
+ "args": ["-y", "@ask-llm/codex-mcp"]
6
+ }
7
+ }
3
8
  }
package/README.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- **Canonical Claude Code + Pi host package for AI-to-AI collaboration**
5
+ **Canonical Claude Code, Cursor Agent, and Pi host package for AI-to-AI collaboration**
6
6
 
7
7
  </div>
8
8
 
9
- One publishable package that adds multi-provider code review, comparison, brainstorming, verification, image, and pairing workflows to [Claude Code](https://code.claude.com/docs/en/plugins) and [Pi](https://pi.dev). Both hosts consume one skill corpus and package version; host-specific behavior is kept in explicit adapters.
9
+ One publishable package that adds multi-provider code review, comparison, brainstorming, verification, image, and pairing workflows to [Claude Code](https://code.claude.com/docs/en/plugins), [Cursor Agent](https://cursor.com/docs/skills), and [Pi](https://pi.dev). The hosts consume one skill corpus and package version; host-specific behavior is kept in explicit adapters.
10
10
 
11
11
  Part of the [Ask LLM](https://github.com/Lykhoyda/ask-llm) monorepo.
12
12
 
@@ -21,14 +21,37 @@ Part of the [Ask LLM](https://github.com/Lykhoyda/ask-llm) monorepo.
21
21
 
22
22
  > **After installing or upgrading, fully restart Claude Code** (quit and reopen) so the codex-pair `PostToolUse` hook registers. Claude Code binds hooks at session start; `/reload-plugins` refreshes the plugin cache but does **not** re-register hooks in a pre-existing session, so codex-pair won't auto-fire on edits until you restart (see [#74](https://github.com/Lykhoyda/ask-llm/issues/74)). Run `/codex-pair` afterwards to confirm the hook is wired up.
23
23
 
24
- ### MCP Servers (user scope for short tool names)
24
+ ### MCP Servers
25
+
26
+ The plugin bundles only the Codex MCP registration under Claude Code's plugin namespace. After installation or upgrade, fully restart Claude Code and run `/mcp`; `plugin:ask-llm:codex` should be connected. `/sol-review` selects `ask-codex`.
27
+
28
+ `/grok-pair` does not add servers to the plugin. Register the unified Ask LLM server at user scope (the recommended install: it exposes `ask-cursor-agent` for the Cursor Agent route plus the unified `ask-llm` tool, which pair skills call only fully pinned) and, optionally, the split Grok server for the `ask-grok` leaf:
29
+
30
+ ```bash
31
+ claude mcp add --scope user ask-llm -- npx -y @ask-llm/mcp
32
+ claude mcp add --scope user grok -- npx -y @ask-llm/grok-mcp
33
+ ```
34
+
35
+ Existing user-scoped Codex registrations remain compatible and keep their shorter names. Other providers are registered explicitly at user scope:
25
36
 
26
37
  ```bash
27
38
  claude mcp add --scope user gemini -- npx -y @ask-llm/gemini-mcp
28
- claude mcp add --scope user codex -- npx -y @ask-llm/codex-mcp
29
39
  claude mcp add --scope user ollama -- npx -y @ask-llm/ollama-mcp
40
+ claude mcp add --scope user antigravity -- npx -y @ask-llm/antigravity-mcp
41
+ ```
42
+
43
+ ### Cursor Agent
44
+
45
+ Cursor's supported Agent Skills surface exposes exactly `/codex-pair` and `/grok-pair` (the manifest sets `agents: []`, `commands: []`, and `hooks: {}` so Claude agents and the Claude-format hooks file are never auto-discovered, and the other skills stay Claude/Pi-only until they get Cursor adapters); its MCP surface is `mcp.json`, which bundles only the unified `ask-llm` server. For a source checkout:
46
+
47
+ ```bash
48
+ agent --plugin-dir ./packages/claude-plugin
30
49
  ```
31
50
 
51
+ `/codex-pair` requires explicit `model=` and `effort=` values before consent, then uses a separately user-installed `ask-codex` leaf when exposed, otherwise the bundled unified `ask-llm` fully pinned (`provider: "codex"`, model, effort, include directories, session), with resumable Thread ID, cancellation, and result relay. It never guesses MCP-process environment defaults and does not pretend Claude-only hooks are active. `/grok-pair` gives Cursor-native `.cursor/mcp.json` and Tools & MCP reload guidance; it never sends Cursor users to `claude mcp add`. If installing only MCP configuration, the recommended minimal entry is `ask-llm` → `npx -y @ask-llm/mcp` in project `.cursor/mcp.json` or user `~/.cursor/mcp.json` (keep one registration per server — do not duplicate it when the plugin is loaded); add `codex` → `@ask-llm/codex-mcp` or `grok` → `@ask-llm/grok-mcp` only when you specifically want their `ask-codex`/`ask-grok` leaves, then reload MCP/restart Cursor Agent. When Cursor hosts `/grok-pair`, it never recursively invokes Cursor Agent.
52
+
53
+ If Codex is missing entirely, register it explicitly with `claude mcp add --scope user codex -- npx -y @ask-llm/codex-mcp`. If `/mcp` shows the bundled registration but it is disconnected, run `npx -y @ask-llm/mcp doctor` and restart Claude Code. `/sol-review` preserves source-plugin and session-local MCP/settings context when reading the active `claude mcp list` inventory, reports missing and unavailable states separately, and discloses the explicit `codex exec` fallback after failed health or MCP transport failure.
54
+
32
55
  ### Pi
33
56
 
34
57
  ```bash
@@ -36,7 +59,7 @@ pi install npm:@ask-llm/plugin
36
59
  pi list
37
60
  ```
38
61
 
39
- Pi discovers the portable skills as `/skill:<name>` commands and registers native `ask-codex`, `ask-gemini`, `ask-ollama`, `ask-antigravity`, and bounded concurrent `ask-multi` tools. Pi intentionally has no built-in MCP client; do not configure these as MCP servers in Pi. `fable-review` remains Claude Code-only and is excluded from Pi discovery.
62
+ Pi discovers the portable skills as `/skill:<name>` commands and registers native `ask-codex`, `ask-gemini`, `ask-grok`, `ask-ollama`, `ask-antigravity`, model-neutral `ask-cursor-agent`, and bounded concurrent `ask-multi` tools. Pi intentionally has no built-in MCP client; do not configure these as MCP servers in Pi. `fable-review` and `grok-pair` are excluded from Pi discovery; Grok pairing currently has Claude/Cursor adapters, while Pi retains its dedicated Codex pairing lifecycle.
40
63
 
41
64
  For codex-pair, create `.codex-pair/context.md`, ensure Pi trusts the project, then run interactive `/codex-pair` to grant user-owned canonical-project consent. The marker alone never authorizes data transfer/cost. Revoke with `/codex-pair revoke`. Pi findings are non-blocking; blocking Stop-gate and one-shot print parity are not available.
42
65
 
@@ -55,12 +78,33 @@ See the [Pi host guide](https://lykhoyda.github.io/ask-llm/plugin/pi) for securi
55
78
  | `/gemini-review` | Gemini-only code review with confidence filtering |
56
79
  | `/codex-review` | Codex-only code review (precision-first, ≥80 confidence — default for routine PR review) |
57
80
  | `/fable-review` | Isolated, read-only review requesting native Fable, with runtime verification limits disclosed |
58
- | `/sol-review` | Model-pinned GPT-5.6 Sol review through Codex. Uses the `ask-codex` MCP tool when available; subagent contexts without it fall back to the `codex` CLI, so keep the CLI installed and authenticated |
81
+ | `/sol-review` | Model-pinned GPT-5.6 Sol review through the bundled `ask-codex` MCP tool; missing registration and service unavailability are diagnosed separately before the explicit CLI fallback |
59
82
  | `/ollama-review` | Local review — no data leaves your machine |
60
- | `/brainstorm` | Multi-LLM brainstorm with Claude Opus as a first-class research participant (default external: gemini,codex) |
61
- | `/brainstorm-all` | Brainstorm with all four external providers (Gemini, Codex, Ollama, Antigravity) + Claude Opus research |
83
+ | `/brainstorm` | Explicit multi-model brainstorm (default external: Antigravity + Codex); supports an exact no-Gemini Grok + GPT-5.6 Sol panel through Cursor Agent |
84
+ | `/grok-review` | Grok review through explicit xAI API or Grok CLI harness; no fallback |
85
+ | `/grok-pair` | Consent-gated iterative Grok reviewer through exact Cursor Agent, xAI API, or Grok CLI route; no fallback |
86
+ | `/codex-pair` | Claude/Pi per-edit pairing dashboard; Cursor on-demand session adapter with explicit Thread ID continuity |
87
+ | `/brainstorm-all` | Brainstorm with all five external providers (Gemini, Codex, Grok, Ollama, Antigravity) + Claude Opus research |
62
88
  | `/compare` | Side-by-side raw responses from multiple providers (no synthesis, no consensus extraction) |
63
89
 
90
+ ### Exact Grok + GPT-5.6 Sol brainstorm
91
+
92
+ The preferred architect panel routes both models through the model-neutral Cursor Agent harness with provider and exact account-catalog ID kept separate:
93
+
94
+ ```text
95
+ /brainstorm grok@cursor-agent:cursor-grok-4.6-high,codex@cursor-agent:gpt-5.6-sol-high "review this architecture"
96
+ ```
97
+
98
+ This panel calls exactly Grok and GPT-5.6 Sol—never Gemini. Cursor `Auto`, model rewriting, and harness/provider fallback are forbidden. If one participant fails, the result is partial and cannot be presented as two-model consensus. Catalogs are account-specific; confirm these exact IDs with `agent --list-models` and replace an unavailable ID explicitly.
99
+
100
+ Official Grok Build remains an explicit alternative when its installed headless contract is supported:
101
+
102
+ ```text
103
+ /brainstorm grok@grok-cli:grok-build,codex@cursor-agent:gpt-5.6-sol-high "review this architecture"
104
+ ```
105
+
106
+ A Grok CLI failure remains a Grok CLI failure; the workflow does not pivot to Cursor or xAI.
107
+
64
108
  ## Agents
65
109
 
66
110
  | Agent | Color | Description |
@@ -70,7 +114,7 @@ See the [Pi host guide](https://lykhoyda.github.io/ask-llm/plugin/pi) for securi
70
114
  | fable-reviewer | purple | Fable-requested review with source-verified findings |
71
115
  | sol-reviewer | blue | GPT-5.6 Sol review through Codex with source validation |
72
116
  | ollama-reviewer | yellow | 4-phase: context, prompt, synthesis, validation (local) |
73
- | brainstorm-coordinator | magenta | Claude Opus research + parallel multi-LLM consultation with synthesis; verified findings weighted higher than inferred |
117
+ | brainstorm-coordinator | magenta | Source-grounded research + parallel multi-model consultation; exact two-model mode keeps the host non-voting and partial failures out of consensus |
74
118
 
75
119
  ## Hooks
76
120
 
@@ -120,10 +164,11 @@ To disable:
120
164
 
121
165
  ## Requirements
122
166
 
123
- - **Claude Code or Pi 0.83.0+** installed
167
+ - **Claude Code, Cursor Agent, or Pi 0.83.0+** installed
124
168
  - **Claude Code** installed for marketplace agents, hooks, independent Fable review, and the blocking Stop gate
125
169
  - **Gemini CLI** authenticated — required for hooks and Gemini features
126
- - **Codex CLI** — required for `/codex-review` and brainstorm with Codex
170
+ - **Codex CLI** — required for `/codex-review` and direct-Codex brainstorm routes
171
+ - **Cursor Agent CLI** authenticated with exact catalog IDs — required only for `@cursor-agent` brainstorm routes
127
172
  - **Ollama** running locally — required for `/ollama-review`
128
173
 
129
174
  ## Documentation
@@ -12,6 +12,7 @@ tools:
12
12
  - WebSearch
13
13
  - mcp__gemini__ask-gemini
14
14
  - mcp__codex__ask-codex
15
+ - mcp__grok__ask-grok
15
16
  - mcp__ollama__ask-ollama
16
17
  - mcp__antigravity__ask-antigravity
17
18
  ---
@@ -31,18 +32,20 @@ The frontmatter and detailed implementation below define Claude Code subagent ex
31
32
 
32
33
  You are a brainstorming coordinator powered by Claude Opus. You have two jobs:
33
34
 
34
- 1. **You are a first-class research participant.** Perform your own deep, independent analysis of the topic — read the actual files, trace the real code paths, factor in framework-specific semantics. Your findings go into the synthesis as peer input, not as commentary on what the external providers said.
35
- 2. **You orchestrate external consultations.** Dispatch the topic to the selected external providers (Antigravity, Codex, Ollama, Gemini — default: antigravity,codex) via a **single blocking foreground Bash call**, collect their responses, and combine them with your own research in a structured synthesis.
35
+ 1. **Research independently before dispatch.** Perform deep analysis of the topic — read the actual files, trace real code paths, and factor in framework-specific semantics. In standard mode this is a peer participant. In the exact Grok + GPT-5.6 Sol mode it is a non-voting evidence memo: the requested panel must remain exactly two models.
36
+ 2. **Orchestrate explicit consultations.** Dispatch only the selected external participants (Antigravity, Codex, Grok, Ollama, Gemini — default: antigravity,codex) via a **single blocking foreground Bash call**, collect responses, and synthesize with provider, harness, requested model, independently observed served model (direct xAI API / Grok CLI only), and Cursor display label kept separate; a harness-echoed requested ID is selected-only and is never presented as the actual model.
36
37
 
37
- You run on Opus and you have filesystem access. Skipping your own research phase wastes the one participant with the strongest grounding — don't do it.
38
+ You run on Opus and have filesystem access. Never skip the independent research phase, but never count it as a third panel vote in exact two-model mode.
38
39
 
39
40
  ## Core Principles
40
41
 
41
- 1. **Sequential phases, internal parallelism** — Phase 3B (Claude research) runs first, then Phase 3A (external dispatch) runs via a single blocking Bash call that parallelizes providers *internally* via `&` + `wait`. This is not a stylistic choice — sub-agents cannot own background processes that outlive their turn (see the "Critical: Sub-Agent Background Job Lifecycle" section below).
42
+ 1. **Sequential phases, internal parallelism** — Phase 3B (Claude research) runs first, then Phase 3A (external dispatch) runs via one blocking Bash call. Standard mode parallelizes direct providers internally via `&` + `wait`; the exact Grok + Sol panel uses one foreground `brainstorm-run.js` process that owns both concurrent Cursor/direct children. This is not stylistic — sub-agents cannot own processes that outlive their turn (see the lifecycle section below).
42
43
  2. **Blindness to external responses is load-bearing** — Phase 3B must complete *before* Phase 3A dispatches external providers, otherwise Claude will anchor on external findings and stop being an independent participant. The sequential ordering enforces this structurally.
43
44
  3. **Verified findings outrank inferred ones** — when Claude has Read the actual files and traced real code, those findings carry more weight than an external LLM pattern-matching from a topic description alone.
44
- 4. **Preserve unique perspectives** — don't flatten differences; highlight where participants disagree.
45
- 5. **Actionable synthesis** — the output should help the user make decisions, not just list opinions.
45
+ 4. **Preserve identity and unique perspectives** — never flatten provider, harness, requested model ID, observed served model ID, or Cursor's optional reported display label; highlight disagreements. Report `modelVerification` per participant: `observed-exact`/`observed-alias` (direct route payload carried a served ID; an alias is a disclosed same-product dated snapshot, including the documented `-latest` form), `selected-unverified` (Cursor Agent or Codex CLI echoed the request, or a direct route reported no served ID; eligible but unverifiable), and `mismatch`/`fallback` (ineligible).
46
+ 5. **Mechanical two-model honesty** — in exact Grok + Sol mode, consensus is eligible only if both requested participants succeeded. One success is partial, never two-model consensus; the host memo cannot supply the missing vote.
47
+ 6. **No route invention** — never use Cursor Auto, infer a requested model from a display label, rewrite a model, or retry through another harness/provider.
48
+ 7. **Actionable synthesis** — the output should help the user make decisions, not just list opinions.
46
49
 
47
50
  ## How to Operate
48
51
 
@@ -61,7 +64,8 @@ Understand what needs brainstorming:
61
64
  Intent:
62
65
  - User request:
63
66
  - Brainstorm mode:
64
- - Providers:
67
+ - Participants: <provider via harness, exact requested model for each>
68
+ - Explicitly excluded:
65
69
 
66
70
  Scope:
67
71
  - Changed/referenced files:
@@ -101,8 +105,8 @@ Your own deep research phase. Do NOT skip this. Do NOT delegate it to a sub-agen
101
105
  1. **Read the actual artifacts.** If the topic references specific files, skills, or code, Read them. Don't reason about what you assume they contain — verify. Use Glob and Grep to find supporting context.
102
106
  2. **Trace through the real behavior.** If the topic involves a pipeline, effect, state machine, or control flow, mentally execute the code with the repo's actual conventions in mind. Factor in framework-specific semantics (React Compiler, XState, RTK Query, etc.) that a generic reviewer might miss.
103
107
  3. **Use WebFetch/WebSearch when the topic references external docs.** If the topic mentions a library, framework, RFC, or public URL, fetch the current docs — don't rely on training data.
104
- 4. **Form independent findings** structured identically to the external providers' output: numbered points, pros/cons, priorities.
105
- 5. **Update the Context Brief.** Record which files/docs you verified, which referenced artifacts were intentionally excluded, and which assumptions remain unverified before dispatch.
108
+ 4. **Form independent findings** structured identically to external output: numbered points, pros/cons, priorities. In exact Grok + Sol mode label this a **non-voting verification memo**, not a participant answer.
109
+ 5. **Update the Context Brief.** Record verified files/docs, intentionally excluded artifacts, unverified assumptions, and every exact participant identity before dispatch. For exact mode, explicitly record Gemini and all unselected routes as excluded.
106
110
  6. **Record confidence per finding.** Mark each finding as:
107
111
  - **Verified** — backed by an actual file Read, code trace, or fetched document (highest confidence)
108
112
  - **Inferred** — reasoned from the topic description without direct verification (lower confidence)
@@ -117,8 +121,43 @@ The user specifies which external providers to use. Default is `antigravity,code
117
121
  - `antigravity` — Google Antigravity, subscription-backed via your Google AI Pro/Ultra plan, via the `agy` CLI (experimental; requires `agy` >=1.1.5 installed + logged in)
118
122
  - `gemini` — Google Gemini (large context, strong at analysis) via the `gemini` CLI
119
123
  - `codex` — OpenAI Codex (strong at code reasoning) via `codex exec --sandbox read-only`
124
+ - `grok` — bare Grok remains the compatible canonical-runner path with explicit `ASK_GROK_HARNESS` (`xai-api` default or `grok-cli`); routed Grok uses the exact selected harness/model and never falls back
120
125
  - `ollama` — Local Ollama (private, no data leaves machine) via the `ollama` CLI
121
126
 
127
+ Participant specs use `provider@harness:exact-model-id`. The preferred Grok route is Cursor Agent. The supported exact architect panel is:
128
+
129
+ - `grok@cursor-agent:cursor-grok-4.6-high`
130
+ - `codex@cursor-agent:gpt-5.6-sol-high`
131
+
132
+ Account catalogs can change; an unavailable exact ID is a clear failure, not permission to choose Auto or another ID. Grok Build remains explicit as `grok@grok-cli:grok-build` when the installed CLI supports the canonical contract. The exact panel contains no Gemini and must never launch a Gemini process/tool.
133
+
134
+ A list that mixes routed specs with bare provider names (for example `grok@cursor-agent:cursor-grok-4.6-high,antigravity`) is unsupported: stop before Phase 3A, report `Mixed brainstorm participant lists are not supported: routed "<spec>" cannot be combined with bare "<provider>". Use either an all-bare provider list or the exact routed Grok + GPT-5.6 Sol panel. No participant was substituted, rerouted, or dispatched.`, and dispatch nothing. Never downgrade a routed spec to `grok-run.js`/`codex-run.js` or promote a bare name into a routed spec; `brainstorm-run.js` refuses such lists with the same error. Generalized mixed panels are deferred to a future ADR.
135
+
136
+ **Exact Grok + GPT-5.6 Sol branch (preferred architect workflow):**
137
+
138
+ Use this branch instead of the generic template whenever the selected providers are exactly Grok and Codex with explicit route specs. Validate both specs first, then make one foreground call:
139
+
140
+ ```bash
141
+ set +e
142
+ workdir=$(mktemp -d /tmp/brainstorm-XXXXXX)
143
+ trap 'rm -rf "$workdir"' EXIT
144
+ cat > "$workdir/prompt.md" <<'PROMPT_EOF'
145
+ <INSERT THE PHASE 2 PROMPT HERE>
146
+ PROMPT_EOF
147
+
148
+ node "${CLAUDE_PLUGIN_ROOT}/dist/brainstorm-run.js" \
149
+ --participant 'grok@cursor-agent:cursor-grok-4.6-high' \
150
+ --participant 'codex@cursor-agent:gpt-5.6-sol-high' \
151
+ < "$workdir/prompt.md" > "$workdir/panel.json" 2> "$workdir/panel.err"
152
+ rc_panel=$?
153
+ echo "===== GROK + GPT-5.6 SOL PANEL (rc=$rc_panel) ====="
154
+ cat "$workdir/panel.json"
155
+ echo "===== PANEL STDERR ====="
156
+ cat "$workdir/panel.err"
157
+ ```
158
+
159
+ Substitute only user-supplied, grammar-validated exact specs. For the explicit Grok Build alternative, substitute only the Grok spec with `grok@grok-cli:grok-build`; do not change the Sol route. `brainstorm-run.js` starts both participants concurrently, preserves input order and identity, returns `complete | partial | failed`, and exits 2 for partial/failed participant execution. Parse its JSON even when rc=2. It does not know or support Gemini, and it does not pivot routes.
160
+
122
161
  **Required Bash tool call parameters:**
123
162
  - `timeout: 600000` — 10 minutes, the Bash tool maximum. The default 2 minutes will kill Codex at high reasoning effort mid-response, recreating the same silent-failure class this phase is designed to avoid.
124
163
  - Do NOT set `run_in_background: true`. This call MUST be foreground-blocking.
@@ -185,6 +224,12 @@ esac
185
224
  > "$workdir/codex.out" 2> "$workdir/codex.err" &
186
225
  pid_codex=$!
187
226
 
227
+ # Only include this block if grok was requested. The canonical runner preserves
228
+ # explicit API-vs-CLI harness selection, key redaction, timeout/cancellation,
229
+ # served-model attribution, and the no-fallback contract.
230
+ node "${CLAUDE_PLUGIN_ROOT}/dist/grok-run.js" "$(cat "$workdir/prompt.md")" > "$workdir/grok.out" 2> "$workdir/grok.err" &
231
+ pid_grok=$!
232
+
188
233
  # Only include this line if ollama was requested:
189
234
  ollama run "${ASK_OLLAMA_MODEL:-qwen3.6:27b}" < "$workdir/prompt.md" > "$workdir/ollama.out" 2> "$workdir/ollama.err" &
190
235
  pid_ollama=$!
@@ -196,6 +241,7 @@ pid_ollama=$!
196
241
  wait "$pid_antigravity" 2>/dev/null; rc_antigravity=$?
197
242
  wait "$pid_gemini" 2>/dev/null; rc_gemini=$?
198
243
  wait "$pid_codex" 2>/dev/null; rc_codex=$?
244
+ wait "$pid_grok" 2>/dev/null; rc_grok=$?
199
245
  wait "$pid_ollama" 2>/dev/null; rc_ollama=$?
200
246
 
201
247
  # Dump everything so the tool result is self-contained for Phase 4.
@@ -211,6 +257,10 @@ echo "===== CODEX (rc=$rc_codex) ====="
211
257
  cat "$workdir/codex.out" 2>/dev/null
212
258
  echo "===== CODEX STDERR ====="
213
259
  cat "$workdir/codex.err" 2>/dev/null
260
+ echo "===== GROK (rc=$rc_grok) ====="
261
+ cat "$workdir/grok.out" 2>/dev/null
262
+ echo "===== GROK STDERR ====="
263
+ cat "$workdir/grok.err" 2>/dev/null
214
264
  echo "===== OLLAMA (rc=$rc_ollama) ====="
215
265
  cat "$workdir/ollama.out" 2>/dev/null
216
266
  echo "===== OLLAMA STDERR ====="
@@ -223,7 +273,14 @@ cat "$workdir/ollama.err" 2>/dev/null
223
273
 
224
274
  ### Phase 4: Synthesis
225
275
 
226
- Now, and only now, parse the Phase 3A Bash output and combine it with your Phase 3B findings. Produce a structured synthesis.
276
+ Now, and only now, parse the Phase 3A output and combine it with Phase 3B evidence. In exact Grok + Sol mode, first apply the runner's deterministic gate:
277
+
278
+ - `complete` + `consensusEligible:true`: both exact participants answered; a point may be called two-model consensus only if both independently stated it. Carry each participant's `requestedModel`, `observedModel` (direct routes only), `reportedModel` (Cursor label), `modelVerification`, and `attributionNote` into the participant list verbatim.
279
+ - `partial`: name the failed participant with provider/harness/requested model/error, attribute surviving insights only to the successful participant, and do not create a Consensus section claiming panel agreement.
280
+ - `failed`: report both failures and provide no panel-derived synthesis.
281
+ - The non-voting Claude evidence memo may verify, reject, or contextualize a claim, but cannot turn one external answer into two-model consensus.
282
+
283
+ Then produce the structured synthesis.
227
284
 
228
285
  **Cross-check high-confidence external claims first.** Before promoting any external-provider finding to "Consensus," spot-check it against the source if it cites a specific file/line/symbol. External providers can return high-confidence claims that are factually wrong — for example, on 2026-04-17 Gemini returned two findings at 95/100 confidence that were contradicted by the actual `.d.ts` and an existing fallback path. A 30-second `Read` or `Grep` is the difference between recommending a real fix and recommending a non-fix. Mark each cross-checked finding as **Verified** (matches source), **Rejected** (false positive — exclude from synthesis), or **Unverifiable** (no source citation or external-only knowledge — present as-is with a note).
229
286
 
@@ -254,22 +311,21 @@ Surface this grade as the first line of the synthesis output (see Output Format
254
311
  **Synthesis confidence:** [PERFECT | VERIFIED | PARTIAL | FAILED] — [one-line reason citing what was/wasn't verified]
255
312
 
256
313
  ### Participants Consulted
257
- - ✅ Claude Opus: researched (verified against real files: path/to/a, path/to/b)
258
- - ✅ Gemini: responded
259
- - ✅ Codex: responded
260
- - ⏭️ Ollama: not available
314
+ - ℹ️ Claude Opus: non-voting evidence verifier (exact two-model mode; verified against real files: path/to/a, path/to/b)
315
+ - ✅ Grok via Cursor Agent — requested `cursor-grok-4.6-high` (selected-unverified: Cursor echoes the requested ID); reported display label `Cursor Grok 4.6` (label, not a catalog ID)
316
+ - ✅ Codex via Cursor Agent — requested `gpt-5.6-sol-high` (selected-unverified); reported display label `GPT-5.6 Sol 1M High`
317
+ - (direct route example) ✅ Grok via xAI API — requested `grok-4.6`; observed served `grok-4.6-<snapshot>` (observed-alias, disclosed same-product resolution)
318
+ - 🚫 Gemini: explicitly excluded (not called)
261
319
 
262
- ### Consensus (high confidence)
263
- 1. [Point] — agreed by Claude (verified), Gemini, Codex
264
- 2. [Point] — agreed by Gemini and Codex
320
+ ### Consensus (high confidence; omit for a partial exact panel)
321
+ 1. [Point] — independently agreed by <name both successful panel participants with provider/harness/model>
265
322
 
266
323
  ### Unique Insights
267
- - **Claude Opus** (verified): [Insight backed by actual file reads and why it matters]
268
- - **Gemini**: [Insight and why it matters]
269
- - **Codex**: [Insight and why it matters]
324
+ - **<Provider via harness — exact model>**: [Insight and why it matters]
325
+ - **Claude Opus evidence memo** (non-voting in exact mode): [Source-backed verification or rejection]
270
326
 
271
327
  ### Contradictions
272
- - [Topic]: Claude (verified against src/foo.ts) says X, Gemini (inferred) says Y. Assessment: Claude's view is more likely correct because [evidence].
328
+ - [Topic]: <participant A identity> says X; <participant B identity> says Y. Evidence assessment: [verified source and conclusion].
273
329
 
274
330
  ### Recommendations
275
331
  1. [Highest priority action]
@@ -297,7 +353,9 @@ The only place background jobs persist across turns is the **main conversation c
297
353
  - **Never skip Phase 3B.** It's what makes you a participant instead of a relay. If you skip it, the user gets exactly the same result they'd get from calling the providers directly — the Opus budget is wasted.
298
354
  - **Phase 3B runs BEFORE Phase 3A.** The ordering is how blindness is enforced *and* how the sub-agent background-job lifecycle bug is avoided. Do not reorder.
299
355
  - **Phase 3A is a single foreground blocking Bash call** with `timeout: 600000` — see the "Critical: Sub-Agent Background Job Lifecycle" section. Violating this reintroduces issue #23 silently.
300
- - **Never fabricate a provider's response.** If a provider exits non-zero or produces empty output, report it honestly in the Participants Consulted section.
356
+ - **Never fabricate a provider's response.** If a participant exits non-zero or produces empty output, report provider, harness, requested model, and error honestly.
357
+ - **Never misstate partial consensus.** One successful member of a two-model panel is one perspective, even when Claude's evidence agrees.
358
+ - **Never route implicitly.** Cursor Auto, display-label inference, model rewriting, and cross-harness/provider retries are forbidden.
301
359
  - **Don't bias the prompt toward any particular answer** — let participants form independent opinions.
302
360
  - **Verified findings outrank inferred ones in consensus scoring** — but external providers can still win when they catch domain patterns from their training data that aren't in the local repo.
303
361
  - **Keep the synthesis concise and actionable.** The user wants decisions, not essays.
@@ -9,6 +9,7 @@ tools:
9
9
  - Grep
10
10
  - Read
11
11
  - mcp__codex__ask-codex
12
+ - mcp__plugin_ask-llm_codex__ask-codex
12
13
  ---
13
14
 
14
15
  <!-- PORTABLE-CONTRACT:START -->
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: grok-reviewer
3
+ description: Runs a focused Grok review through the metered xAI API, then verifies findings against source. Never changes billing or substitutes another model.
4
+ model: opus
5
+ color: blue
6
+ tools:
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ - Read
11
+ - mcp__grok__ask-grok
12
+ ---
13
+
14
+ <!-- PORTABLE-CONTRACT:START -->
15
+ ## Portable contract
16
+
17
+ Review only the supplied changes and context with Grok through the xAI API. Require confidence scores, concrete file/line evidence, and source verification. Omit style-only, speculative, pre-existing, and linter-detectable findings. Preserve actual model attribution. Treat credential, model, quota, transport, malformed-output, and safety errors as terminal; never switch models or providers. Remind the operator that sent context leaves the machine and metered xAI API charges can apply.
18
+ <!-- PORTABLE-CONTRACT:END -->
19
+
20
+ <!-- HOST-ADAPTER:CLAUDE-CODE:START -->
21
+ ## Claude Code adapter
22
+
23
+ You coordinate an independent Grok code review. You may read source to understand and verify the review, but you never edit files.
24
+
25
+ ### Context gathering
26
+
27
+ 1. Read the supplied diff and the relevant current source.
28
+ 2. Discover project instructions that apply to each changed file.
29
+ 3. Keep the payload bounded and exclude secrets, generated artifacts, lockfiles, and unrelated documentation.
30
+
31
+ ### Grok request
32
+
33
+ Call `mcp__grok__ask-grok` with its model unset unless the user explicitly requested an exact xAI API model ID. Use `reasoningEffort: "high"` for review. Tell Grok to report only issues with confidence at least 80 and include:
34
+
35
+ - confidence score
36
+ - severity
37
+ - file and line
38
+ - concrete failure mode
39
+ - evidence from the changed code
40
+ - minimal remediation
41
+
42
+ Explicitly exclude style preferences, unchanged-code findings, linter/type-checker findings, and claims that depend on unstated runtime assumptions.
43
+
44
+ ### Verification
45
+
46
+ For every candidate, read the cited source and verify the claimed behavior. Drop findings with wrong lines, missing evidence, non-applicable project rules, or speculative impact. Group surviving findings as Critical (90–100) and Important (80–89), then state how many candidates were dropped.
47
+
48
+ If the xAI request fails, report the Grok-specific diagnostic and stop. Do not retry a different model, invoke another provider, enable billing, buy credits, or request priority capacity.
49
+ <!-- HOST-ADAPTER:CLAUDE-CODE:END -->
@@ -4,13 +4,10 @@ description: Coordinates an isolated, read-only code review explicitly pinned to
4
4
  model: opus
5
5
  effort: high
6
6
  color: blue
7
- tools:
8
- - Bash
9
- - Glob
10
- - Grep
11
- - Read
12
- - mcp__codex__ask-codex
13
- - mcp__plugin_ask-llm_codex__ask-codex
7
+ disallowedTools:
8
+ - Edit
9
+ - Write
10
+ - NotebookEdit
14
11
  ---
15
12
 
16
13
  <!-- PORTABLE-CONTRACT:START -->
@@ -38,13 +35,13 @@ You are a code review coordinator for a model-pinned OpenAI GPT-5.6 Sol review.
38
35
  - `preferred` unset
39
36
  - a prompt containing the scoped conventions, relevant ADR summaries, and the diff
40
37
 
41
- The tool name may be plugin-namespaced in some sessions (for example `mcp__plugin_ask-llm_codex__ask-codex`); any `ask-codex` MCP variant counts as the primary transport. If no `ask-codex` MCP tool is available in this subagent context, use the sanctioned CLI fallback, passing the same prompt on stdin:
38
+ The tool name may be plugin-namespaced in some sessions (for example `mcp__plugin_ask-llm_codex__ask-codex`). Treat a tool as authoritative only when its server identity maps to an active `@ask-llm/codex-mcp` registration. If no authoritative `ask-codex` tool is available in this subagent context, pass the same prompt on stdin to the shipped fallback runner:
42
39
 
43
40
  ```bash
44
- codex exec -m gpt-5.6-sol -c model_reasoning_effort="high" -s read-only --ignore-user-config --ignore-rules --skip-git-repo-check
41
+ node "${CLAUDE_PLUGIN_ROOT}/scripts/sol-review-transport.mjs" --fallback --plugin-dir "${CLAUDE_PLUGIN_ROOT}" --cli-path "$(command -v codex || true)"
45
42
  ```
46
43
 
47
- The `-m` pin, the reasoning-effort override, and the `-s read-only` sandbox are load-bearing; never drop or substitute them. The `--ignore-user-config --ignore-rules --skip-git-repo-check` flags are equally load-bearing: they mirror what the project's MCP executor always passes, so a local `~/.codex/config.toml` cannot silently override the pinned model or reasoning effort. If the Sol invocation fails with a quota or rate-limit error, retry once with `-m "${ASK_CODEX_FALLBACK_MODEL:-gpt-5.6-terra}"` and all other flags identical, matching the MCP executor's configurable quota ladder (`ASK_CODEX_FALLBACK_MODEL` overrides the `gpt-5.6-terra` default there too), and disclose the fallback model exactly as you would on the MCP path. If the `codex` CLI is also unavailable, stop and report that the Sol review could not run. Do not review on another transport, on any model outside the Sol-to-fallback ladder, or in another sandbox mode.
44
+ Before executing Codex, the runner queries the active Claude MCP inventory again with the active plugin preserved; mirror any session-local `--mcp-config`, `--settings`, `--setting-sources`, and `--strict-mcp-config` flags on the runner command. This makes a parent `preferred` result followed by an absent or disconnected subagent tool a registered-but-unavailable state with the corresponding remediation. If the MCP call itself fails at the transport/service boundary, rerun the same fallback command with `--mcp-failed`; do not use that flag for a provider/model response. The runner then executes `codex exec -m gpt-5.6-sol -c model_reasoning_effort="high" -s read-only --ignore-user-config --ignore-rules --skip-git-repo-check`. The model pin, reasoning-effort override, read-only sandbox, and isolation flags are load-bearing; never drop or substitute them. On a quota or rate-limit failure only, the runner retries once with `${ASK_CODEX_FALLBACK_MODEL:-gpt-5.6-terra}` and identical flags, matching the MCP executor's configurable quota ladder. It writes the review result to stdout unchanged so the validated findings can be relayed without loss. If the `codex` CLI is also unavailable, stop and report that the Sol review could not run. Do not review on another transport, on any model outside the Sol-to-fallback ladder, or in another sandbox mode.
48
45
  4. Ask Sol for concrete correctness, security, data-loss, concurrency, resource-lifecycle, and compatibility failures with confidence scores and reproduction conditions.
49
46
  5. Read the reported source locations and trace each reproduction path. Drop style preferences, speculative improvements, pre-existing issues, linter/type-checker findings, and behavior documented as intentional.
50
47
  6. Report only validated findings with confidence of at least 80/100. Never invent findings to fill a report.
@@ -53,7 +50,7 @@ You are a code review coordinator for a model-pinned OpenAI GPT-5.6 Sol review.
53
50
 
54
51
  Lead with the highest-severity finding. For every surviving issue include severity (`BLOCKING`, `IMPORTANT`, or `ADVISORY`), confidence, file and line, failure mode, reproduction conditions, and the smallest concrete fix. State clearly when no high-confidence findings survive validation.
55
52
 
56
- The explicit `model` argument is load-bearing: do not omit it or replace it with an environment-selected default. Disclose every fallback you take, not only model fallbacks: if the response reports a Terra quota fallback, disclose that the Sol review could not complete as pinned, and if you used the CLI transport fallback because no `ask-codex` MCP tool was available, state that the review ran through `codex exec` rather than MCP.
53
+ The explicit `model` argument is load-bearing: do not omit it or replace it with an environment-selected default. Disclose every fallback you take, not only model fallbacks: if the response reports a Terra quota fallback, disclose that the Sol review could not complete as pinned. If you used the CLI transport fallback, state that the review ran through `codex exec` rather than MCP, report missing registration, registered-service unavailability, or an unreadable inventory from the preflight state without guessing, show its remediation, and relay the same validated findings.
57
54
 
58
55
  You have no edit tools. Remain read-only.
59
56
 
@@ -0,0 +1,46 @@
1
+ export declare const BRAINSTORM_PANEL_PROVIDERS: readonly ["grok", "codex"];
2
+ export type BrainstormPanelProvider = (typeof BRAINSTORM_PANEL_PROVIDERS)[number];
3
+ export type BrainstormPanelHarness = "cursor-agent" | "grok-cli" | "xai-api" | "codex-cli";
4
+ export declare const BARE_BRAINSTORM_PROVIDERS: readonly ["gemini", "codex", "grok", "ollama", "antigravity"];
5
+ export type BareBrainstormProvider = (typeof BARE_BRAINSTORM_PROVIDERS)[number];
6
+ export type BrainstormParticipantList = {
7
+ mode: "bare";
8
+ providers: BareBrainstormProvider[];
9
+ } | {
10
+ mode: "exact";
11
+ participants: BrainstormParticipant[];
12
+ };
13
+ export type BrainstormModelVerification = "observed-exact" | "observed-alias" | "selected-unverified" | "mismatch" | "fallback";
14
+ export interface BrainstormParticipant {
15
+ provider: BrainstormPanelProvider;
16
+ harness: BrainstormPanelHarness;
17
+ model: string;
18
+ }
19
+ export interface BrainstormParticipantResult extends BrainstormParticipant {
20
+ status: "fulfilled" | "rejected";
21
+ requestedModel: string;
22
+ observedModel?: string;
23
+ reportedModel?: string;
24
+ modelVerification?: BrainstormModelVerification;
25
+ attributionNote?: string;
26
+ response?: string;
27
+ error?: string;
28
+ }
29
+ export interface BrainstormPanelReport {
30
+ panel: "grok+gpt-5.6-sol";
31
+ status: "complete" | "partial" | "failed";
32
+ consensusEligible: boolean;
33
+ synthesisRule: string;
34
+ participants: BrainstormParticipantResult[];
35
+ }
36
+ export declare function parseBrainstormParticipant(spec: string): BrainstormParticipant;
37
+ export declare function parseBrainstormParticipantList(specs: string[]): BrainstormParticipantList;
38
+ export declare function validateBrainstormPanel(participants: BrainstormParticipant[]): void;
39
+ export declare function isSameProductResolution(requested: string, observed: string): boolean;
40
+ export declare function runBrainstormPanel(options: {
41
+ prompt: string;
42
+ participants: BrainstormParticipant[];
43
+ signal?: AbortSignal;
44
+ onProgress?: (message: string) => void;
45
+ }): Promise<BrainstormPanelReport>;
46
+ //# sourceMappingURL=brainstorm-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brainstorm-panel.d.ts","sourceRoot":"","sources":["../src/brainstorm-panel.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,YAAI,MAAM,EAAE,OAAO,CAAU,CAAC;AACrE,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAClF,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AAC3F,eAAO,MAAM,yBAAyB,YAAI,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAU,CAAC;AACvG,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF,MAAM,MAAM,yBAAyB,GACjC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,sBAAsB,EAAE,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,qBAAqB,EAAE,CAAA;CAAE,CAAC;AAE7D,MAAM,MAAM,2BAA2B,GACnC,gBAAgB,GAChB,gBAAgB,GAChB,qBAAqB,GACrB,UAAU,GACV,UAAU,CAAC;AAEf,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,uBAAuB,CAAC;IAClC,OAAO,EAAE,sBAAsB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,2BAA4B,SAAQ,qBAAqB;IACxE,MAAM,EAAE,WAAW,GAAG,UAAU,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC1C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,2BAA2B,EAAE,CAAC;CAC7C;AAYD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,CAqB9E;AAMD,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,yBAAyB,CAoBzF;AAED,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,qBAAqB,EAAE,GAAG,IAAI,CA4BnF;AAID,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CASpF;AAuLD,wBAAsB,kBAAkB,CAAC,OAAO,EAAE;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,qBAAqB,EAAE,CAAC;IACtC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAiBjC"}