Ledger Monthly Report
Use this skill for monthly financial summaries and charts.
Required rules
- 1. Always convert/aggregate using
amount_cny (RMB baseline). - Report must include:
- expense by tag: amount + ratio
- expense by major category: amount + ratio
- top expense heads
- income/expense totals and ratio
- 3. Charts must include:
- tag bar chart
- tag pie chart
- major-category chart
- income/expense ratio chart
- 4. All charts must display numeric amount labels.
- Send charts to user, then delete local chart files if requested.
- Generated chart files must stay ignored by git (
reports/*.png already ignored).
Command
IMPORTANT: Get current date on entry to determine the default month.
CODEBLOCK0
If user does not specify a month, use $CURRENT_MONTH as default.
Use project script (all paths relative to workspace root):
CODEBLOCK1
Outputs (under projects/reports/):
- - INLINECODE4
- INLINECODE5
- INLINECODE6
- INLINECODE7
- INLINECODE8
Reply template
- - 总收入(CNY)
- 总支出(CNY)
- 净额(CNY)
- 按标签支出(金额+占比)
- 按大类支出(金额+占比)
- 大头支出 Top N
- 收支占比(收入 vs 支出)
Then send charts.
Cleanup
If user says charts can be removed after sending:
- - delete the generated
reports/*.png files for that month. - keep summary json unless user asks to remove it too.
技能名称:ledger-monthly-report
详细描述:
月度账目报告
使用此技能生成月度财务摘要和图表。
必需规则
- 1. 始终使用 amount_cny(人民币基准)进行转换/汇总。
- 报告必须包含:
- 按标签支出:金额 + 占比
- 按大类支出:金额 + 占比
- 支出大头
- 收入/支出总额及占比
- 3. 图表必须包含:
- 标签柱状图
- 标签饼图
- 大类图表
- 收入/支出占比图
- 4. 所有图表必须显示数值金额标签。
- 将图表发送给用户,若用户要求则删除本地图表文件。
- 生成的图表文件必须被 git 忽略(reports/*.png 已忽略)。
命令
重要:进入时获取当前日期以确定默认月份。
bash
获取亚洲/台北时区的当前年月
CURRENT_MONTH=$(TZ=Asia/Taipei date +%Y-%m)
如果用户未指定月份,则使用 $CURRENT_MONTH 作为默认值。
使用项目脚本(所有路径相对于工作区根目录):
bash
. projects/.venv-chart/bin/activate
python projects/scripts/monthlyreportcny.py \
--data-root projects/data \
--month $CURRENT_MONTH \
--out-dir projects/reports
输出文件(位于 projects/reports/ 目录下):
- - projects/reports/summarycny.json
- projects/reports/expensebytagcny.png
- projects/reports/expensebytagpiecny.png
- projects/reports/expensebymajorcny.png
- projects/reports/incomeexpenseratio_cny.png
回复模板
- - 总收入(CNY)
- 总支出(CNY)
- 净额(CNY)
- 按标签支出(金额+占比)
- 按大类支出(金额+占比)
- 大头支出 Top N
- 收支占比(收入 vs 支出)
然后发送图表。
清理
如果用户表示发送后可以删除图表:
- - 删除该月份生成的 reports/*.png 文件。
- 保留摘要 json 文件,除非用户要求一并删除。