← 返回 Skills 市场
danstaal

Bc Calc

作者 Daniel Staal · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
91
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install bc-calc
功能描述
This skill evaluates arithmetic expressions using the Unix `bc` calculator. It accepts full `bc` syntax (addition, subtraction, multiplication, division, mod...
使用说明 (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.
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install bc-calc
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /bc-calc 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug bc-calc
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Bc Calc 是什么?

This skill evaluates arithmetic expressions using the Unix `bc` calculator. It accepts full `bc` syntax (addition, subtraction, multiplication, division, mod... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 91 次。

如何安装 Bc Calc?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install bc-calc」即可一键安装,无需额外配置。

Bc Calc 是免费的吗?

是的,Bc Calc 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Bc Calc 支持哪些平台?

Bc Calc 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Bc Calc?

由 Daniel Staal(@danstaal)开发并维护,当前版本 v1.0.0。

💬 留言讨论