360 Secure SkillHub
360 安全技能中心

Ledger Monthly Report

按 amount_cny 汇总指定月份账本数据,输出按标签与大类的支出金额及占比、大头支出 Top N、收支总额与占比,并生成带金额标签的标签柱状图、饼图和收支占比图;可按用户要求发送后删除本地图表文件。

shing19
shing19
热度 40.55
最近更新 2026-05-11 17:38:33
分类:数据依赖:代码执行 / 读写文件应用场景:报告撰写 / 财务 / 个人理财 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add ledger-monthly-report
Metadata
name
ledger-monthly-report
description
Generate monthly ledger statistics in CNY with amount and ratio by tag/category, top expense breakdown, and labeled charts. Use when user asks to统计收支, 看占比, 画图表, or requests monthly summary visuals.

Ledger Monthly Report

Use this skill for monthly financial summaries and charts.

Required rules

  1. Always convert/aggregate using amount_cny (RMB baseline).
  2. 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.
  5. Send charts to user, then delete local chart files if requested.
  6. Generated chart files must stay ignored by git (reports/*.png already ignored).

Command

IMPORTANT: Get current date on entry to determine the default month.

# Get current year-month in Asia/Taipei timezone
CURRENT_MONTH=$(TZ='Asia/Taipei' date +%Y-%m)

If user does not specify a month, use $CURRENT_MONTH as default.

Use project script (all paths relative to workspace root):

. projects/.venv-chart/bin/activate
python projects/scripts/monthly_report_cny.py \
  --data-root projects/data \
  --month "$CURRENT_MONTH" \
  --out-dir projects/reports

Outputs (under projects/reports/):

  • projects/reports/<YYYY-MM>_summary_cny.json
  • projects/reports/<YYYY-MM>_expense_by_tag_cny.png
  • projects/reports/<YYYY-MM>_expense_by_tag_pie_cny.png
  • projects/reports/<YYYY-MM>_expense_by_major_cny.png
  • projects/reports/<YYYY-MM>_income_expense_ratio_cny.png

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.