yz2026721
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 "yz2026721" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-96fdb7dfea6d8af5c276a8c5ee4272f4710eda7965dddafc95531010c4747fc9. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/yz2026721 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 or revenue-share expressions using mathjs. Arbitrary eval execution to evaluate expressions is prohibited.
Introduction source: third_party · user_f1b049da · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- Not specified in the source documentation.
- Software, accounts and paid services
- Not specified in the source documentation.
- Limits and differences
- Not specified in the source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: yz2026721
slug: yz2026721
displayName: 安全数学求值
version: 1.0.0
summary: 用 mathjs 安全求值报价/分成表达式,禁止随意 eval。
license: MIT
description: 用 mathjs 安全求值报价/分成表达式,禁止随意 eval。Safe Math Eval(报价/分成表达式)
灵感:工具箱 math-expr。用 mathjs.evaluate 替代 eval,计算报价、分成等表达式。
硬约束
- 禁止
eval/new Function跑用户输入。 - 仅允许数学表达式;限制 scope(勿注入业务对象)。
- 错误要捕获并提示,不抛穿页面。
- 结果建议
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
附加
- 说明见 README.md
- 参考见 reference.md
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供安全的数学表达式求值能力,适用于报价、分成等计算场景
- 使用 mathjs 替代 eval 提升安全性,具有明确实用价值
Highlights
- description 明确描述了使用 mathjs 安全求值报价/分成表达式,禁止随意 eval,触发词清晰
Areas to improve
-
缺少 When to Use/示例章节 Reported severity: Minor
Skill 缺少 When to Use 章节和端到端示例,影响用户理解使用场景。
Recommendation: 建议补充 When to Use 章节和端到端示例,帮助用户更好地理解和使用该 Skill。
Highlights
- Skill 结构基本完整,有硬约束、核心代码示例、工具箱映射
Highlights
- 核心代码示例展示了使用 mathjs.evaluate 的正确用法,包含错误处理建议(toFixed)
- 工具来源明确,参数正确,覆盖主要异常
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.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Not specified in the source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.