スキル一覧に戻る
Shakes-tzd

multi-ai-orchestration

by Shakes-tzd

HTML is All You Need - A lightweight graph database using HTML files as nodes, hyperlinks as edges, and CSS selectors as queries

2🍴 1📅 2026年1月16日
GitHubで見るManusで実行

SKILL.md


name: multi-ai-orchestration description: Spawner selection, cost optimization, and HeadlessSpawner patterns for coordinating multiple AI models (Codex, Gemini, Copilot, Claude).

Multi-AI Orchestration Skill

Use this skill for spawner selection, cost optimization, and HeadlessSpawner patterns when coordinating multiple AI models.

Trigger keywords: spawner, multi-ai, headless, codex, gemini, copilot, model selection, cost optimization, parallel agents


CRITICAL: Cost-First Routing (IMPERATIVE)

Claude Code is EXPENSIVE and has usage limits. You MUST use FREE/CHEAP AIs first.

COST HIERARCHY (lowest to highest):
1. Gemini 2.0-Flash: FREE (2M tokens/min) ← USE FIRST
2. Codex (GPT-4):    $ (cheap, code-specialized)
3. Copilot:          $ (cheap, GitHub integration)
4. Claude Haiku:     $$ (fallback ONLY)
5. Claude Sonnet:    $$$ (coordination only)
6. Claude Opus:      $$$$ (strategic decisions only)

PRE-DELEGATION CHECKLIST (MUST EXECUTE)

BEFORE delegating ANY task, you MUST ask these questions IN ORDER:

┌─────────────────────────────────────────────────────────┐
│ 1. Can Gemini do this? (exploration, research, batch)  │
│    → YES = MUST use spawn_gemini (FREE)                │
│    → NO  = Continue to step 2                          │
├─────────────────────────────────────────────────────────┤
│ 2. Is this code work? (implementation, fixes, tests)   │
│    → YES = MUST use spawn_codex (cheap, specialized)   │
│    → NO  = Continue to step 3                          │
├─────────────────────────────────────────────────────────┤
│ 3. Is this git/GitHub? (commits, PRs, issues)          │
│    → YES = MUST use spawn_copilot (GitHub integration) │
│    → NO  = Continue to step 4                          │
├─────────────────────────────────────────────────────────┤
│ 4. Does this require deep reasoning?                   │
│    → YES = Use Claude Opus (expensive, but needed)     │
│    → NO  = Continue to step 5                          │
├─────────────────────────────────────────────────────────┤
│ 5. Is this multi-agent coordination?                   │
│    → YES = Use Claude Sonnet (mid-tier)                │
│    → NO  = Use Gemini (FREE) or Haiku (fallback)       │
└─────────────────────────────────────────────────────────┘

WRONG vs CORRECT Delegation

❌ WRONG (using Haiku for everything):
- Implementation → Haiku          # WRONG: Use Codex
- Git commits → Haiku             # WRONG: Use Copilot
- Code generation → Haiku         # WRONG: Use Codex
- Research → Haiku                # WRONG: Use Gemini (FREE!)
- File analysis → Haiku           # WRONG: Use Gemini (FREE!)

✅ CORRECT (cost-first routing):
- Implementation → spawn_codex    # Cheap, code-specialized
- Git commits → spawn_copilot     # Cheap, GitHub integration
- Research → spawn_gemini         # FREE, high context
- File analysis → spawn_gemini    # FREE, multimodal
- Strategic planning → Opus       # Expensive, but needed
- Haiku → FALLBACK ONLY           # When others fail

Task-to-AI Routing Table (IMPERATIVE)

Task TypeMUST UseFallbackWhy
Exploration, research, codebase analysisspawn_geminiHaikuFREE, 2M tokens/min, high context
Code generation, implementationspawn_codexSonnetCode-specialized, sandbox isolation
Bug fixes, refactoringspawn_codexHaikuEdit tracking, workspace-write
Git operations, commits, PRsspawn_copilotHaikuGitHub integration, tool permissions
File operations, batch processingspawn_geminiHaikuFREE, fast, multimodal
Image/screenshot analysisspawn_gemini-Vision API, multimodal
Testing, validationspawn_codexHaikuCan execute tests in sandbox
Strategic planning, architectureOpusSonnetDeep reasoning required
Multi-agent coordinationSonnet-Complex coordination
Last resort fallbackHaiku-When Gemini/Codex/Copilot fail

Cost Awareness (CRITICAL)

MONTHLY USAGE IMPACT:

Claude Code (Sonnet/Opus): $$$$
- Limited usage quota
- Exhausts quickly with heavy use
- RESERVE for strategic work only

Gemini 2.0-Flash: FREE
- 2M tokens per minute (rate limited)
- 1M token context window
- Multimodal (images, PDFs, audio)
- Use FIRST for exploration

Codex (GPT-4): $
- Cheap for code work
- Sandbox isolation
- Worth premium for specialization

Copilot: $
- Cheap for GitHub work
- Tool permission controls
- Native GitHub integration

Cost Optimization Impact

BEFORE (using Haiku everywhere):
- 10 implementations × Haiku = $$$$
- 5 git commits × Haiku = $$$
- 20 file searches × Haiku = $$$$$

AFTER (cost-first routing):
- 10 implementations × Codex = $$
- 5 git commits × Copilot = $
- 20 file searches × Gemini = FREE

SAVINGS: 80-90% reduction in Claude Code usage

Spawner Selection Matrix

Priority order (first match wins, cost-first):

PriorityUse CaseSpawnerCost
1Exploration, research, batch opsspawn_geminiFREE
2Code generation, bug fixesspawn_codex$
3Git/GitHub workflows, PRsspawn_copilot$
4Image/multimodal analysisspawn_geminiFREE
5Complex reasoning, architecturespawn_claude$$$$
6Fallback when others failTask(haiku)$$

Decision Aid

  • "Is this exploratory?"spawn_gemini (FREE)
  • "Is this about code?"spawn_codex (cheap)
  • "Does this involve git?"spawn_copilot (cheap)
  • "Do I need vision?"spawn_gemini (FREE)
  • "Is deep reasoning critical?"spawn_claude (expensive)
  • "Everything else"spawn_gemini FIRST, then Haiku fallback

Task() vs spawn_*() Decision

Use spawn_*() when:

  • Work can run in isolation (most cases)
  • Want cost optimization (Gemini FREE)
  • Specialized tool needed (Codex sandbox, Copilot GitHub)

Use Task(haiku) when:

  • Work depends on conversation context
  • Cache hits matter (same conversation)
  • AND spawn_*() has failed or is unavailable

Integration Patterns

Pattern 1: Cost-First Exploration

# ALWAYS start with Gemini for exploration
result = spawn_gemini("Search codebase for all auth patterns")
if not result.success:
    # Fallback to Haiku ONLY if Gemini fails
    Task(prompt="Search codebase for auth patterns", subagent_type="haiku")

Pattern 2: Code Implementation

# Use Codex for code work (not Haiku!)
result = spawn_codex(
    prompt="Implement OAuth authentication",
    sandbox="workspace-write"
)
if not result.success:
    Task(prompt="Implement OAuth", subagent_type="sonnet")  # Fallback

Pattern 3: Git Workflow

# Use Copilot for git (not Haiku!)
result = spawn_copilot(
    prompt="Commit changes and create PR",
    allow_tools=["shell(git)", "github(*)"]
)

Pattern 4: Multi-Provider (Cost-Optimized)

# Research with FREE Gemini
research = spawn_gemini("Analyze current auth implementation")

# Code with cheap Codex
code = spawn_codex("Implement OAuth based on research")

# Git with cheap Copilot
pr = spawn_copilot("Create PR for OAuth implementation")

# Reserve Claude for strategic decisions ONLY
# architecture = spawn_claude("Design long-term auth strategy")

Cost Optimization Rules (IMPERATIVE)

  1. ANY exploratory work → MUST use spawn_gemini (FREE)
  2. ANY code work → MUST use spawn_codex (cheap, specialized)
  3. ANY git/GitHub work → MUST use spawn_copilot (cheap, integrated)
  4. Complex reasoning → MAY use spawn_claude (expensive)
  5. Haiku → ONLY as fallback when above fail

Violating these rules wastes Claude Code quota unnecessarily.


Verification After Spawning

After Gemini/Codex generates code, MUST verify quality:

# Run quality verification script
./scripts/test-quality.sh src/path/to/file.py

# Returns: exit code 0 (pass) or 1 (fail)
# Runs: ruff check, ruff format, mypy, pytest

If verification fails, iterate with the same spawner (not Claude).


For detailed API documentation: → See REFERENCE.md For real-world examples: → See EXAMPLES.md

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です