Skip to content
Back to skills

Formula Validator

ASecurity

Five CAS layers and pint units: pass / fail / unknown. Fires on any formula whose correctness matters.

  • 11 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 12, 2026
ai-agentspythongobashgit

Works with

  • terminal
  • cli

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 18, 2026

npx -y skills add JiamingShi-JsPhys/chelate-shell --skill formula-validator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Formula Validator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Formula Validator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jiamingshi-jsphys-formula-validator/badge)](https://www.skillsdirectory.com/skills/jiamingshi-jsphys-formula-validator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: formula-validator
version: 1.4.0
description: >
  Five CAS layers and pint units: pass / fail / unknown. Fires on any formula whose correctness matters.
metadata:
  version: 1.4.0
  author: Jiaming Shi
  license: MIT
  entry_point: python run.py
  python_requires: '>=3.10'
---

# formula-validator

Checks a formula with five independent layers (parse, dimension, limit,
numeric, symbolic) plus a pint unit cross-check, and returns one strict
verdict. You extract and interpret; the tool computes.

- **Stage:** `gates` · **Sandbox:** no · **Dependencies:** `sympy`, `numpy`, `pint`

## Quick Execution

Run this exact form — do not read the source tree:

```bash
python run.py --root <WS> --action validate -- --expr "F = m*a" --units F=N --units m=kg --units a=m/s**2
```

- Everything after `--` goes to the legacy CLI unchanged.
- `--units sym=unit` may be repeated; leave a symbol undeclared rather than
  guessing its unit.
- The verdict is written to `<WS>/process/gates/formula-validator_<ts>.json`
  and a Markdown report to `<WS>/process/reports/`.

## When to use

- A formula, identity or derived result appears and its correctness matters.
- A multi-step derivation must be checked, or a wrong result localised.
- A matrix must be confirmed Hermitian, unitary or otherwise structured.
- A dimensional or limiting-case check is requested.

## When NOT to use

- Purely numeric evaluation with no symbolic claim.
- Prose or literature work with no formula.
- Curve fitting or statistics on measured data.
- A formula the user only wants typeset.

## Actions

| `--action` | Does | Extra arguments |
| --- | --- | --- |
| `validate` | D1–D5 layers + pint cross-check | `--expr "..." [--units s=u ...]` |
| `check` | Alias of `validate` | same as `validate` |
| `derive` | Check a multi-step derivation | `--expr "..."` |
| `matrix` | Matrix property check | `--expr "..."` |
| `units` | pint unit check only | `--expr "..." --units s=u` |

## Hard constraints

- **Never compute the algebra yourself.**
- **Never report a verdict the tool did not produce.** `unknown` is a valid outcome and must never be reinterpreted as a pass.
- **Never guess a unit silently** — an undeclared symbol is a legitimate state.

## Outputs

- `<WS>/process/gates/formula-validator_<ts>.json` — the merged gate result.
- `<WS>/process/reports/` — the Markdown report with the failing layer named.

## Failure handling

- Exit `3` (parse error) — retry in SymPy syntax, then quote the message.
- Exit `2` (unknown) — report it as unknown and name what was not checked.
- Exit `4` — report the message verbatim; never fall back to guessing.
- D2 disagrees while D4 agrees → verdict `conflict`; almost always a unit error.

## Limitations

- Only `validate`/`check` run the pint layer; `derive`/`matrix` are D1–D5 only.
- Pint cannot unit-check a decision; the report is a deterministic verdict.

## Delivering results

This skill writes intermediates to `process/`. `results/` is filled only by
`python cli.py pipeline` after a human approved that exact plan.

- Do not copy a skill's output into `results/` yourself, and do not do it
  because the user asked for a shortcut: say that only `cli.py pipeline`
  writes there, offer to run the pipeline instead, and if they still insist,
  tell them `cli.py audit` will report the file as unapproved.
- Never set `CHELATE_UNSAFE_AUTO_APPROVE=1` (formerly `CHELATE_HUMAN`) and never run `cli.py approve` on the user's
  behalf. If an approval is needed, ask the human to issue it in their own
  terminal.
- Before telling the user a deliverable is ready — and after any write you
  make under `results/` — run `python cli.py audit --root <ws>`. Exit 1 means
  files there have no approval behind them: report that and name them, do not
  describe the state as delivered.

Files in this skill

  • .gitignore155 B
  • AUTHORS.md98 B
  • CHANGELOG.md8.4 KB
  • CONTRIBUTING.md5.4 KB
  • LICENSE1 KB
  • README.md1.6 KB
  • README_zh.md926 B
  • SKILL.md3 KB
  • manifest.json541 B
  • mcp_server/README.md3.1 KB
  • mcp_server/mcp_config.example.json385 B
  • mcp_server/server.py14.9 KB
  • requirements.txt48 B
  • run.py5.3 KB
  • scripts/__init__.py281 B
  • scripts/cli.py13.9 KB
  • scripts/core/__init__.py237 B
  • scripts/core/breakpoint.py5.4 KB
  • scripts/core/dimensions.py11.7 KB
  • scripts/core/errors.py1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.