Skip to content
Back to skills

Cot Equation Calculator

ASecurity

Safely check and repair simple arithmetic equations inside chain-of-thought reasoning traces.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
testingpythonbashexpress

Security analysis

A100/100

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

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill cot_equation_calculator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cot Equation Calculator?

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

Security grade badge for Cot Equation Calculator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-cot-equation-calculator/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-cot-equation-calculator)

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: cot_equation_calculator
description: Safely check and repair simple arithmetic equations inside chain-of-thought reasoning traces.
---

# Chain-of-Thought Equation Calculator

Use this skill when an arithmetic chain-of-thought trace contains explicit equations and you need to verify or repair calculation-only errors. Do not use it to validate semantic reasoning, create prompts, or score final answers directly.

## Inputs

- Reasoning text containing equation-like spans such as `2 * 3 = 6`.
- Optional repair flag.
- Optional operator and expression-length bounds.

## Outputs

- Equation check records with expression, stated result, computed result, and correctness.
- Aggregate correctness flag.
- Optional repaired text that changes only incorrect stated numeric results.

## Workflow

1. Find simple equation spans in the reasoning trace.
2. Parse arithmetic expressions with Python `ast`.
3. Allow only numeric constants and arithmetic operators.
4. Compare computed and stated results.
5. If repair is requested, replace only the stated numeric result for safe equations.

## Validation

Run:

```bash
python scripts/cot_equation_calculator.py --self-test
python -m unittest discover -s tests
```

The tests cover correct equations, incorrect equations, repaired traces, multiple equations, and unsafe expressions that must be ignored.

## Limitations

The calculator intentionally refuses variables, function calls, and arbitrary Python syntax. It cannot decide whether the chosen equation is semantically appropriate for the word problem.

Files in this skill

  • SKILL.md1.5 KB
  • scripts/cot_equation_calculator.py4.2 KB
  • tests/test_cot_equation_calculator.py1.1 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.

Comments

Loading comments…

Newsletter

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