Intelligent skill router that analyzes user requests and automatically dispatches to the most appropriate skill(s) or zen-mcp tools. Routes to zen-chat for Q&A, zen-thinkdeep for deep problem investigation, codex-code-reviewer for code quality, simple-gemini for standard docs/tests, deep-gemini for deep analysis, or plan-down for planning. Use this skill proactively to interpret all user requests and determine the optimal execution path.
This skill serves as the central intelligence hub that analyzes user requests and automatically routes them to the most appropriate skill(s) for execution. It acts as a smart dispatcher, understanding user intent and orchestrating the right tools for the job.
Core Capabilities:
Division of Responsibilities:
Standards Compliance:
Active Task Monitoring (CRITICAL - Router Must Not Be Lazy):
Main Router MUST actively monitor the entire task lifecycle and proactively invoke appropriate skills at each stage. Do NOT skip skill invocations to save time - proper skill usage ensures quality and compliance.
Mandatory Workflow Rules:
Planning Phase:
Code Generation → Quality Check Cycle:
Test Code Generation Workflow:
Documentation Generation:
Continuous Monitoring:
Anti-Pattern - Router Being Lazy (FORBIDDEN):
BAD: Main Claude generates code → Main Claude self-reviews → Done
GOOD: Main Claude generates code → Router invokes codex-code-reviewer → Done
BAD: Main Claude writes plan.md directly
GOOD: Router invokes plan-down skill → plan.md generated with validation
BAD: Main Claude generates tests → Run immediately
GOOD: Router invokes simple-gemini → codex validates → Main Claude runs
Use this skill PROACTIVELY for ALL user requests to determine the best execution path.
Typical User Requests:
Router's Decision Process:
User Request → Read Standards (CLAUDE.md) → Intent Analysis → Skill Matching → Auto/Manual Decision → Execution
Operation Modes:
Interactive Mode (Default):
Full Automation Mode (automation_mode - READ FROM SSOT):
automation_mode definition and constraints: See CLAUDE.md「📚 共享概念速查」
This skill's role (Router Layer - Sole Source):
[AUTOMATION_MODE: true/false]Purpose: General Q&A and collaborative thinking partner
Triggers:
Use Cases:
Key Features:
Tool: mcp__zen__chat (direct invocation, not a packaged skill)
Purpose: Multi-stage investigation and reasoning for complex problem analysis
Triggers:
Use Cases:
Key Features:
Tool: mcp__zen__thinkdeep (direct invocation, not a packaged skill)
Purpose: Code quality review with iterative fix-and-recheck cycles
Triggers:
Use Cases:
Key Features:
Tool: mcp__zen__codereview
Purpose: Standard documentation and test code generation
Triggers:
Use Cases:
Key Features:
Tool: mcp__zen__clink (launches gemini CLI in WSL)
Purpose: Deep technical analysis documents with complexity evaluation
Triggers:
Use Cases:
Key Features:
Tools: mcp__zen__clink + mcp__zen__docgen
docgen workflow:
Purpose: Intelligent planning with task decomposition and multi-model validation
CRITICAL: This skill is MANDATORY for all plan.md generation tasks
Triggers:
Use Cases:
Key Features:
Tools: mcp__zen__chat (Phase 0 method clarity judgment) + mcp__zen__planner + mcp__zen__consensus (conditional - only for Automatic + Unclear path) + mcp__zen__clink (when using consensus with codex/gemini)
Model Support (G10 Compliance - CRITICAL):
mcp__zen__clink to establish CLI session first (otherwise 401 error)references/standards/cli_env_g10.mdEnforcement:
IF user requests planning OR plan.md generation:
MUST route to plan-down
NEVER allow Main Claude to create plan.md directly
Reason: plan-down provides superior planning quality through:
- Multi-stage interactive planning
- Multi-model consensus validation
- Standards compliance verification
- Risk assessment and dependency analysis
Purpose: Frontend and mobile development specialist using Gemini CLI with multimodal capabilities
适用场景:
Triggers:
Core Advantages (Based on Gemini 3.0):
Use Cases:
Key Features:
automation_mode and coverage_target from routerTools: mcp__zen__clink (gemini CLI) + mcp__zen__codereview + simple-gemini
Frontend Detection Scoring:
Routing Thresholds:
Enforcement:
IF frontend_score ≥ 80:
Auto-route to gemini-frontend (high confidence)
IF 50 ≤ frontend_score < 80:
Ask user: "检测到前端开发需求,是否使用 gemini-frontend?"
IF frontend_score < 50 AND backend_signals ≥ 2:
Notify user: "检测到全栈项目,建议任务分解:
- 前端部分 → gemini-frontend
- 后端部分 → codex-code-reviewer 或其他技能"
Detailed Examples:
Main Router's Action:
Before ANY routing decision, MUST complete the following two sub-phases:
Read the following files to understand project-specific rules and workflows:
a) Read Global Standards:
/home/vc/.claude/CLAUDE.md
b) Read Project-Specific Standards (if exist):
./CLAUDE.md (current directory)
Standards Priority Hierarchy (when conflicts):
核心原则:不假设任何 MCP 工具"一定存在",运行时动态检测并智能适配。
检测时机:
检测方法:
# 伪代码示例 - 动态 MCP 能力检测
mcp_capabilities = {} # 会话级缓存
def detect_mcp_availability():
"""运行时检测 MCP 工具可用性"""
# 1. 检测 zen-mcp
try:
version_info = call_tool("mcp__zen__version")
mcp_capabilities["zen-mcp"] = {
"available": True,
"version": version_info.get("version"),
"tools": extract_available_tools(version_info)
}
except Exception:
mcp_capabilities["zen-mcp"] = {"available": False}
# 2. 检测 serena-mcp(代码智能)
try:
config = call_tool("mcp__serena__get_current_config")
mcp_capabilities["serena-mcp"] = {
"available": True,
"tools": list_serena_tools()
}
except Exception:
mcp_capabilities["serena-mcp"] = {"available": False}
# 3. 检测 unifuncs-mcp(工具函数)
try:
search_test = call_tool("mcp__unifuncs__web-search", {"query": "test", "count": 1})
mcp_capabilities["unifuncs-mcp"] = {"available": True}
except Exception:
mcp_capabilities["unifuncs-mcp"] = {"available": False}
# 4. 检测其他 MCP(用户自定义)
# 可通过 ListMcpResourcesTool 发现额外 MCP 服务器
return mcp_capabilities
技能与 MCP 工具的依赖分为三类:
动态依赖映射表:
| Skill | 必需工具 | 增强工具 | 降级方案 | |-------|---------|---------|---------| | zen-chat | mcp__zen__chat | mcp__zen__apilookup<br/>mcp__unifuncs__web-search | 降级到主模型直接回答(无多轮协作) | | zen-thinkdeep | mcp__zen__thinkdeep | mcp__serena__* (代码分析)<br/>mcp__zen__debug | 降级到主模型单轮深度分析 | | codex-code-reviewer | mcp__zen__codereview<br/>或 mcp__zen__clink (codex CLI) | mcp__serena__* (符号编辑)<br/>mcp__zen__precommit | 使用主模型 + Read/Edit 工具进行审查 | | simple-gemini | mcp__zen__clink (gemini CLI) | mcp__serena__* (代码读取)<br/>mcp__unifuncs__web-reader | 降级到主模型直接生成文档/测试 | | deep-gemini | mcp__zen__clink (gemini CLI)<br/>mcp__zen__docgen | mcp__serena__* (代码分析)<br/>mcp__zen__apilookup | 降级到主模型深度分析 | | plan-down | mcp__zen__chat (方法判断)<br/>mcp__zen__planner (任务分解) | mcp__zen__consensus (自动化模式)<br/>mcp__serena__read_memory (项目上下文)<br/>mcp__zen__clink (codex/gemini CLI) | 降级到主模型直接规划 | | gemini-frontend | mcp__zen__clink (gemini CLI) | mcp__serena__* (代码分析)<br/>mcp__unifuncs__web-reader (设计参考) | 降级到主模型前端开发 |
G10 合规特殊要求:
mcp__zen__clink 建立 CLI 会话适配原则:
用户显式指定 MCP 工具时:
Router 自动选择技能时:
降级决策树:
IF 技能必需工具全部可用:
→ 正常路由到该技能(最优方案)
ELSE IF 技能必需工具部分缺失:
→ 检查降级方案是否可行
IF 降级方案可行:
→ 使用降级方案(通知用户,如果是显式请求)
ELSE:
→ 通知用户工具缺失,请求确认或提供替代方案
ELSE IF 仅增强工具缺失:
→ 正常路由,静默降级(不通知用户)
降级方案示例:
| 原方案 | 缺失工具 | 降级方案 | 通知用户? | |--------|---------|---------|-----------| | codex-code-reviewer | zen-mcp 完全不可用 | 主模型 + Read/Edit 工具审查 | ✅ 是(显著功能降级) | | simple-gemini | clink 不可用 | 主模型直接生成文档 | ✅ 是(质量可能下降) | | zen-chat | zen__apilookup 不可用 | 仅使用 zen__chat,无 API 查询 | ❌ 否(增强功能,非必需) | | zen-thinkdeep | serena 不可用 | 使用 Read/Grep 工具代替代码分析 | ❌ 否(自动适配) |
示例 1:用户显式请求使用 codex
用户:"use codex to check the code"
Router 执行:
1. 检测 zen-mcp 可用性
- IF zen-mcp 可用 → 路由到 codex-code-reviewer(使用 mcp__zen__codereview)
- IF zen-mcp 不可用但 clink 可用 → 路由到 codex-code-reviewer(使用 mcp__zen__clink + codex CLI)
- IF 两者都不可用 → 通知用户:
"检测到 zen-mcp 和 clink 均不可用。可以使用主模型进行代码审查(功能受限),是否继续?"
示例 2:Router 自动路由到 simple-gemini
Router 判断:需要生成 README 文档 → 路由到 simple-gemini
适配流程:
1. 检测 mcp__zen__clink 可用性
- IF 可用 → 正常调用 simple-gemini(使用 gemini CLI)
- IF 不可用 → 降级到主模型直接生成(通知用户:"gemini CLI 不可用,使用主模型生成文档")
2. 检测增强工具(serena, unifuncs)
- IF serena 可用 → 增强代码读取能力
- IF serena 不可用 → 使用 Read 工具(静默降级,不通知)
示例 3:全自动化模式下的 plan-down
Router 判断:P2 阶段,需要生成 plan.md → 路由到 plan-down
适配流程:
1. 检测必需工具(chat, planner)
- IF 全部可用 → 继续
- IF 任一缺失 → 降级到主模型直接规划(通知:"plan-down 依赖工具缺失,使用主模型规划")
2. 检测增强工具(consensus, clink)
- IF automation_mode=true 且方法模糊 → 需要 consensus
- consensus 可用 → 正常多模型验证
- consensus 不可用 → 降级到单模型规划(通知:"多模型验证不可用,使用单模型规划")
- IF consensus 需要 codex/gemini → 检测 clink
- clink 可用 → 符合 G10,建立 CLI 会话
- clink 不可用 → 跳过 consensus(静默降级)
缓存策略:
缓存数据结构:
# 示例缓存结构
mcp_status_cache = {
"zen-mcp": {
"available": True,
"last_check": "2025-11-19T11:30:00Z",
"tools": ["chat", "thinkdeep", "codereview", "clink", "planner", ...]
},
"serena-mcp": {
"available": True,
"last_check": "2025-11-19T11:30:00Z",
"tools": ["list_dir", "find_file", "search_for_pattern", ...]
},
"unifuncs-mcp": {
"available": False, # 用户未安装
"last_check": "2025-11-19T11:30:00Z",
"error": "Connection refused"
}
}
根据 CLAUDE.md 阶段和 MCP 可用性动态调整路由:
透明通知原则:
coverage_target definition and constraints: See CLAUDE.md「📚 共享概念速查」
This skill's role (Router Layer - Sole Setting Source):
[COVERAGE_TARGET: X%]These rules MUST be applied automatically at specific workflow points:
Rule 1: plan.md Generation → plan-down (MANDATORY)
Rule 2: Code Completed → codex-code-reviewer (MANDATORY)
Rule 3: Test Code Needed → Workflow (MANDATORY)
[COVERAGE_TARGET: X%])[COVERAGE_TARGET: X%])Rule 4: Documentation Needed → Skill-Based (MANDATORY)
Rule 5: P3 Code Changes → Document Linkage (MANDATORY)
Rule 6: P4 Error Fixed → Regression Gate (MANDATORY)
Anti-Lazy Principle:
Main Router's Action:
Analyze
<!-- Content truncated for initial SEO render. Open the source file tab for the full file. -->Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer