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/docs/SETUP.md ADDED
@@ -0,0 +1,879 @@
1
+ # Setup Guide - AI Consultants v2.10
2
+
3
+ This guide walks you through installing and configuring AI Consultants for various AI coding agents.
4
+
5
+ ---
6
+
7
+ ## Supported Agents
8
+
9
+ AI Consultants follows the open [Agent Skills standard](https://agentskills.io), enabling cross-platform compatibility:
10
+
11
+ | Agent | Skills Directory | Status |
12
+ |-------|-----------------|--------|
13
+ | **Claude Code** | `~/.claude/skills/` | ✅ Native |
14
+ | **OpenAI Codex CLI** | `~/.codex/skills/` | ✅ Compatible |
15
+ | **Gemini CLI** | `~/.gemini/skills/` | ✅ Compatible |
16
+ | **Kilo Code** | Via agentskills | ✅ Compatible |
17
+ | **GitHub Copilot** | Via SkillPort | ✅ Via AGENTS.md |
18
+ | **Cursor** | Via SkillPort | ✅ Via SkillPort |
19
+ | **Windsurf** | Via SkillPort | ✅ Via SkillPort |
20
+ | **Aider** | Via AGENTS.md | ✅ Via AGENTS.md |
21
+
22
+ ---
23
+
24
+ ## Claude Code Setup (Recommended)
25
+
26
+ AI Consultants is designed as a **Claude Code skill**. This is the fastest and easiest way to get started.
27
+
28
+ ### Step 1: Install the Skill
29
+
30
+ ```bash
31
+ # One-liner installation
32
+ curl -fsSL https://raw.githubusercontent.com/matteoscurati/ai-consultants/main/scripts/install.sh | bash
33
+ ```
34
+
35
+ This installs to `~/.claude/skills/ai-consultants/` and makes slash commands available in Claude Code.
36
+
37
+ ### Step 2: Verify Installation
38
+
39
+ ```bash
40
+ ./scripts/doctor.sh --fix
41
+ ```
42
+
43
+ You should see at least 2 consultants marked as available.
44
+
45
+ ### Step 3: Your First Consultation
46
+
47
+ ```
48
+ /ai-consultants:consult "What's the best way to structure a REST API?"
49
+ ```
50
+
51
+ That's it! You're ready to go.
52
+
53
+ ---
54
+
55
+ ## Claude Code Slash Commands
56
+
57
+ AI Consultants provides 3 slash commands:
58
+
59
+ | Command | Description |
60
+ |---------|-------------|
61
+ | `/ai-consultants:consult` | Main consultation - ask AI consultants a coding question |
62
+ | `/ai-consultants:debate` | Run consultation with multi-round debate |
63
+ | `/ai-consultants:help` | Show all commands and usage |
64
+
65
+ Configuration (presets, strategies, features, personas, API keys) can be managed via natural language — just ask.
66
+
67
+ All settings are saved to `~/.claude/skills/ai-consultants/.env`.
68
+
69
+ ---
70
+
71
+ ## OpenAI Codex CLI Setup
72
+
73
+ Codex CLI supports the Agent Skills standard and can use AI Consultants directly.
74
+
75
+ ### Step 1: Install the Skill
76
+
77
+ ```bash
78
+ # Option A: Clone directly
79
+ git clone https://github.com/matteoscurati/ai-consultants.git ~/.codex/skills/ai-consultants
80
+
81
+ # Option B: Symlink from existing installation
82
+ ln -s ~/.claude/skills/ai-consultants ~/.codex/skills/ai-consultants
83
+
84
+ # Option C: Symlink from any location
85
+ ln -s /path/to/ai-consultants ~/.codex/skills/ai-consultants
86
+ ```
87
+
88
+ ### Step 2: Verify Installation
89
+
90
+ ```bash
91
+ ~/.codex/skills/ai-consultants/scripts/doctor.sh --fix
92
+ ```
93
+
94
+ ### Step 3: Use in Codex
95
+
96
+ Once installed, Codex CLI will discover the skill and make slash commands available.
97
+
98
+ ---
99
+
100
+ ## Gemini CLI Setup
101
+
102
+ Gemini CLI also supports the Agent Skills standard.
103
+
104
+ ### Installation
105
+
106
+ ```bash
107
+ # Option A: Clone directly
108
+ git clone https://github.com/matteoscurati/ai-consultants.git ~/.gemini/skills/ai-consultants
109
+
110
+ # Option B: Symlink
111
+ ln -s ~/.claude/skills/ai-consultants ~/.gemini/skills/ai-consultants
112
+ ```
113
+
114
+ ### Verify
115
+
116
+ ```bash
117
+ ~/.gemini/skills/ai-consultants/scripts/doctor.sh
118
+ ```
119
+
120
+ ---
121
+
122
+ ## SkillPort Setup (Multi-Agent)
123
+
124
+ [SkillPort](https://github.com/gotalab/skillport) is a universal skill manager that enables skill portability across agents like Cursor, Copilot, and Windsurf.
125
+
126
+ ### Step 1: Install SkillPort
127
+
128
+ ```bash
129
+ npm install -g skillport
130
+ ```
131
+
132
+ ### Step 2: Add AI Consultants
133
+
134
+ ```bash
135
+ # From GitHub
136
+ skillport add github.com/matteoscurati/ai-consultants
137
+
138
+ # Or from local clone
139
+ git clone https://github.com/matteoscurati/ai-consultants.git
140
+ cd ai-consultants
141
+ ./scripts/skillport-install.sh
142
+ ```
143
+
144
+ ### Step 3: Verify Installation
145
+
146
+ ```bash
147
+ skillport list # Should show ai-consultants
148
+ ./scripts/skillport-install.sh status # Detailed status
149
+ ```
150
+
151
+ ### Step 4: Use in Your Agent
152
+
153
+ ```bash
154
+ # Load skill on demand
155
+ skillport show ai-consultants
156
+ ```
157
+
158
+ SkillPort also generates `AGENTS.md` for agents that use that format (Copilot, Cursor, Aider).
159
+
160
+ ---
161
+
162
+ ## Generic agentskills Setup
163
+
164
+ For any agent that supports the [agentskills.io](https://agentskills.io) standard:
165
+
166
+ ### Installation
167
+
168
+ ```bash
169
+ # Clone to the agent's skills directory
170
+ git clone https://github.com/matteoscurati/ai-consultants.git ~/.{agent}/skills/ai-consultants
171
+
172
+ # Replace {agent} with your agent name (claude, codex, gemini, etc.)
173
+ ```
174
+
175
+ ### Files Available
176
+
177
+ | File | Purpose |
178
+ |------|---------|
179
+ | `SKILL.md` | Primary skill specification (agentskills.io format) |
180
+ | `AGENTS.md` | Alternative discovery format (Copilot/Cursor/Aider) |
181
+ | `scripts/` | Executable scripts for consultations |
182
+
183
+ ---
184
+
185
+ ## Prerequisites
186
+
187
+ Before installing consultant CLIs, ensure you have:
188
+
189
+ ### Required
190
+ - **jq** for JSON processing
191
+ - **curl** for API connectivity checks
192
+
193
+ ### Recommended
194
+ - **Bash 4.0+** (macOS ships with 3.2 - install newer version)
195
+ - **timeout/gtimeout** for command timeouts (has POSIX fallback)
196
+ - **Node.js 18+** for npm-based CLIs
197
+ - **Python 3.8+** for pip-based CLIs
198
+
199
+ ### Optional
200
+ - **bc** for cost calculations (usually pre-installed)
201
+
202
+ ### Install Bash 4+ (macOS)
203
+
204
+ ```bash
205
+ brew install bash
206
+ sudo bash -c 'echo /opt/homebrew/bin/bash >> /etc/shells'
207
+ ```
208
+
209
+ ### Install jq
210
+
211
+ ```bash
212
+ # macOS
213
+ brew install jq
214
+
215
+ # Ubuntu/Debian
216
+ sudo apt-get install jq
217
+
218
+ # Verify
219
+ jq --version
220
+ ```
221
+
222
+ ### Install timeout (macOS)
223
+
224
+ macOS doesn't include `timeout` by default. Install coreutils for `gtimeout`:
225
+
226
+ ```bash
227
+ brew install coreutils
228
+
229
+ # Verify (gtimeout on macOS, timeout on Linux)
230
+ gtimeout --version
231
+ ```
232
+
233
+ > **Note:** If timeout/gtimeout is not available, AI Consultants uses a POSIX fallback.
234
+
235
+ ---
236
+
237
+ ## Consultant CLIs
238
+
239
+ You need **at least 2 consultants** configured for AI Consultants to work.
240
+
241
+ ### Gemini CLI (The Architect)
242
+
243
+ ```bash
244
+ npm install -g @google/gemini-cli
245
+
246
+ # Authentication
247
+ gemini auth login
248
+ # OR: export GOOGLE_API_KEY="your-key"
249
+ ```
250
+
251
+ Get API key: [Google AI Studio](https://makersuite.google.com/app/apikey)
252
+
253
+ ### Codex CLI (The Pragmatist)
254
+
255
+ ```bash
256
+ npm install -g @openai/codex
257
+
258
+ # Authentication
259
+ export OPENAI_API_KEY="sk-your-key"
260
+ ```
261
+
262
+ Get API key: [OpenAI Platform](https://platform.openai.com/api-keys)
263
+
264
+ ### Mistral Vibe CLI (The Devil's Advocate)
265
+
266
+ ```bash
267
+ pip install mistral-vibe
268
+
269
+ # Authentication
270
+ export MISTRAL_API_KEY="your-key"
271
+ ```
272
+
273
+ Get API key: [Mistral Console](https://console.mistral.ai/api-keys/)
274
+
275
+ ### Kilo CLI (The Innovator)
276
+
277
+ ```bash
278
+ npm install -g @kilocode/cli
279
+
280
+ # Authentication
281
+ kilocode auth login
282
+ ```
283
+
284
+ ### Cursor CLI (The Integrator)
285
+
286
+ ```bash
287
+ curl https://cursor.com/install -fsS | bash
288
+
289
+ # Uses Cursor subscription - no additional key needed
290
+ ```
291
+
292
+ ### Aider CLI (The Pair Programmer)
293
+
294
+ ```bash
295
+ pip install aider-chat
296
+
297
+ # Authentication
298
+ export OPENAI_API_KEY="sk-your-key" # Or other provider
299
+ ```
300
+
301
+ ### Claude CLI (The Synthesizer) - v2.2
302
+
303
+ ```bash
304
+ # Claude CLI is part of Claude Code
305
+ # See https://docs.anthropic.com/en/docs/claude-code for installation
306
+
307
+ # Verify installation
308
+ claude --version
309
+ ```
310
+
311
+ ### Qwen CLI (The Analyst) - v2.7
312
+
313
+ ```bash
314
+ npm install -g @qwen-code/qwen-code@latest
315
+
316
+ # Verify installation
317
+ qwen --version
318
+
319
+ # Or use API mode
320
+ export QWEN3_USE_API=true
321
+ export QWEN3_API_KEY="your-dashscope-key"
322
+ ```
323
+
324
+ Get API key: [Alibaba Cloud DashScope](https://dashscope.console.aliyun.com/)
325
+
326
+ **CLI/API Mode**: Qwen3 defaults to CLI mode (`QWEN3_USE_API=false`). Set to `true` to use the DashScope API.
327
+
328
+ ### Amp CLI (The Systems Thinker) - v2.8
329
+
330
+ ```bash
331
+ # One-liner installation
332
+ curl -fsSL https://ampcode.com/install.sh | bash
333
+
334
+ # Verify installation
335
+ amp --version
336
+
337
+ # Authentication
338
+ export AMP_API_KEY="your-amp-key"
339
+ ```
340
+
341
+ Get API key: [Amp Code](https://ampcode.com)
342
+
343
+ **Usage**: Amp CLI uses `-x` flag for non-interactive execution (required for script integration).
344
+
345
+ ### Kimi CLI (The Eastern Sage) - v2.9
346
+
347
+ ```bash
348
+ curl -L code.kimi.com/install.sh | bash
349
+ ```
350
+
351
+ Verify: `kimi --version`
352
+
353
+ ### MiniMax (API-only) - v2.10
354
+
355
+ MiniMax requires an API key — no CLI installation needed.
356
+
357
+ ```bash
358
+ export MINIMAX_API_KEY="your-key"
359
+ export ENABLE_MINIMAX=true
360
+ ```
361
+
362
+ ---
363
+
364
+ ## Ollama (Local Models) - v2.2
365
+
366
+ Run consultations 100% locally with zero API cost and full privacy.
367
+
368
+ ### Installation
369
+
370
+ **macOS/Linux:**
371
+ ```bash
372
+ curl -fsSL https://ollama.com/install.sh | sh
373
+ ```
374
+
375
+ **macOS (Homebrew):**
376
+ ```bash
377
+ brew install ollama
378
+ ```
379
+
380
+ **Verify installation:**
381
+ ```bash
382
+ ollama --version
383
+ ```
384
+
385
+ ### Start Server
386
+
387
+ Ollama needs a running server:
388
+
389
+ ```bash
390
+ # Start in background
391
+ ollama serve &
392
+
393
+ # Or start manually before consultation
394
+ ollama serve
395
+ ```
396
+
397
+ ### Pull Models
398
+
399
+ ```bash
400
+ # Recommended for general use
401
+ ollama pull llama3.2
402
+
403
+ # For code-specific tasks
404
+ ollama pull codellama
405
+ ollama pull deepseek-coder
406
+
407
+ # Smaller/faster options
408
+ ollama pull mistral
409
+ ollama pull qwen2.5-coder
410
+ ```
411
+
412
+ ### Configuration
413
+
414
+ **Environment variables:**
415
+ ```bash
416
+ # Enable Ollama consultant
417
+ export ENABLE_OLLAMA=true
418
+
419
+ # Choose model (default: qwen2.5-coder:32b)
420
+ export OLLAMA_MODEL=qwen2.5-coder:32b
421
+
422
+ # Server URL (default: localhost)
423
+ export OLLAMA_HOST=http://localhost:11434
424
+
425
+ # Timeout (default: 300s - longer for local inference)
426
+ export OLLAMA_TIMEOUT=300
427
+ ```
428
+
429
+ ### Usage
430
+
431
+ **Bash:**
432
+ ```bash
433
+ # Use local preset (Ollama only)
434
+ ./scripts/consult_all.sh --preset local "Your question"
435
+
436
+ # Add Ollama to other presets
437
+ ENABLE_OLLAMA=true ./scripts/consult_all.sh --preset balanced "Question"
438
+ ```
439
+
440
+ ### Multi-Model Local
441
+
442
+ Query multiple local models:
443
+
444
+ ```bash
445
+ export OLLAMA_MODELS="llama3.2,codellama,mistral"
446
+ ./scripts/consult_all.sh --preset local "Question"
447
+ ```
448
+
449
+ ### Troubleshooting Ollama
450
+
451
+ **Server not running:**
452
+ ```bash
453
+ # Check if running
454
+ curl http://localhost:11434/api/tags
455
+
456
+ # Start server
457
+ ollama serve
458
+ ```
459
+
460
+ **Model not found:**
461
+ ```bash
462
+ # List available models
463
+ ollama list
464
+
465
+ # Pull missing model
466
+ ollama pull llama3.2
467
+ ```
468
+
469
+ **Slow inference:**
470
+ - Use smaller models (`mistral`, `qwen2.5-coder:7b`)
471
+ - Increase timeout: `OLLAMA_TIMEOUT=600`
472
+
473
+ ---
474
+
475
+ ## Self-Exclusion (v2.2)
476
+
477
+ When AI Consultants is invoked from a specific AI agent, that agent is automatically excluded from the consultant panel to prevent self-consultation.
478
+
479
+ ### How It Works
480
+
481
+ | Invoking Agent | Excluded Consultant | Other Consultants |
482
+ |----------------|---------------------|-------------------|
483
+ | Claude Code | Claude | Gemini, Codex, Mistral, Kilo, Cursor, Amp, Qwen, etc. |
484
+ | Codex CLI | Codex | Claude, Gemini, Mistral, Kilo, Cursor, Amp, Qwen, etc. |
485
+ | Gemini CLI | Gemini | Claude, Codex, Mistral, Kilo, Cursor, Amp, Qwen, etc. |
486
+ | Cursor | Cursor | Claude, Gemini, Codex, Mistral, Kilo, Amp, Qwen, etc. |
487
+ | Amp CLI | Amp | Claude, Gemini, Codex, Mistral, Kilo, Cursor, Qwen, etc. |
488
+ | Qwen CLI | Qwen3 | Claude, Gemini, Codex, Mistral, Kilo, Cursor, Amp, etc. |
489
+ | Kimi CLI | Kimi | All except Kimi |
490
+ | Bash (direct) | None | All enabled consultants (up to 15) |
491
+
492
+ ### Automatic Detection
493
+
494
+ When using slash commands, `INVOKING_AGENT` is set automatically:
495
+ - Claude Code: `/ai-consultants:consult` sets `INVOKING_AGENT=claude`
496
+ - Codex CLI: `/ai-consultants:consult` sets `INVOKING_AGENT=codex`
497
+ - Gemini CLI: `/ai-consultants:consult` sets `INVOKING_AGENT=gemini`
498
+
499
+ ### Manual Usage (Bash)
500
+
501
+ ```bash
502
+ # Claude excluded from panel
503
+ INVOKING_AGENT=claude ./scripts/consult_all.sh "Question"
504
+
505
+ # Codex excluded from panel
506
+ INVOKING_AGENT=codex ./scripts/consult_all.sh "Question"
507
+
508
+ # No exclusion (all enabled consultants)
509
+ ./scripts/consult_all.sh "Question"
510
+ ```
511
+
512
+ ---
513
+
514
+ ## CLI/API Mode Switching (v2.6+)
515
+
516
+ Five consultants can switch between CLI mode (using local CLI tools) and API mode (direct API calls): **Gemini, Codex, Claude, Mistral, and Qwen3**.
517
+
518
+ ### Why Use API Mode?
519
+
520
+ - **No CLI installation required**: Use API keys without installing CLI tools
521
+ - **Consistent behavior**: API responses are more predictable
522
+ - **Easier deployment**: No need to manage CLI binaries
523
+
524
+ ### Configuration
525
+
526
+ ```bash
527
+ # Enable API mode for individual consultants
528
+ export GEMINI_USE_API=true
529
+ export GEMINI_API_KEY="your-google-ai-key"
530
+
531
+ export CODEX_USE_API=true
532
+ export OPENAI_API_KEY="sk-..."
533
+
534
+ export CLAUDE_USE_API=true
535
+ export ANTHROPIC_API_KEY="sk-ant-..."
536
+
537
+ export MISTRAL_USE_API=true
538
+ export MISTRAL_API_KEY="your-mistral-key"
539
+
540
+ export QWEN3_USE_API=true # Enable API mode for Qwen3
541
+ export QWEN3_API_KEY="your-dashscope-key"
542
+ ```
543
+
544
+ ### API Endpoints (Custom)
545
+
546
+ ```bash
547
+ GEMINI_API_URL=https://generativelanguage.googleapis.com/v1beta/models
548
+ CODEX_API_URL=https://api.openai.com/v1/chat/completions
549
+ CLAUDE_API_URL=https://api.anthropic.com/v1/messages
550
+ MISTRAL_API_URL=https://api.mistral.ai/v1/chat/completions
551
+ QWEN3_API_URL=https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions
552
+ ```
553
+
554
+ ### Mode Detection
555
+
556
+ Check current mode with doctor command:
557
+
558
+ ```bash
559
+ ./scripts/doctor.sh --verbose
560
+ # Shows:
561
+ # ✓ Gemini: API mode (key: AIza...1234)
562
+ # ○ Codex: CLI mode
563
+ # ○ Claude: CLI mode
564
+ # ○ Mistral: CLI mode
565
+ # ✓ Qwen3: API mode (key: sk-...abcd)
566
+ ```
567
+
568
+ ---
569
+
570
+ ## Configuration Presets (v2.2)
571
+
572
+ Presets let you quickly configure how many consultants to use.
573
+
574
+ ### Available Presets
575
+
576
+ | Preset | Consultants | Use Case |
577
+ |--------|-------------|----------|
578
+ | `minimal` | 2 (Gemini + Codex) | Quick, cheap |
579
+ | `balanced` | 4 (+ Mistral + Kilo) | Standard |
580
+ | `thorough` | 5 (+ Cursor) | Comprehensive |
581
+ | `high-stakes` | All + debate | Critical decisions |
582
+ | `local` | Ollama only | Privacy |
583
+ | `security` | Security-focused + debate | Security reviews |
584
+ | `cost-capped` | Budget-friendly | Low cost |
585
+
586
+ ### Set Default Preset
587
+
588
+ **Bash:**
589
+ ```bash
590
+ # Add to .env
591
+ DEFAULT_PRESET=balanced
592
+ ```
593
+
594
+ ### Override Per Consultation
595
+
596
+ **Claude Code:** Specify in your question context.
597
+
598
+ **Bash:**
599
+ ```bash
600
+ ./scripts/consult_all.sh --preset high-stakes "Critical question"
601
+ ```
602
+
603
+ ---
604
+
605
+ ## Synthesis Strategies (v2.2)
606
+
607
+ Strategies control how consultant responses are combined.
608
+
609
+ ### Available Strategies
610
+
611
+ | Strategy | Description |
612
+ |----------|-------------|
613
+ | `majority` | Simple voting, most common answer wins (default) |
614
+ | `risk_averse` | Weight conservative responses higher |
615
+ | `security_first` | Prioritize security-focused insights |
616
+ | `cost_capped` | Prefer simpler, cheaper solutions |
617
+ | `compare_only` | No recommendation, just comparison |
618
+
619
+ ### Set Default Strategy
620
+
621
+ **Bash:**
622
+ ```bash
623
+ # Add to .env
624
+ DEFAULT_STRATEGY=risk_averse
625
+ ```
626
+
627
+ ### Strategy Recommendations
628
+
629
+ | Use Case | Recommended Strategy |
630
+ |----------|---------------------|
631
+ | General questions | `majority` |
632
+ | Production deployments | `risk_averse` |
633
+ | Security audits | `security_first` |
634
+ | Budget constraints | `cost_capped` |
635
+ | Learning/exploration | `compare_only` |
636
+
637
+ ---
638
+
639
+ ## Environment Configuration
640
+
641
+ ### Using .env file
642
+
643
+ ```bash
644
+ cp .env.example .env
645
+ ```
646
+
647
+ Edit `.env`:
648
+
649
+ ```bash
650
+ # Enable/disable consultants (15 available)
651
+ ENABLE_GEMINI=true
652
+ ENABLE_CODEX=true
653
+ ENABLE_CLAUDE=false # Auto-excluded when invoked from Claude Code
654
+ ENABLE_MISTRAL=false
655
+ ENABLE_KILO=false
656
+ ENABLE_CURSOR=false
657
+ ENABLE_AIDER=false
658
+ ENABLE_AMP=false # v2.8: The Systems Thinker
659
+ ENABLE_QWEN3=false # v2.7: The Analyst (CLI/API)
660
+ ENABLE_GLM=false
661
+ ENABLE_GROK=false
662
+ ENABLE_DEEPSEEK=false
663
+ ENABLE_KIMI=true
664
+ ENABLE_MINIMAX=true
665
+ MINIMAX_API_KEY=your-key
666
+ ENABLE_OLLAMA=true
667
+
668
+ # Self-exclusion (v2.2)
669
+ INVOKING_AGENT=unknown # Set automatically by slash commands
670
+
671
+ # API Keys
672
+ GOOGLE_API_KEY=your-key
673
+ OPENAI_API_KEY=sk-your-key
674
+ MISTRAL_API_KEY=your-key
675
+ ANTHROPIC_API_KEY=sk-ant-your-key
676
+ AMP_API_KEY=your-amp-key
677
+ QWEN3_API_KEY=your-dashscope-key
678
+
679
+ # CLI/API Mode Switching (v2.6+)
680
+ GEMINI_USE_API=false
681
+ CODEX_USE_API=false
682
+ CLAUDE_USE_API=false
683
+ MISTRAL_USE_API=false
684
+ QWEN3_USE_API=false # Default: CLI mode
685
+
686
+ # Defaults (v2.8)
687
+ DEFAULT_PRESET=balanced
688
+ DEFAULT_STRATEGY=majority
689
+
690
+ # Ollama
691
+ OLLAMA_MODEL=qwen2.5-coder:32b
692
+
693
+ # Features
694
+ ENABLE_DEBATE=false
695
+ ENABLE_SYNTHESIS=true
696
+ ENABLE_PANIC_MODE=auto
697
+
698
+ # Budget (v2.4)
699
+ ENABLE_BUDGET_LIMIT=false
700
+ MAX_SESSION_COST=1.00
701
+ BUDGET_ACTION=warn
702
+ ```
703
+
704
+ ### Minimum Requirements
705
+
706
+ **At least 2 consultants must be enabled.**
707
+
708
+ Example configurations:
709
+
710
+ **OpenAI + Google:**
711
+ ```bash
712
+ ENABLE_GEMINI=true
713
+ ENABLE_CODEX=true
714
+ ENABLE_MISTRAL=false
715
+ ENABLE_KILO=false
716
+ ```
717
+
718
+ **OpenAI + Local:**
719
+ ```bash
720
+ ENABLE_CODEX=true
721
+ ENABLE_OLLAMA=true
722
+ ENABLE_GEMINI=false
723
+ ENABLE_MISTRAL=false
724
+ ```
725
+
726
+ **Local only:**
727
+ ```bash
728
+ ENABLE_OLLAMA=true
729
+ OLLAMA_MODELS="llama3.2,codellama"
730
+ # All others false
731
+ ```
732
+
733
+ ---
734
+
735
+ ## Verification
736
+
737
+ ### Doctor Command
738
+
739
+ ```bash
740
+ ./scripts/doctor.sh
741
+ ```
742
+
743
+ Checks:
744
+ - CLI tools installed
745
+ - API keys configured
746
+ - Ollama server running
747
+ - Configuration valid
748
+
749
+ **Auto-fix issues:**
750
+ ```bash
751
+ ./scripts/doctor.sh --fix
752
+ ```
753
+
754
+ ### Preflight Check
755
+
756
+ ```bash
757
+ ./scripts/preflight_check.sh
758
+ ```
759
+
760
+ Expected output:
761
+ ```
762
+ [OK] jq installed
763
+ [OK] Gemini CLI installed and authenticated
764
+ [OK] Codex CLI installed and authenticated
765
+ [OK] Ollama server running
766
+
767
+ Status: Ready (3/4 consultants available)
768
+ ```
769
+
770
+ ### Setup Wizard (Bash)
771
+
772
+ Interactive configuration:
773
+
774
+ ```bash
775
+ ./scripts/setup_wizard.sh
776
+ ```
777
+
778
+ The wizard will:
779
+ 1. Check installed CLIs
780
+ 2. Test authentication
781
+ 3. Suggest configuration
782
+ 4. Generate `.env` file
783
+
784
+ ---
785
+
786
+ ## Troubleshooting
787
+
788
+ ### "Command not found" errors
789
+
790
+ ```bash
791
+ # Check npm global path
792
+ npm list -g --depth=0
793
+
794
+ # Check pip packages
795
+ pip list | grep mistral
796
+ ```
797
+
798
+ ### Authentication failures
799
+
800
+ **Gemini:**
801
+ ```bash
802
+ gemini auth logout
803
+ gemini auth login
804
+ ```
805
+
806
+ **Codex:**
807
+ ```bash
808
+ echo $OPENAI_API_KEY # Verify set
809
+ ```
810
+
811
+ ### Timeout errors
812
+
813
+ Increase timeout in `.env`:
814
+ ```bash
815
+ GEMINI_TIMEOUT=300
816
+ CODEX_TIMEOUT=300
817
+ OLLAMA_TIMEOUT=600 # Local models need more time
818
+ ```
819
+
820
+ ### "Less than 2 consultants" error
821
+
822
+ Either:
823
+ 1. Install another CLI
824
+ 2. Enable Ollama for local inference
825
+ 3. Run `./scripts/doctor.sh --fix`
826
+
827
+ ### Claude Code Issues
828
+
829
+ | Issue | Solution |
830
+ |-------|----------|
831
+ | "Unknown skill" | Run install script again |
832
+ | Commands not showing | Restart Claude Code |
833
+ | "Exit code 1" | Run `./scripts/doctor.sh` |
834
+ | Configuration not saving | Check file permissions on `~/.claude/skills/` |
835
+
836
+ ---
837
+
838
+ ## Platform-Specific Notes
839
+
840
+ ### macOS
841
+
842
+ Install coreutils for better timeout handling:
843
+ ```bash
844
+ brew install coreutils bash
845
+ ```
846
+
847
+ ### Windows
848
+
849
+ Use WSL (Windows Subsystem for Linux):
850
+ ```bash
851
+ wsl --install
852
+ # Then follow Linux instructions
853
+ ```
854
+
855
+ ### Linux
856
+
857
+ No special requirements. Ensure `timeout` is available.
858
+
859
+ ---
860
+
861
+ ## Next Steps
862
+
863
+ After setup:
864
+
865
+ **Claude Code:**
866
+ ```
867
+ /ai-consultants:consult "How do I optimize a SQL query?"
868
+ ```
869
+
870
+ **Bash:**
871
+ ```bash
872
+ # Test your configuration
873
+ ./scripts/consult_all.sh --preset minimal "How do I optimize a SQL query?"
874
+
875
+ # View the report
876
+ cat /tmp/ai_consultations/*/report.md
877
+ ```
878
+
879
+ See [README.md](../README.md) for usage examples and full documentation.