Ledger Project Expense Entry
Use this skill for fast bookkeeping from short natural-language messages.
Defaults
- -
direction: default INLINECODE1 - INLINECODE2 : default INLINECODE3
- INLINECODE4 : default today (Asia/Taipei)
Only change defaults if user explicitly provides different values.
Parse target
Extract from message:
- -
project (项目名) - INLINECODE6 (消费内容)
- INLINECODE7 (number)
- optional INLINECODE8
- optional INLINECODE9
- optional
direction (收入/支出) - optional INLINECODE13
If project and description are both present, build description as:
If only one exists, use that field directly.
If amount is missing, ask one short clarification question.
Write command
IMPORTANT: Get today's date (YYYY-MM-DD) first, for determining which month file to write to.
CODEBLOCK0
Then append via existing script:
CODEBLOCK1
Category catalog (must check before writing)
Before each write, check:
Selection policy:
- - Prefer existing values from catalog (
tags/major_category/type/currency). - If user gives a new tag not in catalog and meaning is clear, write it; otherwise ask one short confirmation.
- If uncertain, keep optional fields empty rather than inventing noisy labels.
Tag suggestion rules
- - If user gives tags, use them directly.
- If user does not give tags:
- project/infra/subscription/domain/server ->
开发成本 /
服务器 /
域名 /
通讯网络 (pick the closest one)
- meal/drink ->
外卖 /
下馆子 /
饮料零食
- ride/transport ->
打车 /
交通卡 /
火车 /
飞机
- - If still uncertain, keep tags empty.
Response format
After appending, reply with:
- - month file path
- one-line summary: INLINECODE31
账本项目费用录入
使用此技能可通过简短的自然语言消息快速记账。
默认值
- - direction:默认 支出
- currency:默认 CNY
- date:默认今天(Asia/Taipei)
仅当用户明确提供不同值时,才更改默认值。
解析目标
从消息中提取:
- - project(项目名)
- description(消费内容)
- amount(数字)
- 可选 date
- 可选 currency
- 可选 direction(收入/支出)
- 可选 tags
如果同时存在 project 和 description,则描述构建为:
如果仅存在其中一个,则直接使用该字段。
如果缺少 amount,则提出一个简短的澄清问题。
写入命令
重要:首先获取今天的日期(YYYY-MM-DD),以确定写入哪个月份的文件。
bash
获取 Asia/Taipei 时区的今天日期
CURRENT_DATE=$(TZ=Asia/Taipei date +%Y-%m-%d)
然后通过现有脚本追加:
bash
python3 projects/scripts/addledgerentry.py \
--data-root projects/data \
--date $CURRENT_DATE \
--direction <支出|收入> \
--amount \
--currency \
--description \
--tags \
--source manual \
--batch manual
类别目录(写入前必须检查)
每次写入前,检查:
- - projects/docs/CATEGORY_CATALOG.md
选择策略:
- - 优先使用目录中的现有值(tags/major_category/type/currency)。
- 如果用户提供了目录中不存在的新标签且含义明确,则写入;否则提出一个简短的确认问题。
- 如果不确定,则保留可选字段为空,而不是编造噪声标签。
标签建议规则
- - 如果用户提供了标签,则直接使用。
- 如果用户未提供标签:
- project/infra/subscription/domain/server -> 开发成本 / 服务器 / 域名 / 通讯网络(选择最接近的一个)
- meal/drink -> 外卖 / 下馆子 / 饮料零食
- ride/transport -> 打车 / 交通卡 / 火车 / 飞机
响应格式
追加后,回复:
- - 月份文件路径
- 一行摘要:日期 | 流向 | 金额币种 | 描述