Router-first: маршрутизация запросов через доменные роутеры
engineering
router-first-architecture is a Claude Code skill that enforces an architectural pattern where every request is routed through a domain router before any individual tool is invoked. Routers such as math-router provide deterministic mapping from user intent to exact CLI commands using regex patterns, returning a confidence score so Claude knows when to fall back (command: null). The design is two-layered: a skill-rules trigger layer nudges Claude toward the correct router via keywords and intent patterns, while the router layer handles precise script resolution. Domain skills wire themselves to their router via coActivate in skill-rules.json — a pattern already applied to 8 math domain skills paired with math-router. Calling scripts directly when a router exists, or duplicating routing logic inside individual skills, is explicitly prohibited by the pattern.
- #architecture
- #routing
- #design-pattern
- #tool-abstraction
- #domain-routers