ai-consultants 2.21.1 → 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.
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
@@ -6,7 +6,7 @@ AI Consultants is a multi-model AI deliberation system that queries up to 11 AI
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.1
9
+ **Version**: 2.22.0
10
10
 
11
11
  ## Distribution
12
12
 
@@ -802,6 +802,18 @@ curl -fsSL https://raw.githubusercontent.com/matteoscurati/ai-consultants/main/s
802
802
 
803
803
  ## Changelog
804
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
+
805
817
  ### v2.21.1
806
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.
807
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.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # AI Consultants v2.21.1
1
+ # AI Consultants v2.22.0
2
2
 
3
3
  > **A harness for every question.** A panel of up to 11 frontier models that writes its own playbook per question — fan out, debate to convergence, cross-examine under adversarial review, or run a tournament — and checks its work before it reaches you.
4
4
 
5
- [![Version](https://img.shields.io/badge/version-2.21.1-blue.svg)](https://github.com/matteoscurati/ai-consultants)
5
+ [![Version](https://img.shields.io/badge/version-2.22.0-blue.svg)](https://github.com/matteoscurati/ai-consultants)
6
6
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
7
  [![Claude Code Skill](https://img.shields.io/badge/Claude%20Code-Skill-orange.svg)](https://docs.anthropic.com/en/docs/claude-code/skills)
8
8
  [![GitHub stars](https://img.shields.io/github/stars/matteoscurati/ai-consultants?style=social)](https://github.com/matteoscurati/ai-consultants)
@@ -513,13 +513,42 @@ Control how responses are combined:
513
513
 
514
514
  ### Environment Variables
515
515
 
516
- **Most users only need:**
516
+ **Automatic configuration (recommended):**
517
517
 
518
518
  ```bash
519
- ai-consultants init # creates ~/.config/ai-consultants/{config.sh,.env}
520
- $EDITOR ~/.config/ai-consultants/.env
519
+ # Detect installed CLIs and available API keys, then write the persistent config
520
+ ai-consultants configure
521
+
522
+ # Review the consultant selection and transports interactively
523
+ ai-consultants configure --interactive
524
+
525
+ # Set any persistent parameter without opening an editor
526
+ ai-consultants configure \
527
+ --set DEFAULT_PRESET=balanced \
528
+ --set ENABLE_DEBATE=true \
529
+ --set ORCHESTRATION_MODE=converge
530
+
531
+ # Inspect the complete machine-readable parameter surface
532
+ ai-consultants configure --show-parameters
521
533
  ```
522
534
 
535
+ The configurator covers every persistent setting in `scripts/config.sh`, plus
536
+ credentials, persona overrides, transport controls, advanced context knobs, and
537
+ calibration commands. Existing custom values and secrets are preserved, while
538
+ `ENABLE_*` flags are refreshed from detected availability (and can be pinned
539
+ with `--set`). Rewrites create a private timestamped backup. Use `--advanced` to
540
+ review every parameter or `--dry-run` to preview a redacted result.
541
+ Auto-selected `*_USE_API` values are marked `# ai-consultants:auto`, allowing a
542
+ later run to adapt when a CLI or credential changes. Environment variables,
543
+ `--set`, and unmarked values remain explicit user choices.
544
+
545
+ Enter credentials through `--interactive`/`--advanced` or export them before the
546
+ run; avoid passing API keys through `--set`, where the shell may retain them in
547
+ history or expose them in the process list.
548
+
549
+ For a manual starter template instead, run `ai-consultants init` and edit
550
+ `~/.config/ai-consultants/.env`.
551
+
523
552
  For ad-hoc overrides without persisting, the most common knobs:
524
553
 
525
554
  ```bash
@@ -688,6 +717,10 @@ Each consultation generates:
688
717
 
689
718
  ## Changelog
690
719
 
720
+ ### v2.22.0
721
+
722
+ - **`ai-consultants configure`**: a public automatic configurator. It detects your installed CLIs and API keys, picks CLI-first transports, and writes a private XDG config while preserving your existing settings and secrets. Drive it with repeatable `--set KEY=VALUE`, review it with `--interactive` / `--advanced`, or preview it with `--dry-run`. See the [v2.22.0 release note](docs/releases/v2.22.0.md).
723
+
691
724
  ### v2.21.1
692
725
 
693
726
  - **Kimi K3**: Kimi now defaults to `kimi-code/k3`, and the adapter passes the model explicitly with `--model`.
@@ -759,7 +792,7 @@ Each consultation generates:
759
792
 
760
793
  - **Claude consultant**: New consultant with "The Synthesizer" persona
761
794
  - **Self-exclusion**: Invoking agent automatically excluded from panel
762
- - **Presets**: Quick configuration with `--preset minimal/balanced/high-stakes/local`
795
+ - **Presets**: Quick configuration with `--preset minimal/balanced/high-stakes/security`
763
796
  - **Doctor command**: Diagnostic and auto-fix tool
764
797
  - **Synthesis strategies**: `--strategy majority/risk_averse/security_first/compare_only`
765
798
  - **Confidence intervals**: Statistical confidence ranges (e.g., "8 +/- 1.2")
package/SKILL.md CHANGED
@@ -5,10 +5,10 @@ license: MIT
5
5
  compatibility: Requires bash, jq, and at least 2 AI CLI tools (agy, codex, vibe, etc.). macOS and Linux.
6
6
  metadata:
7
7
  author: matteoscurati
8
- version: 2.21.1
8
+ version: 2.22.0
9
9
  ---
10
10
 
11
- # AI Consultants v2.21.1 - AI Expert Panel
11
+ # AI Consultants v2.22.0 - AI Expert Panel
12
12
 
13
13
  **A harness for every question.** Convene a panel of AI "consultants" for coding questions — and let the engine pick *how* they deliberate: a quick read, a convergence loop, an adversarial refutation gate, a tournament, or an exhaustive sweep. Each consultant has a **configurable persona** that shapes its analysis.
14
14
 
@@ -100,13 +100,16 @@ Query is classified, then sent to consultants in parallel. Responses are scored,
100
100
  All settings use environment variables. Key toggles:
101
101
 
102
102
  ```bash
103
+ ai-consultants configure # Auto-detect CLIs/API keys and persist all settings
103
104
  ENABLE_DEBATE=true # Multi-agent debate
104
105
  ENABLE_SYNTHESIS=true # Automatic synthesis
105
106
  ENABLE_PANIC_MODE=auto # Auto-rigor for uncertainty
106
107
  ENABLE_BUDGET_LIMIT=false # Budget enforcement (v2.4)
107
108
  ```
108
109
 
109
- Enable opt-in consultants: `ENABLE_KIMI`, `ENABLE_QWEN3`, `ENABLE_CLAUDE`, `ENABLE_MINIMAX`.
110
+ Use `ai-consultants configure --show-parameters` for the exact accepted keys,
111
+ `--set KEY=VALUE` for repeatable automation, or `--advanced` to review all of
112
+ them interactively.
110
113
 
111
114
  CLI/API switching: `GEMINI_USE_API`, `CODEX_USE_API`, `CLAUDE_USE_API`, `MISTRAL_USE_API`, `QWEN3_USE_API`.
112
115
 
@@ -55,13 +55,14 @@ Usage:
55
55
  ai-consultants --preset <name> "question" Use a configuration preset
56
56
  ai-consultants --strategy <name> "question" Use a synthesis strategy
57
57
  ai-consultants doctor [--fix] [--json] Run diagnostics
58
+ ai-consultants configure [options] Auto-configure all persistent settings
58
59
  ai-consultants update-clis [--dry-run] Check & update installed consultant CLIs
59
60
  ai-consultants init [--force] Scaffold ~/.config/ai-consultants/{config.sh,.env}
60
61
  ai-consultants install Install slash commands to ~/.claude/commands/
61
62
  ai-consultants version Show version
62
63
  ai-consultants help Show this help
63
64
 
64
- Presets: minimal, balanced, thorough, high-stakes, local, security, cost-capped,
65
+ Presets: minimal, balanced, thorough, high-stakes, security, cost-capped,
65
66
  max_quality, medium, fast
66
67
 
67
68
  Strategies: majority, risk_averse, security_first, cost_capped, compare_only
@@ -70,6 +71,7 @@ Examples:
70
71
  npx ai-consultants "How to optimize this SQL query?"
71
72
  npx ai-consultants --preset balanced "Redis or Memcached?"
72
73
  npx ai-consultants doctor --fix
74
+ npx ai-consultants configure --set DEFAULT_PRESET=balanced
73
75
 
74
76
  Documentation: https://github.com/matteoscurati/ai-consultants
75
77
  EOF
@@ -79,6 +81,10 @@ EOF
79
81
  shift
80
82
  exec "$SCRIPTS_DIR/doctor.sh" "$@"
81
83
  ;;
84
+ configure|config)
85
+ shift
86
+ exec "$SCRIPTS_DIR/configure.sh" "$@"
87
+ ;;
82
88
  update-clis|update)
83
89
  shift
84
90
  exec "$SCRIPTS_DIR/update_clis.sh" "$@"
@@ -1,4 +1,4 @@
1
- # Cost Rates - AI Consultants v2.21.1
1
+ # Cost Rates - AI Consultants v2.22.0
2
2
 
3
3
  This page documents the per-token rates used by the cost tracking system.
4
4