用途:SpecWeave Router 原用于插件检测与路由,但自 v1.0.140+ 起已废弃,不再控制插件安装或路由,官方明确提示不要使用。
当前架构:用户提示提交后,user-prompt-submit.sh 钩子自动触发,调用 specweave detect-intent --file "$PROMPT_TMP_FILE" --install --silent,由 LLM(Claude Haiku)分析提示,返回 plugins、increment、routing 等信息,自动安装缺失插件,并在需要时注入 TDD 上下文,随后继续原始提示。
detect-intent 能力:基于提示关键词与上下文检测所需插件;建议 increment 动作(new、reopen、small_fix、hotfix、none);将任务路由到相应技能。
TDD 上下文注入:钩子检查配置中的 testing.defaultTestMode,若为 TDD 则向每个提示注入 TDD 上下文横幅,并检查 tasks.md frontmatter 中的逐 increment 覆盖。优先级为逐 increment > 项目配置 .specweave/config.json > 关闭。
插件优先级:SpecWeave 插件在 GitHub、JIRA、Azure DevOps 上优先于官方插件,例如使用 sw-github@specweave 而非 github@claude-plugins-official。官方 LSP 插件仍有效并可能被自动检测,如 csharp-lsp、gopls-lsp、jdtls-lsp、kotlin-lsp、php-lsp、lua-lsp、clangd-lsp(均属 claude-plugins-official)。
迁移:不再使用 Skill({ skill: "sw-router:router" });钩子自动处理,无需显式调用。如需显式安装插件,可使用 CLI:specweave detect-intent "prompt" --install。
限制:该技能已废弃,不应再使用;具体实现细节可参考 detect-intent.ts、user-prompt-submit.sh、llm-plugin-detector.ts 及 TDD 配置指南。