home / skills / louloulin / claude-agent-sdk / example-calculator
/crates/claude-agent-sdk/examples/.claude/skills/example-calculator
This skill helps you perform basic arithmetic operations by adding, subtracting, multiplying, and dividing numbers accurately.
npx playbooks add skill louloulin/claude-agent-sdk --skill example-calculatorReview the files below or copy the command above to add this skill to your agents.
---
name: example-calculator
description: "A simple calculator skill demonstrating SKILL.md format"
version: "1.0.0"
author: "Claude Agent SDK Team"
tags:
- example
- calculator
- math
dependencies: []
---
# Example Calculator Skill
This is an example skill that demonstrates the SKILL.md file format with YAML frontmatter.
## Capabilities
This skill can:
- Add numbers
- Subtract numbers
- Multiply numbers
- Divide numbers
## Usage
Simply ask for a calculation like "What is 2 + 2?"
## Notes
This is a demonstration skill showing the complete SKILL.md format with:
- YAML frontmatter metadata
- Markdown content
- Optional resources in the same directory
This skill provides a simple calculator interface for basic arithmetic operations. It performs addition, subtraction, multiplication, and division with a concise natural-language query style. The implementation demonstrates a lightweight Rust-based agent approach for parsing and evaluating numeric expressions.
The skill parses short natural-language or symbolic expressions (for example, "2 + 2" or "What is 7 times 3?") into tokens, identifies the operator and operands, and performs the requested arithmetic operation. It returns the numeric result and handles common edge cases such as division by zero and malformed input with clear error messages.
How does the skill handle division by zero?
It detects division by zero and returns a clear error message instead of producing Infinity or crashing.
Can it evaluate multi-operator expressions or respect operator precedence?
The skill is designed for single-operator expressions. For complex expressions or strict precedence handling, use a dedicated expression evaluator.