math-router — Claude Code skill: route math to CLI commands
The skill maps a math request to an exact CLI command and returns it as JSON. Useful when the agent needs to integrate, prove or plot something.
npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a claude-codeWhat math-router does
math-router acts as a dispatcher. You hand it a plain-text math request, and it returns JSON with a command field and a confidence score. The agent then runs that command. Routing is pattern-based rather than model-inferred, so the same request yields the same command every time.
It covers 32 routes across 7 scripts: sympy (integrals, derivatives, equations, matrices, series, Laplace and Fourier transforms), pint (unit conversion), shapely (geometry), z3 (proofs and optimisation), scratchpad, tutor and plot (2D and 3D plots, LaTeX). Run uv run python scripts/cc_math/math_router.py list to see everything, or filter with --category.
You need uv and the repository scripts in place. If the router answers {"command": null}, the intent was not recognised — ask the user to clarify, or fall back to a single skill such as /sympy-compute. The skill is marked user-invocable: false, so you cannot call it directly; it runs through the agent.
What it helps with
- pick the right script for a math request without reading docs
- get a ready command for an integral or derivative
- convert units through pint
- prove a statement in z3 or check satisfiability
- plot a function or render a formula as LaTeX
Example prompts for the agent
- Integrate sin(x) from 0 to pi using math-router
- Convert 5 miles to kilometres through the router
- Prove this expression is always true with math-router
How to install math-router
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a claude-code2Manually: put the files in place
~/.claude/skills/math-router/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/math-router/
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a codex2Manually: put the files in place
.agents/skills/math-router/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a cursor2Manually: put the files in place
.cursor/skills/math-router/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install parcadei/Continuous-Claude-v3 math-router2Manually: put the files in place
.github/skills/math-router/SKILL.md1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a gemini-cli2Platform CLI
gemini skills install https://github.com/parcadei/Continuous-Claude-v3 --path .claude/skills/math-routerManually: put the files in place
.devin/skills/math-router/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about math-router
How do I install math-router in Claude?
Run npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a claude-code. The skill lands in ~/.claude/skills/math-router/SKILL.md.
What does math-router do?
It matches a math request to a specific CLI command and returns that command as JSON. The agent executes it and reports the result.
What if the router returns null?
That means the intent was not recognised. Ask the user to rephrase, or call an individual skill like /sympy-compute.
Source text
SKILL.md · MIT
---
name: math-router
description: Deterministic router for math cognitive stack - maps user intent to exact CLI commands
triggers: ["math", "calculate", "compute", "solve", "integrate", "derivative", "plot", "convert", "prove"]
priority: high
user-invocable: false
---
# 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 command
uv 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
| Category | Commands |
|----------|----------|
| sympy | integrate, diff, solve, simplify, limit, det, eigenvalues, inv, expand, factor, series, laplace, fourier |
| pint | convert, check |
| shapely | create, measure, pred, op |
| z3 | prove, sat, optimize |
| scratchpad | verify, explain |
| tutor | hint, steps, generate |
| plot | plot2d, plot3d, latex |
## List All Commands
```bash
# List all available routes
uv run python scripts/cc_math/math_router.py list
# List routes by category
uv 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 · MIT · parcadei/Continuous-Claude-v3