router-first-architecture
A structural pattern that directs user intents through specialized domain routers to ensure the correct tools are invoked.
Install
mkdir -p .claude/skills/router-first-architecture && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1151" && unzip -o skill.zip -d .claude/skills/router-first-architecture && rm skill.zipInstalls to .claude/skills/router-first-architecture
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Router-First ArchitectureKey capabilities
- →Route user intents to CLI commands
- →Co-activate domain skills with their router
- →Abstract tool selection
- →Map user intent to exact CLI commands
- →Handle 'not found' gracefully
How it works
A two-layer architecture uses a skill-rules trigger layer to nudge the system towards a router, which then deterministically maps user intent to specific CLI commands.
Inputs & outputs
When to use router-first-architecture
- →Mapping complex user requests to specific CLI tools
- →Ensuring consistent tool activation
- →Abstracting internal command logic
About this skill
Router-First Architecture
Route through domain routers before using individual tools. Routers abstract tool selection.
Pattern
Domain routers (like math-router) provide deterministic mapping from user intent to exact CLI commands. Always use the router first; only bypass for edge cases.
DO
- Call
math-router route "<intent>"before any math operation - Let domain skills co-activate with their router (via
coActivatein skill-rules.json) - Trust the router's confidence score; only fall back if
command: null - Keep trigger keywords/patterns in skill-rules.json broader than routing patterns
DON'T
- Call individual scripts directly when a router exists
- Duplicate routing logic in individual skills
- Let domain skills bypass their router
Co-Activation Pattern
Domain skills should co-activate with their router:
{
"math/abstract-algebra/groups": {
"coActivate": ["math-router"],
"coActivateMode": "always"
}
}
This ensures the router is always available when domain knowledge is activated.
Two-Layer Architecture
- Skill-rules trigger layer: Nudges Claude to use the router (keywords, intent patterns)
- Router routing layer: Deterministic mapping to scripts via regex patterns
Keep the trigger layer broader than routing - the router should handle "not found" gracefully.
Source Sessions
- 2bbc8d6e: "Trigger layer was narrower than routing layer" - expanded triggers
- This session: Wired 8 domain math skills to co-activate with math-router
When not to use it
- →When individual scripts are called directly
- →When routing logic is duplicated in individual skills
- →When domain skills bypass their router
Limitations
- →Requires domain routers to exist for specific operations
- →Bypassing the router is only for edge cases
How it compares
This architecture ensures that a router always mediates tool selection, unlike direct invocation of individual scripts.
Compared to similar skills
router-first-architecture side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| router-first-architecture (this skill) | 3 | 7mo | No flags | Intermediate |
| openspec-onboard | 10 | 6mo | Review | Beginner |
| workflow-orchestration-patterns | 10 | 2mo | No flags | Advanced |
| meta-automation-architect | 7 | 8mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by parcadei
View all by parcadei →You might also like
openspec-onboard
studyzy
Guided onboarding for OpenSpec - walk through a complete workflow cycle with narration and real codebase work.
workflow-orchestration-patterns
wshobson
Design durable workflows with Temporal for distributed systems. Covers workflow vs activity separation, saga patterns, state management, and determinism constraints. Use when building long-running processes, distributed transactions, or microservice orchestration.
meta-automation-architect
comzine
Use when user wants to set up comprehensive automation for their project. Generates custom subagents, skills, commands, and hooks tailored to project needs. Creates a multi-agent system with robust communication protocol.
hive-mind-advanced
ruvnet
Advanced Hive Mind collective intelligence system for queen-led multi-agent coordination with consensus mechanisms and persistent memory
openspec-new-change
studyzy
使用实验性的产出物工作流启动一个新的 OpenSpec 变更。当用户想要通过结构化的分步方法创建新功能、修复或修改时使用。
mcp-scripts
parcadei
MCP Script Rules