Router First Architecture

parcadei/Continuous-Claude-v3/.claude/skills/router-first-architecture

by parcadeid07ff4b06b62f43771bc0c927d0211b734d6149eNo license3.9K starsListed Oct 9, 2026Updated Oct 9, 2026Repository updated 8 months ago

Router-First Architecture

Instructions onlyAI & Agents
AI-generated overview

Defines a router-first architecture where domain routers map user intent to commands before individual tools are used.

What it does
This skill documents an architectural pattern in which domain routers, such as a math router, deterministically map user intent to exact CLI commands, and individual tools are only used as a fallback. It specifies conventions for co-activation of domain skills with their router, a two-layer design separating trigger rules from routing rules, and a list of practices to follow or avoid. It produces guidance rather than files or code.
When to use it
Use it when designing or maintaining agent skill systems that need centralized routing between user intent and tool or script selection. It is also relevant when wiring domain skills to co-activate with a shared router or when deciding how trigger keywords should relate to routing patterns.
Requirements
No scripts or runtime dependencies; it is an instructions-only document. It references configuration concepts such as skill-rules.json and coActivate settings, but ships no files besides SKILL.md.

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-router

Source and attribution

Source:parcadei/Continuous-Claude-v3in.claude/skills/router-first-architectureat commitd07ff4b

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal