Router First Architecture

parcadei/continuous-claude-v3/.claude/skills/archive/router-first-architecture

作者 parcadeid07ff4b06b62無授權條款3.9K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫8 個月前更新

Router-First Architecture

僅含說明AI & Agents
AI 產生的概覽

定義「路由優先」模式:先由領域路由器把使用者意圖對應為 CLI 指令,再使用個別工具。

功能
這個技能說明了一種代理技能系統的架構模式:領域路由器(例如數學路由器)會以確定性的方式,把使用者意圖對應到精確的 CLI 指令。它列出實務要點,包括先呼叫路由器、讓領域技能與其路由器共同啟用、信任路由器的信心分數,以及讓觸發關鍵字比路由模式更寬鬆。它也描述兩層架構,把技能規則觸發層與路由器路由層分開,並附上一個 JSON 共同啟用範例。它產出的是指引,而不是檔案或程式碼。
適用情境
適合在設計或維護技能系統時使用,讓請求透過領域路由器分派,而不是直接呼叫個別指令碼。也適合用來把領域技能設定成與路由器共同啟用,或調整觸發關鍵字與路由模式的寬鬆程度。
執行需求
不需要指令碼或執行環境相依項目,僅為說明性指示。它會提到 skill-rules.json 等設定檔與路由器指令,但不隨附任何程式碼。

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

來源與署名

來源:parcadei/continuous-claude-v3位於.claude/skills/archive/router-first-architecture提交d07ff4b

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架