@ask-llm/plugin 0.14.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,6 +1,6 @@
1
1
  {
2
2
  "name": "ask-llm",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
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",
@@ -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/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
 
@@ -23,9 +23,16 @@ Part of the [Ask LLM](https://github.com/Lykhoyda/ask-llm) monorepo.
23
23
 
24
24
  ### MCP Servers
25
25
 
26
- The plugin bundles the supported 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 and `/sol-review` will select its `ask-codex` tool automatically.
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
27
 
28
- Existing user-scoped Codex registrations remain compatible and keep the shorter `codex:ask-codex` name. The other provider servers are still registered explicitly at user scope:
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:
29
36
 
30
37
  ```bash
31
38
  claude mcp add --scope user gemini -- npx -y @ask-llm/gemini-mcp
@@ -33,6 +40,16 @@ claude mcp add --scope user ollama -- npx -y @ask-llm/ollama-mcp
33
40
  claude mcp add --scope user antigravity -- npx -y @ask-llm/antigravity-mcp
34
41
  ```
35
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
49
+ ```
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
+
36
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.
37
54
 
38
55
  ### Pi
@@ -42,7 +59,7 @@ pi install npm:@ask-llm/plugin
42
59
  pi list
43
60
  ```
44
61
 
45
- 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` 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.
46
63
 
47
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.
48
65
 
@@ -63,11 +80,31 @@ See the [Pi host guide](https://lykhoyda.github.io/ask-llm/plugin/pi) for securi
63
80
  | `/fable-review` | Isolated, read-only review requesting native Fable, with runtime verification limits disclosed |
64
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 |
65
82
  | `/ollama-review` | Local review — no data leaves your machine |
66
- | `/brainstorm` | Multi-LLM brainstorm with Claude Opus as a first-class research participant (default external: gemini,codex) |
83
+ | `/brainstorm` | Explicit multi-model brainstorm (default external: Antigravity + Codex); supports an exact no-Gemini Grok + GPT-5.6 Sol panel through Cursor Agent |
67
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 |
68
87
  | `/brainstorm-all` | Brainstorm with all five external providers (Gemini, Codex, Grok, Ollama, Antigravity) + Claude Opus research |
69
88
  | `/compare` | Side-by-side raw responses from multiple providers (no synthesis, no consensus extraction) |
70
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
+
71
108
  ## Agents
72
109
 
73
110
  | Agent | Color | Description |
@@ -77,7 +114,7 @@ See the [Pi host guide](https://lykhoyda.github.io/ask-llm/plugin/pi) for securi
77
114
  | fable-reviewer | purple | Fable-requested review with source-verified findings |
78
115
  | sol-reviewer | blue | GPT-5.6 Sol review through Codex with source validation |
79
116
  | ollama-reviewer | yellow | 4-phase: context, prompt, synthesis, validation (local) |
80
- | 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 |
81
118
 
82
119
  ## Hooks
83
120
 
@@ -127,10 +164,11 @@ To disable:
127
164
 
128
165
  ## Requirements
129
166
 
130
- - **Claude Code or Pi 0.83.0+** installed
167
+ - **Claude Code, Cursor Agent, or Pi 0.83.0+** installed
131
168
  - **Claude Code** installed for marketplace agents, hooks, independent Fable review, and the blocking Stop gate
132
169
  - **Gemini CLI** authenticated — required for hooks and Gemini features
133
- - **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
134
172
  - **Ollama** running locally — required for `/ollama-review`
135
173
 
136
174
  ## Documentation
@@ -32,18 +32,20 @@ The frontmatter and detailed implementation below define Claude Code subagent ex
32
32
 
33
33
  You are a brainstorming coordinator powered by Claude Opus. You have two jobs:
34
34
 
35
- 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.
36
- 2. **You orchestrate external consultations.** Dispatch the topic to the selected external providers (Antigravity, Codex, Grok, 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.
37
37
 
38
- 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.
39
39
 
40
40
  ## Core Principles
41
41
 
42
- 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).
43
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.
44
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.
45
- 4. **Preserve unique perspectives** — don't flatten differences; highlight where participants disagree.
46
- 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.
47
49
 
48
50
  ## How to Operate
49
51
 
@@ -62,7 +64,8 @@ Understand what needs brainstorming:
62
64
  Intent:
63
65
  - User request:
64
66
  - Brainstorm mode:
65
- - Providers:
67
+ - Participants: <provider via harness, exact requested model for each>
68
+ - Explicitly excluded:
66
69
 
67
70
  Scope:
68
71
  - Changed/referenced files:
@@ -102,8 +105,8 @@ Your own deep research phase. Do NOT skip this. Do NOT delegate it to a sub-agen
102
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.
103
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.
104
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.
105
- 4. **Form independent findings** structured identically to the external providers' output: numbered points, pros/cons, priorities.
106
- 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.
107
110
  6. **Record confidence per finding.** Mark each finding as:
108
111
  - **Verified** — backed by an actual file Read, code trace, or fetched document (highest confidence)
109
112
  - **Inferred** — reasoned from the topic description without direct verification (lower confidence)
@@ -118,9 +121,43 @@ The user specifies which external providers to use. Default is `antigravity,code
118
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)
119
122
  - `gemini` — Google Gemini (large context, strong at analysis) via the `gemini` CLI
120
123
  - `codex` — OpenAI Codex (strong at code reasoning) via `codex exec --sandbox read-only`
121
- - `grok` — Grok through the canonical runner and explicit `ASK_GROK_HARNESS` (`xai-api` default or `grok-cli`); may incur xAI API/plan usage and never falls back
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
122
125
  - `ollama` — Local Ollama (private, no data leaves machine) via the `ollama` CLI
123
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
+
124
161
  **Required Bash tool call parameters:**
125
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.
126
163
  - Do NOT set `run_in_background: true`. This call MUST be foreground-blocking.
@@ -189,7 +226,7 @@ pid_codex=$!
189
226
 
190
227
  # Only include this block if grok was requested. The canonical runner preserves
191
228
  # explicit API-vs-CLI harness selection, key redaction, timeout/cancellation,
192
- # actual model attribution, and the no-fallback contract.
229
+ # served-model attribution, and the no-fallback contract.
193
230
  node "${CLAUDE_PLUGIN_ROOT}/dist/grok-run.js" "$(cat "$workdir/prompt.md")" > "$workdir/grok.out" 2> "$workdir/grok.err" &
194
231
  pid_grok=$!
195
232
 
@@ -236,7 +273,14 @@ cat "$workdir/ollama.err" 2>/dev/null
236
273
 
237
274
  ### Phase 4: Synthesis
238
275
 
239
- 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.
240
284
 
241
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).
242
286
 
@@ -267,22 +311,21 @@ Surface this grade as the first line of the synthesis output (see Output Format
267
311
  **Synthesis confidence:** [PERFECT | VERIFIED | PARTIAL | FAILED] — [one-line reason citing what was/wasn't verified]
268
312
 
269
313
  ### Participants Consulted
270
- - ✅ Claude Opus: researched (verified against real files: path/to/a, path/to/b)
271
- - ✅ Gemini: responded
272
- - ✅ Codex: responded
273
- - ⏭️ 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)
274
319
 
275
- ### Consensus (high confidence)
276
- 1. [Point] — agreed by Claude (verified), Gemini, Codex
277
- 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>
278
322
 
279
323
  ### Unique Insights
280
- - **Claude Opus** (verified): [Insight backed by actual file reads and why it matters]
281
- - **Gemini**: [Insight and why it matters]
282
- - **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]
283
326
 
284
327
  ### Contradictions
285
- - [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].
286
329
 
287
330
  ### Recommendations
288
331
  1. [Highest priority action]
@@ -310,7 +353,9 @@ The only place background jobs persist across turns is the **main conversation c
310
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.
311
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.
312
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.
313
- - **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.
314
359
  - **Don't bias the prompt toward any particular answer** — let participants form independent opinions.
315
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.
316
361
  - **Keep the synthesis concise and actionable.** The user wants decisions, not essays.
@@ -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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,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"}
@@ -0,0 +1,247 @@
1
+ import { executeCodexCLI } from "@ask-llm/codex-mcp/executor";
2
+ import { executeGrok } from "@ask-llm/grok-mcp/executor";
3
+ import { executeCursorAgent } from "@ask-llm/mcp/cursor";
4
+ export const BRAINSTORM_PANEL_PROVIDERS = ["grok", "codex"];
5
+ export const BARE_BRAINSTORM_PROVIDERS = ["gemini", "codex", "grok", "ollama", "antigravity"];
6
+ const SYNTHESIS_RULE = "Call a point two-model consensus only when both requested participants fulfilled successfully and independently stated it. On any participant failure, label the run partial and attribute surviving insights to that participant only.";
7
+ function routeAllowed(participant) {
8
+ if (participant.provider === "grok") {
9
+ return ["cursor-agent", "grok-cli", "xai-api"].includes(participant.harness);
10
+ }
11
+ return ["cursor-agent", "codex-cli"].includes(participant.harness);
12
+ }
13
+ export function parseBrainstormParticipant(spec) {
14
+ const match = spec.match(/^(grok|codex)@(cursor-agent|grok-cli|xai-api|codex-cli):(.+)$/);
15
+ if (!match) {
16
+ throw new Error(`Invalid brainstorm participant "${spec}". Use provider@harness:exact-model-id (for example grok@cursor-agent:cursor-grok-4.6-high).`);
17
+ }
18
+ const participant = {
19
+ provider: match[1],
20
+ harness: match[2],
21
+ model: match[3].trim(),
22
+ };
23
+ if (!participant.model || participant.model.toLowerCase() === "auto") {
24
+ throw new Error(`Participant "${spec}" requires an exact non-Auto model ID from the selected harness catalog.`);
25
+ }
26
+ if (!routeAllowed(participant)) {
27
+ throw new Error(`Unsupported brainstorm route ${participant.provider}@${participant.harness}. Harness, provider, and model are not interchangeable; no substitute route was selected.`);
28
+ }
29
+ return participant;
30
+ }
31
+ function isBareProvider(spec) {
32
+ return BARE_BRAINSTORM_PROVIDERS.includes(spec);
33
+ }
34
+ export function parseBrainstormParticipantList(specs) {
35
+ const trimmed = specs.map((spec) => spec.trim()).filter(Boolean);
36
+ if (trimmed.length === 0)
37
+ throw new Error("The brainstorm participant list is empty.");
38
+ const bare = trimmed.filter((spec) => !spec.includes("@"));
39
+ const routed = trimmed.filter((spec) => spec.includes("@"));
40
+ if (bare.length > 0 && routed.length > 0) {
41
+ throw new Error(`Mixed brainstorm participant lists are not supported: routed ${routed.map((spec) => `"${spec}"`).join(", ")} cannot be combined with bare ${bare.map((spec) => `"${spec}"`).join(", ")}. Use either an all-bare provider list or the exact routed Grok + GPT-5.6 Sol panel. No participant was substituted, rerouted, or dispatched.`);
42
+ }
43
+ if (routed.length > 0) {
44
+ return { mode: "exact", participants: routed.map(parseBrainstormParticipant) };
45
+ }
46
+ const unknown = bare.find((spec) => !isBareProvider(spec));
47
+ if (unknown) {
48
+ throw new Error(`Unknown brainstorm provider "${unknown}". Supported bare providers: ${BARE_BRAINSTORM_PROVIDERS.join(", ")}; routed participants use provider@harness:exact-model-id. No substitute was selected.`);
49
+ }
50
+ return { mode: "bare", providers: bare.filter(isBareProvider) };
51
+ }
52
+ export function validateBrainstormPanel(participants) {
53
+ if (participants.length !== 2) {
54
+ throw new Error("The Grok + GPT-5.6 Sol panel requires exactly two participants.");
55
+ }
56
+ const providers = participants.map(({ provider }) => provider);
57
+ if (new Set(providers).size !== providers.length) {
58
+ throw new Error("The Grok + GPT-5.6 Sol panel requires one Grok participant and one Codex participant.");
59
+ }
60
+ for (const required of BRAINSTORM_PANEL_PROVIDERS) {
61
+ if (!providers.includes(required)) {
62
+ throw new Error(`The Grok + GPT-5.6 Sol panel is missing provider "${required}".`);
63
+ }
64
+ }
65
+ for (const participant of participants) {
66
+ if (!participant.model.trim() || participant.model.toLowerCase() === "auto") {
67
+ throw new Error(`${participant.provider}@${participant.harness} requires an exact non-Auto model ID.`);
68
+ }
69
+ if (!routeAllowed(participant)) {
70
+ throw new Error(`Unsupported brainstorm route ${participant.provider}@${participant.harness}. No provider or harness fallback was attempted.`);
71
+ }
72
+ if (participant.provider === "codex" && !participant.model.toLowerCase().includes("gpt-5.6-sol")) {
73
+ throw new Error(`The Codex participant must request an exact GPT-5.6 Sol model ID; received "${participant.model}". No model substitution was attempted.`);
74
+ }
75
+ }
76
+ }
77
+ const LATEST_ALIAS_SUFFIX = "-latest";
78
+ export function isSameProductResolution(requested, observed) {
79
+ const requestedId = requested.trim().toLowerCase();
80
+ const observedId = observed.trim().toLowerCase();
81
+ if (requestedId === observedId)
82
+ return true;
83
+ const productId = requestedId.endsWith(LATEST_ALIAS_SUFFIX)
84
+ ? requestedId.slice(0, -LATEST_ALIAS_SUFFIX.length)
85
+ : requestedId;
86
+ if (!productId || !observedId.startsWith(`${productId}-`))
87
+ return false;
88
+ return /^[0-9][0-9.-]*$/.test(observedId.slice(productId.length + 1));
89
+ }
90
+ function classifyObservedModel(participant, observedModel) {
91
+ const identity = `${participant.provider} via ${participant.harness}`;
92
+ if (observedModel.trim().toLowerCase() === participant.model.trim().toLowerCase()) {
93
+ return {
94
+ modelVerification: "observed-exact",
95
+ attributionNote: `${identity} reported served model "${observedModel}", matching the requested ID.`,
96
+ };
97
+ }
98
+ if (isSameProductResolution(participant.model, observedModel)) {
99
+ return {
100
+ modelVerification: "observed-alias",
101
+ attributionNote: `${identity} served "${observedModel}" for requested "${participant.model}" (disclosed provider-side alias/snapshot resolution of the same model; the requested ID was sent unchanged and was not rewritten).`,
102
+ };
103
+ }
104
+ throw new Error(`${identity} requested exact model "${participant.model}" but reported "${observedModel}". The response is excluded from two-model consensus; no additional route was attempted.`);
105
+ }
106
+ function selectedOnlyNote(participant, detail) {
107
+ return `${participant.provider} via ${participant.harness} ran the requested ID "${participant.model}" (${detail}); the harness does not independently confirm the served catalog model, so this attribution is selected-only and unverifiable, not an observed actual model.`;
108
+ }
109
+ async function invokeParticipant(participant, prompt, signal, onProgress) {
110
+ const identity = `${participant.provider} via ${participant.harness} (${participant.model})`;
111
+ const progress = onProgress ? (message) => onProgress(`[${identity}] ${message}`) : undefined;
112
+ const base = { ...participant, requestedModel: participant.model };
113
+ let observedModel;
114
+ let reportedModel;
115
+ let modelVerification;
116
+ try {
117
+ if (participant.harness === "cursor-agent") {
118
+ const result = await executeCursorAgent({
119
+ provider: participant.provider,
120
+ model: participant.model,
121
+ prompt,
122
+ signal,
123
+ onProgress: progress,
124
+ });
125
+ reportedModel = result.reportedModel;
126
+ if (result.usage.fellBack) {
127
+ modelVerification = "fallback";
128
+ throw new Error(`Cursor Agent reported a model fallback for requested "${participant.model}". The response is excluded from two-model consensus.`);
129
+ }
130
+ if (result.model !== participant.model) {
131
+ modelVerification = "mismatch";
132
+ throw new Error(`Cursor Agent ran "${result.model}" instead of requested "${participant.model}". The response is excluded from two-model consensus; no additional route was attempted.`);
133
+ }
134
+ modelVerification = "selected-unverified";
135
+ return {
136
+ ...base,
137
+ reportedModel,
138
+ modelVerification,
139
+ attributionNote: selectedOnlyNote(participant, reportedModel
140
+ ? `Cursor echoed the requested ID and reported display label "${reportedModel}", which is a label and not a catalog ID`
141
+ : "Cursor echoed the requested ID and reported no display label"),
142
+ response: result.response,
143
+ status: "fulfilled",
144
+ };
145
+ }
146
+ if (participant.provider === "grok") {
147
+ if (participant.harness !== "grok-cli" && participant.harness !== "xai-api") {
148
+ throw new Error(`Unsupported brainstorm route ${participant.provider}@${participant.harness}. No fallback was attempted.`);
149
+ }
150
+ const result = await executeGrok({
151
+ prompt,
152
+ model: participant.model,
153
+ harness: participant.harness,
154
+ reasoningEffort: "high",
155
+ signal,
156
+ onProgress: progress,
157
+ });
158
+ if (result.usage?.fellBack) {
159
+ modelVerification = "fallback";
160
+ throw new Error(`${participant.harness} reported a model fallback for requested "${participant.model}". The response is excluded from two-model consensus.`);
161
+ }
162
+ if (!result.reportedModel) {
163
+ if (result.model !== participant.model) {
164
+ modelVerification = "mismatch";
165
+ throw new Error(`${participant.provider} via ${participant.harness} ran "${result.model}" instead of requested "${participant.model}". The response is excluded from two-model consensus; no additional route was attempted.`);
166
+ }
167
+ modelVerification = "selected-unverified";
168
+ return {
169
+ ...base,
170
+ modelVerification,
171
+ attributionNote: selectedOnlyNote(participant, `${participant.harness} reported no served model ID, so only the requested ID is known`),
172
+ response: result.response,
173
+ status: "fulfilled",
174
+ };
175
+ }
176
+ observedModel = result.reportedModel;
177
+ let observed;
178
+ try {
179
+ observed = classifyObservedModel(participant, observedModel);
180
+ }
181
+ catch (error) {
182
+ modelVerification = "mismatch";
183
+ throw error;
184
+ }
185
+ modelVerification = observed.modelVerification;
186
+ return {
187
+ ...base,
188
+ observedModel,
189
+ modelVerification,
190
+ attributionNote: observed.attributionNote,
191
+ response: result.response,
192
+ status: "fulfilled",
193
+ };
194
+ }
195
+ const result = await executeCodexCLI({
196
+ prompt,
197
+ model: participant.model,
198
+ reasoningEffort: "high",
199
+ sandbox: "read-only",
200
+ signal,
201
+ onProgress: progress,
202
+ });
203
+ if (result.usage?.fellBack) {
204
+ modelVerification = "fallback";
205
+ throw new Error(`Codex CLI reported a model fallback to "${result.usage.model}" for requested "${participant.model}". The response is excluded from two-model consensus.`);
206
+ }
207
+ if (result.usage && result.usage.model !== participant.model) {
208
+ modelVerification = "mismatch";
209
+ throw new Error(`Codex CLI ran "${result.usage.model}" instead of requested "${participant.model}". The response is excluded from two-model consensus; no additional route was attempted.`);
210
+ }
211
+ modelVerification = "selected-unverified";
212
+ return {
213
+ ...base,
214
+ modelVerification,
215
+ attributionNote: selectedOnlyNote(participant, result.usage
216
+ ? "Codex CLI echoed the requested ID with no fallback"
217
+ : "served from the Codex response cache keyed by the requested ID, which stores only no-fallback responses"),
218
+ response: result.response,
219
+ status: "fulfilled",
220
+ };
221
+ }
222
+ catch (error) {
223
+ return {
224
+ ...base,
225
+ observedModel,
226
+ reportedModel,
227
+ modelVerification,
228
+ status: "rejected",
229
+ error: error instanceof Error ? error.message : String(error),
230
+ };
231
+ }
232
+ }
233
+ export async function runBrainstormPanel(options) {
234
+ if (!options.prompt.trim())
235
+ throw new Error("The brainstorm panel requires a non-empty prompt.");
236
+ validateBrainstormPanel(options.participants);
237
+ const participants = await Promise.all(options.participants.map((participant) => invokeParticipant(participant, options.prompt, options.signal, options.onProgress)));
238
+ const successCount = participants.filter(({ status }) => status === "fulfilled").length;
239
+ return {
240
+ panel: "grok+gpt-5.6-sol",
241
+ status: successCount === 2 ? "complete" : successCount === 1 ? "partial" : "failed",
242
+ consensusEligible: successCount === 2,
243
+ synthesisRule: SYNTHESIS_RULE,
244
+ participants,
245
+ };
246
+ }
247
+ //# sourceMappingURL=brainstorm-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brainstorm-panel.js","sourceRoot":"","sources":["../src/brainstorm-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AAGrE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAU,CAAC;AAuCvG,MAAM,cAAc,GAClB,yOAAyO,CAAC;AAE5O,SAAS,YAAY,CAAC,WAAkC;IACtD,IAAI,WAAW,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QACpC,OAAO,CAAC,cAAc,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AAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC9D,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,OAKxC;IACC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACjG,uBAAuB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAE9C,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,CACpC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CACvC,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CACnF,CACF,CAAC;IACF,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,MAAM,CAAC;IACxF,OAAO;QACL,KAAK,EAAE,kBAAkB;QACzB,MAAM,EAAE,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;QACnF,iBAAiB,EAAE,YAAY,KAAK,CAAC;QACrC,aAAa,EAAE,cAAc;QAC7B,YAAY;KACb,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=brainstorm-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brainstorm-run.d.ts","sourceRoot":"","sources":["../src/brainstorm-run.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ import { parseBrainstormParticipantList, runBrainstormPanel } from "./brainstorm-panel.js";
3
+ function parseArgs(argv) {
4
+ const participants = [];
5
+ for (let index = 0; index < argv.length; index += 1) {
6
+ const arg = argv[index];
7
+ if (arg === "--participant") {
8
+ const value = argv[index + 1];
9
+ if (!value)
10
+ throw new Error("--participant requires provider@harness:exact-model-id");
11
+ participants.push(value);
12
+ index += 1;
13
+ continue;
14
+ }
15
+ throw new Error(`Unknown argument "${arg}". Only repeated --participant arguments are supported.`);
16
+ }
17
+ return participants;
18
+ }
19
+ async function readStdin() {
20
+ if (process.stdin.isTTY)
21
+ return "";
22
+ const chunks = [];
23
+ for await (const chunk of process.stdin)
24
+ chunks.push(chunk);
25
+ return Buffer.concat(chunks).toString();
26
+ }
27
+ async function main() {
28
+ try {
29
+ const specs = parseArgs(process.argv.slice(2));
30
+ const list = parseBrainstormParticipantList(specs);
31
+ if (list.mode !== "exact") {
32
+ throw new Error(`ask-brainstorm-run executes only the exact routed Grok + GPT-5.6 Sol panel; bare providers (${list.providers.join(", ")}) use the standard coordinator dispatch. No participant was dispatched.`);
33
+ }
34
+ const prompt = await readStdin();
35
+ const report = await runBrainstormPanel({
36
+ prompt,
37
+ participants: list.participants,
38
+ onProgress: (message) => console.error(message),
39
+ });
40
+ console.log(JSON.stringify(report, null, 2));
41
+ if (report.status !== "complete")
42
+ process.exitCode = 2;
43
+ }
44
+ catch (error) {
45
+ const message = error instanceof Error ? error.message : String(error);
46
+ console.error(`ask-brainstorm-run failed: ${message}`);
47
+ process.exitCode = 1;
48
+ }
49
+ }
50
+ main();
51
+ //# sourceMappingURL=brainstorm-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brainstorm-run.js","sourceRoot":"","sources":["../src/brainstorm-run.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3F,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KA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,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC;YACtC,MAAM;YACN,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;SAChD,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU;YAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACzD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,CAAC,KAAK,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;QACvD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
package/mcp.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "mcpServers": {
3
+ "ask-llm": {
4
+ "command": "npx",
5
+ "args": [
6
+ "-y",
7
+ "@ask-llm/mcp"
8
+ ]
9
+ }
10
+ }
11
+ }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@ask-llm/plugin",
3
- "version": "0.14.0",
4
- "description": "Ask LLM review, comparison, brainstorming, image, verification, and pairing workflows for Claude Code and Pi",
3
+ "version": "0.15.0",
4
+ "description": "Ask LLM review, comparison, brainstorming, image, verification, and pairing workflows for Claude Code, Cursor Agent, and Pi",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
8
8
  "ask-antigravity-run": "dist/antigravity-run.js",
9
+ "ask-brainstorm-run": "dist/brainstorm-run.js",
9
10
  "ask-codex-run": "dist/codex-run.js",
10
11
  "ask-gemini-run": "dist/run.js",
11
12
  "ask-grok-run": "dist/grok-run.js",
@@ -43,7 +44,9 @@
43
44
  "homepage": "https://github.com/Lykhoyda/ask-llm#readme",
44
45
  "files": [
45
46
  ".claude-plugin/",
47
+ ".cursor-plugin/",
46
48
  ".mcp.json",
49
+ "mcp.json",
47
50
  "agents/",
48
51
  "codex-pair-defaults.json",
49
52
  "dist/",
@@ -83,8 +86,8 @@
83
86
  "@ask-llm/antigravity-mcp": "^0.7.2",
84
87
  "@ask-llm/codex-mcp": "^0.7.5",
85
88
  "@ask-llm/gemini-mcp": "^1.7.2",
86
- "@ask-llm/grok-mcp": "^0.1.1",
87
- "@ask-llm/mcp": "^0.7.0",
89
+ "@ask-llm/grok-mcp": "^0.1.2",
90
+ "@ask-llm/mcp": "^0.8.0",
88
91
  "@ask-llm/ollama-mcp": "^0.5.7"
89
92
  },
90
93
  "peerDependencies": {
@@ -87,6 +87,10 @@ const cursorAgentSchema = Type.Object({
87
87
  description:
88
88
  "Exact ID from agent --list-models; echoed back as `model`, with the CLI display label in `reportedModel`. Auto and other noncanonical IDs are refused.",
89
89
  }),
90
+ includeDirs: Type.Optional(relativeDirs),
91
+ sessionId: Type.Optional(
92
+ Type.String({ description: "Prior Cursor conversation ID to resume; omit first, then reuse the returned ID." }),
93
+ ),
90
94
  });
91
95
 
92
96
  const askMultiSchema = Type.Object({
@@ -239,6 +243,8 @@ export function registerProviderTools(pi: ExtensionAPI): void {
239
243
  prompt: params.prompt,
240
244
  provider: params.provider,
241
245
  model: params.model,
246
+ includeDirs: params.includeDirs,
247
+ sessionId: params.sessionId,
242
248
  signal,
243
249
  onProgress: progressForwarder(onUpdate, params.provider),
244
250
  });
@@ -250,6 +256,7 @@ export function registerProviderTools(pi: ExtensionAPI): void {
250
256
  harness: result.harness,
251
257
  model: result.model,
252
258
  reportedModel: result.reportedModel,
259
+ sessionId: result.sessionId,
253
260
  askLlmUsage: result.usage,
254
261
  outputTruncated: text.truncated,
255
262
  },
@@ -1,63 +1,89 @@
1
1
  ---
2
2
  name: brainstorm
3
- description: Send a topic to multiple LLM providers concurrently after the current host model forms an independent view, then synthesize all findings. Usage /brainstorm [providers] <topic>. External providers default to antigravity,codex. Example /brainstorm antigravity,codex,ollama "review this architecture"
3
+ description: Send a topic to an explicit multi-model panel, then synthesize findings with truthful provider, harness, and model attribution. Usage /brainstorm [participants] <topic>. Defaults to antigravity,codex. Preferred Grok route uses Cursor Agent with an exact catalog ID.
4
4
  ---
5
5
 
6
6
  <!-- PORTABLE-CONTRACT:START -->
7
7
  ## Portable contract
8
8
 
9
- The current host model must form and record an independent analysis before seeing external answers. Then send the same bounded topic and Context Brief concurrently to the selected providers, cross-check claims against source where possible, and synthesize consensus, unique insights, contradictions, rejected false positives, and confidence. Report the actual host model/providers and disclose possible same-family overlap.
9
+ For the standard workflow, the current host model records an independent analysis before seeing external answers, then sends the same bounded topic and Context Brief concurrently to the selected providers. For the exact Grok + GPT-5.6 Sol workflow, the host is a non-voting evidence verifier/synthesizer: the brainstorming panel has exactly those two requested participants. Cross-check source where possible and synthesize consensus, unique insights, contradictions, rejected false positives, failures, and confidence. Keep provider, harness, requested model ID, independently observed served model ID, and Cursor's reported display label separate. Only direct xAI API / Grok CLI routes can report a served ID, and only when the provider/CLI payload actually carries one; a disclosed same-product alias/snapshot resolution (for example `grok-4.6` or `grok-4-latest` served as a dated `grok-4-<snapshot>`) stays eligible, while a different model is a mismatch and ineligible. A direct route whose payload omits the model stays selected-only. Cursor Agent and Codex CLI echo the requested ID, so that attribution is selected-only and unverifiable—never call a requested or selected ID the actual model. Never select Cursor Auto, infer a requested ID from a display label, silently change a model, or pivot to another harness/provider.
10
10
  <!-- PORTABLE-CONTRACT:END -->
11
11
 
12
12
  ## Host adapters
13
13
 
14
14
  ### Pi adapter
15
15
 
16
- The current Pi host model completes its independent view first, records its actual provider/model, and only then calls native `ask-multi`. Do not claim the host is Claude Opus or that the coordinator has an isolated context.
16
+ The current Pi host model completes its independent evidence memo first. Standard provider lists use native `ask-multi`. A routed participant uses the matching native tool instead: `provider@cursor-agent:model` calls `ask-cursor-agent` with separate `provider` and exact `model`; direct Grok calls `ask-grok` with the explicit `harness` and exact model. A participant list mixing routed `provider@harness:exact-model-id` entries with bare provider names is refused before any tool call; nothing is dispatched or substituted. For the exact Grok + Sol panel, issue only these two consultations (concurrently when the host supports it):
17
+
18
+ - `ask-cursor-agent({ provider: "grok", model: "cursor-grok-4.6-high", prompt })`
19
+ - `ask-cursor-agent({ provider: "codex", model: "gpt-5.6-sol-high", prompt })`
20
+
21
+ Do not call `ask-multi` for that panel because it cannot express Cursor harness identity, and do not call Gemini. Treat the host memo as non-voting verification evidence, not a third panel answer. If either participant fails, label the run partial and do not claim two-model consensus.
17
22
 
18
23
  <!-- HOST-ADAPTER:CLAUDE-CODE:START -->
19
24
  ### Claude Code adapter
20
25
 
21
26
  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
27
 
23
-
24
-
25
28
  # Multi-LLM Brainstorm
26
29
 
27
- Consult multiple external LLM providers simultaneously on a topic while Claude Opus performs its own independent research in parallel, then synthesize the findings from all participants.
30
+ Consult an explicitly selected panel on a topic, then synthesize the responses against source-grounded host research.
28
31
 
29
32
  ## Instructions
30
33
 
31
- ### Phase 1: Parse arguments
34
+ ### Phase 1: Parse arguments and freeze participant identity
35
+
36
+ - The first argument may be a comma-separated participant list.
37
+ - Compatible bare provider names remain supported: `gemini`, `codex`, `grok`, `ollama`, `antigravity`. If omitted, default to `antigravity,codex`.
38
+ - Bare `grok` retains the existing direct canonical runner and its explicit `ASK_GROK_HARNESS` selection (`xai-api` default or `grok-cli`) for compatibility. That direct route never falls back.
39
+ - Preferred explicit syntax is `provider@harness:exact-model-id`. Supported routed participants are:
40
+ - `grok@cursor-agent:<exact ID from agent --list-models>` (preferred Grok route)
41
+ - `codex@cursor-agent:<exact GPT-5.6 Sol ID from agent --list-models>`
42
+ - `grok@grok-cli:<exact ID from grok models>` (explicit Grok Build alternative)
43
+ - `grok@xai-api:<exact ID from GET /v1/models>`
44
+ - `codex@codex-cli:gpt-5.6-sol` (explicit direct Codex alternative; any reported fallback makes the exact panel partial)
45
+ - Never accept `Auto`, map a display label to an ID, or substitute a route. A missing registration/harness, unavailable model, auth failure, or unsupported provider/harness pair is a participant failure with its actionable error preserved.
46
+ - A participant list must be either all bare provider names or all routed `provider@harness:exact-model-id` specs. A mixed list (for example `grok@cursor-agent:cursor-grok-4.6-high,antigravity`) is refused before any dispatch with the "Mixed brainstorm participant lists are not supported" error; no participant is rerouted to a bare runner, substituted, or dispatched. Generalized mixed panels are deferred to a future ADR.
47
+ - Everything after the participant list is the topic.
48
+ - In standard mode, Claude Opus remains a participant. In the exact Grok + Sol mode below, Claude is only the non-voting evidence verifier/synthesizer so the panel has exactly two participants.
49
+
50
+ **Architect workflow — exactly Grok + GPT-5.6 Sol, no Gemini:**
51
+
52
+ ```text
53
+ /brainstorm grok@cursor-agent:cursor-grok-4.6-high,codex@cursor-agent:gpt-5.6-sol-high "review this architecture"
54
+ ```
55
+
56
+ These IDs are exact catalog examples verified for this workflow; account catalogs can change, so use `agent --list-models` and replace an unavailable ID explicitly. The coordinator must not call Gemini, the direct Grok runner, xAI API, Grok Build, or Codex CLI for this invocation.
57
+
58
+ **Explicit Grok Build alternative (still no Gemini):**
32
59
 
33
- - If the first argument looks like a comma-separated provider list (e.g., `antigravity,codex` or `gemini,codex,grok,ollama`), use those as the external providers
34
- - If no provider list is given, default to `antigravity,codex`
35
- - Valid external providers: `gemini`, `codex`, `grok`, `ollama`, `antigravity`
36
- - `grok` requires `XAI_API_KEY` for the default API harness or official Grok Build auth with `ASK_GROK_HARNESS=grok-cli`; it may consume metered/plan usage and never falls back
37
- - `antigravity` requires `agy` installed + logged in; if it's unavailable the coordinator surfaces that and continues with the other providers
38
- - Everything after the provider list (or all args if no list) is the topic
39
- - Claude Opus is always a participant — it's not in the provider list because it runs inside the coordinator
60
+ ```text
61
+ /brainstorm grok@grok-cli:grok-build,codex@cursor-agent:gpt-5.6-sol-high "review this architecture"
62
+ ```
63
+
64
+ This route is valid only when the installed Grok Build contract supports Ask LLM's headless JSON/read-only flags. Failure is terminal for the Grok participant; do not pivot to Cursor or xAI.
40
65
 
41
66
  ### Phase 2: Determine and prepare the brainstorm topic
42
67
 
43
- - If the user provided a topic directly, use it
44
- - If the context is about code changes, gather the relevant diff:
45
- - `git status --short` first to see what's modified/added/deleted
46
- - `git add -N <new-files>` for untracked files the user wants included
47
- - `git diff` + `git diff --cached` combined
48
- - **Filter noise**: exclude `:!docs/` `:!apps/docs/` `:!*.md` `:!yarn.lock` `:!*.lock` `:!*.png` from the pathspec — providers don't need to review your ADR/doc additions
49
- - **Size-check**: if combined diff > 150KB, ask the user before sending (the providers will take 5–15 min on payloads that large)
50
- - If the context is a design/plan, gather the relevant documentation or conversation context
51
- - If no topic is clear, ask the user what they'd like to brainstorm about
52
- - Create a compact **Context Brief** before launching the coordinator. Keep it tiny for simple topics; add detail when the request is architecture/design/security/concurrency/migration related, spans packages, references external specs, or depends on conversation context external providers cannot see.
68
+ - If the user provided a topic directly, use it.
69
+ - For code changes, gather relevant context:
70
+ - Run `git status --short` first.
71
+ - Use `git add -N <new-files>` for untracked files the user wants included.
72
+ - Combine `git diff` and `git diff --cached`.
73
+ - Exclude noise with `:!docs/` `:!apps/docs/` `:!*.md` `:!yarn.lock` `:!*.lock` `:!*.png`.
74
+ - If the combined diff exceeds 150KB, ask before sending.
75
+ - For a design/plan, gather relevant documentation and conversation context.
76
+ - If no topic is clear, ask what to brainstorm.
77
+ - Create a compact **Context Brief**. It must list the exact requested participant identities, not just display names:
53
78
 
54
79
  ```markdown
55
80
  ## Context Brief
56
81
 
57
82
  Intent:
58
83
  - User request:
59
- - Brainstorm mode:
60
- - Providers: <list the selected providers for this run>
84
+ - Brainstorm mode: <standard | exact-grok-sol>
85
+ - Participants: <provider via harness, exact requested model for each>
86
+ - Explicitly excluded: <for exact-grok-sol: Gemini and every unselected route>
61
87
 
62
88
  Scope:
63
89
  - Changed/referenced files:
@@ -83,24 +109,21 @@ Open questions:
83
109
 
84
110
  ### Phase 3: Launch the brainstorm-coordinator agent
85
111
 
86
- Launch with: the topic, the selected external providers list, the Context Brief, and any gathered context (diff/files/docs).
112
+ Pass the topic, exact participant specs, Context Brief, and gathered context. The coordinator:
87
113
 
88
- The coordinator handles:
89
- - Phase 3B: its own Claude Opus research (reads actual files, traces code, uses WebFetch/WebSearch on referenced external docs) — runs FIRST so Claude doesn't anchor on external responses
90
- - Context Brief update: after Phase 3B, records verified files/docs and unverified assumptions before external dispatch
91
- - Phase 3A: external provider dispatch via a single blocking foreground Bash call (ADR-050 dispatch pattern)
92
- - Phase 4: synthesis — consensus, unique insights, contradictions across all participants
93
- - Verified findings (backed by Claude's file reads) are weighted higher than inferred ones
94
- - Failed providers are surfaced inline with their stderr, not silently dropped
114
+ - researches independently before dispatch and records any unverified assumptions;
115
+ - treats that research as non-voting verification evidence in exact two-model mode;
116
+ - uses the packaged `dist/brainstorm-run.js` for the exact Grok + Sol panel so both requests start concurrently within one blocking foreground process;
117
+ - uses only the selected routes and exact IDs;
118
+ - surfaces every failure and preserves provider/harness/model attribution; and
119
+ - synthesizes only after dispatch completes.
95
120
 
96
- ### Phase 4: Present the coordinator's synthesis
121
+ ### Phase 4: Present synthesis truthfully
97
122
 
98
- Pass through the coordinator's structured output. If the coordinator returned a partial result (some providers failed), present what landed and explicitly note what's missing — don't paraphrase or hide compromises.
123
+ Pass through the coordinator's structured output. Attribute each participant by provider, harness, and requested ID; add the observed served ID only for direct xAI API / Grok CLI routes (noting a disclosed alias/snapshot), and describe Cursor and Codex CLI attributions as selected-only and unverifiable with any Cursor display label shown as a label, not a catalog ID. A two-model consensus exists only when both requested participants succeeded and independently support the point. If one fails, label the run **partial**, attribute surviving insights to the model that produced them, and never describe them as consensus. If both fail, report failure and provide no panel synthesis. The host's verification memo may verify or reject claims, but it cannot turn one participant's answer into two-model agreement.
99
124
 
100
125
  ## Important — verification matters
101
126
 
102
- Confidence scores are not an oracle. The coordinator's Phase 3B exists specifically because external LLMs can return high-confidence findings that turn out to be factually wrong (a real example from 2026-04-17: Gemini returned 95/100-confidence claims that were contradicted by the actual `.d.ts` file). Claude's "Verified" findings carry more weight than external "Inferred" findings precisely for this reason.
103
-
104
- If you want a code-review-specific version of this with explicit per-finding source verification, use `/multi-review` instead.
127
+ Confidence scores are not an oracle. External LLMs can return high-confidence claims contradicted by source. Verified findings carry more weight than inferred findings, while participant counts and consensus eligibility remain mechanical and cannot be upgraded by confidence. For code-review-specific per-finding verification, use `/multi-review`.
105
128
 
106
129
  <!-- HOST-ADAPTER:CLAUDE-CODE:END -->
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: codex-pair
3
- description: Show codex-pair status and set up the per-edit Codex review hook for this project. Detects whether codex-pair is active, paused, or not yet configured. On first run (no marker), offers interactive setup with auto-detected project context. On subsequent runs, shows current state, recent review activity, and toggle instructions. The per-edit hook itself runs automatically; this command is the human-facing dashboard for it.
3
+ description: Pair with Codex using the host's supported lifecycle. On Claude Code and Pi, manages the proven opt-in per-edit review flow; on Cursor Agent, runs an explicit consent-gated iterative reviewer session through an exact ask-codex leaf or fully pinned unified ask-llm without assuming Claude hooks or namespaces.
4
4
  ---
5
5
 
6
6
  <!-- PORTABLE-CONTRACT:START -->
7
7
  ## Portable contract
8
8
 
9
- Set up and report status for recall-first per-edit Codex review. The repository marker carries review context but is not, by itself, authorization on Pi. Preserve bounded file context, debounce, pause/resume, acknowledgement, deduplication, failure disclosure, and explicit host lifecycle limitations.
9
+ Use Codex as an explicit read-only reviewer while the host remains the editor. Apply `../pairing-contract.md`. Where the host supports the established per-edit integration, set up and report its status: the repository marker carries review context but is not, by itself, authorization on Pi. Preserve bounded file context, include-directory handling, reasoning effort, session continuity where supported, consent, cancellation, actionable relay, failure disclosure, and explicit host lifecycle limitations.
10
10
  <!-- PORTABLE-CONTRACT:END -->
11
11
 
12
12
  ## Host adapters
@@ -15,6 +15,48 @@ Set up and report status for recall-first per-edit Codex review. The repository
15
15
 
16
16
  Pi requires project trust, this repository marker, and explicit user-owned allowlist consent through `/codex-pair`. Pairing is asynchronous in TUI/RPC/long-lived JSON modes, uses `tool_result`, and surfaces findings non-blockingly. One-shot print mode, blocking Stop-gate parity, and nested Fable execution are unsupported.
17
17
 
18
+ ### Cursor Agent adapter
19
+
20
+ Cursor discovers this `SKILL.md` through its supported Agent Skills surface; `/codex-pair` attaches it as an explicit command. Do **not** use Claude Code's `PostToolUse`, `Stop`, `SessionStart`, `SessionEnd`, `CLAUDE_PLUGIN_ROOT`, `AskUserQuestion`, or plugin tool namespaces. This adapter is an on-demand iterative pairing session, not a claim that Claude hooks were registered in Cursor.
21
+
22
+ 1. Read `../pairing-contract.md`. The Cursor plugin bundle registers only the unified `ask-llm` server; if the user separately installed `@ask-llm/codex-mcp`, prefer that deterministic `ask-codex` leaf. Resolve an exposed MCP tool whose exact leaf is `ask-codex`; do not assume its server prefix. When only the unified `ask-llm` leaf is registered, it may serve as the transport with `provider: "codex"` and every option (model, reasoning effort, include directories, session) pinned explicitly; its schema rejects unsupported combinations instead of stripping them and Codex runs read-only by default. Never make an unpinned generic call. If neither tool is exposed, stop with the recommended user-installed unified server:
23
+ ```json
24
+ {"mcpServers":{"ask-llm":{"command":"npx","args":["-y","@ask-llm/mcp"]}}}
25
+ ```
26
+ Save that as project `.cursor/mcp.json` or user `~/.cursor/mcp.json`, ensure `codex` is authenticated, reload the server from Cursor Settings → Tools & MCP or restart Cursor Agent, and invoke `/codex-pair` again. A split `codex` entry using `@ask-llm/codex-mcp` is an explicit user-installed alternative when only the `ask-codex` leaf is desired; keep one registration per server (the plugin already provides `ask-llm`, so do not add a second `ask-llm` entry merely to duplicate it).
27
+ 2. Require both `model=<exact ID>` and `effort=low|medium|high|xhigh|max`; parse optional `include=dir1,dir2`. If model or effort is omitted, ask the user to choose it and stop before reading extra context, requesting consent, or calling a provider. Do not infer either value from the Cursor host environment: the MCP server may resolve different `ASK_CODEX_MODEL` or `ASK_CODEX_REASONING_EFFORT` values. Reject absolute, `..`, and `~` include paths; cap at 32. Build a bounded context manifest (20 KB/file, 100 KB/request) from task requirements, relevant project instructions, changed files, and tests. Do not send secrets or unrelated files.
28
+ 3. Before the first provider call, show host=`Cursor Agent`, reviewer provider=`codex`, selected transport=`ask-codex` or unified `ask-llm`, exact user-supplied model, exact user-supplied reasoning effort, include directories, read-only behavior, data/quota boundary, and fresh persisted-session intent. Ask for explicit confirmation using Cursor's normal conversational approval surface. Refusal ends `cancelled` with no provider call.
29
+ 4. First call exactly one of these protocol shapes, substituting the already disclosed explicit choices:
30
+ ```json
31
+ [
32
+ {
33
+ "tool": "ask-codex",
34
+ "arguments": {
35
+ "prompt": "<bounded reviewer prompt>",
36
+ "model": "<required exact ID>",
37
+ "reasoningEffort": "<required effort>",
38
+ "includeDirs": ["<validated relative directory>"],
39
+ "sessionId": "",
40
+ "sandbox": "read-only"
41
+ }
42
+ },
43
+ {
44
+ "tool": "ask-llm",
45
+ "arguments": {
46
+ "provider": "codex",
47
+ "prompt": "<bounded reviewer prompt>",
48
+ "model": "<required exact ID>",
49
+ "reasoningEffort": "<required effort>",
50
+ "includeDirs": ["<validated relative directory>"],
51
+ "sessionId": ""
52
+ }
53
+ }
54
+ ]
55
+ ```
56
+ The prompt assigns Codex the independent reviewer role and requests actionable severity/file/line evidence. Capture the returned structured `sessionId`/Thread ID and actual model. Relay feedback before changing code; verify every finding against source and label it accepted, rejected, or deferred.
57
+ 5. At meaningful checkpoints, call the same tool with the captured `sessionId`, same model/effort, and bounded delta. On `ask-codex`, keep `sandbox: "read-only"`; unified `ask-llm` has no sandbox input and is read-only by default, so do not send an unsupported sandbox field. Omit `includeDirs` on resumed calls because `codex exec resume` does not support them (every Codex transport — split `ask-codex`, unified `ask-llm`, and Pi — rejects that combination at the shared executor instead of dropping the directories); never silently strip them from the first call. If no session ID was returned, stop with a session diagnostic instead of pretending continuity.
58
+ 6. A Cursor interrupt cancels the MCP request. Report `cancelled` and never retry another tool/model/provider. Preserve earlier feedback on later failure and report `failed (partial)`. On success report `completed` with host, provider, requested/actual model, effort, session reuse count, context/include directories, accepted/rejected/deferred actions, and any reported Codex quota fallback. Never conceal fallback or rewrite a model.
59
+
18
60
  <!-- HOST-ADAPTER:CLAUDE-CODE:START -->
19
61
  ### Claude Code adapter
20
62
 
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: grok-pair
3
+ description: Pair with Grok as an explicit independent reviewer while the host edits. Use when the user asks for /grok-pair, Grok pair programming, iterative Grok feedback, or Grok through Cursor Agent. Selects one exact route/model with consent and never falls back.
4
+ ---
5
+
6
+ <!-- PORTABLE-CONTRACT:START -->
7
+ ## Portable contract
8
+
9
+ Apply `../pairing-contract.md`. The host is the editor and Grok is the explicit read-only reviewer. Share bounded context only after consent, relay and verify actionable feedback at checkpoints, preserve exact route/model attribution, reuse a returned Cursor session where supported, propagate cancellation, and terminate clearly without silent provider, harness, or model fallback.
10
+ <!-- PORTABLE-CONTRACT:END -->
11
+
12
+ ## Host adapters
13
+
14
+ ### Cursor Agent adapter
15
+
16
+ When Cursor itself hosts this skill, do not recursively launch `ask-cursor-agent`. Offer only the explicit direct routes (`xai-api` or `grok-cli`) through an exact `ask-grok` leaf or a fully pinned unified `ask-llm` leaf, and follow the same consent and no-fallback contract. The Cursor plugin bundle registers only the unified `ask-llm` server; a separately user-installed `grok` entry (`@ask-llm/grok-mcp`) exposes the deterministic `ask-grok` leaf and is preferred when exposed. A unified call must specify `provider: "grok"`, exact `harness`, exact `model`, and `reasoningEffort`; direct Grok is one-shot and does not accept include directories or sessions.
17
+
18
+ If neither leaf is exposed, stop and give this Cursor-native setup (never `claude mcp add`):
19
+
20
+ ```json
21
+ {"mcpServers":{"ask-llm":{"command":"npx","args":["-y","@ask-llm/mcp"]}}}
22
+ ```
23
+
24
+ Save it as project `.cursor/mcp.json` or user `~/.cursor/mcp.json`. For `xai-api`, ensure `XAI_API_KEY` is present in the MCP server process environment; keep any literal secret in the user-level config and never commit it. For `grok-cli`, install/authenticate Grok Build and verify `grok --help` advertises headless JSON support. Reload the server from **Cursor Settings → Tools & MCP** or restart Cursor Agent, verify that `ask-llm` is exposed, then invoke `/grok-pair` again. The split alternative is the same entry named `grok` with package `@ask-llm/grok-mcp`, which exposes `ask-grok`; keep one registration per server and do not configure both merely to create fallback.
25
+
26
+ <!-- HOST-ADAPTER:CLAUDE-CODE:START -->
27
+ ### Claude Code adapter
28
+
29
+ # `/grok-pair`
30
+
31
+ Run an iterative pair-programming session in which Claude remains the sole editor and Grok is the independent reviewer.
32
+
33
+ ## 1. Parse and lock the route
34
+
35
+ Accept optional command text in this form (ask for any missing choice):
36
+
37
+ ```text
38
+ /grok-pair route=cursor-agent model=cursor-grok-4.6-high include=packages/api,packages/shared <task>
39
+ /grok-pair route=xai-api model=grok-4.6 effort=xhigh <task>
40
+ /grok-pair route=grok-cli model=grok-build effort=high <task>
41
+ ```
42
+
43
+ Supported routes:
44
+
45
+ 1. `cursor-agent` — preferred **only when** an `ask-cursor-agent` MCP tool is actually exposed and the user supplies an exact Grok-family ID from `agent --list-models`. Use `provider: "grok"`; never use Auto. Reasoning effort remains part of the exact Cursor catalog ID, not a separate generic option.
46
+ 2. `xai-api` — call `ask-grok` with `harness: "xai-api"`, exact model, and explicit `reasoningEffort`. Requires `XAI_API_KEY`; metered xAI API pricing is separate from consumer subscriptions.
47
+ 3. `grok-cli` — call `ask-grok` with `harness: "grok-cli"`, an exact ID from `grok models`, and explicit `reasoningEffort`. Uses the authenticated official Grok Build plan.
48
+
49
+ Inspect the current tool surface by leaf capability. The Claude plugin bundles only Codex; Cursor and Grok tools come from user-scoped registrations such as `mcp__ask-llm__ask-cursor-agent`, `mcp__ask-llm__ask-llm`, or `mcp__grok__ask-grok`, so match on the `__ask-cursor-agent`, `__ask-grok`, or `__ask-llm` leaf and never on one assumed prefix. When no `ask-grok` leaf exists but the unified `ask-llm` leaf does, a direct route may use `ask-llm({ provider: "grok", harness, model, reasoningEffort, prompt })` only with every one of those fields pinned explicitly; the unified schema rejects unsupported combinations instead of stripping them. An unpinned generic call or a raw CLI never replaces a missing selected tool.
50
+
51
+ If both Cursor and direct tools exist and no route was given, recommend Cursor Agent and show the direct alternatives, then use `AskUserQuestion` to obtain an explicit selection. Once selected, route/model/effort are immutable. A failure is terminal for that route.
52
+
53
+ ## 2. Bound context and obtain consent
54
+
55
+ Read `../pairing-contract.md`. Determine the task, changed files, project instructions, tests, and requested relative include directories. Reject absolute, `..`, and `~` paths and cap the list at 32. Prepare a context manifest before reading extra directories:
56
+
57
+ ```text
58
+ Host: Claude Code
59
+ Reviewer provider: grok
60
+ Harness: cursor-agent | xai-api | grok-cli
61
+ Requested model: <exact ID>
62
+ Reported model: pending
63
+ Reasoning: <exact Cursor model ID carries tier | low|medium|high|xhigh>
64
+ Shared context: <files/directories and byte bounds>
65
+ Session: fresh resumable Cursor conversation | one-shot
66
+ Cost/credential boundary: <Cursor plan/spend | xAI API | Grok Build plan>
67
+ ```
68
+
69
+ Use `AskUserQuestion` with **Start pairing** and **Cancel**. Do not invoke a tool or widen filesystem reads on refusal. For direct API/CLI routes, `includeDirs` is unsupported: offer to inline bounded excerpts or omit them; never silently discard the request.
70
+
71
+ ## 3. First reviewer checkpoint
72
+
73
+ Build a prompt under 100 KB containing the reviewer role, task/acceptance criteria, relevant project invariants, bounded diff/excerpts, tests already run, and focused questions. Require concise findings with severity, file/line evidence, consequence, and a proposed next action; require `NO CONCERNS` when appropriate.
74
+
75
+ Call exactly one selected tool:
76
+
77
+ - Cursor: `ask-cursor-agent({ provider: "grok", model, prompt, includeDirs })`.
78
+ - Direct: `ask-grok({ harness, model, reasoningEffort, prompt })`, or the fully pinned `ask-llm({ provider: "grok", harness, model, reasoningEffort, prompt })` when only the unified tool is registered.
79
+
80
+ For Cursor, capture `sessionId`, exact `model`, `harness`, and optional `reportedModel` from structured output. Treat a cross-provider label, a requested Auto/noncanonical ID, a changed exact model, or an absent final result as failure. If an unclassifiable display label such as `Auto` is merely reported, preserve it separately and flag the uncertainty; do not guess that it replaced the exact requested ID. Direct Grok transports are one-shot and return no session.
81
+
82
+ ## 4. Relay, act, and re-check
83
+
84
+ Relay Grok's feedback before editing. Verify each finding against source and label it accepted, rejected, or deferred with reason. Claude makes the edits. At meaningful checkpoints, send only the bounded delta plus outcomes of prior findings:
85
+
86
+ - Cursor route: reuse the returned `sessionId`, preserving the same provider/model and include directories.
87
+ - Direct route: make a new one-shot call through the same harness/model/effort and disclose that continuity comes from the bounded recap, not a provider session.
88
+
89
+ Do not hide partial success. If checkpoint 1 succeeded and checkpoint 2 fails, retain checkpoint 1's feedback and report `failed (partial)` with the failed stage.
90
+
91
+ ## 5. Cancellation and final report
92
+
93
+ If the user cancels or interrupts, stop the in-flight MCP call and report `cancelled`; never retry another route. On completion report:
94
+
95
+ ```text
96
+ grok-pair completed | cancelled | failed | failed (partial)
97
+ Host / provider / harness: Claude Code / grok / <route>
98
+ Requested model: <exact ID>
99
+ Reported model: <label or not reported>
100
+ Reasoning: <explicit effort semantics>
101
+ Session: <ID reused N times | one-shot>
102
+ Context shared: <bounded files/include dirs>
103
+ Accepted / rejected / deferred findings: <counts and actions>
104
+ Fallback: none
105
+ ```
106
+
107
+ ## Setup failures
108
+
109
+ Give guidance for the selected route only:
110
+
111
+ - Missing Cursor tool: `claude mcp add --scope user ask-llm -- npx -y @ask-llm/mcp` (exposes `ask-cursor-agent` and the unified `ask-llm` tool); authenticate `agent`, run `agent --list-models`, and restart Claude Code.
112
+ - Missing direct tool: `claude mcp add --scope user grok -- npx -y @ask-llm/grok-mcp` for the `ask-grok` leaf, or the same `@ask-llm/mcp` registration for the fully pinned unified form, then restart.
113
+ - Cursor unavailable/trust/model errors: follow the returned `agent --version`, explicit workspace trust, or `agent --list-models` guidance. Never pass `--trust` automatically.
114
+ - xAI/API or Grok CLI auth/model/quota errors: preserve the redacted diagnostic and state that no fallback was attempted.
115
+ <!-- HOST-ADAPTER:CLAUDE-CODE:END -->
@@ -0,0 +1,40 @@
1
+ # Portable pair-programming contract
2
+
3
+ This contract is shared by `/codex-pair` on Cursor Agent and `/grok-pair` on Claude Code. Host adapters may use different registration and lifecycle APIs, but must preserve these guarantees.
4
+
5
+ ## Roles and lifecycle
6
+
7
+ The host remains the only editor. The consulted model is an explicit, read-only reviewer that challenges correctness, tests assumptions, and returns actionable findings. Run one state machine:
8
+
9
+ `idle -> consented -> active -> completed | cancelled | failed`
10
+
11
+ Before `active`, resolve and show the user the provider, harness, exact requested model, reasoning effort, directories/files to be shared, credential/cost boundary, and whether a resumable provider session will be created. If the host cannot read the provider process's configured model and effort deterministically, require the user to supply both rather than inferring defaults that may differ across environments. Missing choices stop before extra context reads, consent, or provider invocation. Refusal returns `cancelled` without creating a marker, reading extra directories, or invoking a provider.
12
+
13
+ During `active`, relay each reviewer response before acting on it, verify findings against source, state accepted/rejected/deferred actions, and send only the bounded delta needed for the next checkpoint. The user or host interrupt cancels the in-flight MCP call; do not retry it under another tool, harness, model, or provider. End with one explicit `completed`, `cancelled`, or `failed` report.
14
+
15
+ ## Bounded context and include directories
16
+
17
+ Default bounds are 20 KB per file and 100 KB per provider request. Prefer diffs, task requirements, project instructions, relevant tests, and narrow excerpts over whole repositories. Never send secrets, credential files, unrelated untracked files, or ignored paths.
18
+
19
+ Additional directories must be explicit relative workspace paths: no absolute paths, `..`, or `~`; at most 32. Pass `includeDirs` only to a tool that supports it. If a selected route cannot expose extra directories, say so and ask whether to inline bounded excerpts or continue without them. Never silently drop a requested directory.
20
+
21
+ ## Transport, options, and attribution
22
+
23
+ Select one route before the first call and keep it immutable for the run. Resolve tools by their exact leaf capability (`ask-codex`, `ask-grok`, or `ask-cursor-agent`), not by assuming a Claude plugin namespace. The unified `ask-llm` tool is an acceptable transport only when the call pins provider, harness where applicable, exact model, reasoning effort, include directories, and session explicitly and its schema rejects unsupported combinations rather than stripping them; it is never an unpinned generic call and never a fallback for a failed split tool. A missing tool is a setup failure, never permission to use a generic call.
24
+
25
+ Every call and final report must keep these separate:
26
+
27
+ - host harness;
28
+ - provider;
29
+ - execution harness/transport;
30
+ - exact requested model ID;
31
+ - provider-native reasoning effort (or, for Cursor catalogs, the exact effort-bearing model ID);
32
+ - optional upstream display label (`reportedModel`).
33
+
34
+ Never choose Cursor Auto, rewrite a model ID, suppress a requested option, or claim fallback when none occurred. Any cross-provider reported label is terminal.
35
+
36
+ ## Sessions, partial failure, and diagnostics
37
+
38
+ Create and reuse a provider session only when the selected tool returns a session ID. Capture the ID from structured output, never scrape prose. On resumed Codex calls, omit `includeDirs` because `codex exec resume` does not support them; the initial call must establish that context. One-shot transports receive bounded deltas and are reported as one-shot.
39
+
40
+ Preserve successful feedback if a later checkpoint fails, label the run `failed (partial)`, and report the failed checkpoint. Distinguish tool missing, provider unavailable, authentication, model unavailable, quota/spend, trust, timeout, cancellation, malformed output, and cross-provider substitution. Include exact setup guidance for the selected route and explicitly say that no fallback was attempted.