agentleFS
RoentekRoentek/Claude_Code_Boilerplate_Framework/.claude/skills/three-brain/SKILL.md

three-brain

Skill4 starsChanged 6 months agoMITView on GitHub

Auto-routes work to GPT-5.5 (Codex) or Gemini 2.5 Pro when the task fits their unique capabilities better than Claude alone. Claude stays the driver — the others are tools it calls.

  • Reads credentials

4 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before the first route fires in a session, verify the tooling.

    line 85
  2. Very specific:

    If codex is missing → Codex routes unavailable.

    line 92
  3. Very specific:

    If gemini is missing → Gemini routes unavailable.

    line 94
  4. Distinctive:

    When invoking rescue, send full context: the failing output, what's been tried, the relevant files.

    line 119
  5. Distinctive:

    Always demand timestamps, page numbers, or file:line citations in the output — don't accept a flat summary.

    line 163
  6. Distinctive:

    Only when explicitly invoked: *"ask all three / before I commit to this / cross-architecture consensus."*

    line 198
  7. Distinctive:

    All three answer the SAME question.

    line 200
  8. Very specific:

    Prefer the plugin slash commands (/codex:review, etc.) when the calling context is interactive — they have prompt engineering baked in.

    line 252
  9. Distinctive:

    Do not fire on:

    line 256
  10. Distinctive:

    When uncertain: stay asleep.

    line 264

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Three-Brain Auto-Router

A single skill that routes work invisibly. Three brains, one terminal:

  • Claude = builder, driver, IDE harness — stays in front of the user the whole time
  • Codex (GPT-5.5) = reviewer, second brain, rescue
  • Gemini 2.5 Pro = eyes, ears, long-context — handles anything Claude literally cannot see or hear

Startup self-check (run once per session, before first route)

Before the first route fires in a session, verify the tooling. If anything's missing, announce it once, fall back gracefully, and don't retry every turn.

codex --version 2>&1 | head -1   # expect: codex-cli 0.125+
gemini --version 2>&1 | head -1  # expect: 0.39+

If codex is missing → Codex routes unavailable. Tell the user: "Codex CLI not found — review/rescue routes off until installed." Continue without those routes.

If gemini is missing → Gemini routes unavailable. Tell the user the same way. Continue without those routes.

Announcement protocol (REQUIRED for all forced routes)

Whenever the skill fires a route the user did NOT explicitly request — i.e. risk-path detection or failure-counter rescue — announce it in one line BEFORE running. The user must be able to interrupt with one word.

Format:

[three-brain] routing to Codex (adversarial-review) — risk path: src/auth/
[three-brain] handing off to Codex rescue — Claude failed same test 2× in a row

For routes the user explicitly asked for ("yo check this") — no announcement needed. They asked, just do it.

Failure-detection rule (HARD)

This is a deterministic counter, not a vibe. After Claude attempts the same operation and fails:

  • 2× same test failure on same code path → MUST invoke Codex rescue. Not optional. Announce it.
  • 2× same error on same shell command → MUST invoke Codex rescue. Announce it.
  • 2× same edit re-tried with no progress → MUST invoke Codex rescue. Announce it.

Reset the counter only when (a) the test/build passes, (b) the user changes the goal, or (c) the user explicitly says "keep trying."

When invoking rescue, send full context: the failing output, what's been tried, the relevant files. Use:

cat <context-bundle> | codex exec --skip-git-repo-check "rescue: [task]. Claude has tried 2x and failed. Full context attached."

Gemini preprocessing contract

Long media must be prepped before sending to Gemini — raw 2-hour videos blow rate limits and produce noise.

Video pipeline:

# 1. Acquire (if YouTube URL)
yt-dlp -f "best[ext=mp4][height<=720]" "<url>" -o /tmp/three-brain/in.mp4

# 2. Cap duration (default: 120s for demos, 600s for analysis)
ffmpeg -t 120 -i /tmp/three-brain/in.mp4 /tmp/three-brain/clip.mp4 -y

# 3. Extract audio for transcript (parallel track)
ffmpeg -i /tmp/three-brain/clip.mp4 -vn -ac 1 -ar 16000 /tmp/three-brain/audio.wav -y

# 4. Send with explicit ask for TIMESTAMPED findings
gemini -p "Analyze frame-by-frame. Return findings as a timestamped list: [MM:SS] event. Cover: graphics, lower-thirds, transitions, on-screen text, speaker actions. Cap output at 800 words." @/tmp/three-brain/clip.mp4

Audio pipeline: same as above without the video step.

PDF pipeline:

# Cap page count for very long docs
qpdf --pages input.pdf 1-100 -- /tmp/three-brain/doc.pdf 2>/dev/null || cp input.pdf /tmp/three-brain/doc.pdf

gemini -p "Extract: key claims, data tables, chart findings, page-numbered. Cap at 1000 words." @/tmp/three-brain/doc.pdf

Whole-codebase scan:

# Use the plugin which handles directory packaging
/cc-gemini-plugin:gemini --dirs <comma-separated-paths> "Find every place X. Return file:line list."

Always demand timestamps, page numbers, or file:line citations in the output — don't accept a flat summary.

Risk-path detection (path-based, not keyword-based)

Codex's review is forced — without the user asking — when an active edit touches any of these:

src/auth/**          # authentication flows
src/billing/**       # payments, subscriptions
**/migrations/**     # DB schema changes
**/deploy/**         # deployment scripts
**/.env*             # env handling
**/secrets/**        # credentials
**/policy/**         # ACLs, permissions
infra/**             # Terraform, k8s, IaC
**/Stripe* **/Plaid* # payment integrations
**/jwt* **/oauth*    # token handling

Keywords alone (auth, payments, prod) in casual chat do NOT trigger forced review — it has to be an active edit on the file paths.

This avoids false positives on docs/comments/test fixtures, and false negatives on code that uses domain names like billingFlow or policy.ts instead of generic words.

Risk-by-reversibility rule

Even task verbs that normally don't fire (refactor/plan/explain/design) DO fire if the target is irreversible or high-blast-radius:

  • "Refactor the auth middleware" → fires Codex review (auth path)
  • "Plan the Stripe migration" → fires Codex review (billing + migration path)
  • "Design the deployment pipeline" → fires Codex review (deploy path)

Verb is irrelevant if the target is risky.

Parallel consensus mode (high-stakes)

Only when explicitly invoked: "ask all three / before I commit to this / cross-architecture consensus."

All three answer the SAME question. Claude does not summarize a vibe-consensus — it forces structured output:

Recommendation: <one line>
Blocking risks: <bullet list>
Assumptions: <bullet list>
Confidence: low / medium / high
Tests required to verify: <bullet list>

Each model returns this template. Claude diffs them: where they agree, where they disagree, and adjudicates by evidence, not by averaging.

Output filing

Anything the skill produces goes to ./three-brain-out/<YYYY-MM-DD>-<slug>/:

./three-brain-out/2026-04-27-alex-graphic/
  ├── input.txt          # what the user asked
  ├── gemini-analysis.md # Gemini's output
  ├── claude-build.html  # what Claude built
  ├── codex-review.md    # Codex's review
  └── log.md             # one-line summary, dated

Append to ./three-brain-out/log.md (root-level) every time the skill runs:

[2026-04-27 16:24] route=video-build target=alex-clip duration=187s files=4

That's the compounding ledger.

Calling pattern (Bash, since slash commands aren't issuable from inside a skill)

# Codex review
git diff | codex exec --skip-git-repo-check "Review this diff. Flag bugs, risks, missing tests. Be specific."

# Codex adversarial
git diff | codex exec --skip-git-repo-check "Adversarial review. Challenge the design. Find what's wrong. Prove it's broken."

# Codex rescue
cat <bundle> | codex exec --skip-git-repo-check "Rescue mode. Claude tried 2x and failed. Solve it from scratch."

# Gemini multimodal
gemini -p "<focused ask with output format>" @./file

# Gemini whole-codebase
/cc-gemini-plugin:gemini --dirs <paths> "<focused question>"

Prefer the plugin slash commands (/codex:review, etc.) when the calling context is interactive — they have prompt engineering baked in. Fall back to the raw CLI when the slash commands are not available or when piping context.

Stay-asleep rules (explicit)

Do not fire on:

  • Casual conversation, greetings, status checks
  • Any question Claude can answer directly without external help
  • "Recall / what did we decide / look up" → that's the recall skill's job
  • "Save this / wrap up / log this" → that's wrap-up's job
  • "What's my strategy on X" → that's strategy-awareness
  • Any task already in another skill's territory

When uncertain: stay asleep. Under-firing is fine. Over-firing breaks trust.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.