ai-consultants 5.1.2 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/.claude/commands/ai-consultants:consult.md +21 -5
  2. package/.env.example +81 -43
  3. package/CLAUDE.md +67 -34
  4. package/README.md +112 -55
  5. package/SKILL.md +44 -24
  6. package/bin/ai-consultants +62 -1
  7. package/docs/COST_RATES.md +89 -41
  8. package/docs/JSON_SCHEMA.md +155 -294
  9. package/docs/RECIPES.md +60 -33
  10. package/docs/SETUP.md +108 -58
  11. package/docs/SMART_ROUTING.md +37 -22
  12. package/docs/cost_rates.json +61 -21
  13. package/package.json +2 -2
  14. package/references/configuration.md +114 -42
  15. package/references/details.md +10 -5
  16. package/scripts/build_context.sh +30 -5
  17. package/scripts/classify_question.sh +30 -9
  18. package/scripts/config.sh +107 -78
  19. package/scripts/configure.sh +74 -15
  20. package/scripts/consult_all.sh +409 -61
  21. package/scripts/doctor.sh +26 -22
  22. package/scripts/followup.sh +32 -14
  23. package/scripts/install.sh +12 -0
  24. package/scripts/lib/agy_exit_guard.sh +80 -0
  25. package/scripts/lib/api.sh +123 -57
  26. package/scripts/lib/api_query.sh +47 -21
  27. package/scripts/lib/cache.sh +34 -5
  28. package/scripts/lib/common.sh +354 -40
  29. package/scripts/lib/costs.sh +67 -9
  30. package/scripts/lib/json_schema_check.jq +65 -0
  31. package/scripts/lib/personas.sh +39 -18
  32. package/scripts/lib/response_canonicalize.jq +97 -0
  33. package/scripts/lib/schema.json +150 -118
  34. package/scripts/lib/session.sh +28 -8
  35. package/scripts/lib/synthesis_canonicalize.jq +90 -0
  36. package/scripts/lib/user_config.sh +22 -7
  37. package/scripts/query_claude.sh +3 -2
  38. package/scripts/query_codex.sh +3 -3
  39. package/scripts/query_gemini.sh +38 -12
  40. package/scripts/query_glm.sh +1 -1
  41. package/scripts/query_kimi.sh +21 -7
  42. package/scripts/query_minimax.sh +15 -11
  43. package/scripts/query_mistral.sh +6 -3
  44. package/scripts/query_qwen3.sh +12 -3
  45. package/scripts/synthesize.sh +101 -15
  46. package/templates/consultation_report.md +2 -0
  47. package/templates/synthesis_prompt.md +2 -0
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # AI Consultants v5.1.2
1
+ # AI Consultants v5.2.0
2
2
 
3
3
  > **Coverage, not a single guess.** A panel of up to 10 frontier models from different vendors fans out on your question in parallel and hands you the *union* of what they collectively see — the risks, edge cases, and approaches a single model misses.
4
4
 
5
- [![Version](https://img.shields.io/badge/version-5.1.2-blue.svg)](https://github.com/matteoscurati/ai-consultants)
5
+ [![Version](https://img.shields.io/badge/version-5.2.0-blue.svg)](https://github.com/matteoscurati/ai-consultants)
6
6
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
7
  [![Claude Code Skill](https://img.shields.io/badge/Claude%20Code-Skill-orange.svg)](https://docs.anthropic.com/en/docs/claude-code/skills)
8
8
  [![GitHub stars](https://img.shields.io/github/stars/matteoscurati/ai-consultants?style=social)](https://github.com/matteoscurati/ai-consultants)
@@ -18,7 +18,8 @@
18
18
  - [Supported CLI Agents](#supported-cli-agents)
19
19
  - [Claude Code](#claude-code)
20
20
  - [OpenAI Codex CLI](#openai-codex-cli)
21
- - [Gemini CLI](#gemini-cli)
21
+ - [Antigravity (agy)](#antigravity-agy)
22
+ - [Gemini CLI (legacy)](#gemini-cli-legacy)
22
23
  - [Cursor / Copilot / Windsurf](#cursor--copilot--windsurf-via-skillport)
23
24
  - [Standalone Bash](#standalone-bash)
24
25
  - [Consultants](#consultants)
@@ -100,7 +101,8 @@ Before installing AI Consultants, ensure you have the following dependencies ins
100
101
  |------------|---------|
101
102
  | **jq** | JSON processing |
102
103
  | **curl** | HTTP requests and connectivity |
103
- | **Bash 4.0+** | Script execution (macOS ships with 3.2) |
104
+ | **Bash 3.2+** | Script execution (the stock macOS `/bin/bash` 3.2 is supported) |
105
+ | **bc** | Cost arithmetic |
104
106
 
105
107
  ### Installation by Platform
106
108
 
@@ -110,21 +112,22 @@ Before installing AI Consultants, ensure you have the following dependencies ins
110
112
  # Install Homebrew if not already installed
111
113
  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
112
114
 
113
- # Install required dependencies
114
- brew install jq bash coreutils
115
+ # Install required dependencies (coreutils is optional: it provides
116
+ # `timeout`; a built-in fallback is used without it)
117
+ brew install jq coreutils
115
118
 
116
119
  # Verify installation
117
120
  jq --version && bash --version | head -1
118
121
  ```
119
122
 
120
- > **Note:** macOS ships with Bash 3.2. The Homebrew version (4.x) is installed to `/opt/homebrew/bin/bash`.
123
+ > **Note:** the scripts target the stock macOS Bash 3.2 (`#!/bin/bash`); installing a newer Bash is not required.
121
124
 
122
125
  #### Linux (Ubuntu/Debian)
123
126
 
124
127
  ```bash
125
128
  # Install required dependencies
126
129
  sudo apt-get update
127
- sudo apt-get install -y jq curl bash
130
+ sudo apt-get install -y jq curl bash bc
128
131
 
129
132
  # Verify installation
130
133
  jq --version && bash --version | head -1
@@ -134,7 +137,7 @@ jq --version && bash --version | head -1
134
137
 
135
138
  ```bash
136
139
  # Install required dependencies
137
- sudo dnf install -y jq curl bash
140
+ sudo dnf install -y jq curl bash bc
138
141
 
139
142
  # Verify installation
140
143
  jq --version && bash --version | head -1
@@ -144,7 +147,7 @@ jq --version && bash --version | head -1
144
147
 
145
148
  ```bash
146
149
  # Install required dependencies
147
- sudo pacman -S jq curl bash
150
+ sudo pacman -S jq curl bash bc
148
151
 
149
152
  # Verify installation
150
153
  jq --version && bash --version | head -1
@@ -160,7 +163,7 @@ wsl --install
160
163
 
161
164
  # After restart, open WSL and follow Linux instructions
162
165
  sudo apt-get update
163
- sudo apt-get install -y jq curl bash
166
+ sudo apt-get install -y jq curl bash bc
164
167
  ```
165
168
 
166
169
  Alternatively, use **Git Bash** or **MSYS2** with the required packages.
@@ -171,7 +174,7 @@ For CLI-based consultants, you'll also need:
171
174
 
172
175
  | Dependency | Required for |
173
176
  |------------|--------------|
174
- | **Node.js 18+** | Gemini CLI, Codex CLI, Qwen CLI, MiniMax CLI |
177
+ | **Node.js 18+** | Codex CLI, Qwen CLI, MiniMax CLI |
175
178
  | **Python 3.8+** | Mistral Vibe CLI |
176
179
 
177
180
  ```bash
@@ -201,7 +204,7 @@ AI Consultants follows the open [Agent Skills standard](https://agentskills.io),
201
204
 
202
205
  ### Claude Code
203
206
 
204
- > **Status:** ✅ Native support
207
+ > **Status:** ✅ Native support (headless run verified with Claude Code 2.1.303 on 2026-10-19)
205
208
 
206
209
  **Installation:**
207
210
 
@@ -234,18 +237,27 @@ slash command.
234
237
 
235
238
  ### OpenAI Codex CLI
236
239
 
237
- > **Status:** ✅ Compatible
240
+ > **Status:** ✅ Compatible (headless run verified with Codex CLI 0.163 on 2026-10-19)
238
241
 
239
242
  **Installation:**
240
243
 
241
244
  ```bash
242
245
  git clone https://github.com/matteoscurati/ai-consultants.git ~/.codex/skills/ai-consultants
243
246
  ~/.codex/skills/ai-consultants/scripts/doctor.sh --fix
247
+ # Or share an existing installation through the cross-agent skills directory:
248
+ # ln -s ~/.claude/skills/ai-consultants ~/.agents/skills/ai-consultants
244
249
  ```
245
250
 
246
- **Commands:**
251
+ **Usage:**
247
252
 
248
- Use the same slash commands as Claude Code. Codex CLI loads skills from `~/.codex/skills/`.
253
+ Codex has no custom slash commands: it loads the skill from `~/.codex/skills/`
254
+ or `~/.agents/skills/` and runs it when asked, for example *"use the
255
+ ai-consultants skill to review src/auth.ts"*. The consultation calls other CLIs
256
+ and APIs over the network and writes under `~/.cache` and `~/.config`, so
257
+ Codex's default sandbox cannot run it: approve the escalation when Codex asks,
258
+ or start Codex with `--sandbox danger-full-access`. Codex's automatic approval
259
+ review (`--approve-for-me`) rejects that escalation because it sends your files
260
+ to external providers, so the approval has to come from you.
249
261
 
250
262
  **Self-Exclusion:** Codex consultant is automatically excluded when invoked from Codex CLI.
251
263
 
@@ -257,28 +269,40 @@ Use the same slash commands as Claude Code. Codex CLI loads skills from `~/.code
257
269
 
258
270
  ---
259
271
 
260
- ### Gemini CLI
272
+ ### Antigravity (agy)
261
273
 
262
- > **Status:** ✅ Compatible
274
+ > **Status:** ✅ Compatible (headless run verified with agy 1.4.2 on 2026-10-19)
275
+
276
+ Antigravity (`agy`) replaced the Gemini CLI for individual Google accounts.
263
277
 
264
278
  **Installation:**
265
279
 
266
280
  ```bash
267
- git clone https://github.com/matteoscurati/ai-consultants.git ~/.gemini/skills/ai-consultants
268
- ~/.gemini/skills/ai-consultants/scripts/doctor.sh --fix
281
+ # Per project (agy reads <project>/.agents/skills/)
282
+ mkdir -p .agents/skills
283
+ git clone https://github.com/matteoscurati/ai-consultants.git .agents/skills/ai-consultants
284
+ # Or for every project: agy's user skill directory is ~/.gemini/config/skills/
269
285
  ```
270
286
 
271
- **Commands:**
287
+ **Usage:** ask in natural language, for example *"use the ai-consultants skill
288
+ to compare these two designs"*. agy runs the consultation as a background task
289
+ and follows its progress; in print mode (`agy -p`) it waits at most 30 minutes
290
+ for background tasks.
272
291
 
273
- Use the same slash commands as Claude Code. Gemini CLI loads skills from `~/.gemini/skills/`.
292
+ **Self-Exclusion:** the Gemini consultant is excluded when invoked from agy
293
+ (`INVOKING_AGENT=gemini`).
274
294
 
275
- **Self-Exclusion:** Gemini consultant is automatically excluded when invoked from Gemini CLI.
295
+ ---
276
296
 
277
- **Verify:**
297
+ ### Gemini CLI (legacy)
278
298
 
279
- ```bash
280
- ~/.gemini/skills/ai-consultants/scripts/doctor.sh
281
- ```
299
+ > **Status:** ⚠️ Legacy. Google stopped serving the Gemini CLI to individual
300
+ > accounts on 2026-06-18; use [Antigravity (agy)](#antigravity-agy) instead.
301
+
302
+ Accounts that can still use it get the skill from `~/.gemini/skills/` or
303
+ `~/.agents/skills/`, through natural language: the Gemini CLI loads only
304
+ `.toml` custom commands, so the `/ai-consultants:*` slash commands are not
305
+ available there. The Gemini consultant is excluded as for agy.
282
306
 
283
307
  ---
284
308
 
@@ -416,7 +440,8 @@ the observed version is response provenance only.
416
440
 
417
441
  ### Installing Consultant CLIs
418
442
 
419
- At least 2 consultant CLIs are required:
443
+ At least 2 consultants are required (a CLI, or an API key for API mode). The
444
+ first three below make up the `balanced` preset:
420
445
 
421
446
  ```bash
422
447
  curl -fsSL https://antigravity.google/cli/install.sh | bash # Gemini (Antigravity CLI: agy)
@@ -462,11 +487,12 @@ accepted reasoning effort: Grok Build uses `xhigh`, while GLM and DeepSeek use
462
487
  effort silently.
463
488
 
464
489
  The maximum preset also applies the transport budgets proven by the live panel
465
- smoke: four bounded advisory turns for Mistral/Grok, a 600-second Token Plan
466
- window for Qwen3.8-Max, a 600-second DeepSeek reasoning window, and larger
467
- OpenAI-compatible output budgets for Qwen, GLM, and DeepSeek. MiniMax M3
468
- likewise receives a 16,384-token completion budget in the maximum tier and a
469
- provider-specific compact Markdown contract through mmx's native system channel.
490
+ smoke: four bounded advisory turns for Mistral/Grok, the maximum-tier Qwen3.8-Max
491
+ and DeepSeek timeouts (`QWEN3_MAX_QUALITY_TIMEOUT`/`DEEPSEEK_MAX_QUALITY_TIMEOUT`,
492
+ default 0: no limit), and larger OpenAI-compatible output budgets for Qwen, GLM,
493
+ and DeepSeek. MiniMax M3 likewise receives a 16,384-token completion budget in
494
+ the maximum tier and the shared JSON response contract through mmx's native
495
+ system channel.
470
496
  Provider output is tagged `structured`, `fallback`, or `error`;
471
497
  malformed/truncated JSON fails
472
498
  closed. In coverage/union mode, only locally atomized `summary`, `pros`,
@@ -484,30 +510,40 @@ and cannot support a comprehensive coverage claim.
484
510
  | Consultant | `max_quality` | Premium | Standard | Economy |
485
511
  |------------|---------------|---------|----------|---------|
486
512
  | Claude | claude-fable-5-1 | claude-fable-5-1 | claude-opus-5-5 | claude-haiku-4-5 |
487
- | Gemini CLI | Gemini 3.8 Flash (High) | Gemini 3.8 Flash (High) | Gemini 3.8 Flash (High) | Gemini 3.8 Flash (Low) |
488
- | Gemini API | gemini-3.1-pro-preview | gemini-3.1-pro-preview | gemini-3.1-pro-preview | gemini-3.1-pro-preview |
489
- | Codex | gpt-6-astra | gpt-6-astra | gpt-5.6-terra | gpt-5.6-luna |
490
- | Mistral CLI | mistral-medium-3.5 | mistral-medium-3.5 | mistral-medium-3.5 | devstral-small-2 |
491
- | Mistral API | mistral-large-3 | mistral-large-3 | mistral-large-3 | mistral-large-3 |
513
+ | Gemini CLI | Gemini 4 Argon (High) | Gemini 4 Argon (High) | Gemini 3.8 Flash (High) | Gemini 3.8 Flash (Low) |
514
+ | Gemini API | gemini-4-argon | gemini-4-argon | gemini-3.1-pro-preview | gemini-3.1-pro-preview |
515
+ | Codex | gpt-6-astra | gpt-6.1-sol | gpt-5.6-terra | gpt-5.6-luna |
516
+ | Mistral CLI | mistral-medium-3.5 | mistral-medium-3.5 | mistral-medium-3.5 | mistral-medium-3.5 |
517
+ | Mistral API | mistral-large-4 | mistral-large-4 | mistral-large-4 | mistral-large-4 |
492
518
  | DeepSeek | deepseek-flash | deepseek-flash | deepseek-flash | deepseek-flash |
493
- | GLM | glm-5.3-flash | glm-5.3-flash | glm-5.3-flash | glm-4-flash |
519
+ | GLM | glm-5.3 | glm-5.3-flash | glm-5.3-flash | glm-4-flash |
494
520
  | Grok | grok-4.7 | grok-4.7 | grok-4.5 | grok-4.5 |
495
- | Qwen3 | qwen3.8-max when Token Plan is configured; otherwise qwen3.7-max | qwen3.7-max | qwen3.6-35b-a3b | qwen3-32b |
521
+ | Qwen3 | qwen3.8-max | qwen3.8-max | qwen3.8-flash | qwen3.8-flash |
496
522
  | Kimi | kimi-code/k3-256k | kimi-code/k3 | kimi-code/k3 | kimi-code/k3 |
497
523
  | MiniMax | MiniMax-M3 | MiniMax-M2.7 | MiniMax-M2.7 | MiniMax-M2.5 |
498
524
 
499
- Promotion is transport-specific. Gemini 3.8 Flash High is the new CLI target;
500
- Low serves economy. Both are available in the installed `agy models` inventory;
501
- High/Low CLI smokes passed on 2026-09-28 with capability-probed identity. Earlier Gemini 3.7 evidence remains historical.
502
- The Google API default remains `gemini-3.1-pro-preview`; `gemini-3.8-flash` is
503
- an explicit API opt-in whose live transport is not yet verified. The new Mistral API IDs (`mistral-medium-3-5`,
504
- `mistral-large-2512`, `mistral-small-2603`) remain catalogued opt-ins. Claude
525
+ Promotion is transport-specific. Gemini 4 Argon (GA 2026-10-13) is the Gemini
526
+ default and maximum target: `Gemini 4 Argon (High)` on `agy` and `gemini-4-argon`
527
+ on the API. An authorized `agy` consultation smoke returned a structured answer
528
+ with capability-probed identity on 2026-10-16; the API transport is covered by
529
+ offline tests only. Google excludes Argon from the Free tier and the AI Pro
530
+ plan, so the `agy` listing alone is not an access check. Gemini 3.8 Flash keeps
531
+ the CLI standard (High) and economy (Low) tiers; the API standard and economy
532
+ tiers keep `gemini-3.1-pro-preview`, and `gemini-3.8-flash` remains an explicit
533
+ API opt-in whose live transport is not yet verified. Mistral Large 4 (`mistral-large-4`, public preview) is the
534
+ Mistral API target for every tier. An authorized consultation smoke returned a
535
+ structured answer with provider-reported identity on 2026-10-15; the preview is absent from
536
+ `GET /v1/models`, so that listing is not an access check. Vibe keeps
537
+ `mistral-medium-3.5`. The other Mistral
538
+ API IDs (`mistral-medium-3-5`, `mistral-large-2512`, `mistral-small-2603`)
539
+ remain catalogued opt-ins. Claude
505
540
  Fable 5.1 is the default/premium/maximum target; use
506
541
  `CLAUDE_MODEL=claude-opus-5-5` for the lower-cost standard override. Selecting a preset later intentionally reapplies that
507
542
  preset's tier and can replace an explicit model override for the run.
508
- Qwen3.8-Max is likewise selected by `max_quality` only when API mode already
509
- points at an authenticated OpenAI-compatible Token Plan `/chat/completions`
510
- endpoint; the preset never repoints a DashScope key or CLI installation.
543
+ Qwen3.8-Max serves the default, premium and maximum tiers on every Qwen
544
+ transport (the `qwen` CLI, the Token Plan and DashScope); `max_quality` adds
545
+ `xhigh` effort only on the OpenAI-compatible wire and never repoints a key or
546
+ endpoint.
511
547
 
512
548
  ### Usage
513
549
 
@@ -611,11 +647,13 @@ later run to adapt when a CLI or credential changes. Environment variables,
611
647
  `--set`, and unmarked values remain explicit user choices, except for the exact
612
648
  historical generated Claude default described below.
613
649
  Managed model defaults use `# ai-consultants:default`; `configure` upgrades
614
- un-pinned historical `CLAUDE_MODEL=claude-opus-4-8` and `claude-opus-5` defaults
615
- to Fable 5.1, along with the exact managed Gemini CLI, GLM, and Grok defaults.
616
- To keep the lower-cost Opus 5 choice, run
617
- `ai-consultants configure --set CLAUDE_MODEL=claude-opus-5`; explicit model
618
- overrides are stored with `# ai-consultants:pin`.
650
+ the exact historical defaults it generated when they are not pinned (for
651
+ example `CLAUDE_MODEL=claude-opus-4-8`/`claude-opus-5` to Fable 5.1, and the
652
+ previous Gemini, Codex, Mistral API, Qwen, GLM, Grok and DeepSeek defaults),
653
+ and turns the fixed timeouts it generated through 5.1.2 into 0 (no limit).
654
+ To keep a model, run for example
655
+ `ai-consultants configure --set CLAUDE_MODEL=claude-opus-5-5`; explicit model
656
+ overrides are stored with `# ai-consultants:pin` and never migrated.
619
657
 
620
658
  Enter credentials through `--interactive`/`--advanced` or export them before the
621
659
  run; avoid passing API keys through `--set`, where the shell may retain them in
@@ -634,7 +672,7 @@ MAX_SESSION_COST=1.00 # USD budget cap (paired with ENABLE_BUDGET_LIMIT=t
634
672
  KIMI_MODEL=kimi-code/k3 # Pin the Kimi consultant to K3
635
673
  CLAUDE_API_MAX_TOKENS=16384 # Shared thinking + visible-output budget in API mode
636
674
  MISTRAL_CLI_MODEL=mistral-medium-3.5 # Vibe alias; MISTRAL_MODEL remains API-only
637
- GEMINI_MODEL="Gemini 3.8 Flash (High)" # agy CLI; API uses GEMINI_API_MODEL
675
+ GEMINI_MODEL="Gemini 4 Argon (High)" # agy CLI; API uses GEMINI_API_MODEL
638
676
  ```
639
677
 
640
678
  Full reference: [`references/configuration.md`](references/configuration.md). Copy-paste workflows: [`docs/RECIPES.md`](docs/RECIPES.md). For category-aware preset suggestions: `ai-consultants doctor --suggest-preset --question "..."`.
@@ -713,6 +751,25 @@ Classify -> Route -> Fan out (parallel) -> Coverage synthesis
713
751
  non-comprehensive. Override with `--strategy compare_only` (side-by-side) or
714
752
  `majority` (a single blended recommendation).
715
753
 
754
+ ### Waiting and stopping
755
+
756
+ Consultants and synthesis have **no time limit by default**: reasoning models
757
+ can take minutes, and a call cut off by a client timeout is usually still
758
+ billed while its answer is lost. Whoever started the run decides when to stop
759
+ waiting. The run logs `Output: <dir>` near the start and
760
+ `Still waiting after Ns for: <names>` every 30 seconds, and accepts:
761
+
762
+ - `touch <dir>/.proceed` (or `kill -USR1 <pid>`, or a first Ctrl-C): continue
763
+ with the answers already received. Consultants still running are stopped and
764
+ reported as `stopped`; sent during synthesis, it skips the synthesis.
765
+ - `touch <dir>/.abort` (or SIGTERM, or a second Ctrl-C): end the run and keep
766
+ the partial output.
767
+
768
+ A stopped call may still be billed for what it generated. Never stop a run with
769
+ SIGKILL: the shell cannot clean up, so consultant CLIs would keep running. A
770
+ positive `<NAME>_TIMEOUT` restores a hard limit for that consultant; see
771
+ [`references/configuration.md`](references/configuration.md#timeouts-waiting-and-retries).
772
+
716
773
  ### Output
717
774
 
718
775
  Each consultation generates:
package/SKILL.md CHANGED
@@ -5,10 +5,10 @@ license: MIT
5
5
  compatibility: Requires bash, jq, and at least 2 AI CLI tools (agy, codex, vibe, etc.). macOS and Linux.
6
6
  metadata:
7
7
  author: matteoscurati
8
- version: 5.1.2
8
+ version: 5.2.0
9
9
  ---
10
10
 
11
- # AI Consultants v5.1.2 - AI Expert Panel
11
+ # AI Consultants v5.2.0 - AI Expert Panel
12
12
 
13
13
  **Coverage, not a single guess.** Convene a panel of AI "consultants" from different vendors for coding questions: they fan out in parallel and you get the *union* of what they collectively see — the risks, edge cases, and approaches a single model misses. Each consultant has a **configurable persona** that decorrelates its analysis.
14
14
 
@@ -25,15 +25,20 @@ only telling the user to type the slash command. Route through
25
25
  `scripts/consult_all.sh`; do not call provider adapters individually.
26
26
 
27
27
  1. Identify the invoking host and set `INVOKING_AGENT` explicitly:
28
- `claude` for Claude Code, `codex` for Codex CLI, or `gemini` for Gemini CLI.
28
+ `claude` for Claude Code, `codex` for Codex CLI, or `gemini` for
29
+ Antigravity (`agy`) and the legacy Gemini CLI.
29
30
  This is the boundary that prevents the host from consulting or synthesizing
30
31
  with itself.
31
- 2. Resolve the skill root from `AI_CONSULTANTS_DIR` when set. Otherwise use the
32
- host installation (`~/.claude/skills/ai-consultants` for Claude Code,
33
- `~/.codex/skills/ai-consultants` for Codex, or
34
- `~/.gemini/skills/ai-consultants` for Gemini).
35
- 3. Preserve consultation options such as `--preset` and `--strategy` as CLI
36
- arguments before the question. Pass referenced files as paths, optionally
32
+ 2. Resolve the skill root from `AI_CONSULTANTS_DIR` when set. Otherwise the
33
+ skill root is the directory that contains this `SKILL.md` (for example
34
+ `~/.claude/skills/ai-consultants`, `~/.agents/skills/ai-consultants` or
35
+ `<project>/.agents/skills/ai-consultants`); run everything from there.
36
+ The consultation calls external CLIs and APIs over the network and writes
37
+ under `~/.cache`, `~/.config` and the CLIs' own directories, so a sandboxed
38
+ shell (for example Codex's default sandbox) must run it with network access
39
+ and those writes allowed, or ask the user for that permission.
40
+ 3. Preserve consultation options such as `--mode`, `--preset` and `--strategy`
41
+ as CLI arguments before the question. Pass referenced files as paths, optionally
37
42
  suffixed with `@PRIMARY` or `@CONTEXT`; do not paste their contents. Capture
38
43
  the caller's project directory before entering the skill root and pass it as
39
44
  `--context-root`, so the runtime can privately stage only regular in-project
@@ -43,15 +48,28 @@ only telling the user to type the slash command. Route through
43
48
  question. Use `--query-file`; never pass raw user text as a shell argument or
44
49
  through an unquoted heredoc. Shell-quote every context-file path as one
45
50
  argument, and install a shell trap that removes only that exact temporary
46
- question file. Capture the last stdout line as the output directory, then
51
+ question file (some harnesses, such as Codex, reject `rm -f`; `unlink` works
52
+ there). Capture the last stdout line as the output directory, then
47
53
  read `report.md` and
48
54
  `synthesis.json` (or the individual consultant JSON files when synthesis is
49
55
  unavailable).
50
- 5. Keep `INVOKING_AGENT` and the private `--query-file` handoff on follow-ups.
56
+ 5. There is no generation time limit by default, and you decide when to stop
57
+ waiting. Run the consultation in the background when your shell tool allows
58
+ it, and read its log: it prints `Output: <dir>` near the start and
59
+ `Still waiting after Ns for: <names>` every 30 seconds. `touch <dir>/.proceed`
60
+ continues with the answers received (consultants still running are stopped;
61
+ during synthesis it skips the synthesis); `touch <dir>/.abort` ends the run.
62
+ A stopped call may still be billed, so keep waiting unless the user wants
63
+ results now or a consultant looks stuck. Never stop the run with SIGKILL.
64
+ Your own harness may cap the wait (for example, `agy` in print mode waits at
65
+ most 30 minutes for background tasks); touch `.proceed` before such a cap
66
+ rather than letting the harness kill the run.
67
+ 6. Keep `INVOKING_AGENT` and the private `--query-file` handoff on follow-ups.
51
68
  A targeted follow-up to the invoking consultant must fail closed. For a
52
- Claude invocation, `claude.json` must not be produced and Claude must not be
53
- the synthesis provider. Treat either condition as a self-exclusion failure,
54
- not a valid consultation.
69
+ Claude invocation, `claude.json` must not be produced and the
70
+ `synthesis_provider` field of `synthesis.json` must not be `claude` (the same
71
+ holds for `codex` and `gemini` hosts). Treat either condition as a
72
+ self-exclusion failure, not a valid consultation.
55
73
 
56
74
  Claude Code example:
57
75
 
@@ -102,20 +120,22 @@ model, and structured-output surface. Compatible version changes are accepted;
102
120
  the observed version is recorded only as response provenance.
103
121
 
104
122
  The `max_quality` preset enables all 10 consultants. It uses the separately
105
- smoke-tested K3-256k and MiniMax M3 targets, plus Qwen3.8-Max when an authenticated Token Plan transport is
106
- already configured. Gemini 3.8 Flash High is the new `agy` target for maximum,
107
- premium, and standard CLI tiers; Low serves economy. The installed model inventory
108
- lists both; High/Low CLI smokes passed on 2026-09-28 with capability-probed identity.
109
- The Gemini API default remains 3.1 Pro; `gemini-3.8-flash` is an explicit API opt-in. Claude Fable 5.1 is the default/premium/maximum target; the new
110
- Mistral API IDs remain explicit opt-ins.
123
+ smoke-tested K3-256k and MiniMax M3 targets, GLM-5.3 (the flagship; Flash serves
124
+ premium/standard) and Qwen3.8-Max (also the Qwen default; Flash serves
125
+ standard/economy). Gemini 4 Argon (High) is the `agy` target for the default
126
+ and maximum tiers (`gemini-4-argon` on the API); one authorized `agy` smoke passed on
127
+ 2026-10-16 with capability-probed identity, and the API transport is offline-tested only.
128
+ Gemini 3.8 Flash High/Low keep the CLI standard/economy tiers, the API standard/economy
129
+ tiers keep 3.1 Pro, and `gemini-3.8-flash` is an explicit API opt-in. Claude Fable 5.1 is the default/premium/maximum target. Mistral
130
+ API mode uses Mistral Large 4 in every tier; the other new Mistral API IDs remain explicit opt-ins.
111
131
  Grok, GLM, and DeepSeek receive their
112
132
  highest accepted reasoning effort in this preset (`xhigh`, `max`, and `max`
113
133
  respectively); no failed target is silently replaced.
114
134
 
115
135
  Maximum-quality transports use smoke-tested runtime budgets: four advisory
116
- turns for Mistral/Grok, extended Qwen/DeepSeek timeouts, and larger response
117
- budgets for reasoning APIs and a compact native-system Markdown contract for
118
- MiniMax M3. Responses carry an explicit `structured`,
136
+ turns for Mistral/Grok, no generation time limit, and larger response
137
+ budgets for reasoning APIs; MiniMax M3 receives the shared JSON contract in
138
+ its native system channel. Responses carry an explicit `structured`,
119
139
  `fallback`, or `error` quality. Truncated JSON fails closed. Coverage/union
120
140
  synthesis source-attributed claims use only locally normalized atomic fields;
121
141
  fallback prose remains visible as context-only manual-review material. Inspect
@@ -224,7 +244,7 @@ Use `ai-consultants configure --show-parameters` for the exact accepted keys,
224
244
  `--set KEY=VALUE` for repeatable automation, or `--advanced` to review all of
225
245
  them interactively.
226
246
 
227
- CLI/API switching: `GEMINI_USE_API`, `CODEX_USE_API`, `CLAUDE_USE_API`, `MISTRAL_USE_API`, `QWEN3_USE_API`.
247
+ CLI/API switching: `GEMINI_USE_API`, `CODEX_USE_API`, `CLAUDE_USE_API`, `MISTRAL_USE_API`, `QWEN3_USE_API`, `GROK_USE_API`, `MINIMAX_USE_API`.
228
248
 
229
249
  See [Full Configuration Reference](references/configuration.md) for all variables, model overrides, tiers, timeouts, and optimization settings.
230
250
 
@@ -191,6 +191,32 @@ EOF
191
191
  install)
192
192
  COMMANDS_SRC="$PROJECT_ROOT/.claude/commands"
193
193
  COMMANDS_DST="$HOME/.claude/commands"
194
+
195
+ # The commands cd into ${AI_CONSULTANTS_DIR:-$HOME/.claude/skills/ai-consultants}.
196
+ # A curl | bash install lives there and outlasts any npx cache, so when a
197
+ # complete one exists, install its own commands: they stay matched to the
198
+ # scripts they run. Only without one do the commands point at this package.
199
+ DEFAULT_SKILL_ROOT='${AI_CONSULTANTS_DIR:-$HOME/.claude/skills/ai-consultants}'
200
+ default_root="$HOME/.claude/skills/ai-consultants"
201
+ default_root_resolved=$(cd -P "$default_root" 2>/dev/null && pwd || true)
202
+ use_default_root=false
203
+ if [ -n "$default_root_resolved" ] && [ "$PROJECT_ROOT" != "$default_root_resolved" ] \
204
+ && [ -x "$default_root/scripts/consult_all.sh" ] \
205
+ && [ -x "$default_root/scripts/doctor.sh" ] \
206
+ && [ -x "$default_root/scripts/followup.sh" ] \
207
+ && [ -d "$default_root/.claude/commands" ] \
208
+ && grep -q '^name: ai-consultants$' "$default_root/SKILL.md" 2>/dev/null; then
209
+ use_default_root=true
210
+ COMMANDS_SRC="$default_root/.claude/commands"
211
+ default_version=$(grep -E '^AI_CONSULTANTS_VERSION=' "$default_root/scripts/config.sh" 2>/dev/null \
212
+ | head -1 | sed -E 's/.*"([^"]+)".*/\1/' || true)
213
+ echo "Using the existing installation at $default_root (v${default_version:-unknown})"
214
+ if [ "$default_version" != "$VERSION" ]; then
215
+ echo "Note: this package is v$VERSION. To upgrade that installation run:" >&2
216
+ echo " bash \"$default_root/scripts/install.sh\" --update" >&2
217
+ fi
218
+ fi
219
+
194
220
  if [ ! -d "$COMMANDS_SRC" ]; then
195
221
  echo "Error: slash commands directory not found at $COMMANDS_SRC" >&2
196
222
  exit 1
@@ -215,10 +241,45 @@ EOF
215
241
  echo "Pruned $pruned slash command(s) removed in a previous release"
216
242
  fi
217
243
 
244
+ # Without a usable default install, point the default at this package
245
+ # root so the installed commands can run.
246
+ rewrite_root=""
247
+ if [ "$use_default_root" = false ] && [ "$PROJECT_ROOT" != "$default_root_resolved" ]; then
248
+ # The root lands inside "${AI_CONSULTANTS_DIR:-<root>}", where Bash also
249
+ # treats a single quote as quoting: an unmatched one is a syntax error.
250
+ case "$PROJECT_ROOT" in
251
+ *'"'*|*"'"*|*'$'*|*'`'*|*'\'*)
252
+ echo "Warning: package path contains shell metacharacters; set AI_CONSULTANTS_DIR=$PROJECT_ROOT before using the slash commands" >&2
253
+ ;;
254
+ *)
255
+ rewrite_root="$PROJECT_ROOT"
256
+ ;;
257
+ esac
258
+ case "$PROJECT_ROOT" in
259
+ */_npx/*)
260
+ echo "Warning: this package runs from the npx cache ($PROJECT_ROOT), which npm may delete." >&2
261
+ echo " For stable slash commands run: npm install -g ai-consultants && ai-consultants install" >&2
262
+ ;;
263
+ esac
264
+ fi
265
+
218
266
  copied=0
219
267
  for f in "$COMMANDS_SRC"/ai-consultants:*.md; do
220
268
  [ -f "$f" ] || continue
221
- cp "$f" "$COMMANDS_DST/"
269
+ dest="$COMMANDS_DST/$(basename "$f")"
270
+ if [ -n "$rewrite_root" ]; then
271
+ # awk index/substr: a literal replacement, independent of Bash
272
+ # version quirks in ${var//pattern/replacement} (e.g. "&" in 5.2).
273
+ awk -v old="$DEFAULT_SKILL_ROOT" -v new="\${AI_CONSULTANTS_DIR:-$rewrite_root}" '
274
+ { out = ""; line = $0
275
+ while ((i = index(line, old)) > 0) {
276
+ out = out substr(line, 1, i - 1) new
277
+ line = substr(line, i + length(old))
278
+ }
279
+ print out line }' "$f" > "$dest"
280
+ else
281
+ cp "$f" "$dest"
282
+ fi
222
283
  copied=$((copied + 1))
223
284
  done
224
285
  if [ "$copied" -eq 0 ]; then