Router First Architecture

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

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

Router-First Architecture

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

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

功能
此技能說明一種架構模式:領域路由器(例如數學路由器)以確定性方式把使用者意圖對應到確切的 CLI 指令,只有在邊緣情況下才略過路由器直接使用個別工具。它訂定領域技能與其路由器共同啟用的慣例、把觸發規則層與路由層分開的兩層設計,以及應遵循與應避免的做法清單。產出的是指導說明,而非檔案或程式碼。
適用情境
適合在設計或維護需要在使用者意圖與工具或指令碼選擇之間集中路由的代理技能體系時使用。也適合把領域技能設定為與共用路由器共同啟用,或決定觸發關鍵字與路由模式之間該保持何種關係時。
執行需求
不需要指令碼或執行環境相依項目,僅為說明性文件。文中提及 skill-rules.json、coActivate 等設定概念,但除 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

來源與署名

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

授權條款: 無授權條款

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

檢舉或申請下架