ai-consultants 2.21.0 → 2.22.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 (68) hide show
  1. package/.claude/commands/ai-consultants:consult.md +1 -1
  2. package/.env.example +432 -0
  3. package/CLAUDE.md +36 -58
  4. package/README.md +128 -80
  5. package/SKILL.md +9 -9
  6. package/bin/ai-consultants +7 -1
  7. package/docs/COST_RATES.md +9 -15
  8. package/docs/JSON_SCHEMA.md +1 -1
  9. package/docs/RECIPES.md +272 -0
  10. package/docs/SETUP.md +127 -192
  11. package/docs/SMART_ROUTING.md +2 -2
  12. package/docs/cost_rates.json +23 -54
  13. package/docs/releases/v2.21.1.md +84 -0
  14. package/docs/releases/v2.22.0.md +82 -0
  15. package/package.json +6 -3
  16. package/references/affinity.json +20 -23
  17. package/references/configuration.md +128 -27
  18. package/references/details.md +3 -7
  19. package/scripts/config.sh +30 -102
  20. package/scripts/configure.sh +329 -1016
  21. package/scripts/consult_all.sh +2 -3
  22. package/scripts/debate_round.sh +0 -12
  23. package/scripts/doctor.sh +27 -75
  24. package/scripts/followup.sh +0 -3
  25. package/scripts/install.sh +1 -1
  26. package/scripts/lib/common.sh +17 -19
  27. package/scripts/lib/costs.sh +1 -3
  28. package/scripts/lib/personas.sh +2 -9
  29. package/scripts/lib/progress.sh +2 -2
  30. package/scripts/lib/reflection.sh +0 -1
  31. package/scripts/lib/routing.sh +1 -1
  32. package/scripts/lib/schema.json +2 -2
  33. package/scripts/lib/user_config.sh +6 -4
  34. package/scripts/peer_review.sh +0 -2
  35. package/scripts/preflight_check.sh +2 -2
  36. package/scripts/query_kimi.sh +5 -2
  37. package/scripts/setup_wizard.sh +4 -364
  38. package/scripts/update_clis.sh +0 -8
  39. package/templates/consultation_report.md +17 -17
  40. package/scripts/lib/test_helpers.sh +0 -82
  41. package/scripts/query_aider.sh +0 -83
  42. package/scripts/query_amp.sh +0 -67
  43. package/scripts/query_kilo.sh +0 -155
  44. package/scripts/query_ollama.sh +0 -329
  45. package/scripts/test_all.sh +0 -65
  46. package/scripts/test_bin.sh +0 -139
  47. package/scripts/test_capability_weighting.sh +0 -135
  48. package/scripts/test_context_optimization.sh +0 -333
  49. package/scripts/test_doctor.sh +0 -264
  50. package/scripts/test_e2e.sh +0 -84
  51. package/scripts/test_fixtures/context/sample.json +0 -13
  52. package/scripts/test_fixtures/context/sample.py +0 -90
  53. package/scripts/test_fixtures/context/sample.sh +0 -66
  54. package/scripts/test_fixtures/context/sample.txt +0 -11
  55. package/scripts/test_fixtures/stub_cli.sh +0 -45
  56. package/scripts/test_orchestration.sh +0 -203
  57. package/scripts/test_release.sh +0 -220
  58. package/scripts/test_reliability.sh +0 -83
  59. package/scripts/test_roster_audit.sh +0 -65
  60. package/scripts/test_roster_calibrate.sh +0 -91
  61. package/scripts/test_routing_parity.sh +0 -180
  62. package/scripts/test_set_e_safety.sh +0 -118
  63. package/scripts/test_stance.sh +0 -67
  64. package/scripts/test_suite.sh +0 -1723
  65. package/scripts/test_taste_elo.sh +0 -61
  66. package/scripts/test_update_clis.sh +0 -79
  67. package/scripts/test_user_config.sh +0 -403
  68. package/scripts/test_voting_metadata.sh +0 -69
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Consult AI experts (Gemini, Codex, Mistral, Kilo, Cursor, Aider, Amp, Kimi, Qwen, GLM, Grok, DeepSeek, MiniMax, Ollama) for coding questions. Use when weighing trade-offs, comparing approaches, or wanting multiple expert perspectives on non-trivial decisions.
2
+ description: Consult AI experts (Gemini, Codex, Mistral, Cursor, Kimi, Qwen, GLM, Grok, DeepSeek, MiniMax) for coding questions. Use when weighing trade-offs, comparing approaches, or wanting multiple expert perspectives on non-trivial decisions.
3
3
  argument-hint: <question> [file1] [file2] ...
4
4
  allowed-tools: Bash Read Glob Grep
5
5
  ---
package/.env.example ADDED
@@ -0,0 +1,432 @@
1
+ # =============================================================================
2
+ # AI Consultants - Environment Variables
3
+ # =============================================================================
4
+ # Copy this file to .env and customize as needed.
5
+ # All variables have sensible defaults - only override what you need.
6
+ #
7
+ # IMPORTANT: At least 2 consultants must be enabled for the system to work.
8
+ #
9
+ # Export variables before running, or source this file:
10
+ # source .env && ./scripts/consult_all.sh "Your question"
11
+ #
12
+ # For detailed setup instructions, see: docs/SETUP.md
13
+
14
+ # =============================================================================
15
+ # API KEYS & AUTHENTICATION
16
+ # =============================================================================
17
+ # Each CLI tool requires its own authentication. Set the appropriate API keys
18
+ # or use the CLI's built-in auth flow.
19
+
20
+ # Google Gemini API key (only needed for API mode; the agy CLI uses OAuth)
21
+ # Get yours at: https://makersuite.google.com/app/apikey
22
+ # CLI mode uses the Antigravity CLI (agy); sign in by running `agy` once.
23
+ # GEMINI_API_KEY=your-google-api-key
24
+
25
+ # OpenAI API Key (required for Codex)
26
+ # Get yours at: https://platform.openai.com/api-keys
27
+ # OPENAI_API_KEY=sk-your-openai-api-key
28
+
29
+ # Mistral API Key
30
+ # Get yours at: https://console.mistral.ai/api-keys/
31
+ # MISTRAL_API_KEY=your-mistral-api-key
32
+
33
+ # Anthropic API Key (for Claude API mode or synthesis)
34
+ # Get yours at: https://console.anthropic.com/settings/keys
35
+ # ANTHROPIC_API_KEY=sk-ant-your-anthropic-api-key
36
+
37
+
38
+ # =============================================================================
39
+ # API-BASED CONSULTANT KEYS
40
+ # =============================================================================
41
+ # These are required for the API-based consultants (Qwen3, GLM, Grok, DeepSeek)
42
+
43
+ # Qwen3 (Alibaba DashScope) - The Analyst
44
+ # Get yours at: https://dashscope.console.aliyun.com/
45
+ # QWEN3_API_KEY=your_dashscope_api_key
46
+
47
+ # GLM (Zhipu AI) - The Methodologist
48
+ # Get yours at: https://open.z.ai/
49
+ # GLM_API_KEY=your_zhipu_api_key
50
+
51
+ # Grok (xAI) - The Provocateur
52
+ # Get yours at: https://console.x.ai/
53
+ # GROK_API_KEY=your_xai_api_key
54
+
55
+ # DeepSeek - The Code Specialist
56
+ # Get yours at: https://platform.deepseek.com/
57
+ # DEEPSEEK_API_KEY=your_deepseek_api_key
58
+
59
+ # MiniMax - The Pragmatic Optimizer (v2.10)
60
+ # Get yours at: https://platform.minimax.io/user-center/basic-information/interface-key
61
+ # MINIMAX_API_KEY=your_minimax_api_key
62
+
63
+ # =============================================================================
64
+ # ENABLED CONSULTANTS
65
+ # =============================================================================
66
+ # Set to "false" to disable a consultant you haven't configured.
67
+ # MINIMUM 2 consultants must be enabled for comparison/voting to work.
68
+
69
+ # CLI-based consultants (default: enabled)
70
+ ENABLE_GEMINI=true
71
+ ENABLE_CODEX=true
72
+ ENABLE_MISTRAL=true
73
+ ENABLE_CURSOR=true
74
+ ENABLE_KIMI=true
75
+ ENABLE_QWEN3=true
76
+ ENABLE_MINIMAX=true
77
+ ENABLE_CLAUDE=true
78
+
79
+ # API-only consultants (default: disabled - require API keys)
80
+ ENABLE_GLM=false
81
+ ENABLE_GROK=false
82
+ ENABLE_DEEPSEEK=false
83
+
84
+ # =============================================================================
85
+ # CLI/API MODE SWITCHING (v2.6+)
86
+ # =============================================================================
87
+ # 6 agents support switching: Gemini, Codex, Claude, Mistral, Qwen3, MiniMax
88
+ # When API mode is enabled, CLI mode is automatically disabled.
89
+
90
+ # GEMINI_USE_API is auto-resolved when left UNSET (v2.15.1): API mode if
91
+ # GEMINI_API_KEY is present (no CLI install / OAuth needed — best for npm/npx),
92
+ # else the agy CLI. Leave it commented to keep auto-resolution; uncomment only
93
+ # to force a specific mode (an explicit value disables auto-detection).
94
+ # GEMINI_USE_API=false # Force Google AI API (true) or agy CLI (false)
95
+ # Leave the following commented to keep CLI-first auto-resolution (CLI wins
96
+ # when installed; API is the fallback for a key with no CLI). Uncomment only
97
+ # to force a specific transport for that agent.
98
+ # CODEX_USE_API=false # Use OpenAI API instead of codex CLI
99
+ # CLAUDE_USE_API=false # Use Anthropic API instead of claude CLI
100
+ # MISTRAL_USE_API=false # Use Mistral API instead of vibe CLI
101
+ # QWEN3_USE_API=false # Use qwen CLI (default) or DashScope API (v2.7)
102
+ # MINIMAX_USE_API=false # Unset = API for legacy key users, otherwise mmx CLI
103
+
104
+ # API endpoints (override if using custom endpoints)
105
+ # GEMINI_API_URL=https://generativelanguage.googleapis.com/v1beta/models
106
+ # CODEX_API_URL=https://api.openai.com/v1/chat/completions
107
+ # CLAUDE_API_URL=https://api.anthropic.com/v1/messages
108
+ # MISTRAL_API_URL=https://api.mistral.ai/v1/chat/completions
109
+ # QWEN3_API_URL=https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation
110
+
111
+ # =============================================================================
112
+ # MODEL CONFIGURATION (June 2026 premium defaults)
113
+ # =============================================================================
114
+
115
+ # Gemini - The Architect (CLI mode via Antigravity CLI: agy)
116
+ GEMINI_MODEL="Gemini 3.1 Pro (High)"
117
+ GEMINI_TIMEOUT=180
118
+ GEMINI_CMD=agy
119
+ # API-mode model ID (only used when GEMINI_USE_API=true)
120
+ GEMINI_API_MODEL=gemini-3.1-pro-preview
121
+
122
+ # Codex - The Pragmatist
123
+ CODEX_MODEL=gpt-5.5
124
+ CODEX_TIMEOUT=180
125
+ CODEX_CMD=codex
126
+
127
+ # Mistral Vibe - The Devil's Advocate
128
+ MISTRAL_MODEL=mistral-large-3
129
+ MISTRAL_TIMEOUT=180
130
+ MISTRAL_CMD=vibe
131
+
132
+ # Cursor - The Integrator
133
+ CURSOR_MODEL=composer-2.5
134
+ CURSOR_TIMEOUT=180
135
+ CURSOR_CMD=agent
136
+
137
+ # Kimi - The Eastern Sage (K3 via Kimi Code CLI)
138
+ KIMI_MODEL=kimi-code/k3
139
+ KIMI_TIMEOUT=180
140
+ KIMI_CMD=kimi
141
+
142
+ # Claude - The Synthesizer
143
+ CLAUDE_MODEL=claude-opus-4-8
144
+ CLAUDE_TIMEOUT=240
145
+ CLAUDE_CMD=claude
146
+
147
+ # Qwen3 - The Analyst (CLI/API switchable v2.7)
148
+ QWEN3_MODEL=qwen3.7-max
149
+ QWEN3_TIMEOUT=180
150
+ QWEN3_CMD=qwen
151
+
152
+ # =============================================================================
153
+ # API-BASED CONSULTANT CONFIGURATION
154
+ # =============================================================================
155
+
156
+ # GLM - The Methodologist
157
+ GLM_MODEL=glm-5.2
158
+ GLM_TIMEOUT=180
159
+ GLM_API_URL=https://api.z.ai/api/coding/paas/v4/chat/completions
160
+
161
+ # Grok - The Provocateur
162
+ GROK_MODEL=grok-4.5
163
+ GROK_TIMEOUT=180
164
+ GROK_API_URL=https://api.x.ai/v1/chat/completions
165
+
166
+ # DeepSeek - The Code Specialist
167
+ DEEPSEEK_MODEL=deepseek-v4-pro
168
+ DEEPSEEK_TIMEOUT=180
169
+ DEEPSEEK_API_URL=https://api.deepseek.com/v1/chat/completions
170
+
171
+ # MiniMax - The Pragmatic Optimizer (CLI via mmx by default, v2.21; API opt-in)
172
+ MINIMAX_CMD=mmx
173
+ MINIMAX_MODEL=MiniMax-M2.7
174
+ MINIMAX_TIMEOUT=180
175
+ MINIMAX_API_URL=https://api.minimax.io/v1/chat/completions
176
+
177
+ # Response formats for API-based consultants
178
+ QWEN3_FORMAT=qwen
179
+ GLM_FORMAT=openai
180
+ GROK_FORMAT=openai
181
+ DEEPSEEK_FORMAT=openai
182
+ MINIMAX_FORMAT=openai
183
+
184
+ # =============================================================================
185
+ # FEATURES v2.8
186
+ # =============================================================================
187
+
188
+ # Defaults used when --preset / --strategy are omitted
189
+ DEFAULT_PRESET=balanced
190
+ DEFAULT_STRATEGY=majority
191
+
192
+ # The invoking integration normally sets this per run for self-exclusion.
193
+ INVOKING_AGENT=unknown
194
+
195
+ # Personas: specialized roles for each consultant
196
+ ENABLE_PERSONA=true
197
+
198
+ # Auto-synthesis: automatic synthesis of all responses
199
+ ENABLE_SYNTHESIS=true
200
+ SYNTHESIS_CMD=claude
201
+ # Optional synthesis-specific model. Empty delegates model selection to the CLI.
202
+ SYNTHESIS_MODEL=
203
+ SYNTHESIS_EXTRACT_FIELDS=true
204
+ SYNTH_MAX=10
205
+
206
+ # Multi-Agent Debate (MAD): cross-critique rounds
207
+ ENABLE_DEBATE=false
208
+ DEBATE_ROUNDS=1 # 1 = no debate, 2-3 = with cross-critique
209
+
210
+ # Self-Reflection (experimental): generate-critique-refine loop
211
+ ENABLE_REFLECTION=false
212
+ REFLECTION_CYCLES=1
213
+
214
+ # Peer Review: anonymous evaluation
215
+ ENABLE_PEER_REVIEW=false
216
+ PEER_REVIEW_MIN_RESPONSES=3
217
+ REVIEWS_PER_CONSULTANT=3
218
+
219
+ # Panic Mode: auto-rigor when uncertainty detected
220
+ ENABLE_PANIC_MODE=auto
221
+ PANIC_CONFIDENCE_THRESHOLD=5
222
+ PANIC_EXTRA_DEBATE_ROUNDS=1
223
+ PANIC_KEYWORDS="uncertain|maybe|not sure|possibly|unclear|depends|hard to say|difficult to determine"
224
+
225
+ # Dynamic orchestration: choose how the panel deliberates
226
+ # auto | fixed | quick | converge | adversarial | tournament | exhaustive
227
+ ORCHESTRATION_MODE=auto
228
+ CONVERGENCE_MAX_ROUNDS=4
229
+ CONVERGENCE_TARGET_CONSENSUS=75
230
+ CONVERGENCE_STALL_EPSILON=5
231
+ ENABLE_ADVERSARIAL_VERIFY=true
232
+
233
+ # Debate optimization: avoid extra rounds when the panel already agrees
234
+ ENABLE_DEBATE_OPTIMIZATION=true
235
+ DEBATE_CONFIDENCE_SPREAD_THRESHOLD=2
236
+ DEBATE_USE_SUMMARIES=true
237
+
238
+ # Health gate and quorum: validate the live panel before spending on a full run
239
+ ENABLE_HEALTH_GATE=false # Adds one small ping per selected consultant
240
+ HEALTH_GATE_TIMEOUT=30
241
+ QUORUM_MIN=2
242
+ QUORUM_ACTION=warn # warn or stop
243
+
244
+ # =============================================================================
245
+ # SEMANTIC CACHING (v2.3)
246
+ # =============================================================================
247
+
248
+ ENABLE_SEMANTIC_CACHE=true
249
+ CACHE_TTL_HOURS=24
250
+ # CACHE_DIR=/custom/cache/path
251
+
252
+ # API retry and rate-limit controls
253
+ API_BASE_BACKOFF=2
254
+ API_MAX_BACKOFF=60
255
+ API_RATE_LIMIT=30
256
+
257
+ # Optional response limits by question category
258
+ ENABLE_RESPONSE_LIMITS=false
259
+ MAX_RESPONSE_TOKENS_BY_CATEGORY=QUICK_SYNTAX:200,CODE_REVIEW:800,BUG_DEBUG:800,ARCHITECTURE:1000,SECURITY:1000,DATABASE:600,GENERAL:500
260
+
261
+ # =============================================================================
262
+ # BUDGET ENFORCEMENT (v2.4, opt-in)
263
+ # =============================================================================
264
+
265
+ ENABLE_BUDGET_LIMIT=false
266
+ BUDGET_ACTION=warn # warn or stop
267
+ MAX_SESSION_COST=1.00
268
+
269
+ # =============================================================================
270
+ # SMART ROUTING
271
+ # =============================================================================
272
+
273
+ # Question classification (required for smart routing)
274
+ ENABLE_CLASSIFICATION=true
275
+ CLASSIFICATION_MODE=pattern # pattern (fast) or llm (accurate)
276
+
277
+ # Smart routing: select consultants based on question category
278
+ ENABLE_SMART_ROUTING=false
279
+ MIN_AFFINITY=7 # Minimum affinity score (1-10) to include
280
+
281
+ # Cost-aware routing (v2.3)
282
+ ENABLE_COST_AWARE_ROUTING=false
283
+ USE_ECONOMIC_MODELS_FOR_SIMPLE=true
284
+ COMPLEXITY_THRESHOLD_SIMPLE=3
285
+ COMPLEXITY_THRESHOLD_MEDIUM=6
286
+ FALLBACK_CONFIDENCE_THRESHOLD=7
287
+
288
+ # Capability-aware routing & voting (v2.20, opt-in): weight votes and rank the
289
+ # panel by each consultant's capability on the quality axis a question stresses
290
+ # (intelligence or taste, per references/affinity.json 'category_axis'). cost is
291
+ # a composition/budget axis only, never a vote weight.
292
+ ENABLE_CAPABILITY_WEIGHTING=false # capability-weighted voting
293
+ ENABLE_CAPABILITY_ROUTING=false # capability-aware panel composition
294
+ CAPABILITY_WEIGHT_STRENGTH=10 # higher = gentler nudge: weight = conf*(S+cap)/S
295
+ CAPABILITY_DEFAULT=5 # fallback capability for a missing consultant/axis
296
+
297
+ # Stance-based semantic consensus (v2.21, opt-in): the panel picks from a shared
298
+ # enumerated stance set so agreement is scored by exact match instead of lexical
299
+ # similarity. Adds ~1 LLM call per run; degrades to the lexical cluster on any
300
+ # failure, so it is always safe to enable.
301
+ ENABLE_STANCE_CONSENSUS=false
302
+ STANCE_MAX_OPTIONS=5 # max stance options generated per question
303
+ STANCE_TIMEOUT=60 # seconds for the stance-generation call (guards a hang)
304
+
305
+ # =============================================================================
306
+ # COST MANAGEMENT
307
+ # =============================================================================
308
+
309
+ ENABLE_COST_TRACKING=true
310
+ WARN_AT_COST=0.50 # Warning threshold (USD)
311
+ ENABLE_RELIABILITY_TRACKING=true
312
+ # COST_TRACKING_FILE=/custom/data/costs.json
313
+ # RELIABILITY_FILE=/custom/data/reliability.json
314
+ # COST_RATES_FILE=/custom/config/cost_rates.json
315
+
316
+ # =============================================================================
317
+ # SESSION MANAGEMENT
318
+ # =============================================================================
319
+
320
+ SESSION_CLEANUP_DAYS=7 # Auto-cleanup sessions older than N days
321
+ # SESSION_DIR=/custom/state/sessions
322
+
323
+ # =============================================================================
324
+ # INTERACTIVE MODE
325
+ # =============================================================================
326
+
327
+ ENABLE_PROGRESS_BARS=true # Show progress bars during consultation
328
+ ENABLE_EARLY_TERMINATION=true # Allow Ctrl+C to stop with partial results
329
+
330
+ # =============================================================================
331
+ # PRE-FLIGHT CHECKS
332
+ # =============================================================================
333
+
334
+ ENABLE_PREFLIGHT=false # Run health check before each consultation
335
+ PREFLIGHT_QUICK=true # Quick mode: CLI check only, skip API test
336
+
337
+ # =============================================================================
338
+ # RETRY & TIMEOUT
339
+ # =============================================================================
340
+
341
+ MAX_RETRIES=2 # Max retry attempts on failure
342
+ RETRY_DELAY_SECONDS=5 # Pause between retries
343
+ LAUNCH_STAGGER_MAX_SECONDS=2
344
+
345
+ # Output directory base
346
+ # DEFAULT_OUTPUT_DIR_BASE=/custom/cache/consultations
347
+
348
+ # Live doctor probe timeout
349
+ DOCTOR_LIVE_TIMEOUT=45
350
+
351
+ # =============================================================================
352
+ # CONTEXT HANDOFF & TOKEN OPTIMIZATION
353
+ # =============================================================================
354
+
355
+ TOKEN_OPTIMIZATION_MODE=ast
356
+ MAX_CONTEXT_FILE_BYTES=8000
357
+ ENABLE_AST_EXTRACTION=true
358
+ ENABLE_SYMBOL_COMPRESSION=false
359
+ ENABLE_SEMANTIC_CHUNKING=true
360
+ CHUNK_MAX_TOKENS=500
361
+ CHUNK_OVERLAP_LINES=5
362
+ CHUNK_PRIORITY_KEYWORDS=main,export,public,api,handler,controller
363
+ INCLUDE_DOCSTRINGS=true
364
+ INCLUDE_CRITICAL_COMMENTS=true
365
+ MAX_BODY_SUMMARY_LINES=3
366
+ MIN_IDENTIFIER_LENGTH=8
367
+ PRESERVE_EXPORTS=true
368
+ USE_COMPACT_PROMPTS=true
369
+ FORCE_PROJECT_TREE=false
370
+ ENABLE_SELECTIVE_CONTEXT=false
371
+ MAX_FILES_PER_CONSULTANT=5
372
+
373
+ # =============================================================================
374
+ # REPORTING & STORAGE
375
+ # =============================================================================
376
+
377
+ ENABLE_COMPACT_REPORT=true
378
+ REPORT_MAX_JSON_LINES=50
379
+ # RATE_LIMIT_DIR=/custom/cache/ratelimit
380
+ # CHUNK_TEMP_DIR=/custom/cache/chunks
381
+
382
+ # =============================================================================
383
+ # CUSTOM ROUTING & PERSONAS
384
+ # =============================================================================
385
+
386
+ # AFFINITY_FILE=/path/to/affinity.json
387
+
388
+ # Each consultant supports _PERSONA_ID (1-21), _PERSONA (custom prompt), and
389
+ # _PERSONA_NAME (custom display name). Uncomment only the overrides you need.
390
+ # GEMINI_PERSONA_ID=1
391
+ # CODEX_PERSONA_ID=2
392
+ # MISTRAL_PERSONA_ID=3
393
+ # CURSOR_PERSONA_ID=5
394
+ # KIMI_PERSONA_ID=20
395
+ # CLAUDE_PERSONA_ID=18
396
+ # QWEN3_PERSONA_ID=6
397
+ # GLM_PERSONA_ID=7
398
+ # GROK_PERSONA_ID=8
399
+ # DEEPSEEK_PERSONA_ID=17
400
+ # MINIMAX_PERSONA_ID=21
401
+ # GEMINI_PERSONA=Custom persona instructions
402
+ # GEMINI_PERSONA_NAME=Custom persona name
403
+ # CODEX_PERSONA=Custom persona instructions
404
+ # CODEX_PERSONA_NAME=Custom persona name
405
+ # MISTRAL_PERSONA=Custom persona instructions
406
+ # MISTRAL_PERSONA_NAME=Custom persona name
407
+ # CURSOR_PERSONA=Custom persona instructions
408
+ # CURSOR_PERSONA_NAME=Custom persona name
409
+ # KIMI_PERSONA=Custom persona instructions
410
+ # KIMI_PERSONA_NAME=Custom persona name
411
+ # CLAUDE_PERSONA=Custom persona instructions
412
+ # CLAUDE_PERSONA_NAME=Custom persona name
413
+ # QWEN3_PERSONA=Custom persona instructions
414
+ # QWEN3_PERSONA_NAME=Custom persona name
415
+ # GLM_PERSONA=Custom persona instructions
416
+ # GLM_PERSONA_NAME=Custom persona name
417
+ # GROK_PERSONA=Custom persona instructions
418
+ # GROK_PERSONA_NAME=Custom persona name
419
+ # DEEPSEEK_PERSONA=Custom persona instructions
420
+ # DEEPSEEK_PERSONA_NAME=Custom persona name
421
+ # MINIMAX_PERSONA=Custom persona instructions
422
+ # MINIMAX_PERSONA_NAME=Custom persona name
423
+
424
+ # Calibration judge commands
425
+ TASTE_JUDGE_CMD=
426
+ JUDGE_CLI=claude
427
+
428
+ # =============================================================================
429
+ # LOGGING
430
+ # =============================================================================
431
+
432
+ LOG_LEVEL=INFO # DEBUG, INFO, WARN, ERROR
package/CLAUDE.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  ## Project Overview
4
4
 
5
- AI Consultants is a multi-model AI deliberation system that queries up to 15 AI consultants (Gemini, Codex, Mistral, Kilo, Cursor, Aider, Amp, Kimi, Claude, Qwen3, GLM, Grok, DeepSeek, MiniMax, Ollama) to obtain diverse perspectives on coding problems.
5
+ AI Consultants is a multi-model AI deliberation system that queries up to 11 AI consultants (Gemini, Codex, Mistral, Cursor, Kimi, Claude, Qwen3, GLM, Grok, DeepSeek, MiniMax) to obtain diverse perspectives on coding problems.
6
6
 
7
7
  **Self-Exclusion**: The invoking agent is automatically excluded from the panel to prevent self-consultation. Claude Code won't query Claude, Codex CLI won't query Codex, etc.
8
8
 
9
- **Version**: 2.21.0
9
+ **Version**: 2.22.0
10
10
 
11
11
  ## Distribution
12
12
 
@@ -47,7 +47,6 @@ ai-consultants/
47
47
  │ ├── install.sh # One-liner installer (v2.2)
48
48
  │ ├── query_*.sh # Wrapper for each consultant
49
49
  │ ├── query_claude.sh # Claude consultant (v2.2)
50
- │ ├── query_ollama.sh # Local model support (v2.2)
51
50
  │ ├── synthesize.sh # Auto-synthesis of responses
52
51
  │ ├── debate_round.sh # Multi-Agent Debate
53
52
  │ ├── classify_question.sh # Question classifier
@@ -73,6 +72,7 @@ ai-consultants/
73
72
  ├── docs/
74
73
  │ ├── releases/ # Release notes (one per version)
75
74
  │ ├── SETUP.md # Installation guide
75
+ │ ├── RECIPES.md # Copy-paste workflow configurations
76
76
  │ ├── COST_RATES.md # Model pricing
77
77
  │ ├── SMART_ROUTING.md # Affinity matrix
78
78
  │ └── JSON_SCHEMA.md # Output schema
@@ -200,9 +200,8 @@ Functions in `lib/common.sh`:
200
200
 
201
201
  # Use Case Presets
202
202
  ./scripts/consult_all.sh --preset minimal "question" # Gemini + Codex
203
- ./scripts/consult_all.sh --preset balanced "question" # + Mistral + Kilo
203
+ ./scripts/consult_all.sh --preset balanced "question" # + Mistral + Cursor
204
204
  ./scripts/consult_all.sh --preset high-stakes "question" # All + debate
205
- ./scripts/consult_all.sh --preset local "question" # Ollama only
206
205
  ```
207
206
 
208
207
  Presets are defined in `config.sh` via `apply_preset()` function.
@@ -225,17 +224,6 @@ Strategies are implemented in `synthesize.sh` via `get_strategy_instructions()`.
225
224
  ./scripts/doctor.sh --verbose # Detailed output
226
225
  ```
227
226
 
228
- ### Ollama Local Models
229
- ```bash
230
- ENABLE_OLLAMA=true ./scripts/consult_all.sh "question"
231
- OLLAMA_MODEL=codellama ./scripts/consult_all.sh "question"
232
- ```
233
-
234
- Configuration in `config.sh`:
235
- - `OLLAMA_MODEL` - Model to use (default: hf.co/prithivMLmods/VibeThinker-3B-GGUF)
236
- - `OLLAMA_HOST` - Server URL (default: http://localhost:11434)
237
- - `OLLAMA_TIMEOUT` - Timeout in seconds (default: 300)
238
-
239
227
  ### Panic Button Mode
240
228
  Automatically adds rigor when uncertainty detected:
241
229
  - Average confidence below `PANIC_CONFIDENCE_THRESHOLD` (default: 5)
@@ -270,30 +258,6 @@ Functions in `lib/reflection.sh`:
270
258
  - `heuristic_overconfidence_check()` - Fast fallback without LLM
271
259
  - `judge_all_responses()` - Batch evaluation
272
260
 
273
- ## v2.8 Features
274
-
275
- ### Amp CLI Support
276
- Amp Code is now supported as a CLI-based consultant with "The Systems Thinker" persona.
277
-
278
- ```bash
279
- # Enable Amp consultant
280
- export ENABLE_AMP=true
281
- ./scripts/consult_all.sh "question"
282
- ```
283
-
284
- **CLI Installation:**
285
- ```bash
286
- curl -fsSL https://ampcode.com/install.sh | bash
287
- ```
288
-
289
- **Environment Variables:**
290
- - `ENABLE_AMP` - Enable Amp consultant (default: true)
291
- - `AMP_CMD` - CLI command (default: amp)
292
- - `AMP_TIMEOUT` - Timeout in seconds (default: 180)
293
- - `AMP_API_KEY` - API key for authentication
294
-
295
- **Persona:** The Systems Thinker - Focuses on holistic system design, component interactions, and emergent behaviors.
296
-
297
261
  ## v2.9 Features
298
262
 
299
263
  ### Kimi CLI Support
@@ -314,7 +278,7 @@ curl -L code.kimi.com/install.sh | bash
314
278
  - `ENABLE_KIMI` - Enable Kimi consultant (default: false)
315
279
  - `KIMI_CMD` - CLI command (default: kimi)
316
280
  - `KIMI_TIMEOUT` - Timeout in seconds (default: 180)
317
- - `KIMI_MODEL` - Model identifier (default: kimi-code/kimi-for-coding)
281
+ - `KIMI_MODEL` - Kimi CLI model alias (default: kimi-code/k3; passed explicitly with `--model`)
318
282
 
319
283
  **Persona:** The Eastern Sage - Focuses on holistic understanding, balance of perspectives, and wisdom from diverse viewpoints.
320
284
 
@@ -468,13 +432,10 @@ All consultants now use premium models by default:
468
432
  | Cursor | composer-2.5 |
469
433
  | DeepSeek | deepseek-v4-pro |
470
434
  | GLM | glm-5.2 |
471
- | Grok | grok-4.3 |
435
+ | Grok | grok-4.5 |
472
436
  | Qwen3 | qwen3.7-max |
473
- | Kimi | kimi-code/kimi-for-coding |
474
- | Aider | qwen3-coder:free |
437
+ | Kimi | kimi-code/k3 |
475
438
  | MiniMax | MiniMax-M2.7 |
476
- | Kilo | auto |
477
- | Ollama | hf.co/prithivMLmods/VibeThinker-3B-GGUF |
478
439
 
479
440
  Override with environment variables: `CLAUDE_MODEL`, `GEMINI_MODEL`, `CODEX_MODEL`, `KIMI_MODEL`, etc.
480
441
 
@@ -628,6 +589,12 @@ REPORT_MAX_JSON_LINES=50 # Max JSON lines in full report
628
589
  ## Testing
629
590
 
630
591
  ```bash
592
+ # Full regression suite (required before committing/releasing)
593
+ npm test
594
+
595
+ # ShellCheck lint
596
+ npm run lint
597
+
631
598
  # Full diagnostic
632
599
  ./scripts/doctor.sh
633
600
 
@@ -661,8 +628,6 @@ for f in scripts/*.sh scripts/lib/*.sh; do bash -n "$f" && echo "OK: $f"; done
661
628
  | `MAX_SESSION_COST` | 1.00 | Max budget ($) |
662
629
  | `ENABLE_PANIC_MODE` | auto | Panic mode trigger (v2.2) |
663
630
  | `PANIC_CONFIDENCE_THRESHOLD` | 5 | Panic threshold (v2.2) |
664
- | `ENABLE_OLLAMA` | false | Local model support (v2.2) |
665
- | `OLLAMA_MODEL` | hf.co/prithivMLmods/VibeThinker-3B-GGUF | Ollama model (v2.17 default) |
666
631
  | `CLAUDE_MODEL` | claude-opus-4-8 | Claude model (v2.5) |
667
632
  | `GEMINI_MODEL` | Gemini 3.1 Pro (High) | Gemini agy CLI model (v2.15) |
668
633
  | `GEMINI_API_MODEL` | gemini-3.1-pro-preview | Gemini API-mode model ID (v2.15) |
@@ -673,7 +638,7 @@ for f in scripts/*.sh scripts/lib/*.sh; do bash -n "$f" && echo "OK: $f"; done
673
638
  | `CACHE_TTL_HOURS` | 24 | Cache expiration in hours (v2.3) |
674
639
  | `ENABLE_RESPONSE_LIMITS` | false | Response token limits (v2.3, opt-in) |
675
640
  | `ENABLE_COST_AWARE_ROUTING` | false | Cost-based model routing (v2.3) |
676
- | `ENABLE_DEBATE_OPTIMIZATION` | false | Skip debate if all agree (v2.3, opt-in) |
641
+ | `ENABLE_DEBATE_OPTIMIZATION` | true | Skip debate if all agree; SECURITY and ARCHITECTURE remain mandatory (default since v2.13) |
677
642
  | `ENABLE_COMPACT_REPORT` | true | Compact report format (v2.3) |
678
643
  | `ENABLE_CAPABILITY_WEIGHTING` | false | Capability-weighted voting (v2.20, opt-in) |
679
644
  | `ENABLE_CAPABILITY_ROUTING` | false | Capability-aware panel composition (v2.20, opt-in) |
@@ -687,7 +652,7 @@ for f in scripts/*.sh scripts/lib/*.sh; do bash -n "$f" && echo "OK: $f"; done
687
652
  | `QWEN3_CMD` | qwen | Qwen CLI command (v2.7) |
688
653
  | `ENABLE_KIMI` | true | Enable Kimi consultant (v2.9) |
689
654
  | `KIMI_CMD` | kimi | Kimi CLI command (v2.9) |
690
- | `KIMI_MODEL` | kimi-code/kimi-for-coding | Kimi model (v2.9) |
655
+ | `KIMI_MODEL` | kimi-code/k3 | Kimi CLI model alias |
691
656
  | `ENABLE_MINIMAX` | true | Enable MiniMax consultant (v2.10; CLI via mmx v2.21) |
692
657
  | `MINIMAX_USE_API` | false | Use MiniMax API instead of the mmx CLI (v2.21) |
693
658
  | `MINIMAX_CMD` | mmx | MiniMax CLI command (v2.21) |
@@ -699,15 +664,11 @@ for f in scripts/*.sh scripts/lib/*.sh; do bash -n "$f" && echo "OK: $f"; done
699
664
  - `agy` CLI - Antigravity CLI (Gemini consultant; successor to the deprecated Gemini CLI, v2.15)
700
665
  - `codex` CLI - OpenAI Codex
701
666
  - `vibe` CLI - Mistral Vibe
702
- - `kilocode` CLI - Kilo Code
703
667
  - `agent` CLI - Cursor
704
- - `aider` CLI - Aider
705
- - `amp` CLI - Amp Code (v2.8)
706
668
  - `kimi` CLI - Kimi Code (v2.9)
707
669
  - `claude` CLI - Claude (v2.2, also used for synthesis)
708
670
  - `qwen` CLI - Qwen via qwen-code (v2.7, optional)
709
671
  - `mmx` CLI - MiniMax via mmx-cli (v2.21, optional; `npm i -g mmx-cli`, auth `mmx auth login`)
710
- - `ollama` CLI - Local models (v2.2)
711
672
  - `jq` - JSON parsing
712
673
 
713
674
  ## Error Handling and Retry
@@ -727,13 +688,12 @@ RETRY_DELAY_SECONDS=10
727
688
  # Per-consultant timeout
728
689
  GEMINI_TIMEOUT=240
729
690
  CODEX_TIMEOUT=180
730
- OLLAMA_TIMEOUT=300 # Longer for local inference
731
691
  ```
732
692
 
733
693
  ## Extended Documentation
734
694
 
735
695
  For detailed information, see:
736
- - [docs/SETUP.md](docs/SETUP.md) - Installation, authentication, Ollama setup
696
+ - [docs/SETUP.md](docs/SETUP.md) - Installation and authentication
737
697
  - [docs/COST_RATES.md](docs/COST_RATES.md) - Rates and budget management
738
698
  - [docs/SMART_ROUTING.md](docs/SMART_ROUTING.md) - Affinity matrix and routing
739
699
  - [docs/JSON_SCHEMA.md](docs/JSON_SCHEMA.md) - Complete output schema
@@ -741,8 +701,8 @@ For detailed information, see:
741
701
  ## Development Notes
742
702
 
743
703
  - Scripts in `lib/` are libraries, not standalone executables
744
- - Output goes to `/tmp/ai_consultations/TIMESTAMP/`
745
- - Session state in `/tmp/ai_consultants_sessions/`
704
+ - Output goes to `$XDG_CACHE_HOME/ai-consultants/consultations/TIMESTAMP/` (normally `~/.cache/ai-consultants/consultations/`)
705
+ - Session state lives in `$XDG_STATE_HOME/ai-consultants/sessions/` (normally `~/.local/state/ai-consultants/sessions/`)
746
706
  - All timeouts are configurable in `config.sh`
747
707
  - Consultants can be disabled individually (`ENABLE_GEMINI=false`, etc.)
748
708
  - Use `.env.example` as template for environment configuration
@@ -842,6 +802,24 @@ curl -fsSL https://raw.githubusercontent.com/matteoscurati/ai-consultants/main/s
842
802
 
843
803
  ## Changelog
844
804
 
805
+ ### v2.22.0
806
+ - Added the public `ai-consultants configure` / `config` subcommand. Automatic mode detects every current consultant, uses CLI-first transport selection with API fallback when credentials are available, persists to the XDG user config directory, preserves custom values and secrets while refreshing availability-derived `ENABLE_*` flags, backs up rewrites, and keeps files at mode 600.
807
+ - Replaced the stale 1,092-line v2.0 configurator with a compact implementation whose accepted parameter surface is derived from `.env.example`. `--set KEY=VALUE` supports repeatable automation and participates in detection, `--interactive` reviews credentials/transports/panel selection, `--advanced` reviews every parameter, `--show-parameters` exposes the contract, and side-effect-free `--dry-run` redacts secrets.
808
+ - Added `test_configure.sh` (60 assertions) covering public routing, runtime-wide template parity, full-roster detection, API fallback, override precedence/empty values, transport provenance, advanced defaults, export preservation, dry-run isolation/redaction, symlink refusal, backups/permissions, and rejection of removed settings. The npm-pack smoke path now includes `.env.example` and exercises both `init` and `configure` from the installed tarball.
809
+ - **Three interactive/provenance bugs fixed before the subcommand ever shipped** (found in review; none reached a tagged release):
810
+ - **`--interactive` aborted on the first Enter.** `prompt_value` ended both branches with `[[ -n "$reply" ]] && set_value …`. An empty reply — the documented "press Enter to keep" path — made that `&&` list return 1, and since it was the function's last command, `prompt_value` returned 1; under `set -e` the plain call site in the `for` loop killed the script (exit 1, nothing written). Now an explicit `if` block, so an empty reply returns 0.
811
+ - **`--advanced` silently wrote garbage.** `done < <(list_parameters)` redirects fd 0 for the *whole loop body*, so `prompt_value`'s nested `read -r -p` consumed the parameter list instead of the terminal — each prompt took the *next parameter's name* as the user's answer (observed: `AFFINITY_FILE` ← `ANTHROPIC_API_KEY`). Fixed with the standard fd-separation idiom (`read … <&3` / `done 3< <(…)`).
812
+ - **`init` then `configure` disabled four consultants.** `init` copies `.env.example` verbatim, and the template carried uncommented `CODEX_USE_API=false` / `CLAUDE_USE_API` / `MISTRAL_USE_API` / `QWEN3_USE_API`. `has_explicit_value` reads any unmarked value as a user pin, so `configure_switchable` took the explicit-`false` branch: with no CLI and a valid API key the consultant was disabled outright instead of resolving to API. Fixed in the *template*, not the provenance logic — the four switches are now commented out, matching the convention `GEMINI_USE_API`/`MINIMAX_USE_API` already established (commented = auto-resolve, uncommented = force). CLI-first is unaffected: an installed CLI still wins over a present key.
813
+ - **Backup names are now collision-proof.** `${OUTPUT_FILE}.backup.$(date +%Y%m%d_%H%M%S)` is only second-precise, so two runs inside one second resolved to the same path and the second `cp` clobbered the first backup — losing the user's *original* config while keeping a machine-generated one. Now `mktemp "…backup.<ts>.XXXXXX"`, which claims the name atomically (also making concurrent runs safe). Note the collision is unreachable from a sequential test — a real run takes ~1-8s, longer than the granularity — so the regression test stubs `date` on `PATH` to freeze the clock; the backup line is the only `date` caller in this path.
814
+ - **`test_configure.sh` made hermetic against an ambient config environment — `scripts/release.sh` could not run its own gate.** `config.sh` auto-resolves `GEMINI_USE_API`/`MINIMAX_USE_API` and **exports** them; `configure.sh::has_explicit_value` treats any ambient value as a deliberate user pin. `release.sh` sources `lib/common.sh` (→ `config.sh`) *before* running `npm test`, so the gate inherited pinned transports: Tests 4 and 11 failed under `release.sh` while passing from a clean shell — a "flaky" result that was in fact deterministic per-environment. The suite now `unset`s the whole switchable `*_USE_API` set at the top (one place, covering all 10 configure invocations; only the two auto-resolved ones actually leak today, but the set is cleared so a future auto-resolution — as MiniMax gained in v2.21 — cannot silently reopen it). Same class as the v2.21.0 `test_user_config.sh` fix. Verified green both from a clean shell and under `source lib/common.sh; npm test`. Latent since `test_configure.sh` was introduced; it never affected the shipped runtime, only the release gate.
815
+ - Deprecated `setup_wizard.sh` to a compatibility forwarder. Corrected `GOOGLE_API_KEY` to `GEMINI_API_KEY`, removed legacy `/tmp` overrides from the starter template, completed advanced settings/persona coverage, and fixed safe parsing of unquoted `.env` inline comments.
816
+
817
+ ### v2.21.1
818
+ - **Kimi upgraded to K3.** `KIMI_MODEL` now defaults to `kimi-code/k3`; premium, standard, and economy tiers all resolve to the same K3 alias.
819
+ - **Model selection is now real, not metadata-only.** `query_kimi.sh` passes `--model "$KIMI_MODEL"` to the CLI, overriding a stale user-level Kimi default. A dedicated offline regression test captures the CLI arguments and validates response metadata; a live K3 smoke test returned a structured response with confidence 10.
820
+ - **Roster reduced from 15 to 11 supported consultants.** Kilo, Aider, Amp, and Ollama were removed end-to-end: canonical/default lists, presets, routing and personas, debate/synthesis/reflection, doctor/preflight, updater, configuration/wizard, schemas, tests, docs, and their four query adapters. `ENABLE_KILO`/`KILO_*`, `ENABLE_AIDER`/`AIDER_*`, `ENABLE_AMP`/`AMP_*`, `ENABLE_OLLAMA`/`OLLAMA_*`, and the Ollama-only `local` preset are obsolete and ignored.
821
+ - **Documentation and release surfaces synced.** README, SKILL, `.env.example`, setup/configuration/recipes, cost catalog, changelog, release note, npm metadata, and the showcase site all identify Kimi K3. Version bumped to 2.21.1.
822
+
845
823
  ### v2.21.0
846
824
  - **CLI-first transport (principle).** Every `*_USE_API` defaults `false`; a consultant with a CLI always uses it, API is opt-in (CLI-less model or explicit choice). `ENABLE_AMP`/`ENABLE_CLAUDE` default true.
847
825
  - **MiniMax via `mmx` CLI** (was API-only). `query_minimax.sh` runs `mmx text chat --non-interactive …` in CLI mode; `config.sh` adds `MINIMAX_CMD` + auto-resolves `MINIMAX_USE_API` (API iff `MINIMAX_API_KEY` set — back-compat), drops MiniMax from `API_CONSULTANTS`; `doctor.sh` treats it as switchable.