← Back to Skills Marketplace
purchase-record
by
linbei2007
· GitHub ↗
· v1.0.1
· MIT-0
222
Downloads
0
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install purchase-record
Description
Automatically parses input like "采购 <日期> <物品名称> <价格>" and records the purchase details into purchase_record.xlsx on the desktop.
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install purchase-record - After installation, invoke the skill by name or use
/purchase-record - Provide required inputs per the skill's parameter spec and get structured output
Version History
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(已预装)。
Metadata
Frequently Asked Questions
What is purchase-record?
Automatically parses input like "采购 <日期> <物品名称> <价格>" and records the purchase details into purchase_record.xlsx on the desktop. It is an AI Agent Skill for Claude Code / OpenClaw, with 222 downloads so far.
How do I install purchase-record?
Run "/install purchase-record" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is purchase-record free?
Yes, purchase-record is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does purchase-record support?
purchase-record is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created purchase-record?
It is built and maintained by linbei2007 (@linbei2007); the current version is v1.0.1.
More Skills