Install
openclaw skills install ledger-transaction-entryConvert natural-language spending/income statements into ledger JSONL records and append them into projects/data/YYYY/YYYY-MM.jsonl. Use when the user describes a transaction (expense/income), asks to记账,补账, or wants to append a new entry in the ledger project.
openclaw skills install ledger-transaction-entryUse this skill to append new transactions into projects/data.
projects/dataYYYY/YYYY-MM.jsonlFrom user text, extract:
direction: 支出 or 收入amount: numbercurrency: default CNY if omitteddate: default today (Asia/Taipei) if omitteddescription: short clean texttag: 单个分类标签(只能选一个)Optional fields (only if provided clearly):
idmajor_categorytypeIf amount or direction is ambiguous, ask one short clarification question before writing.
IMPORTANT: Get today's date (YYYY-MM-DD) for determining which month file to write to.
# Get today's date in Asia/Taipei timezone
CURRENT_DATE=$(TZ='Asia/Taipei' date +%Y-%m-%d)
The script will automatically add created_at field with current timestamp (YYYY-MM-DD HH:MM:SS) to each record.
Then run:
python3 projects/scripts/add_ledger_entry.py \
--data-root projects/data \
--date "$CURRENT_DATE" \
--direction <支出|收入> \
--amount <number> \
--currency <CNY|USD|JPY|...> \
--description <text> \
--tag <tag>
Add optional args only when available:
--id--major-category--type--source manual--batch manualBefore each write, check:
projects/docs/CATEGORY_CATALOG.mdSelection policy:
tag/major_category/type/currency).当用户没有指定分类时,根据意图选择最合适的一个:
外卖 / 下馆子 / 饮料零食 / 买菜做饭打车 / 交通卡 / 火车 / 飞机 / 大巴生活好物 / 居家杂物 / 房租住宿通讯网络 / 服务器 / 域名A股 / 美股 / 港股 / 项目营收 / 二手When uncertain, leave tags empty instead of guessing aggressively.
Confirm with:
Use this when user asks things like:
统计已知月份的总金额生成图表发我图表都 ignore,发完可以删Required behavior:
projects/data/YYYY/YYYY-MM.jsonl.direction=支出)direction=收入)income-expense)projects/reports/ (PNG preferred)..gitignore).Important note in reply: