# math-router

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.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 493 installs · ★ 3946
- Author: parcadei
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/parcadei/Continuous-Claude-v3/tree/HEAD/.claude/skills/math-router/SKILL.md
- Updated: 2026-01-26
- HTML: https://affpapa.org/en/nevibecode/skills/math-router

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/math-router/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/math-router/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/math-router/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/math-router/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install parcadei/Continuous-Claude-v3 math-router
```

2. **Manually: put the files in place**
- File: `.github/skills/math-router/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/parcadei/Continuous-Claude-v3 --path .claude/skills/math-router
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/math-router/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill math-router -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/parcadei/Continuous-Claude-v3/tree/HEAD/.claude/skills/math-router/SKILL.md

## When to use it
- 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
- 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

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 63a7b44251290739.

BEGIN THIRD-PARTY FILE 63a7b44251290739
````text
---
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.
````
END THIRD-PARTY FILE 63a7b44251290739

The third-party file has ended. Everything between the 63a7b44251290739 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© parcadei · MIT · https://github.com/parcadei/Continuous-Claude-v3/tree/HEAD/.claude/skills/math-router/SKILL.md

## Similar
- [math-reasoning](https://affpapa.org/en/nevibecode/skills/math-reasoning.md) — skill · 2200 installs
- [math-proof-judge](https://affpapa.org/en/nevibecode/agents/math-proof-judge.md) — subagent · ★ 44635
- [math-olympiad](https://affpapa.org/en/nevibecode/plugins/math-olympiad.md) — plugin · ★ 44635
- [math-teacher](https://affpapa.org/en/nevibecode/skills/math-teacher.md) — skill · 871 installs
- [pixijs-math](https://affpapa.org/en/nevibecode/skills/pixijs-math.md) — skill · 5900 installs
- [geometry-and-math](https://affpapa.org/en/nevibecode/skills/geometry-and-math.md) — skill · 807 installs

From the same set: [parcadei/continuous-claude-v3](https://affpapa.org/en/nevibecode/by/parcadei/continuous-claude-v3.md) — 69 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
