Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add alinaqi/maggy --skill model-routinggit clone --depth 1 https://github.com/alinaqi/maggyWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/alinaqi/maggy/model-routing)<a href="https://agentmods.dev/skills/alinaqi/maggy/model-routing"><img src="https://agentmods.dev/badge/skills/alinaqi/maggy/model-routing/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/alinaqi/maggy/model-routing"><img src="https://agentmods.dev/badge/skills/alinaqi/maggy/model-routing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Excessive Agency · line 72 Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.Fix: Remove the model/provider override or disclose it prominently and require explicit operator approval before invoking an external coding CLI or billed model.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00017 | $0.01708 |
| Opus 5 | $0.00009 | $0.00854 |
| Sonnet 5 | $0.00003 | $0.00342 |
| Haiku 4.5 | $0.00002 | $0.00171 |
Grade A, and why
model-routing scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
├── qwen3 # Shell: curl to local Ollama API How it starts
The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Model Routing System
How Routing Decisions Are Made
Every user prompt goes through a 9-tier classification pipeline before any AI model processes it. The system answers three questions:
- Which model should handle this? — 9-tier cost/complexity classification
- Is the classifier itself working? — Cascading fallback (qwen3 → kimi → deepseek → cache)
- Can we verify the result? — Tool-level fallback + auto-evaluation
The Pipeline
User types prompt
↓
UserPromptSubmit hook fires (~/.claude/hooks/route-task-hook)
↓
Classifier: qwen3 (local, free) classifies into tier
↓ (fails?)
Classifier: kimi (local, free) retries
↓ (fails?)
Classifier: deepseek-flash (~$0.0001) retries
↓ (fails?)
Classifier: cached tier from last success
↓
Hook injects routing decision into Claude's context
↓
Claude delegates to the right model or handles directly
9-Tier Routing Table
| Tier | Model | Input (per M) | Output (per M) | Handles |
|---|---|---|---|---|
| 0 | Qwen3 (local) | $0 | $0 | grep, find, shell, syntax, log reading |
| 1 | Gemini 2.5 Flash-Lite | $0.10 | $0.40 | Bulk extraction, classification, CIG pipelines |
| 2 | DeepSeek V4 Flash | $0.14 | $0.28 | Simple code, CRUD, test writing, small fixes |
| 3 | DeepSeek V4 Pro | $0.44 | $0.87 | Multi-file features, refactors, debugging (~80% of work) |
| 4 | Gemini 2.5 Flash | $0.15 | $0.60 | Multimodal (images, video, audio), brand analysis |
| 5 | Kimi K2.6 | $0.60 | $2.50 | Code review, commit messages, diff summaries |
| 6 | Gemini 3.1 Pro + Search | $1.25 | $10.00 | Deep research, Google grounding, 2M context |
| 7 | Codex | varies | varies | Bulk generation, code review |
| 8 | Claude Sonnet/Opus | $3-5 | $15-25 | Architecture, security, quality-critical |
Delegation Commands
When the hook says "delegate to X", run the matching command and return its output:
# Tier 0 — Qwen3
~/bin/qwen3 "prompt"
# Tier 1 — Gemini Flash-Lite
~/bin/gemini --flash-lite "prompt"
# Tier 2 — DeepSeek Flash
~/bin/deepseek --flash "prompt"
# Tier 3 — DeepSeek Pro
~/bin/deepseek --pro "prompt"
# Tier 4 — Gemini Flash
~/bin/gemini --flash "prompt"
# Tier 5 — Kimi
~/bin/kimi --quiet -p "prompt"
# Tier 6 — Gemini Pro Search
~/bin/gemini --pro-search "prompt"
# Tier 7 — Codex
codex exec "prompt"
# Tier 8 — Claude
# Handle directly (no delegation)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago Changed · +8 lines · +17 tokens per session 82f75f78cf31
- 9d ago First seen · 160 lines · 0 tokens per session scan A 1634fa9281f1
model-routing is a skill published in the GitHub repository alinaqi/maggy (707 stars, last pushed 4d ago), licensed MIT. It adds 17 tokens to every session and 1,708 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
writing-python
Idiomatic Python 3.12+ development. Use when writing Python code, CLI tools, scripts, or services. Emphasizes stdlib, type hints, fast pytest feedback, uv/ruff/pyright toolchain, and minimal dependencies. NOT for Go, Rust, TypeScript, or shell-only tasks.
python-authoring
Write, edit, refactor, or review Python in easy-cheese with concise stdlib-first code, Python 3.12, Shiv .pyz packaging, and repository test and validation conventions. Use for Python changes under src/, scripts/, .github/scripts/, or tests/, especially when the user asks for Pythonic, succinct, de-slopped…
frappe-backend
Frappe backend guidance for Python and backend-adjacent JavaScript surfaces such as client interaction patterns, hooks, APIs, patches, scheduler logic, reports, and server-side review. Use when implementing or reviewing Frappe backend behavior.
python-best-practices
Python/FastAPI coding standards including async patterns, Pydantic v2, SQLAlchemy 2.0, and project structure. Use when writing Python code, reviewing FastAPI projects, or learning FastAPI conventions.
python-packaging
Comprehensive guide to creating, structuring, and distributing Python packages using modern packaging tools, pyproject.toml, and publishing to PyPI.
python-type-annotator
Add missing type annotations to Python code. Generates mypy-compatible type hints for function signatures, variables, and class attributes. Triggers on "add types", "type annotate", "add type hints", "type this file".