ClawReceipt Skill for OpenClaw
Use this skill to interface with the ClawReceipt system whenever the user wants to process a receipt, check their monthly spending budget, or export financial data.
Trigger Conditions
Use this skill when the user wants to:
- - Upload or provide a picture/text of a receipt to be recorded.
- Add a new expense, bill, or receipt to the database.
- Check their current total spend against their monthly budget.
- Update their monthly spending budget.
- List recent receipts/expenses.
Core Workflows
1) Process and Add a Receipt
When the user provides a receipt image or details, extract the relevant fields (Date, Time, Store, Amount, Category) and use the CLI to save it:
- 1. Extract details using OCR or LLM vision capabilities.
- Ensure you have
date (YYYY-MM-DD), time (HH:MM:SS, optional), store (string), amount (float), and category (string, e.g., "อาหาร", "เดินทาง", "Shopping"). - Run the CLI command in the ClawReceipt directory:
CODEBLOCK0
- 4. Read the output to check if the budget was exceeded and relay that information to the user.
2) Check Budget Status
If the user asks "How much budget do I have left?" or "What is my total spend?":
- 1. Run:
CODEBLOCK1
- 2. Parse the output which includes "Total Spent" and "Target Budget" and accurately report to the user.
- Alert the user if the status indicates "Exceeded Budget!".
3) Set New Budget
If the user wants to set a new monthly budget (e.g., "Set my budget to 5000 baht"):
- 1. Run:
CODEBLOCK2
- 2. Confirm to the user that the budget has been updated successfully.
4) List All Receipts
If the user asks to see history or recently recorded receipts:
- 1. Run:
CODEBLOCK3
- 2. Summarize the output table for the user.
5) Open TUI / Export (Interactive mode only)
If the user asks to see a beautiful dashboard or export to CSV/Excel, you can suggest they run:
CODEBLOCK4
(Note: As an agent, do not run the tui command directly as it will block the terminal. Instruct the user to run it themselves in a new terminal if they want to interact with the UI or manually export the data).
Required Checks Before Execution
- - Verify
run.py is present in the ClawReceipt root folder before calling. - Ensure the active Python environment has the required dependencies (
rich, pandas, openpyxl, textual, etc.) by utilizing .\venv\Scripts\activate if available. - Always quote string arguments like
--store "Full Name" to prevent shell argument splitting.
Troubleshooting
- -
UnicodeEncodeError: Ensure the terminal is using UTF-8 encoding. The run.py handles this internally for Windows, but be aware if piping output. - INLINECODE15 : Ensure parameters like
--category are explicitly mapped and don't contain unescaped quotes.
Completion Checklist
- - Required fields accurately extracted and fed to the
add command. - Command executed successfully (exit code 0).
- Relevant confirmation (and budget alerts, if any) relayed back to the user clearly.
OpenClaw的ClawReceipt技能
当用户想要处理收据、检查月度预算或导出财务数据时,使用此技能与ClawReceipt系统进行交互。
触发条件
当用户想要以下操作时使用此技能:
- - 上传或提供收据图片/文本进行记录
- 向数据库添加新的支出、账单或收据
- 检查当前总支出与月度预算的对比情况
- 更新月度支出预算
- 列出最近的收据/支出
核心工作流程
1) 处理并添加收据
当用户提供收据图片或详细信息时,提取相关字段(日期、时间、商店、金额、类别)并使用CLI保存:
- 1. 使用OCR或LLM视觉能力提取详细信息
- 确保包含date(YYYY-MM-DD)、time(HH:MM:SS,可选)、store(字符串)、amount(浮点数)和category(字符串,例如อาหาร、เดินทาง、Shopping)
- 在ClawReceipt目录中运行CLI命令:
bash
python run.py add --date YYYY-MM-DD --time HH:MM:SS --store <商店名称> --amount <金额> --category <类别>
- 4. 读取输出以检查是否超出预算,并将该信息传达给用户
2) 检查预算状态
如果用户询问我还剩多少预算?或我的总支出是多少?:
- 1. 运行:
bash
python run.py budget
- 2. 解析包含总支出和目标预算的输出,并准确报告给用户
- 如果状态显示超出预算!,则提醒用户
3) 设置新预算
如果用户想要设置新的月度预算(例如将我的预算设置为5000泰铢):
- 1. 运行:
bash
python run.py budget --set <金额>
- 2. 向用户确认预算已成功更新
4) 列出所有收据
如果用户要求查看历史记录或最近记录的收据:
- 1. 运行:
bash
python run.py list
- 2. 为用户总结输出表格
5) 打开TUI/导出(仅交互模式)
如果用户想要查看美观的仪表板或导出为CSV/Excel,可以建议他们运行:
bash
python run.py tui
(注意:作为代理,不要直接运行tui命令,因为它会阻塞终端。如果用户想要与UI交互或手动导出数据,请指导他们在新终端中自行运行。)
执行前的必要检查
- - 在调用前确认run.py存在于ClawReceipt根文件夹中
- 通过使用.\venv\Scripts\activate(如果可用)确保当前Python环境具有所需的依赖项(rich、pandas、openpyxl、textual等)
- 始终引用字符串参数,如--store 完整名称,以防止shell参数分割
故障排除
- - UnicodeEncodeError:确保终端使用UTF-8编码。run.py在Windows上内部处理此问题,但在管道输出时需注意
- unrecognized arguments:确保像--category这样的参数被明确映射,并且不包含未转义的引号
完成检查清单
- - 准确提取必填字段并输入到add命令中
- 命令成功执行(退出代码0)
- 向用户清晰传达相关确认信息(以及任何预算提醒)