$npx -y skills add parcadei/Continuous-Claude-v3 --skill router-first-architectureRouter-First Architecture
| 1 | # Router-First Architecture |
| 2 | |
| 3 | Route through domain routers before using individual tools. Routers abstract tool selection. |
| 4 | |
| 5 | ## Pattern |
| 6 | |
| 7 | 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. |
| 8 | |
| 9 | ## DO |
| 10 | |
| 11 | - Call `math-router route "<intent>"` before any math operation |
| 12 | - Let domain skills co-activate with their router (via `coActivate` in skill-rules.json) |
| 13 | - Trust the router's confidence score; only fall back if `command: null` |
| 14 | - Keep trigger keywords/patterns in skill-rules.json broader than routing patterns |
| 15 | |
| 16 | ## DON'T |
| 17 | |
| 18 | - Call individual scripts directly when a router exists |
| 19 | - Duplicate routing logic in individual skills |
| 20 | - Let domain skills bypass their router |
| 21 | |
| 22 | ## Co-Activation Pattern |
| 23 | |
| 24 | Domain skills should co-activate with their router: |
| 25 | |
| 26 | ```json |
| 27 | { |
| 28 | "math/abstract-algebra/groups": { |
| 29 | "coActivate": ["math-router"], |
| 30 | "coActivateMode": "always" |
| 31 | } |
| 32 | } |
| 33 | ``` |
| 34 | |
| 35 | This ensures the router is always available when domain knowledge is activated. |
| 36 | |
| 37 | ## Two-Layer Architecture |
| 38 | |
| 39 | 1. **Skill-rules trigger layer**: Nudges Claude to use the router (keywords, intent patterns) |
| 40 | 2. **Router routing layer**: Deterministic mapping to scripts via regex patterns |
| 41 | |
| 42 | Keep the trigger layer broader than routing - the router should handle "not found" gracefully. |
| 43 | |
| 44 | ## Source Sessions |
| 45 | |
| 46 | - 2bbc8d6e: "Trigger layer was narrower than routing layer" - expanded triggers |
| 47 | - This session: Wired 8 domain math skills to co-activate with math-router |