ensemble:generate-router-rules

ensemble:generate-router-rules is a command for Claude Code from FortiumPartners/ensemble. It costs 17 tokens per session (1,369 once invoked), scanned A, original, MIT.

A command that inspects the agents and skills available in a coding-assistant session and generates routing rules for them. The rules group capabilities by areas such as development, testing, review, and infrastructure.

In plain words
What is it for?
It helps discover available agents and skills, classify them by domain, and create a router-rules file.
Why use it?
It avoids maintaining the full list of available agents and skills by hand, reducing the chance that routing rules become incomplete or outdated.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Part of the ensemble-router plugin — 2 commands shipped together

Good fit It helps discover available agents and skills, classify them by domain, and create a router-rules file.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/fortiumpartners/ensemble/generate-router-rules
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.

Clone the repo
git clone --depth 1 https://github.com/FortiumPartners/ensemble

Made for: Claude Code.

Or install ensemble-router, the plugin that ships this one along with the rest of its 2 commands.

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 ensemble:generate-router-rules

README.md
[![agentmods](https://agentmods.dev/badge/commands/fortiumpartners/ensemble/generate-router-rules.svg)](https://agentmods.dev/commands/fortiumpartners/ensemble/generate-router-rules)
Your own site
<a href="https://agentmods.dev/commands/fortiumpartners/ensemble/generate-router-rules"><img src="https://agentmods.dev/badge/commands/fortiumpartners/ensemble/generate-router-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,369 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.00017 $0.01369
Opus 5 $0.00009 $0.00685
Sonnet 5 $0.00003 $0.00274
Haiku 4.5 $0.00002 $0.00137

Measured 4d ago against content hash 79a5aa1a94e3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

ensemble:generate-router-rules 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 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.

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.

packages/router/commands/generate-router-rules.md · 175 lines

How it starts

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

Generate Router Rules

Introspect available agents and skills in this Claude Code session, then generate a router-rules.json with categorized keyword mappings for the UserPromptSubmit routing hook.

Phase 1: Agent Discovery

1.1 Extract Available Agents

Examine your own Task tool documentation to extract all available subagent_type values. Look in the Task tool description for the list of agent types.

Actions:

  • Parse the subagent_type options from the Task tool description
  • Extract agent name and description for each
  • Note the tools each agent has access to

1.2 Categorize Agents by Domain

Group discovered agents into these functional domains:

Domain Description Example Agents
product_documentation PRD, TRD, docs, requirements product-management-orchestrator, documentation-specialist
orchestration Coordination and planning ensemble-orchestrator, tech-lead-orchestrator
development Code implementation frontend-developer, backend-developer, mobile-developer
quality_testing Review, testing, debugging code-reviewer, test-runner, deep-debugger
infrastructure_build Deploy, build, release deployment-orchestrator, build-orchestrator
utility Support tasks general-purpose, file-creator, git-workflow
database Database operations postgresql-specialist

Phase 2: Skill Discovery

2.1 Extract Available Skills

Examine the Skill tool documentation's <available_skills> section to extract all available skills.

Actions:

  • Parse skill names from the Skill tool's available_skills list
  • Extract description and location for each skill
  • Note any argument hints or usage patterns

2.2 Generate Skill Keywords

For each skill, create keyword mappings:

Keyword Type Example for vercel skill
Primary vercel, nextjs, next.js
Technology edge function, serverless, preview
Action deploy, preview, domains
Diagnostic vercel issue, vercel problem, not working
Pattern deploy.*react, next.*app, vercel.*issue

Read the full file on GitHub · 175 lines

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. 4d ago First seen · 175 lines · 17 tokens per session scan A 79a5aa1a94e3

Subscribe to this mod's changes

ensemble:generate-router-rules is a command published in the GitHub repository FortiumPartners/ensemble (11 stars, last pushed 1mo ago), licensed MIT. It adds 17 tokens to every session and 1,369 once invoked, about $0.0001 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-09-03.