mul2026254

Safely evaluate pricing/revenue-share expressions using mathjs, prohibiting arbitrary eval execution of untrusted code.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "mul2026254" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-8c74a2e8bb8af4ade754378c43d71626259f87544989650930810adc6031cc04. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/mul2026254 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Safely evaluate pricing/revenue-share expressions using mathjs, prohibiting arbitrary eval execution of untrusted code.

0 Downloads

Introduction source: third_party · user_f1b049da · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: mul2026254
slug: mul2026254
displayName: 安全数学求值
version: 1.0.0
summary: 用 mathjs 安全求值报价/分成表达式,禁止随意 eval。
license: MIT
description: 用 mathjs 安全求值报价/分成表达式,禁止随意 eval。

Safe Math Eval(报价/分成表达式)

灵感:工具箱 math-expr。用 mathjs.evaluate 替代 eval,计算报价、分成等表达式。

硬约束

  1. 禁止 eval / new Function 跑用户输入。
  2. 仅允许数学表达式;限制 scope(勿注入业务对象)。
  3. 错误要捕获并提示,不抛穿页面。
  4. 结果建议 toFixed 按业务位(金额常 2 位)。

核心

import { evaluate } from 'mathjs';
export function safeEval(expr: string, scope: Record<string, number> = {}) {
  return evaluate(expr, scope);
}
// 例:safeEval('price * rate', { price: 10000, rate: 0.06 })

工具箱映射

  • 能力:math-expr
  • 依赖:mathjs

附加

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value75/100

Highlights

  • 提供安全的数学表达式求值能力,适用于报价、分成等常见业务场景
  • 使用 mathjs 替代 eval,有效提升安全性,避免代码注入风险
Trigger Precision70/100

Areas to improve

  • description写错位置 Reported severity: Minor

    顶层 frontmatter 中 description 字段为空,实际描述内容在 skill_body 内部

    Recommendation: 建议将 description 内容移至顶层 frontmatter 的 description 字段,确保触发词精准完整

Highlights

  • 功能描述清晰明确,'安全求值报价/分成表达式'触发词准确
Structure and Standards70/100

Areas to improve

  • 缺少When to Use/示例章节 Reported severity: Minor

    文档缺少 When to Use 使用场景说明和端到端的完整示例

    Recommendation: 建议补充 When to Use 章节说明适用场景,并提供完整的端到端使用示例

Highlights

  • 文档结构基本完整,包含硬约束、核心代码、工具箱映射等必要部分
  • 有明确的硬约束说明,体现了对安全性的重视
Execution Reliability75/100

Highlights

  • 核心使用 mathjs.evaluate 替代 eval,符合安全要求
  • 提及错误捕获机制,有基本的可靠性保障
  • scope 限制说明有助于防止业务对象注入
Evidence Verifiability (mean of the first four)73/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.