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 baphuongna/pi-crew --skill model-routing-contextgit clone --depth 1 https://github.com/baphuongna/pi-crewWrote 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/baphuongna/pi-crew/model-routing-context)<a href="https://agentmods.dev/skills/baphuongna/pi-crew/model-routing-context"><img src="https://agentmods.dev/badge/skills/baphuongna/pi-crew/model-routing-context/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/baphuongna/pi-crew/model-routing-context"><img src="https://agentmods.dev/badge/skills/baphuongna/pi-crew/model-routing-context.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
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 →
- medium MCP Rug Pull · line 149 npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.Fix: Pin the version: npx @scope/[email protected]
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.00066 | $0.01572 |
| Opus 5.5 | $0.00026 | $0.00629 |
| Sonnet 5.5 | $0.00013 | $0.00314 |
| Haiku 4.5 | $0.00007 | $0.00157 |
Grade A, and why
model-routing-context scanned grade A with 0 findings 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 22d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 163 lines — stays where its author put it; the contents beside it link to each section on GitHub.
model-routing-context
Use this skill when working on model/context propagation.
Source patterns distilled
- Pi session context/model state:
source/pi/packages/coding-agent/src/core/session-manager.ts,agent-session.ts, compaction modules - pi-crew model and prompt code:
src/runtime/model-fallback.ts,src/runtime/pi-args.ts,src/runtime/task-runner/prompt-builder.ts,src/runtime/task-output-context.ts,src/extension/team-tool/context.ts
Rules
- Preserve parent model inheritance unless an agent/task/user explicitly provides a non-empty model override.
- Treat empty strings and whitespace model values as absent.
- Carry relevant parent conversation context as reference-only; do not let it override explicit task instructions or safety constraints.
- Distinguish the two compaction layers: host-Pi session compaction (
source/pi/.../session-manager.ts,agent-session.ts, compaction modules) is a reference-only concept — it is not a pi-crew API. - Respect pi-crew's write-side compaction when building context:
compactString/compactValuetranscript truncation insrc/runtime/child-pi/child-pi-transcript.ts:132-164(compactStringexported at :134; cuts marked[truncated]/[pi-crew truncated N entries]). Avoid ballooning prompts with redundant transcript data. - Avoid inline dynamic imports for model providers or prompt helpers.
- When changing model precedence, add tests for undefined, empty, whitespace, agent, task, parent, and explicit tool override cases.
- Redact secrets in context snippets and child prompts where logs/artifacts may persist them.
Enforcement — Model Routing Context Gate
Before changing model precedence or building task prompts, verify:
- Empty/whitespace model values treated as absent (not as explicit overrides)
- Model precedence chain understood: tool override → step model → team role → agent model → parent → registry default
- Thinking level suffix applied correctly (or intentionally omitted)
- Secrets redacted in context snippets and child prompts
- Tests cover: undefined, empty, whitespace, agent, task, parent, and explicit tool override cases
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.
- 22d ago Changed · +1 lines · +3 tokens per session d23131f2d8a6
- 1mo ago Changed · +9 lines · +24 tokens per session c72ddaf5b8b1
- 1mo ago First seen · 153 lines · 39 tokens per session scan A 25996168f3b6
model-routing-context is a skill published in the GitHub repository baphuongna/pi-crew (59 stars, last pushed today), licensed MIT. It adds 66 tokens to every session and 1,572 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
llm-app-patterns
Production-ready patterns for building LLM applications. Covers RAG pipelines, agent architectures, prompt IDEs, and LLMOps monitoring. Use when designing AI applications, implementing RAG, building agents, or setting up LLM observability.
prompt-engineer
Writes, refactors, and evaluates prompts for LLMs — generating optimized prompt templates, structured output schemas, evaluation rubrics, and test suites. Use when designing prompts for new LLM applications, refactoring existing prompts for better accuracy or token efficiency, implementing chain-of-thought or few-shot…
prompt-optimization
Improve a prompt on the evaluations workbench through a measured loop. Score the baseline first, then duplicate the target column, form a hypothesis from failing rows, edit the copy's prompt draft, run, compare pass rate and cost, and repeat until the numbers hold. Use when the user asks to optimize or improve a…
omh-model-optimization
This is a Hermes-native model-optimization workflow skill.
ideogram4
Prompting patterns for Ideogram 4 text-to-image — best-in-class in-image text rendering and exact color/layout control via structured JSON captions. Use when generating images that need legible on-image text (title cards, thumbnails, logos, signage, CTAs), precise brand colors, or controlled spatial layout. Triggers…
prompt-library-for-startups
AWS-curated copy-paste prompts for AI coding agents (MVP scaffolding, RAG chatbot with Claude on Bedrock, security baseline evaluation, cost anomaly detection, GPU quota requests, EKS deployment, Well-Architected review, etc.) plus downloadable installable agents (Multi-Account Transition Advisor, Bill Shock…