route-models

route-models is a skill for Claude Code from kotaroyamame/formal-agent-contracts. It costs 179 tokens per session (2,503 once invoked), scanned A, original, MIT.

A rules-based tool that assigns each VDM-SL module to a light, standard, or heavy AI model based on the module’s formal specification. VDM-SL is a language for describing software precisely, and VDMJ is a tool that checks those descriptions and their results.

In plain words
What is it for?
Use it before generating code, tests, or reconciliations for a multi-module VDM-SL specification when you want to reduce token use according to measurable complexity.
Why use it?
It prevents using an expensive model for simple modules while keeping complex modules with a model suited to their reasoning needs. The same formal checks and contract tests judge every generated result.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents; names the AskUserQuestion tool; mentions Claude Code.

Part of the formal-agent-contracts plugin — 15 skills shipped together

Good fit Use it before generating code, tests, or reconciliations for a multi-module VDM-SL specification when you want to reduce token use according to measurable complexity.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kotaroyamame/formal-agent-contracts/route-models
Install

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.

Any agent
npx skills add kotaroyamame/formal-agent-contracts --skill route-models
Clone the repo
git clone --depth 1 https://github.com/kotaroyamame/formal-agent-contracts

Made for: Claude Code.

Or install formal-agent-contracts, the plugin that ships this one along with the rest of its 15 skills.

Wrote 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.

agentmods badge for route-models

README.md
[![agentmods](https://agentmods.dev/badge/skills/kotaroyamame/formal-agent-contracts/route-models/github.svg)](https://agentmods.dev/skills/kotaroyamame/formal-agent-contracts/route-models)
Your own site
<a href="https://agentmods.dev/skills/kotaroyamame/formal-agent-contracts/route-models"><img src="https://agentmods.dev/badge/skills/kotaroyamame/formal-agent-contracts/route-models/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.

agentmods 80×15 button for route-models

Your own site · 80×15
<a href="https://agentmods.dev/skills/kotaroyamame/formal-agent-contracts/route-models"><img src="https://agentmods.dev/badge/skills/kotaroyamame/formal-agent-contracts/route-models.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 179 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,503 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00179 $0.02503
Opus 5 $0.00089 $0.01252
Sonnet 5 $0.00036 $0.00501
Haiku 4.5 $0.00018 $0.00250

Measured 10d ago against content hash 1bcb007368a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

route-models 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 10d 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.

skills/route-models/SKILL.md · 189 lines

How it starts

The opening of the file, as written. The whole thing — 189 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Model Routing — Contract-Driven Model Assignment per Module

Overview

Multi-agent development spends most of its tokens on bulk phases: code generation, test generation, and reconciliation. Not every module needs the strongest model for those phases — a types-only module converts mechanically, while a module full of implicit definitions needs real reasoning.

This skill reads the VDM-SL contract and assigns each module to the lightest capable model tier, using only objective, countable signals from the spec. The formal contract itself is what makes this safe: whichever model generates the artifact, the same VDMJ checks and contract tests judge the result.

マルチエージェント開発でトークンを最も消費するのは、コード生成・テスト生成・照合 といった一括処理のフェーズです。型定義だけのモジュールは機械的に変換できる一方、 暗黙的定義だらけのモジュールには本物の推論が要ります。

このスキルは VDM-SL 契約を読み取り、仕様に含まれる客観的で数えられるシグナルだけを 根拠に、各モジュールを「能力が足りる範囲で最も軽いモデル層」へ割り振ります。これが安全 なのは形式契約があるからです — どのモデルが生成しても、同じ VDMJ チェックと契約 テストが結果を判定します。

Trigger Conditions

Activate this skill when the user says any of:

  • 「モデルを割り振って」「モジュールごとに軽量モデルを使いたい」
  • 「トークン消費を抑えたい」「コストを下げたい(生成フェーズで)」
  • "Route models", "assign models per module", "reduce token cost"
  • Before a bulk generation phase over a multi-module spec, when the user wants to reduce cost

Model Tiers

Tiers are abstract; the concrete model names depend on what the runtime offers. In Claude Code, subagents accept a model parameter — map tiers as follows:

Tier Claude Code model Suited for
light haiku Mechanical conversion: types-only modules, boilerplate, simple pure functions
standard sonnet Typical modules: state + invariants, explicit operations
heavy inherit (the session's main model) Implicit-definition-heavy modules, cross-module protocol logic, high PO counts

層は抽象名で扱い、実行環境が提供するモデルに対応付けます。heavy は「セッションの メインモデルを継承」が既定です(メインより強いモデルを勝手に選ばない)。

Execution Flow

Step 1: Read the Specification

Read the .vdmsl file(s) specified by the user (search the workspace if unspecified). Split into modules: VDM-SL module ... end sections, or treat a flat file as one module.

Read the full file on GitHub · 189 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 10d ago First seen · 189 lines · 179 tokens per session scan A 1bcb007368a2

Subscribe to this mod's changes

route-models is a skill published in the GitHub repository kotaroyamame/formal-agent-contracts (1 stars, last pushed 2mo ago), licensed MIT. It adds 179 tokens to every session and 2,503 once invoked, about $0.0009 per session on Opus 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-31.