ai-consultants 2.10.1

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 (62) hide show
  1. package/.claude/commands/ai-consultants:consult.md +94 -0
  2. package/.claude/commands/ai-consultants:debate.md +103 -0
  3. package/.claude/commands/ai-consultants:help.md +30 -0
  4. package/CLAUDE.md +839 -0
  5. package/LICENSE +21 -0
  6. package/README.md +758 -0
  7. package/SKILL.md +156 -0
  8. package/bin/ai-consultants +96 -0
  9. package/docs/COST_RATES.md +172 -0
  10. package/docs/JSON_SCHEMA.md +305 -0
  11. package/docs/SETUP.md +879 -0
  12. package/docs/SMART_ROUTING.md +219 -0
  13. package/docs/cost_rates.json +143 -0
  14. package/package.json +47 -0
  15. package/references/configuration.md +141 -0
  16. package/references/details.md +60 -0
  17. package/scripts/build_context.sh +562 -0
  18. package/scripts/classify_question.sh +148 -0
  19. package/scripts/config.sh +753 -0
  20. package/scripts/configure.sh +1093 -0
  21. package/scripts/consult_all.sh +934 -0
  22. package/scripts/debate_round.sh +421 -0
  23. package/scripts/doctor.sh +642 -0
  24. package/scripts/followup.sh +197 -0
  25. package/scripts/install.sh +319 -0
  26. package/scripts/lib/api.sh +640 -0
  27. package/scripts/lib/api_query.sh +228 -0
  28. package/scripts/lib/cache.sh +338 -0
  29. package/scripts/lib/chunking.sh +880 -0
  30. package/scripts/lib/code_optimizer.sh +671 -0
  31. package/scripts/lib/common.sh +1088 -0
  32. package/scripts/lib/costs.sh +674 -0
  33. package/scripts/lib/personas.sh +372 -0
  34. package/scripts/lib/progress.sh +251 -0
  35. package/scripts/lib/reflection.sh +447 -0
  36. package/scripts/lib/routing.sh +566 -0
  37. package/scripts/lib/schema.json +165 -0
  38. package/scripts/lib/session.sh +327 -0
  39. package/scripts/lib/symbol_map.sh +445 -0
  40. package/scripts/lib/voting.sh +495 -0
  41. package/scripts/peer_review.sh +460 -0
  42. package/scripts/preflight_check.sh +452 -0
  43. package/scripts/query_aider.sh +83 -0
  44. package/scripts/query_amp.sh +67 -0
  45. package/scripts/query_claude.sh +99 -0
  46. package/scripts/query_codex.sh +92 -0
  47. package/scripts/query_cursor.sh +72 -0
  48. package/scripts/query_deepseek.sh +17 -0
  49. package/scripts/query_gemini.sh +85 -0
  50. package/scripts/query_glm.sh +17 -0
  51. package/scripts/query_grok.sh +17 -0
  52. package/scripts/query_kilo.sh +140 -0
  53. package/scripts/query_kimi.sh +67 -0
  54. package/scripts/query_minimax.sh +17 -0
  55. package/scripts/query_mistral.sh +97 -0
  56. package/scripts/query_ollama.sh +328 -0
  57. package/scripts/query_qwen3.sh +93 -0
  58. package/scripts/setup_wizard.sh +367 -0
  59. package/scripts/skillport-install.sh +196 -0
  60. package/scripts/synthesize.sh +332 -0
  61. package/templates/consultation_report.md +323 -0
  62. package/templates/synthesis_prompt.md +120 -0
package/README.md ADDED
@@ -0,0 +1,758 @@
1
+ # AI Consultants v2.10.1
2
+
3
+ > Query multiple AI models simultaneously for expert opinions on coding questions. Get diverse perspectives, automatic synthesis, confidence-weighted recommendations, and multi-agent debate.
4
+
5
+ [![Version](https://img.shields.io/badge/version-2.10.1-blue.svg)](https://github.com/matteoscurati/ai-consultants)
6
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
+ [![Claude Code Skill](https://img.shields.io/badge/Claude%20Code-Skill-orange.svg)](https://docs.anthropic.com/en/docs/claude-code/skills)
8
+ [![GitHub stars](https://img.shields.io/github/stars/matteoscurati/ai-consultants?style=social)](https://github.com/matteoscurati/ai-consultants)
9
+ [![agentskills.io](https://img.shields.io/badge/agentskills.io-compatible-blue.svg)](https://agentskills.io)
10
+
11
+ ---
12
+
13
+ ## Table of Contents
14
+
15
+ - [Why AI Consultants?](#why-ai-consultants)
16
+ - [Quick Start](#quick-start)
17
+ - [Prerequisites](#prerequisites)
18
+ - [Supported CLI Agents](#supported-cli-agents)
19
+ - [Claude Code](#claude-code)
20
+ - [OpenAI Codex CLI](#openai-codex-cli)
21
+ - [Gemini CLI](#gemini-cli)
22
+ - [Cursor / Copilot / Windsurf](#cursor--copilot--windsurf-via-skillport)
23
+ - [Aider](#aider)
24
+ - [Standalone Bash](#standalone-bash)
25
+ - [Consultants](#consultants)
26
+ - [Quality Tiers](#quality-tiers)
27
+ - [Configuration](#configuration)
28
+ - [How It Works](#how-it-works)
29
+ - [Best Practices](#best-practices)
30
+ - [Documentation](#documentation)
31
+ - [Changelog](#changelog)
32
+ - [License](#license)
33
+
34
+ ---
35
+
36
+ ## Why AI Consultants?
37
+
38
+ Making important technical decisions? Get **multiple expert perspectives** instantly:
39
+
40
+ - **15 AI consultants** with unique personas (Architect, Pragmatist, Devil's Advocate, etc.)
41
+ - **Automatic synthesis** combines all responses into a weighted recommendation
42
+ - **Confidence scoring** tells you how certain each consultant is
43
+ - **Multi-agent debate** lets consultants critique each other
44
+ - **Anonymous peer review** identifies the strongest arguments without bias
45
+ - **Local model support** via Ollama for complete privacy
46
+
47
+ ---
48
+
49
+ ## Quick Start
50
+
51
+ Get started in 30 seconds:
52
+
53
+ ### Option A: npx (recommended)
54
+
55
+ ```bash
56
+ # Run directly - no install needed
57
+ npx ai-consultants "How should I structure my authentication system?"
58
+
59
+ # With a preset
60
+ npx ai-consultants --preset balanced "Redis or Memcached?"
61
+
62
+ # Run diagnostics
63
+ npx ai-consultants doctor --fix
64
+
65
+ # Install slash commands for Claude Code
66
+ npx ai-consultants install
67
+ ```
68
+
69
+ ### Option B: curl | bash (Claude Code skill)
70
+
71
+ ```bash
72
+ # Install the skill
73
+ curl -fsSL https://raw.githubusercontent.com/matteoscurati/ai-consultants/main/scripts/install.sh | bash
74
+
75
+ # Ask your first question
76
+ /ai-consultants:consult "How should I structure my authentication system?"
77
+ ```
78
+
79
+ ### Update & Uninstall
80
+
81
+ ```bash
82
+ # npx always runs latest (or pin a version)
83
+ npx ai-consultants@latest "question"
84
+
85
+ # curl | bash update
86
+ ~/.claude/skills/ai-consultants/scripts/install.sh --update
87
+
88
+ # Uninstall (curl | bash only)
89
+ ~/.claude/skills/ai-consultants/scripts/install.sh --uninstall
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Prerequisites
95
+
96
+ Before installing AI Consultants, ensure you have the following dependencies installed.
97
+
98
+ ### Required Dependencies
99
+
100
+ | Dependency | Purpose |
101
+ |------------|---------|
102
+ | **jq** | JSON processing |
103
+ | **curl** | HTTP requests and connectivity |
104
+ | **Bash 4.0+** | Script execution (macOS ships with 3.2) |
105
+
106
+ ### Installation by Platform
107
+
108
+ #### macOS
109
+
110
+ ```bash
111
+ # Install Homebrew if not already installed
112
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
113
+
114
+ # Install required dependencies
115
+ brew install jq bash coreutils
116
+
117
+ # Verify installation
118
+ jq --version && bash --version | head -1
119
+ ```
120
+
121
+ > **Note:** macOS ships with Bash 3.2. The Homebrew version (4.x) is installed to `/opt/homebrew/bin/bash`.
122
+
123
+ #### Linux (Ubuntu/Debian)
124
+
125
+ ```bash
126
+ # Install required dependencies
127
+ sudo apt-get update
128
+ sudo apt-get install -y jq curl bash
129
+
130
+ # Verify installation
131
+ jq --version && bash --version | head -1
132
+ ```
133
+
134
+ #### Linux (Fedora/RHEL/CentOS)
135
+
136
+ ```bash
137
+ # Install required dependencies
138
+ sudo dnf install -y jq curl bash
139
+
140
+ # Verify installation
141
+ jq --version && bash --version | head -1
142
+ ```
143
+
144
+ #### Linux (Arch)
145
+
146
+ ```bash
147
+ # Install required dependencies
148
+ sudo pacman -S jq curl bash
149
+
150
+ # Verify installation
151
+ jq --version && bash --version | head -1
152
+ ```
153
+
154
+ #### Windows
155
+
156
+ Use **WSL (Windows Subsystem for Linux)**:
157
+
158
+ ```powershell
159
+ # Install WSL (run in PowerShell as Administrator)
160
+ wsl --install
161
+
162
+ # After restart, open WSL and follow Linux instructions
163
+ sudo apt-get update
164
+ sudo apt-get install -y jq curl bash
165
+ ```
166
+
167
+ Alternatively, use **Git Bash** or **MSYS2** with the required packages.
168
+
169
+ ### Optional Dependencies
170
+
171
+ For CLI-based consultants, you'll also need:
172
+
173
+ | Dependency | Required for |
174
+ |------------|--------------|
175
+ | **Node.js 18+** | Gemini CLI, Codex CLI, Kilo CLI |
176
+ | **Python 3.8+** | Mistral Vibe CLI, Aider |
177
+
178
+ ```bash
179
+ # macOS
180
+ brew install node python
181
+
182
+ # Ubuntu/Debian
183
+ sudo apt-get install -y nodejs npm python3 python3-pip
184
+
185
+ # Verify
186
+ node --version && python3 --version
187
+ ```
188
+
189
+ ### Verify All Prerequisites
190
+
191
+ Run the doctor command to check everything is installed:
192
+
193
+ ```bash
194
+ ./scripts/doctor.sh
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Supported CLI Agents
200
+
201
+ AI Consultants follows the open [Agent Skills standard](https://agentskills.io), enabling cross-platform compatibility.
202
+
203
+ ### Claude Code
204
+
205
+ > **Status:** ✅ Native support
206
+
207
+ **Installation:**
208
+
209
+ ```bash
210
+ curl -fsSL https://raw.githubusercontent.com/matteoscurati/ai-consultants/main/scripts/install.sh | bash
211
+ ```
212
+
213
+ **Slash Commands:**
214
+
215
+ | Command | Description |
216
+ |---------|-------------|
217
+ | `/ai-consultants:consult` | Main consultation - ask AI consultants a coding question |
218
+ | `/ai-consultants:debate` | Run consultation with multi-round debate |
219
+ | `/ai-consultants:help` | Show all commands and usage |
220
+
221
+ Configuration (presets, strategies, features, personas, API keys) can be managed via natural language — just ask.
222
+
223
+ **Self-Exclusion:** Claude consultant is automatically excluded when invoked from Claude Code.
224
+
225
+ **Verify:**
226
+
227
+ ```bash
228
+ ./scripts/doctor.sh
229
+ ```
230
+
231
+ ---
232
+
233
+ ### OpenAI Codex CLI
234
+
235
+ > **Status:** ✅ Compatible
236
+
237
+ **Installation:**
238
+
239
+ ```bash
240
+ git clone https://github.com/matteoscurati/ai-consultants.git ~/.codex/skills/ai-consultants
241
+ ~/.codex/skills/ai-consultants/scripts/doctor.sh --fix
242
+ ```
243
+
244
+ **Commands:**
245
+
246
+ Use the same slash commands as Claude Code. Codex CLI loads skills from `~/.codex/skills/`.
247
+
248
+ **Self-Exclusion:** Codex consultant is automatically excluded when invoked from Codex CLI.
249
+
250
+ **Verify:**
251
+
252
+ ```bash
253
+ ~/.codex/skills/ai-consultants/scripts/doctor.sh
254
+ ```
255
+
256
+ ---
257
+
258
+ ### Gemini CLI
259
+
260
+ > **Status:** ✅ Compatible
261
+
262
+ **Installation:**
263
+
264
+ ```bash
265
+ git clone https://github.com/matteoscurati/ai-consultants.git ~/.gemini/skills/ai-consultants
266
+ ~/.gemini/skills/ai-consultants/scripts/doctor.sh --fix
267
+ ```
268
+
269
+ **Commands:**
270
+
271
+ Use the same slash commands as Claude Code. Gemini CLI loads skills from `~/.gemini/skills/`.
272
+
273
+ **Self-Exclusion:** Gemini consultant is automatically excluded when invoked from Gemini CLI.
274
+
275
+ **Verify:**
276
+
277
+ ```bash
278
+ ~/.gemini/skills/ai-consultants/scripts/doctor.sh
279
+ ```
280
+
281
+ ---
282
+
283
+ ### Cursor / Copilot / Windsurf (via SkillPort)
284
+
285
+ > **Status:** ✅ Via SkillPort
286
+
287
+ **Installation:**
288
+
289
+ ```bash
290
+ # Install SkillPort if not already installed
291
+ npm install -g skillport
292
+
293
+ # Add AI Consultants skill
294
+ skillport add github.com/matteoscurati/ai-consultants
295
+
296
+ # Load skill in your agent
297
+ skillport show ai-consultants
298
+ ```
299
+
300
+ Or clone and use the included installer:
301
+
302
+ ```bash
303
+ git clone https://github.com/matteoscurati/ai-consultants.git
304
+ cd ai-consultants
305
+ ./scripts/skillport-install.sh
306
+ ```
307
+
308
+ **Commands:**
309
+
310
+ SkillPort translates skill commands to the native agent format.
311
+
312
+ **Self-Exclusion:** Cursor consultant is automatically excluded when invoked from Cursor.
313
+
314
+ **Verify:**
315
+
316
+ ```bash
317
+ skillport status ai-consultants
318
+ ```
319
+
320
+ ---
321
+
322
+ ### Aider
323
+
324
+ > **Status:** ✅ Via AGENTS.md
325
+
326
+ **Installation:**
327
+
328
+ ```bash
329
+ git clone https://github.com/matteoscurati/ai-consultants.git
330
+ cd ai-consultants
331
+ # Aider reads AGENTS.md for skill instructions
332
+ ```
333
+
334
+ **Usage:**
335
+
336
+ Reference the skill in your Aider session:
337
+
338
+ ```
339
+ /add AGENTS.md
340
+ # Then ask: "Use ai-consultants to review my code"
341
+ ```
342
+
343
+ **Self-Exclusion:** When using Aider as the invoking agent, set `INVOKING_AGENT=aider`.
344
+
345
+ **Verify:**
346
+
347
+ ```bash
348
+ ./scripts/doctor.sh
349
+ ```
350
+
351
+ ---
352
+
353
+ ### Standalone Bash
354
+
355
+ > **Status:** ✅ Direct execution
356
+
357
+ **Installation:**
358
+
359
+ ```bash
360
+ git clone https://github.com/matteoscurati/ai-consultants.git
361
+ cd ai-consultants
362
+ ./scripts/doctor.sh --fix
363
+ ./scripts/setup_wizard.sh
364
+ ```
365
+
366
+ **Commands:**
367
+
368
+ ```bash
369
+ # Basic consultation
370
+ ./scripts/consult_all.sh "How to optimize this function?" src/utils.py
371
+
372
+ # With preset
373
+ ./scripts/consult_all.sh --preset balanced "Redis or Memcached?"
374
+
375
+ # With debate
376
+ ENABLE_DEBATE=true DEBATE_ROUNDS=2 ./scripts/consult_all.sh "Microservices vs monolith?"
377
+
378
+ # With smart routing
379
+ ENABLE_SMART_ROUTING=true ./scripts/consult_all.sh "Bug in auth code"
380
+
381
+ # Follow-up questions
382
+ ./scripts/followup.sh "Can you elaborate on that point?"
383
+ ./scripts/followup.sh -c Gemini "Show me code example"
384
+ ```
385
+
386
+ **Self-Exclusion:** Set `INVOKING_AGENT` environment variable:
387
+
388
+ ```bash
389
+ INVOKING_AGENT=claude ./scripts/consult_all.sh "Question" # Claude excluded
390
+ INVOKING_AGENT=codex ./scripts/consult_all.sh "Question" # Codex excluded
391
+ ./scripts/consult_all.sh "Question" # No exclusion
392
+ ```
393
+
394
+ **Verify:**
395
+
396
+ ```bash
397
+ ./scripts/doctor.sh
398
+ ```
399
+
400
+ ---
401
+
402
+ ## Consultants
403
+
404
+ ### CLI-Based Consultants
405
+
406
+ | Consultant | CLI | Persona | Focus |
407
+ |------------|-----|---------|-------|
408
+ | **Google Gemini** | `gemini` | The Architect | Design patterns, scalability, enterprise |
409
+ | **OpenAI Codex** | `codex` | The Pragmatist | Simplicity, quick wins, proven solutions |
410
+ | **Mistral Vibe** | `vibe` | The Devil's Advocate | Problems, edge cases, vulnerabilities |
411
+ | **Kilo Code** | `kilocode` | The Innovator | Creativity, unconventional approaches |
412
+ | **Cursor** | `agent` | The Integrator | Full-stack perspective |
413
+ | **Aider** | `aider` | The Pair Programmer | Collaborative coding |
414
+ | **Amp** | `amp` | The Systems Thinker | System design, interactions, emergent behavior |
415
+ | **Kimi** | `kimi` | The Eastern Sage | Holistic, balanced perspectives |
416
+ | **Claude** | `claude` | The Synthesizer | Big picture, synthesis, connecting ideas |
417
+
418
+ ### API-Based Consultants
419
+
420
+ | Consultant | Default Model | Persona | Focus |
421
+ |------------|---------------|---------|-------|
422
+ | **Qwen3** | qwen3.5-plus | The Analyst | Data-driven analysis |
423
+ | **GLM** | glm-5 | The Methodologist | Structured approaches |
424
+ | **Grok** | grok-4-1-fast-reasoning | The Provocateur | Challenge conventions |
425
+ | **DeepSeek** | deepseek-reasoner | The Code Specialist | Algorithms, code generation |
426
+ | **MiniMax** | MiniMax-M2.5 | The Pragmatic Optimizer | Performance, efficiency, pragmatism |
427
+
428
+ ### Local Consultants
429
+
430
+ | Consultant | Default Model | Persona | Focus |
431
+ |------------|---------------|---------|-------|
432
+ | **Ollama** | qwen2.5-coder:32b | The Local Expert | Privacy-first, zero API cost |
433
+
434
+ ### Installing Consultant CLIs
435
+
436
+ At least 2 consultant CLIs are required:
437
+
438
+ ```bash
439
+ npm install -g @google/gemini-cli # Gemini
440
+ npm install -g @openai/codex # Codex
441
+ pip install mistral-vibe # Mistral
442
+ npm install -g @kilocode/cli # Kilo
443
+ curl https://cursor.com/install -fsS | bash # Cursor
444
+
445
+ # Optional CLI-based consultants
446
+ curl -fsSL https://ampcode.com/install.sh | bash # Amp
447
+ curl -L code.kimi.com/install.sh | bash # Kimi
448
+ npm install -g @qwen-code/qwen-code@latest # Qwen (alternative to API)
449
+
450
+ # For local inference (optional)
451
+ curl -fsSL https://ollama.com/install.sh | sh
452
+ ollama pull llama3.2
453
+ ```
454
+
455
+ ---
456
+
457
+ ## Quality Tiers
458
+
459
+ Choose the right balance of quality, speed, and cost with model quality tiers.
460
+
461
+ ### Tier Presets
462
+
463
+ | Preset | Tier | Agents | Debate | Reflection | Use Case |
464
+ |--------|------|--------|--------|------------|----------|
465
+ | `max_quality` | Premium | 7 (all) | 3 rounds | 2 cycles + peer review | Critical decisions |
466
+ | `medium` | Standard | 4 | 1 round | No | General questions |
467
+ | `fast` | Economy | 2 | No | No | Quick checks |
468
+ | `local` | Economy | 1 (Ollama) | No | No | Full privacy |
469
+
470
+ ### Models by Tier
471
+
472
+ | Consultant | Premium | Standard | Economy |
473
+ |------------|---------|----------|---------|
474
+ | Claude | opus-4.6 | sonnet-4.6 | haiku-4.5 |
475
+ | Gemini | gemini-3.1-pro-preview | gemini-3-flash-preview | gemini-2.0-flash |
476
+ | Codex | gpt-5.3-codex | gpt-5.3 | gpt-4o-mini |
477
+ | Mistral | mistral-large-3 | mistral-medium-latest | devstral-small-2 |
478
+ | Cursor | composer-1.5 | composer-1.5 | gemini-2.0-flash |
479
+ | DeepSeek | deepseek-reasoner | deepseek-v3.2 | deepseek-chat |
480
+ | GLM | glm-5 | glm-5 | glm-4-flash |
481
+ | Grok | grok-4-1-fast-reasoning | grok-3 | grok-3-mini |
482
+ | Qwen3 | qwen3.5-plus | qwen3.5-plus | qwen3-32b |
483
+ | Aider | gpt-5.3-codex | gpt-5.3 | gpt-4o-mini |
484
+ | MiniMax | MiniMax-M2.5 | MiniMax-M2.1 | MiniMax-M2.5-highspeed |
485
+ | Ollama | qwen2.5-coder:32b | llama3.3 | llama3.2 |
486
+
487
+ ### Usage
488
+
489
+ **Claude Code:**
490
+ ```
491
+ /ai-consultants:consult --preset max_quality "critical architecture decision"
492
+ /ai-consultants:consult --preset fast "quick syntax question"
493
+ ```
494
+
495
+ **Bash:**
496
+ ```bash
497
+ ./scripts/consult_all.sh --preset max_quality "microservices vs monolith?"
498
+ ./scripts/consult_all.sh --preset fast "how to use async/await?"
499
+
500
+ # Programmatic tier selection
501
+ source scripts/config.sh
502
+ apply_model_tier "premium" # Set all to premium models
503
+ apply_model_tier "economy" # Set all to economy models
504
+ ```
505
+
506
+ ---
507
+
508
+ ## Configuration
509
+
510
+ ### Presets
511
+
512
+ Choose how many consultants to use:
513
+
514
+ | Preset | Consultants | Tier | Use Case |
515
+ |--------|-------------|------|----------|
516
+ | `max_quality` | 7 (all) + debate + reflection | Premium | Critical decisions |
517
+ | `medium` | 4 + light debate | Standard | General questions |
518
+ | `fast` | 2 | Economy | Quick checks |
519
+ | `minimal` | 2 (Gemini + Codex) | Default | Quick questions, low cost |
520
+ | `balanced` | 4 (+ Mistral + Kilo) | Default | Standard consultations |
521
+ | `thorough` | 5 (+ Cursor) | Default | Comprehensive analysis |
522
+ | `high-stakes` | All + debate | Default | Critical decisions |
523
+ | `local` | Ollama only | Economy | Full privacy |
524
+ | `security` | Security-focused + debate | Default | Security reviews |
525
+ | `cost-capped` | Budget-conscious | Default | Minimal API costs |
526
+
527
+ **Bash:**
528
+ ```bash
529
+ ./scripts/consult_all.sh --preset balanced "Question"
530
+ ```
531
+
532
+ ### Synthesis Strategies
533
+
534
+ Control how responses are combined:
535
+
536
+ | Strategy | Description |
537
+ |----------|-------------|
538
+ | `majority` | Most common answer wins (default) |
539
+ | `risk_averse` | Weight conservative responses higher |
540
+ | `security_first` | Prioritize security considerations |
541
+ | `cost_capped` | Prefer simpler, cheaper solutions |
542
+ | `compare_only` | No recommendation, just comparison |
543
+
544
+ **Bash:**
545
+ ```bash
546
+ ./scripts/consult_all.sh --strategy risk_averse "Question"
547
+ ```
548
+
549
+ ### Environment Variables
550
+
551
+ ```bash
552
+ # Core features
553
+ ENABLE_DEBATE=true # Multi-agent debate
554
+ ENABLE_SYNTHESIS=true # Automatic synthesis
555
+ ENABLE_SMART_ROUTING=true # Intelligent consultant selection
556
+ ENABLE_PANIC_MODE=auto # Automatic rigor for uncertainty
557
+
558
+ # Defaults
559
+ DEFAULT_PRESET=balanced # Preset when --preset not given
560
+ DEFAULT_STRATEGY=majority # Strategy when --strategy not given
561
+
562
+ # Ollama (local models)
563
+ ENABLE_OLLAMA=true # Enable Ollama consultant
564
+ OLLAMA_MODEL=qwen2.5-coder:32b # Model to use (premium default)
565
+ OLLAMA_HOST=http://localhost:11434
566
+
567
+ # Cost management
568
+ MAX_SESSION_COST=1.00 # Budget limit in USD
569
+ WARN_AT_COST=0.50 # Warning threshold
570
+
571
+ # Panic mode
572
+ PANIC_CONFIDENCE_THRESHOLD=5 # Trigger threshold
573
+ PANIC_EXTRA_DEBATE_ROUNDS=1 # Additional rounds in panic mode
574
+ ```
575
+
576
+ ### Doctor Command
577
+
578
+ Diagnose and fix configuration issues:
579
+
580
+ ```bash
581
+ ./scripts/doctor.sh # Full diagnostic
582
+ ./scripts/doctor.sh --fix # Auto-fix common issues
583
+ ./scripts/doctor.sh --json # JSON output for automation
584
+ ```
585
+
586
+ ---
587
+
588
+ ## How It Works
589
+
590
+ ```
591
+ Query -> Classify -> Parallel Queries -> Voting -> Synthesis -> Report
592
+ | | |
593
+ Gemini (8) Consensus Recommendation
594
+ Codex (7) Analysis Comparison
595
+ Mistral (6) Risk Assessment
596
+ Kilo (9) Action Items
597
+ ```
598
+
599
+ With debate enabled:
600
+ ```
601
+ Round 1 -> Cross-Critique -> Round 2 -> Updated Positions -> Final Synthesis
602
+ ```
603
+
604
+ With peer review:
605
+ ```
606
+ Responses -> Anonymize -> Peer Ranking -> De-anonymize -> Peer Scores
607
+ ```
608
+
609
+ ### Output
610
+
611
+ Each consultation generates:
612
+
613
+ ```
614
+ /tmp/ai_consultations/TIMESTAMP/
615
+ ├── gemini.json # Individual responses
616
+ ├── codex.json # with confidence scores
617
+ ├── mistral.json
618
+ ├── kilo.json
619
+ ├── voting.json # Consensus calculation
620
+ ├── synthesis.json # Weighted recommendation
621
+ ├── report.md # Human-readable report
622
+ └── round_2/ # (if debate enabled)
623
+ ```
624
+
625
+ ---
626
+
627
+ ## Best Practices
628
+
629
+ ### When to Use High-Stakes Mode
630
+
631
+ - Architectural decisions affecting system design
632
+ - Security-critical code changes
633
+ - Performance-critical optimizations
634
+ - Decisions that are difficult to reverse
635
+
636
+ ### Interpreting Results
637
+
638
+ | Scenario | Recommendation |
639
+ |----------|----------------|
640
+ | High confidence + High consensus | Proceed with confidence |
641
+ | Low confidence OR Low consensus | Consider more options |
642
+ | Mistral (Devil's Advocate) disagrees | Investigate the risks |
643
+ | Panic mode triggered | Add more consultants or debate rounds |
644
+
645
+ ### Security
646
+
647
+ - **Never** include credentials or API keys in queries
648
+ - Use `--preset local` for sensitive code
649
+ - Files in `/tmp` are automatically cleaned up
650
+
651
+ ---
652
+
653
+ ## Documentation
654
+
655
+ - [Setup Guide](docs/SETUP.md) - Installation, authentication, Claude Code setup
656
+ - [Cost Rates](docs/COST_RATES.md) - Model pricing and budgets
657
+ - [Smart Routing](docs/SMART_ROUTING.md) - Category-based routing
658
+ - [JSON Schema](docs/JSON_SCHEMA.md) - Output format specification
659
+ - [Reference Details](references/details.md) - Presets, strategies, best practices
660
+ - [Contributing](CONTRIBUTING.md) - How to contribute
661
+
662
+ ---
663
+
664
+ ## Changelog
665
+
666
+ ### v2.10.0
667
+
668
+ - **MiniMax M2.5 support**: New API-based consultant with "The Pragmatic Optimizer" persona
669
+ - **15 consultants total**: Gemini, Codex, Mistral, Kilo, Cursor, Aider, Amp, Kimi, Claude, Qwen3, GLM, Grok, DeepSeek, MiniMax, Ollama
670
+ - **npx distribution**: `npx ai-consultants "question"` - run directly without install
671
+ - **npm packaging**: `package.json` with zero dependencies, `.npmignore` for clean publishing
672
+
673
+ ### v2.8.1
674
+
675
+ - **Bug fixes**: Fixed `((count++))` abort under `set -e`, missing Amp in consultant map, hardcoded `claude` in synthesize.sh
676
+ - **Security**: Variable name validation before `export` in escalation and cost-aware routing
677
+ - **DRY refactoring**: Rewrote `query_kilo.sh` and `query_cursor.sh` using shared `process_consultant_response()`; added `get_model_for_tier()` as single source of truth
678
+
679
+ ### v2.8.0
680
+
681
+ - **Amp CLI support**: New consultant with "The Systems Thinker" persona
682
+ - **13 consultants total**: Gemini, Codex, Mistral, Kilo, Cursor, Aider, Amp, Claude, Qwen3, GLM, Grok, DeepSeek, Ollama
683
+ - **Installation**: `curl -fsSL https://ampcode.com/install.sh | bash`
684
+
685
+ ### v2.7.0
686
+
687
+ - **Qwen CLI support**: CLI/API mode switching for Qwen3 via qwen-code
688
+ - **5 switchable agents**: Gemini, Codex, Claude, Mistral, and now Qwen3 support CLI/API mode
689
+ - **CLI default**: `QWEN3_USE_API` defaults to `false` (CLI mode via qwen-code)
690
+
691
+ ### v2.6.0
692
+
693
+ - **CLI/API mode switching**: Gemini, Codex, Claude, and Mistral can switch between CLI and API mode
694
+ - **New environment variables**: `*_USE_API` and `*_API_URL` for each switchable agent
695
+ - **Unified API query module**: `lib/api_query.sh` for consistent API handling
696
+
697
+ ### v2.5.0
698
+
699
+ - **Model quality tiers**: Premium, standard, and economy tiers for all consultants
700
+ - **New presets**: `max_quality`, `medium`, `fast` for quick tier selection
701
+ - **Premium defaults**: All consultants now use premium models by default (March 2026)
702
+ - **`apply_model_tier()` function**: Programmatically switch all models to a tier
703
+ - **Updated models**: opus-4.6, gemini-3.1-pro-preview, gpt-5.3-codex, mistral-large-3, etc.
704
+
705
+ ### v2.4.0
706
+
707
+ - **Budget enforcement**: Optional budget limits with configurable actions (warn/stop)
708
+ - **Budget checks**: 4 enforcement points (before/after consultation, debate, synthesis)
709
+ - **Budget configuration**: Configurable via natural language or environment variables
710
+
711
+ ### v2.3.0
712
+
713
+ - **Semantic caching**: Cache responses to avoid redundant API calls (15-25% savings)
714
+ - **Cost-aware routing**: Route simple queries to cheaper models (30-50% savings)
715
+ - **Fallback escalation**: Auto-escalate to premium model if confidence < 7
716
+ - **Debate optimization**: Skip debate if all consultants agree (opt-in)
717
+ - **Category exceptions**: SECURITY/ARCHITECTURE always trigger debate
718
+ - **Quality monitoring**: `optimization_metrics.json` tracks optimization impact
719
+ - **Compact reports**: Shorter reports by default (summaries only)
720
+ - **Response limits**: Per-category token limits (opt-in)
721
+
722
+ ### v2.2.0
723
+
724
+ - **Claude consultant**: New consultant with "The Synthesizer" persona
725
+ - **Self-exclusion**: Invoking agent automatically excluded from panel
726
+ - **Presets**: Quick configuration with `--preset minimal/balanced/high-stakes/local`
727
+ - **Doctor command**: Diagnostic and auto-fix tool
728
+ - **Synthesis strategies**: `--strategy majority/risk_averse/security_first/compare_only`
729
+ - **Confidence intervals**: Statistical confidence ranges (e.g., "8 +/- 1.2")
730
+ - **Anonymous peer review**: Unbiased evaluation of responses
731
+ - **Ollama support**: Local model inference for privacy
732
+ - **Panic mode**: Automatic rigor when uncertainty detected
733
+ - **One-liner install**: `curl | bash` installation
734
+
735
+ ### v2.1.0
736
+
737
+ - New consultants: Aider, DeepSeek
738
+ - 17 configurable personas
739
+ - Token optimization with AST extraction
740
+
741
+ ### v2.0.0
742
+
743
+ - Persona system with 15 predefined roles
744
+ - Confidence scoring (1-10) on every response
745
+ - Auto-synthesis with weighted recommendations
746
+ - Multi-Agent Debate (MAD)
747
+ - Smart routing by question category
748
+ - Session management and cost tracking
749
+
750
+ ---
751
+
752
+ ## License
753
+
754
+ MIT License - see [LICENSE](LICENSE) for details.
755
+
756
+ ## Contributing
757
+
758
+ Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.