brains-trust
Brains Trust queries multiple leading AI models from different providers for second opinions on code, architecture, strategy, prompting, or general problems. It triggers on phrases like "brains trust," "second opinion," "peer review," "challenge this," or "ask gemini/gpt," and applies sensible defaults when no specific scope is given. Use it whenever fresh perspectives from competing models would help validate decisions, catch blind spots, or strengthen work in progress.
git clone --depth 1 https://github.com/jezweb/claude-skills /tmp/brains-trust && cp -r /tmp/brains-trust/plugins/dev-tools/skills/brains-trust ~/.claude/skills/brains-trustSKILL.md
# Brains Trust
Consult other leading AI models for a second opinion. Not limited to code — works for architecture, strategy, prompting, debugging, writing, or any question where a fresh perspective helps.
## Defaults (When User Just Says "Brains Trust")
If the user triggers this skill without specifying what to consult about, apply these defaults:
1. **Pattern**: Consensus (2 models from different providers) — it's called "brains trust", not "single opinion"
2. **Scope**: Whatever Claude has been working on in the current session. Look at recent context: files edited, decisions made, architecture discussed, problems being solved.
3. **Mode**: Infer from context:
- Recently wrote/edited code → **Code Review**
- In a planning or design discussion → **Architecture**
- Debugging something → **Debug**
- Building prompts or skills → **Prompting**
- No clear signal → **General** (ask: "what are we missing? what are our blind spots?")
4. **Models**: Pick the newest pro-tier model from 2 different providers (check `models.flared.au`). Prefer diversity: e.g. one Google + one OpenAI, or one Qwen + one Google. Never two from the same provider.
5. **Prompt focus**: "Review what we've been working on. What are we missing? What could be improved? What blind spots might we have? Are there simpler approaches we haven't considered?"
### Trigger → Default Mapping
| Trigger | Default pattern | Default scope |
|---------|----------------|---------------|
| "brains trust" | Consensus (2 models) | Current session work |
| "second opinion" | Single (1 model) | Current session work |
| "ask gemini" / "ask gpt" | Single (specified provider) | Current session work |
| "peer review" | Consensus (2 models) | Recently changed files |
| "challenge this" / "devil's advocate" | Devil's advocate (1 model) | Claude's current position |
The user can always override by being specific: "brains trust this config file", "ask gemini about the auth approach", etc.
## Setup
Set at least one API key as an environment variable:
```bash
# Recommended — one key covers all providers
export OPENROUTER_API_KEY="your-key"
# Optional — direct access (often faster/cheaper)
export GEMINI_API_KEY="your-key"
export OPENAI_API_KEY="your-key"
```
OpenRouter is the universal path — one key gives access to Gemini, GPT, Qwen, DeepSeek, Llama, Mistral, and more.
## Current Models
**Do not use hardcoded model IDs.** Before every consultation, fetch the current leading models:
```
https://models.flared.au/llms.txt
```
This is a live-updated, curated list of ~40 leading models from 11 providers, filtered from OpenRouter's full catalogue. Use it to pick the right model for the task.
For programmatic use in the generated Python script: `https://models.flared.au/json`
## Consultation Patterns
| Pattern | Default for | What happens |
|---------|------------|-------------|
| **Consensus** | "brains trust", "peer review" | Ask 2 models from different providers in parallel, compare where they agree/disagree |
| **Single** | "second opinion", "ask gemini", "ask gpt" | Ask one model, synthesise with your own view |
| **Devil's advocate** | "challenge this", "devil's advocate" | Ask a model to explicitly argue against your current position |
For consensus, always pick models from different providers (e.g. one Google + one Qwen) for maximum diversity of perspective.
## Modes
| Mode | When | Model tier |
|------|------|-----------|
| Code Review | Review files for bugs, patterns, security | Flash |
| Architecture | Design decisions, trade-offs | Pro |
| Debug | Stuck after 2+ failed attempts | Flash |
| Security | Vulnerability scan | Pro |
| Strategy | Business, product, approach decisions | Pro |
| Prompting | Improve prompts, system prompts, KB files | Flash |
| General | Any question, brainstorm, challenge | Flash |
**Pro tier**: The most capable model from the chosen provider (e.g. `google/gemini-3.1-pro-preview`, `openai/gpt-5.4`).
**Flash tier**: Fast, cheaper models for straightforward analysis (e.g. `google/gemini-3-flash-preview`, `qwen/qwen3.5-flash-02-23`).
## Workflow
1. **Detect available keys** — check `OPENROUTER_API_KEY`, `GEMINI_API_KEY`, `OPENAI_API_KEY` in environment. If none found, show setup instructions and stop.
2. **Fetch current models** — `WebFetch https://models.flared.au/llms.txt` and pick appropriate models based on mode (pro vs flash) and consultation pattern (single vs consensus). If user requested a specific provider ("ask gemini"), use that.
3. **Read target files** into context (if code-related). For non-code questions (strategy, prompting, general), skip file reading.
4. **Build prompt** using the AI-to-AI template from [references/prompt-templates.md](references/prompt-templates.md). Include file contents inline with `--- filename ---` separators. **Do not set output token limits** — let models reason fully.
5. **Create consultation directory** at `.jez/artifacts/brains-trust/{timestamp}-{topic}/` (e.g. `2026-03-10-1423-auth-architecture/`). Write the prompt to `prompt.txt` inside it — never pass code inline via bash arguments (shell escaping breaks it).
6. **Generate and run Python script** at `.jez/scripts/brains-trust.py` using patterns from [references/provider-api-patterns.md](references/provider-api-patterns.md):
- Reads prompt from the consultation directory's `prompt.txt`
- Calls the selected API(s)
- For consensus mode: calls multiple APIs in parallel using `concurrent.futures`
- Saves each response to `{model}.md` in the consultation directory
- Prints results to stdout
7. **Synthesise** — read the responses, present findings to the user. Note where models agree and disagree. Add your own perspective (agree/disagree with reasoning). Let the user decide what to act on.
## When to Use
**Good use cases**:
- Before committing major architectural changes
- When stuck debugging after multiple attempts
- Architecture decisions with multiple valid options
- RevGenerate AI images using Gemini or GPT APIs directly. Covers model selection (Gemini for scenes; GPT Image 2 for text rendering, batch variations, multi-reference compositing; GPT Image 1.5 for transparent icons), the 5-part prompting framework, API calling patterns, multi-turn editing, and quality assurance. Produces photorealistic scenes, icons, illustrations, OG images, posters, infographics, and product shots. Use when building websites that need images, creating marketing assets, or generating visual content. Triggers: 'generate image', 'ai image', 'create hero image', 'make an icon', 'generate illustration', 'create og image', 'poster', 'infographic', 'image variations', 'gpt-image-2', 'ai art', 'image generation'.
Generate complete user documentation for a web app with screenshots. Browses the app via browser automation, screenshots every screen, and produces a structured user guide with step-by-step instructions, annotated screenshots, workflow diagrams, and reference tables. Supports quick (key screens), standard (all pages), thorough (every state and flow), and exhaustive (publishable documentation suite). Triggers: 'document the app', 'user guide', 'app documentation', 'screenshot docs', 'generate user docs', 'help docs', 'how-to guide', 'write the docs'.
Australian business English for professional writing — warm, direct, EN-AU spelling (colour, organise, centre), no filler words. Use whenever the user is writing for an Australian audience: emails, chat messages, proposals, client communications, blog posts, web copy, or any business writing. Apply to drafting, editing, and tone-checking professional text.
Write compelling award submissions, grant applications, and competition entries. Maps achievements to selection criteria using evidence-based narratives. Use whenever the user is applying for a business award (Telstra, chamber of commerce, industry awards), a grant, a competition, or any submission demonstrating merit against defined criteria.
Hit the Cloudflare REST API directly for operations that wrangler and MCP can't handle well. Bulk DNS, custom hostnames, email routing, cache purge, WAF rules, redirect rules, zone settings, Worker routes, D1 cross-database queries, R2 bulk operations, KV bulk read/write, Vectorize queries, Queues, and fleet-wide resource audits. Produces curl commands or scripts. Triggers: 'cloudflare api', 'bulk dns', 'custom hostname', 'email routing', 'cache purge', 'waf rule', 'd1 query', 'r2 bucket', 'kv bulk', 'vectorize query', 'audit resources', 'fleet operation'.
Scaffold and deploy Cloudflare Workers with Hono routing, Vite plugin, and Static Assets. Describe project, scaffold structure, configure bindings, deploy. Use whenever the user wants to create a Worker project, set up Hono on Cloudflare, configure D1 / R2 / KV / Queues bindings, or troubleshoot Worker export syntax, API route conflicts, HMR issues, or deployment failures.
Run an independent code review using the OpenAI Codex CLI in headless mode. Gets a second opinion from a different model family (the current Codex models) on recent changes, a PR, a commit, or the whole app — covering bugs, regressions, security, data consistency, UX/state bugs, performance risks, and testing gaps. Saves a severity-prioritised report to .jez/reviews/. Triggers: 'codex review', 'review with codex', 'independent code review', 'what does codex think', 'get codex to review'.
Generate complete, accessible colour palettes from a single brand hex. Produces 11-shade scale (50-950), semantic tokens, dark mode variants, Tailwind v4 CSS output, WCAG contrast checks. Use whenever the user supplies a brand hex and asks for a palette, mentions setting up a design system, wants Tailwind theme colours from a brand colour, or asks to check colour accessibility / contrast.