- Home
- Skills
- Bdambrosio
- Cognitive Workbench
- Test Calculate
test-calculate_skill
- Python
9
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill bdambrosio/cognitive_workbench --skill test-calculate- plan.json2.2 KB
- SKILL.md393 B
Overview
This skill exercises a calculate tool to validate arithmetic, trigonometry, and variable substitution in formula evaluation. It runs targeted checks like basic operations, degree-based trig for projectile motion, and combined functions such as square root and factorial. The goal is a quick, reliable verification of numerical parsing and execution behavior.
How this skill works
The skill sends formulas to the calculate tool and compares results against expected values. It covers basic operator precedence, trig functions interpreted in degrees, substitution of named variables into expressions, and composite function calls (e.g., sqrt and factorial). Failures indicate parsing, unit handling, or function implementation issues.
When to use it
- Validate a calculator implementation or expression parser during development.
- Verify trig functions handle degree input as required by the system.
- Test variable substitution and scoped evaluation for dynamic formulas.
- Confirm combined math functions (sqrt, factorial) execute correctly.
- Include in CI to catch regressions in numeric evaluation logic.
Best practices
- Run tests with clear expected outputs for each case to isolate failures.
- Use representative numeric values, including edge cases (zero, negatives where allowed).
- Ensure trig inputs are explicitly documented as degrees or radians to avoid ambiguity.
- Include both simple and composite expressions to exercise parsing and function resolution.
- Log intermediate results when a test fails to speed root-cause analysis.
Example use cases
- Check basic arithmetic: verify 2 + 3 * 4 equals 14 to confirm operator precedence.
- Verify trig in degrees: compute projectile flight time using v, theta, and g with theta in degrees.
- Test variable substitution: evaluate a formula with {"v": 20, "theta": 30, "g": 9.8}.
- Exercise other functions: confirm sqrt(16) + factorial(5) yields 124 to test combined functions.
- Automated CI job that re-runs these checks after changes to the calculation engine.
FAQ
Tests explicitly use degrees; document and confirm the calculator's expected unit to avoid mismatches.
What variable names are supported?
Use simple alphanumeric names like v, theta, and g; adapt tests if your evaluator enforces different naming rules.