Math Router

作者 parcadeid07ff4b06b62无许可证3.9K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库8个月前更新

Deterministic router for math cognitive stack - maps user intent to exact CLI commands

仅含说明AI & Agents
AI 生成的概览

将数学请求路由到数学认知栈的精确 CLI 命令。

功能
该技能充当确定性的、基于模式的路由器,将用户的数学意图映射到特定的 CLI 命令。它返回包含命令和置信度值的 JSON 对象,然后由代理执行。它覆盖 7 个脚本中的 32 条路由,包括 sympy、pint、shapely、z3、scratchpad、tutor 和 plot 类别。它还支持列出所有路由或按类别筛选。
适用场景
在任何数学请求中首先使用它,例如积分、求导、求解、单位转换、证明或绘图。它旨在避免阅读单个技能文档并快速获得精确命令。如果路由器返回空命令,则表示意图未被识别,应请用户澄清。
运行要求
它需要 uv 运行时和 Python,并引用 scripts/cc_math/ 下的脚本,例如 math_router.py 和 sympy_compute.py。该技能本身不附带脚本,仅为说明。

Math Router

ALWAYS use this router first for math requests.

Instead of reading individual skill documentation, call the router to get the exact command:

Usage

bash
# Route any math intent to get the CLI commanduv run python scripts/cc_math/math_router.py route "<user's math request>"

Example Workflow

  1. User says: "integrate sin(x) from 0 to pi"
  2. You run: uv run python scripts/cc_math/math_router.py route "integrate sin(x) from 0 to pi"
  3. Router returns:
    json
    {  "command": "uv run python scripts/cc_math/sympy_compute.py integrate \"sin(x)\" --var x --lower 0 --upper pi",  "confidence": 0.95}
  4. You execute the returned command
  5. Return result to user

Why Use The Router

  • Faster: No need to read skill docs
  • Deterministic: Pattern-based, not LLM inference
  • Accurate: Extracts arguments correctly
  • Complete: Covers 32 routes across 7 scripts

Available Routes

CategoryCommands
sympyintegrate, diff, solve, simplify, limit, det, eigenvalues, inv, expand, factor, series, laplace, fourier
pintconvert, check
shapelycreate, measure, pred, op
z3prove, sat, optimize
scratchpadverify, explain
tutorhint, steps, generate
plotplot2d, plot3d, latex

List All Commands

bash
# List all available routesuv run python scripts/cc_math/math_router.py list
# List routes by categoryuv run python scripts/cc_math/math_router.py list --category sympy

Fallback

If the router returns {"command": null}, the intent wasn't recognized. Then:

  1. Ask user to clarify
  2. Or use individual skills: /sympy-compute, /z3-solve, /pint-compute, etc.

来源与署名

来源:parcadei/continuous-claude-v3位于.claude/skills/math-router提交d07ff4b

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架