Best use case
router-first-architecture is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Router-First Architecture
Teams using router-first-architecture should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/router-first-architecture/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How router-first-architecture Compares
| Feature / Agent | router-first-architecture | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Router-First Architecture
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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 `coActivate` in 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:
```json
{
"math/abstract-algebra/groups": {
"coActivate": ["math-router"],
"coActivateMode": "always"
}
}
```
This ensures the router is always available when domain knowledge is activated.
## Two-Layer Architecture
1. **Skill-rules trigger layer**: Nudges Claude to use the router (keywords, intent patterns)
2. **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-routerRelated Skills
workflow-router
Goal-based workflow orchestration - routes tasks to specialist agents based on user goals
tldr-router
Map code questions to the optimal tldr command by detecting intent and routing to the right analysis layer.
search-router
Choose the right search tool for each query type
opc-architecture
OPC Architecture Understanding
first-order-odes
Problem-solving strategies for first order odes in odes pdes
math-router
Deterministic router for math cognitive stack - maps user intent to exact CLI commands
wiring
Wiring Verification
websocket-patterns
Connection management, room patterns, reconnection strategies, message buffering, and binary protocol design.
visual-verdict
Screenshot comparison QA for frontend development. Takes a screenshot of the current implementation, scores it across multiple visual dimensions, and returns a structured PASS/REVISE/FAIL verdict with concrete fixes. Use when implementing UI from a design reference or verifying visual correctness.
verification-loop
Comprehensive verification system covering build, types, lint, tests, security, and diff review before a PR.
vector-db-patterns
Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.
variant-analysis
Find similar vulnerabilities across a codebase after discovering one instance. Uses pattern matching, AST search, Semgrep/CodeQL queries, and manual tracing to propagate findings. Adapted from Trail of Bits. Use after finding a bug to check if the same pattern exists elsewhere.