← 返回 Skills 市场
purchase-record
作者
linbei2007
· GitHub ↗
· v1.0.1
· MIT-0
222
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install purchase-record
功能描述
Automatically parses input like "采购 <日期> <物品名称> <价格>" and records the purchase details into purchase_record.xlsx on the desktop.
安全使用建议
This skill appears to implement the described purchase-record functionality, but there are practical and security issues to consider before installing:
- Hardcoded paths: Several scripts use an absolute Windows path with a specific username. If your environment uses a different user or OS, the skill will fail or attempt to read/write an unexpected location. Prefer the record.py approach (Path.home()/Desktop) or change the path to a configurable value.
- Undeclared runtime dependencies: The package includes Node and Python code and requires libraries (exceljs, openpyxl) and a Python interpreter, but the manifest declares no required binaries or install steps. Make sure you have Python, Node, and the needed packages installed, or the skill will fail.
- Shell execution risk: index.js builds a shell command with the user message and runs it via exec. This can be dangerous (shell injection) if the message contains unexpected characters. Consider reviewing and sanitizing inputs or using spawn with an argument array (no shell) or invoking Python code directly via require/spawn without shell interpolation.
- Data safety: The skill will create or modify purchase_record.xlsx on your Desktop and may overwrite cells. Back up any important files before using.
- Code quality issues: Some scripts contain bugs/mismatches (e.g., test.js calls a non-existent handlePurchase export). The Python parser regex in add_purchase.py appears malformed. Expect potential runtime errors.
Recommendation: If you want to use this skill, inspect and modify the code first: (1) fix the hardcoded path to be configurable or use Path.home(); (2) replace exec-based invocation with a safer IPC mechanism (spawn with args or call Python functions directly); (3) ensure dependency installation is documented and performed in a sandboxed environment; (4) back up the Excel file. If you are not comfortable reviewing/modifying code, do not install it in a production environment.
功能分析
Type: OpenClaw Skill
Name: purchase-record
Version: 1.0.1
The skill contains a shell injection vulnerability in `scripts/index.js`, where user-provided input is executed via `child_process.exec` with inadequate sanitization (only escaping double quotes). Furthermore, the skill relies on highly specific, hardcoded absolute file paths targeting a particular user's desktop and workspace (e.g., `C:\Users\Administrator.rjazz-2022BWPUD\Desktop\purchase_record.xlsx`) across multiple files including `scripts/add_purchase.js`, `scripts/add_purchase.py`, and `scripts/index.js`. While these behaviors align with the stated purpose of logging data to Excel, the combination of RCE risk and environment-specific targeting is irregular and poses a security risk.
能力评估
Purpose & Capability
The code and SKILL.md align with the stated purpose: parsing '采购 MMDD 名称 价格' and appending to purchase_record.xlsx. However multiple files hardcode an absolute Windows path with a specific username (C:\Users\Administrator.rjazz-2022BWPUD\Desktop\purchase_record.xlsx) while one Python module uses Path.home()/Desktop — inconsistent and not portable. The presence of both Node and Python implementations is redundant but plausible.
Instruction Scope
index.js spawns a shell command (exec) to run a Python script using the raw user message interpolated into the command line. Although double quotes are escaped, this pattern can be prone to shell injection or unexpected behavior on different shells. All file I/O is limited to a Desktop Excel file (consistent with purpose), but executing a subprocess with user-provided text broadens the attack surface beyond simple parsing.
Install Mechanism
There is no install spec despite Node and Python code that depend on packages (exceljs in JS; openpyxl in Python). Required binaries are declared as 'none', yet the runtime relies on 'python' and Node. No instructions for installing dependencies are provided — this is an inconsistency and a practical deployment risk.
Credentials
The skill requests no credentials or environment variables. The only sensitive resource it needs is filesystem access to the user's Desktop Excel file, which is appropriate for the stated purpose. That said, the hardcoded username path could point at files belonging to a different user account if run in a different environment.
Persistence & Privilege
The skill is not always-enabled and is user-invocable only. It does not request elevated privileges or modify other skills or system settings. Its impact is limited to creating/modifying the Excel file on the Desktop.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install purchase-record - 安装完成后,直接呼叫该 Skill 的名称或使用
/purchase-record触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
purchase-record 1.0.1
- Added package.json to manage dependencies.
- Introduced scripts/add_purchase.py script.
- Updated README.md and SKILL.md for improved documentation and usage examples.
- Modified config.json and scripts/index.js to support new features and enhancements.
v1.0.0
purchase-record 1.0.0
- 新增功能:自动将用户输入的采购信息写入桌面 Excel 表格(purchase_record.xlsx)。
- 支持语句格式:“采购 <日期> <物品名称> <价格>”,日期自动补全年份,价格自动提取数字。
- 记录写入 Sheet1,按顺序填入日期、名称、价格三列。
- 操作完成后自动发送确认回复。
- 依赖:exceljs(已预装)。
元数据
常见问题
purchase-record 是什么?
Automatically parses input like "采购 <日期> <物品名称> <价格>" and records the purchase details into purchase_record.xlsx on the desktop. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 222 次。
如何安装 purchase-record?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install purchase-record」即可一键安装,无需额外配置。
purchase-record 是免费的吗?
是的,purchase-record 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
purchase-record 支持哪些平台?
purchase-record 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 purchase-record?
由 linbei2007(@linbei2007)开发并维护,当前版本 v1.0.1。
推荐 Skills