Calculator

Safely evaluates a mathematical expression

hyw208 Updated

File contents

Instructions

Use this skill when the user asks to perform mathematical calculations or evaluate mathematical expressions.

Command

Run:

.github/skills/.venv/bin/python -m scripts.calculator --expression "EXPRESSION"`

Replace EXPRESSION with the mathematical expression to evaluate (e.g., "2+3*4").

Output Format

The command returns JSON:

  • Success: {"status": "success", "result": VALUE}
  • Error: {"status": "error", "message": "ERROR_MESSAGE"}

Example: For expression "2+3*4", the result will be {"status": "success", "result": 14}

hyw208/skills-for-gemini-and-copilot/tree/main/skills/calculator commit f294fc44f8

Frequently asked questions

npx skillmds@latest add hyw208/calculator