commit dcd122ec58520026eb6e6525314b342bc3eaf1e0 Author: dtzp555-max Date: Tue Mar 31 04:10:58 2026 +0000 Initial commit: agent-dispatch skill for Claude Code model selection Co-Authored-By: Claude Opus 4.6 (1M context) diff --git a/README.md b/README.md new file mode 100644 index 0000000..7af37e2 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# agent-dispatch + +A Claude Code skill for selecting the right model (Opus/Sonnet/Haiku) when launching subagents. + +## What it does + +Before launching ANY Agent tool call, this skill evaluates the task complexity and selects the most cost-effective model: + +- **Opus** — Architecture decisions, domain expertise, code audits, trade-off analysis +- **Sonnet** — Pattern-following code, known bug fixes, testing, UI work, file operations +- **Haiku** — Quick searches, counting, simple data extraction, status checks + +## Why not just use Opus for everything? + +Sonnet handles **70% of subagent tasks equally well** at lower cost and higher speed. This skill prevents the common pattern of defaulting to the most expensive model "just to be safe." + +## How it complements Superpowers + +The [superpowers](https://github.com/obra/superpowers) plugin includes a generic model selection guide ("cheap/standard/most capable"). This skill extends it with: + +- **Concrete Opus/Sonnet/Haiku mapping** for Claude Code's Agent tool +- **Decision matrix** with specific task categories +- **Real-world examples** from production development +- **Split-task pattern** — e.g., Opus for research, Sonnet for implementation + +## Installation + +### As a Claude Code skill (recommended) + +```bash +mkdir -p .claude/skills/agent-dispatch +cp SKILL.md .claude/skills/agent-dispatch/ +``` + +### In CLAUDE.md + +Alternatively, paste the content of `SKILL.md` into your project's `CLAUDE.md`. + +## Usage + +The skill is **not user-invocable** — it activates automatically when the agent-dispatch pattern is referenced. It guides Claude Code to select the right `model:` parameter before every `Agent` tool call. + +## License + +MIT diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..3a8e48b --- /dev/null +++ b/SKILL.md @@ -0,0 +1,61 @@ +--- +name: agent-dispatch +description: Guide for selecting the right model (opus/sonnet/haiku) when launching subagents. Apply this before EVERY Agent tool call. +user-invocable: false +--- + +# Subagent Model Selection Guide + +Before launching ANY Agent, evaluate the task and select the appropriate model. Default to sonnet unless the task clearly requires opus. + +## Decision Matrix + +### Use OPUS when: +- Reading technical documentation and making architectural decisions +- Auditing code for logical/business errors (not just syntax) +- Designing new features with multiple valid approaches +- Cross-referencing multiple data sources to find inconsistencies +- Writing code that requires deep domain knowledge (e.g., ACI class hierarchy, EVPN semantics) +- Evaluating trade-offs between approaches +- Any task where getting it wrong is expensive to fix + +### Use SONNET when: +- Writing code following an established pattern (e.g., new plugin matching existing plugin structure) +- Fixing a known bug with clear instructions (file, line, what to change) +- Running tests (executing curl commands, comparing results) +- CSS/UI styling adjustments +- File operations (git, cleanup, rename, copy) +- Simple search-and-replace across files +- Building frontend components with clear specs +- Installing dependencies +- Any task where the "what" is clear and only the "how" needs execution + +### Use HAIKU when: +- Quick file searches (grep, glob) +- Counting things (plugin count, line count) +- Simple data extraction (parse JSON, extract field) +- Status checks (is server running, what's the file size) + +## Examples from autoACI development + +| Task | Model | Why | +|------|-------|-----| +| Read Cisco ACI Multi-Site Design Guide | opus | Deep technical comprehension needed | +| Audit 60 plugins for ACI terminology accuracy | opus | Domain expertise required to judge correctness | +| Design EP Tunnel Trace 3-segment path | opus | Novel architecture decision | +| Create fabric_isis plugin (follows routing_state pattern) | sonnet | Clear pattern to follow | +| Fix contract scope context→VRF | sonnet | One-line mapping change | +| Reorder columns in 7 plugins | sonnet | Repetitive mechanical edits | +| Run 5-agent production test | sonnet | Execute curl, compare results | +| Beautify CSS (fonts, colors, spacing) | sonnet | Style-only, no logic | +| Evaluate external GitHub project | sonnet | Web search + summarize | +| Verify topology data against APIC | sonnet | Execute queries, compare numbers | + +## How to apply + +When about to call the Agent tool: +1. Classify the task using the matrix above +2. Set `model: "opus"` only if the task matches OPUS criteria +3. Default to `model: "sonnet"` for everything else +4. Never use opus "just to be safe" — sonnet handles 70% of tasks equally well +5. For mixed tasks (e.g., "read docs then write code"), split into two agents: opus for research, sonnet for implementation