← Back to Skills Marketplace
lastarla

Bookkeeping

by lastarla · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ✓ Security Clean
185
Downloads
0
Stars
0
Active Installs
4
Versions
Install in OpenClaw
/install bookkeeping-agent
Description
导入账单、检查重复、查询交易、查看汇总,并通过本地 bookkeeping CLI 执行。优先处理当前消息里已经落到本地的账单附件;当用户要求导入支付宝、微信或本地账单时,优先直接使用当前消息上下文中已有的本地文件路径。
README (SKILL.md)

Bookkeeping

仅当本地 PATH 中已经可用 bookkeeping 命令时,才使用这个 skill。

适用场景

  • 你想导入账单附件或本地账单文件
  • 你想检查某个账单文件是否已经导入过
  • 你想按时间范围、平台、收支方向或分类查询交易
  • 你想查看概览、趋势或分类汇总
  • 你想用自然语言记录单笔支出或收入
  • 你想设置或检查日 / 月 / 年预算
  • 你明确想启动本地 bookkeeping 看板
  • 你明确想重置数据库

高置信账单信号:

  • 文件扩展名为 .csv.xlsx
  • 文件名包含 alipaywxwechatbill账单交易流水
  • 用户提到 账单流水导入支出收入支付宝微信

附件与文件解析

按以下顺序解析最终要导入的文件:

  1. 如果当前 OpenClaw 消息上下文里已经有本地附件路径,直接使用该路径
  2. 优先使用已经落在本地的 inbound 文件;典型路径可能位于 /root/.openclaw/media/inbound/
  3. 如果没有本地路径,但存在可下载的消息附件引用,则先使用当前环境中可用的附件下载能力将文件落到本地
  4. 将最终得到的本地路径传给 CLI

处理规则:

  • 不要要求用户重新下载一个已经存在于本地的文件
  • 不要要求用户手动把 inbound 文件复制到 workspace,只要当前进程能读就直接用
  • message_attachment_download 可用时,优先调用它,并使用返回的 download.local_path
  • 如果当前环境没有可用的附件下载能力,则明确告知用户当前只能处理已经落到本地的附件或本地文件路径
  • 文件类型判断优先依据附件原始文件名或 MIME 元数据,不要只依赖 inbound 本地文件名后缀,因为 inbound 文件可能不保留 .csv.xlsx
  • 如果存在多个可能的账单文件,先列出候选并让用户确认要导入哪一个
  • 如果只有一个高置信账单文件且用户明确说要导入,可以直接继续

CLI 映射

使用本地 bookkeeping CLI 作为执行后端。

  • 导入:bookkeeping import \x3Cfile> --original-file-name \x3Cname> --json
  • 查询:bookkeeping query --json
  • 概览汇总:bookkeeping summary overview --json
  • 趋势汇总:bookkeeping summary trend --json
  • 分类汇总:bookkeeping summary category --json
  • 记录支出:bookkeeping record expense --payload \x3Cjson> --json
  • 记录收入:bookkeeping record income --payload \x3Cjson> --json
  • 设置预算:bookkeeping budget set --scope \x3Cscope> --period \x3Cperiod> --amount \x3Camount> --json
  • 检查预算:bookkeeping budget check --scope \x3Cscope> --trade-date \x3Cdate> --json
  • 查看批次:bookkeeping inspect batches --json
  • 查看重复:bookkeeping inspect duplicates --json
  • 启动看板:bookkeeping serve
  • 重置数据库:bookkeeping reset --yes

导入规则:

  • 当 inbound 本地文件没有可用后缀时,传入 --original-file-name \x3Coriginal attachment name>,让 CLI 仍然能根据原始文件名推断平台、owner 或格式
  • 只要可用,优先使用 --json 输出
  • 如果导入失败,简要说明原始错误原因

行为规则

可直接执行

在高置信、低风险情况下,可以直接执行:

  • 导入单个高置信账单附件或本地账单文件
  • 查询交易
  • 执行 summary overviewsummary trendsummary category
  • 查看导入批次
  • 查看重复导入情况
  • 当金额、收支方向与平台可高置信推断时,记录单笔收入或支出
  • 设置或检查预算

先澄清或确认

遇到以下情况时,先问最小必要问题:

  • 只有一个账单附件,但用户表达很模糊,例如“处理一下”
  • 用户说要导入,但存在多个疑似账单附件或多个候选本地文件
  • 用户问“这个文件导入过没有”,但当前指代不清
  • 用户想启动 dashboard,但没有明确表示现在就要启动本地服务

必须强确认

以下动作不能静默执行:

  • bookkeeping reset --yes
  • 重置数据库后再重新导入
  • 批量处理多个附件

自然语言记账分类规则

当通过自然语言记录单笔收入或支出时:

  • 允许模型推断分类,但必须落入固定分类集合
  • 正常路径下不要要求用户手动选择分类
  • 不要创造固定集合之外的自由分类
  • 低置信度时,支出回退到 其他支出,收入回退到 其他收入

固定支出分类:

  • 餐饮
  • 交通
  • 日用
  • 购物
  • 娱乐
  • 医疗
  • 住房
  • 教育
  • 其他支出

固定收入分类:

  • 工资
  • 报销
  • 转账
  • 退款
  • 理财
  • 其他收入

reminders 协议

当 CLI 返回 bookkeeping 结果时:

  • budget_checks 视为完整的预算状态
  • reminders 视为可直接面向 OpenClaw 或 IM 通道输出的提醒列表
  • 如果 reminder 项中存在 channel_text,优先使用它生成简洁消息
  • 如果 reminders 为空,不要额外生成预算提醒文案
  • 如果 statusunset,可以温和提示用户设置预算
  • 如果 statuswarningexceeded,在回复中明确呈现预算提醒
  • 不要忽略已有 reminders;如果存在,就在结果中带出摘要

回复规则

  • 先说明识别到的意图
  • 再说明下一步动作,或提出最小必要问题
  • 除非用户在排查环境问题,否则不要暴露底层 CLI 细节
  • 如果缺少 bookkeeping,明确说明这个 skill 依赖本地 CLI
  • 如果数据库为空,先提示用户导入账单,再进行查询或汇总
  • 如果附件类型不支持,明确说明当前只支持 .csv.xlsx
  • 单笔记账成功后,简要返回收支方向、金额、平台、分类和日期
  • 导入成功后,尽量返回文件名、owner、平台、总行数、导入行数、跳过行数和 batch id(如果 CLI 有这些字段)
  • 如果存在 reminders,在结果后追加简短预算摘要
Usage Guidance
This skill appears to be a thin wrapper around a local `bookkeeping` CLI. Before installing or enabling: 1) confirm you trust the Homebrew tap and the GitHub repo referenced for pipx (third-party code will be fetched to install the CLI); 2) ensure the `bookkeeping` CLI behaves as you expect by running `bookkeeping --help` locally; 3) be aware the skill will read local inbound attachments the agent process can access (e.g., /root/.openclaw/media/inbound/) — any file readable by the agent could be used as input; 4) dangerous commands like `bookkeeping reset --yes` are gated and require explicit confirmation, but verify your workflow and backups before permitting resets; and 5) no credentials are requested by the skill itself, but installing from third-party sources carries standard supply-chain risk, so review the upstream project if you have security concerns.
Capability Analysis
Type: OpenClaw Skill Name: bookkeeping-agent Version: 1.0.3 The bookkeeping-agent skill bundle is a legitimate tool designed to interface with a local 'bookkeeping' CLI for managing financial records (CSV/XLSX). It provides structured instructions for the AI agent to handle file imports, transaction queries, and budget management, including explicit safety rules that require user confirmation for destructive actions like 'bookkeeping reset'. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found across SKILL.md or the reference files.
Capability Assessment
Purpose & Capability
The skill is explicitly a frontend for a local `bookkeeping` CLI; required binary and install methods (Homebrew formula, pipx from GitHub) align with that purpose. No unrelated credentials or system accesses are requested.
Instruction Scope
Runtime instructions focus on locating local inbound attachments, optionally invoking the platform's attachment-download capability, and mapping user intents to `bookkeeping` CLI commands. The skill does not instruct reading unrelated system files or exfiltrating data to external endpoints. Dangerous operations (database reset, batch processing) are gated behind explicit user confirmation.
Install Mechanism
Install metadata lists a third-party Homebrew tap (lastarla/tap/bookkeeping-tool) and an option to install via pipx from the project's GitHub repo. These are reasonable for delivering a CLI, but both fetch third-party code — review the tap and GitHub repo before installing to ensure you trust the publisher.
Credentials
No environment variables, credentials, or config paths are requested. The skill only requires a locally-available `bookkeeping` binary, which is proportionate to its stated function.
Persistence & Privilege
Skill is not marked always:true, is user-invocable, and does not request persistent elevated privileges or modify other skills. It can invoke autonomously (platform default) but that is not combined with other red flags.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install bookkeeping-agent
  3. After installation, invoke the skill by name or use /bookkeeping-agent
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.3
本次更新明确了账单附件导入的实际处理链路,并同步到 skill 规则中: 优先使用当前消息上下文里已经存在的本地附件路径 优先消费 OpenClaw 已落盘的 inbound 文件 只有没有本地路径时,才使用当前环境可用的附件下载能力作为 fallback 当 message_attachment_download 可用时,优先调用它 文件类型判断优先依据附件原始文件名或 MIME 信息,不只依赖 inbound 本地文件名后缀 补回了自然语言单笔记账、预算设置 / 检查、reminders 协议和分类规则
v1.0.2
本次更新明确了账单附件导入的优先链路: 优先使用 OpenClaw 已落盘的 inbound 本地文件 只有没有本地路径时,才使用附件下载 fallback 文件类型判断优先依据附件原始文件名或 MIME 信息,不只看 inbound 本地文件名后缀 同时补充了安装、快速开始和排障说明,明确了 @angli/openclaw-message-attachments 在账单导入场景中是可选 fallback,而不是唯一前置依赖。
v1.0.1
Version 1.0.1 introduces budget and natural-language entry support, plus improved attachment handling. - Added support for recording single expenses/incomes via natural language (e.g., "吃午饭微信20"). - Introduced budget operations: set, update, or check daily/monthly/yearly budgets. - Updated installation options: now supports both Homebrew (macOS) and pipx (cross-platform). - Improved attachment workflow: clearly specifies when to download attachments before processing. - Expanded direct execution to include natural-language single entries and budget actions. - Enhanced responses: now summarizes bookkeeping results, including budget reminders when relevant.
v1.0.0
Initial major release with new local CLI integration and updated workflow. - Introduced a new skill design focused on importing, querying, and summarizing bill files via the local bookkeeping CLI. - Updated supported formats to `.csv` and `.xlsx` only. - Added high-confidence signals and clear rules for handling attachments, multiple files, and confirmation before risky actions. - Provided direct CLI mapping for import, query, summary, dashboard, and reset operations. - Legacy scripts and documentation removed; prior bash script workflow replaced. - New metadata and installation instructions available via Homebrew.
Metadata
Slug bookkeeping-agent
Version 1.0.3
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 4
Frequently Asked Questions

What is Bookkeeping?

导入账单、检查重复、查询交易、查看汇总,并通过本地 bookkeeping CLI 执行。优先处理当前消息里已经落到本地的账单附件;当用户要求导入支付宝、微信或本地账单时,优先直接使用当前消息上下文中已有的本地文件路径。 It is an AI Agent Skill for Claude Code / OpenClaw, with 185 downloads so far.

How do I install Bookkeeping?

Run "/install bookkeeping-agent" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Bookkeeping free?

Yes, Bookkeeping is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Bookkeeping support?

Bookkeeping is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Bookkeeping?

It is built and maintained by lastarla (@lastarla); the current version is v1.0.3.

💬 Comments