← Back to Skills Marketplace
danstaal

Bc Calc

by Daniel Staal · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
91
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install bc-calc
Description
This skill evaluates arithmetic expressions using the Unix `bc` calculator. It accepts full `bc` syntax (addition, subtraction, multiplication, division, mod...
README (SKILL.md)

bc-calc

Use the Unix bc calculator to evaluate arbitrary arithmetic expressions. The skill accepts the expression as a command‑line argument or via standard input.

When This Skill Applies

This skill activates when the user's request involves:

  • Basic or advanced arithmetic calculations (addition, subtraction, multiplication, division, modulus)
  • Full bc expressions (including scale, sqrt, pi, etc.)
  • Any math expression evaluation request

How It Works

  1. Parse the mathematical expression from the request or stdin.
  2. Pass the expression to bc and capture the output.
  3. Return the result, or the bc error message if the expression is invalid.

Usage Examples

# As a CLI command with a single expression
bc-calc "12+34*5"

# With piped input and scale
printf "scale=2; 1/3" | bc-calc

Installation

The skill can be installed with the ClawHub CLI:

openclaw install bc-calc

Or simply place the bc-calc directory under ~/.openclaw/workspace/skills.

Dependencies

  • node (>=12)
  • bc command‑line tool (usually pre‑installed on Linux/macOS)

Optional Flags

# Show help
bc-calc --help

The help flag displays usage instructions.

NOTE: The math‑library flag -l is now enabled by default, giving access to trigonometric and other advanced functions.

Available functions:

  • s(x) : sine, in radians.
  • c(x) : cosine, in radians.
  • a(x) : arctangent, in radians.
  • l(x) : natural logarithm.
  • e(x) : e^x.
  • j(n,x) : Bessel function of integer order n for x.
Usage Guidance
This skill is a thin wrapper that runs your local 'bc' process. Before installing: (1) ensure you trust the runtime environment and that the 'bc' binary on PATH is the legitimate system bc, (2) be aware the SKILL.md slightly overstates available constants (e.g., 'pi' may not be predefined in all bc implementations), and (3) if you run untrusted input in an environment where PATH might be controlled by others, consider hardcoding an absolute path to the bc binary or running it in a restricted environment. Otherwise the skill's behavior is proportional to its description.
Capability Analysis
Type: OpenClaw Skill Name: bc-calc Version: 1.0.0 The skill is a straightforward wrapper for the Unix `bc` utility, designed to perform arbitrary-precision arithmetic. The implementation in `index.js` uses `child_process.spawn` to execute the command safely and passes user-provided expressions via standard input. There are no external dependencies, no signs of data exfiltration, and no malicious instructions in the documentation.
Capability Assessment
Purpose & Capability
The name/description (evaluate bc expressions) matches the code and SKILL.md. The code launches the local 'bc' with -l and -q and returns output. Minor documentation mismatch: SKILL.md mentions a built-in 'pi' constant whereas standard bc does not define 'pi' automatically (users normally define it); this is a documentation inaccuracy rather than a security problem.
Instruction Scope
Runtime instructions and the implementation stay within scope: parse an expression from argv or stdin and feed it to bc. The skill does not read unrelated files, call external services, or exfiltrate data. Errors from bc are returned to the user. There is no vague instruction granting the agent broad discretionary access.
Install Mechanism
No install spec or remote downloads are present; the package contains only a small Node wrapper. It requires node and the system 'bc' binary — reasonable and proportional for the stated purpose.
Credentials
The skill requests no credentials or environment variables. One operational note: the wrapper invokes 'bc' via PATH (spawn('bc')), so if PATH is manipulated in the runtime environment a malicious binary named 'bc' could be executed. This is an operational risk of launching system binaries and not a problem unique to this skill.
Persistence & Privilege
The skill does not request persistent or elevated privileges, is not always-enabled, and does not modify other skills or global agent configuration.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install bc-calc
  3. After installation, invoke the skill by name or use /bc-calc
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of bc-calc. - Evaluates arithmetic expressions using the Unix `bc` calculator, supporting full `bc` syntax. - Provides arbitrary-precision calculations and access to advanced functions (trigonometric, logarithmic, etc.) via the math library (enabled by default). - Accepts expressions as command-line arguments or via standard input. - Returns precise results or relevant `bc` error messages for invalid expressions.
Metadata
Slug bc-calc
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Bc Calc?

This skill evaluates arithmetic expressions using the Unix `bc` calculator. It accepts full `bc` syntax (addition, subtraction, multiplication, division, mod... It is an AI Agent Skill for Claude Code / OpenClaw, with 91 downloads so far.

How do I install Bc Calc?

Run "/install bc-calc" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Bc Calc free?

Yes, Bc Calc is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Bc Calc support?

Bc Calc is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Bc Calc?

It is built and maintained by Daniel Staal (@danstaal); the current version is v1.0.0.

💬 Comments