docs: switch AutoACCT docs to OpenClaw
This commit is contained in:
16
README.md
16
README.md
@@ -1,10 +1,10 @@
|
|||||||
# AutoACCT — Bookkeeping Skill for Claude Code
|
# AutoACCT for OpenClaw
|
||||||
|
|
||||||
**English** | [简体中文](README.zh-CN.md)
|
**English** | [简体中文](README.zh-CN.md)
|
||||||
|
|
||||||
A [Claude Code](https://claude.com/claude-code) skill that turns a receipt image (optionally with a caption) into a structured row in a Google Sheet, with automatic HKD conversion.
|
An OpenClaw skill that turns a receipt image (optionally with a caption) into a structured row in a Google Sheet, with automatic HKD conversion.
|
||||||
|
|
||||||
Intended to be invoked manually inside Claude Code today, and wired up to a WhatsApp webhook later.
|
Intended to be invoked manually inside OpenClaw today, and wired up to a WhatsApp webhook later.
|
||||||
|
|
||||||
## What it does
|
## What it does
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ Follow the 6 steps below. Takes ~10 minutes.
|
|||||||
### Step 1 — Clone the skill and install Python deps
|
### Step 1 — Clone the skill and install Python deps
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://git.deepknow.site/Knowit/AutoACCT.git ~/.claude/skills/bookkeeping
|
git clone https://git.deepknow.site/Knowit/AutoACCT.git ~/.openclaw/workspace/skills/bookkeeping
|
||||||
pip install google-api-python-client google-auth
|
pip install google-api-python-client google-auth
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ chmod 600 ~/.config/gcp/bookkeeping-sa.json
|
|||||||
### Step 5 — Write config.json
|
### Step 5 — Write config.json
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/.claude/skills/bookkeeping
|
cd ~/.openclaw/workspace/skills/bookkeeping
|
||||||
cp config.example.json config.json
|
cp config.example.json config.json
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ Open `config.json` in your editor and fill in **sheet_id** and **worksheet** wit
|
|||||||
### Step 6 — Sanity check
|
### Step 6 — Sanity check
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' | python3 ~/.claude/skills/bookkeeping/scripts/append_row.py
|
echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' | python3 ~/.openclaw/workspace/skills/bookkeeping/scripts/append_row.py
|
||||||
```
|
```
|
||||||
|
|
||||||
Success looks like: `OK 'Sheet1'!A2:N2` and a new row appears in the sheet. Delete the TEST row when you're done.
|
Success looks like: `OK 'Sheet1'!A2:N2` and a new row appears in the sheet. Delete the TEST row when you're done.
|
||||||
@@ -91,7 +91,7 @@ If you hit an error, see [`scripts/setup.md`](scripts/setup.md) for the longer r
|
|||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|
||||||
In a Claude Code session, drop a receipt image in and say "log this" (or similar). The skill auto-triggers on receipt-image requests — no slash command needed.
|
In an OpenClaw session, drop a receipt image in and say "log this" (or similar). The skill auto-triggers on receipt-image requests — no slash command needed.
|
||||||
|
|
||||||
Caption is optional; use it to add context (payment method, split, category hint, free-text note).
|
Caption is optional; use it to add context (payment method, split, category hint, free-text note).
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ Caption is optional; use it to add context (payment method, split, category hint
|
|||||||
|
|
||||||
| File | Purpose |
|
| File | Purpose |
|
||||||
|-----------------------|---------------------------------------------------|
|
|-----------------------|---------------------------------------------------|
|
||||||
| `SKILL.md` | Entry — Claude reads this to invoke the skill |
|
| `SKILL.md` | Entry — OpenClaw reads this to invoke the skill |
|
||||||
| `categories.md` | Fixed category list (14 categories) |
|
| `categories.md` | Fixed category list (14 categories) |
|
||||||
| `schema.md` | Google Sheet column order (A–N) |
|
| `schema.md` | Google Sheet column order (A–N) |
|
||||||
| `config.example.json` | Template → copy to `config.json` (gitignored) |
|
| `config.example.json` | Template → copy to `config.json` (gitignored) |
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# AutoACCT — Claude Code 记账 Skill
|
# AutoACCT for OpenClaw
|
||||||
|
|
||||||
[English](README.md) | **简体中文**
|
[English](README.md) | **简体中文**
|
||||||
|
|
||||||
一个 [Claude Code](https://claude.com/claude-code) skill,把小票照片(可附文字说明)自动变成 Google Sheet 里结构化的一行记录,并按当日 ECB 汇率换算为港币。
|
一个 OpenClaw skill,把小票照片(可附文字说明)自动变成 Google Sheet 里结构化的一行记录,并按当日 ECB 汇率换算为港币。
|
||||||
|
|
||||||
目前在 Claude Code 中手动调用;后续计划接入 WhatsApp webhook 实现真正的"发张图就记账"。
|
目前在 OpenClaw 中手动调用;后续计划接入 WhatsApp webhook 实现真正的"发张图就记账"。
|
||||||
|
|
||||||
## 功能
|
## 功能
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
### Step 1 — Clone 仓库 + 装 Python 依赖
|
### Step 1 — Clone 仓库 + 装 Python 依赖
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://git.deepknow.site/Knowit/AutoACCT.git ~/.claude/skills/bookkeeping
|
git clone https://git.deepknow.site/Knowit/AutoACCT.git ~/.openclaw/workspace/skills/bookkeeping
|
||||||
pip install google-api-python-client google-auth
|
pip install google-api-python-client google-auth
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ chmod 600 ~/.config/gcp/bookkeeping-sa.json
|
|||||||
### Step 5 — 写 config.json
|
### Step 5 — 写 config.json
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/.claude/skills/bookkeeping
|
cd ~/.openclaw/workspace/skills/bookkeeping
|
||||||
cp config.example.json config.json
|
cp config.example.json config.json
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ cp config.example.json config.json
|
|||||||
### Step 6 — 冒烟测试
|
### Step 6 — 冒烟测试
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' | python3 ~/.claude/skills/bookkeeping/scripts/append_row.py
|
echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' | python3 ~/.openclaw/workspace/skills/bookkeeping/scripts/append_row.py
|
||||||
```
|
```
|
||||||
|
|
||||||
看到 `OK 'Sheet1'!A2:N2`(或中文 tab 名)并且 sheet 第 2 行出现 TEST,就全通了。完事记得把这行测试数据删掉。
|
看到 `OK 'Sheet1'!A2:N2`(或中文 tab 名)并且 sheet 第 2 行出现 TEST,就全通了。完事记得把这行测试数据删掉。
|
||||||
@@ -91,7 +91,7 @@ echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"curr
|
|||||||
|
|
||||||
## 使用
|
## 使用
|
||||||
|
|
||||||
在 Claude Code 会话里把小票图片拖进来,然后说 "log this" / "记一下" 之类即可。Skill 会根据"小票/记账"类请求自动触发,**不需要** slash command。
|
在 OpenClaw 会话里把小票图片拖进来,然后说 "log this" / "记一下" 之类即可。Skill 会根据"小票/记账"类请求自动触发,**不需要** slash command。
|
||||||
|
|
||||||
文字说明可选,可用来补充上下文(支付方式、AA、分类提示、备注等)。
|
文字说明可选,可用来补充上下文(支付方式、AA、分类提示、备注等)。
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"curr
|
|||||||
|
|
||||||
| 文件 | 作用 |
|
| 文件 | 作用 |
|
||||||
|------------------------|-----------------------------------------------|
|
|------------------------|-----------------------------------------------|
|
||||||
| `SKILL.md` | 入口文件 — Claude 读它来决定如何执行 skill |
|
| `SKILL.md` | 入口文件 — OpenClaw 读它来决定如何执行 skill |
|
||||||
| `categories.md` | 固定的 14 个分类列表 |
|
| `categories.md` | 固定的 14 个分类列表 |
|
||||||
| `schema.md` | Google Sheet 列顺序(A–N) |
|
| `schema.md` | Google Sheet 列顺序(A–N) |
|
||||||
| `config.example.json` | 配置模板 → 复制为 `config.json`(已 gitignore)|
|
| `config.example.json` | 配置模板 → 复制为 `config.json`(已 gitignore)|
|
||||||
|
|||||||
6
SKILL.md
6
SKILL.md
@@ -13,7 +13,7 @@ Default working language: **English**. All written output (row values, replies)
|
|||||||
- Caption may be empty, or may add context (who paid, split %, category hint, payment method). Always incorporate caption if present.
|
- Caption may be empty, or may add context (who paid, split %, category hint, payment method). Always incorporate caption if present.
|
||||||
|
|
||||||
## Prerequisites (check once per session)
|
## Prerequisites (check once per session)
|
||||||
1. `~/.claude/skills/bookkeeping/config.json` exists. If only `config.example.json` is present, **stop** and tell the user to copy it and fill in `sheet_id`, `worksheet`, `service_account_path`. Point them at `scripts/setup.md`.
|
1. `~/.openclaw/workspace/skills/bookkeeping/config.json` exists. If only `config.example.json` is present, **stop** and tell the user to copy it and fill in `sheet_id`, `worksheet`, `service_account_path`. Point them at `scripts/setup.md`.
|
||||||
2. Python deps installed: `google-api-python-client`, `google-auth`. If `append_row.py` fails with ImportError, instruct the user to run `pip install google-api-python-client google-auth` and retry.
|
2. Python deps installed: `google-api-python-client`, `google-auth`. If `append_row.py` fails with ImportError, instruct the user to run `pip install google-api-python-client google-auth` and retry.
|
||||||
|
|
||||||
## Workflow
|
## Workflow
|
||||||
@@ -21,12 +21,12 @@ Default working language: **English**. All written output (row values, replies)
|
|||||||
2. **Normalize** per the rules below.
|
2. **Normalize** per the rules below.
|
||||||
3. **Convert to HKD** by running:
|
3. **Convert to HKD** by running:
|
||||||
```
|
```
|
||||||
python ~/.claude/skills/bookkeeping/scripts/fx_convert.py <amount> <currency> --date <yyyy-mm-dd>
|
python ~/.openclaw/workspace/skills/bookkeeping/scripts/fx_convert.py <amount> <currency> --date <yyyy-mm-dd>
|
||||||
```
|
```
|
||||||
Output is `<hkd_amount>\t<fx_rate>\t<fx_date>` (tab-separated). If currency is HKD, skip the call and set `amount_hkd=amount`, `fx_rate=1`, `fx_date=<date>`.
|
Output is `<hkd_amount>\t<fx_rate>\t<fx_date>` (tab-separated). If currency is HKD, skip the call and set `amount_hkd=amount`, `fx_rate=1`, `fx_date=<date>`.
|
||||||
4. **Append the row** by piping JSON into:
|
4. **Append the row** by piping JSON into:
|
||||||
```
|
```
|
||||||
echo '<json>' | python ~/.claude/skills/bookkeeping/scripts/append_row.py
|
echo '<json>' | python ~/.openclaw/workspace/skills/bookkeeping/scripts/append_row.py
|
||||||
```
|
```
|
||||||
Keys must match `schema.md` (snake_case: `date`, `merchant`, `category`, `amount`, `currency`, `amount_hkd`, `fx_rate`, `fx_date`, `payment_method`, `line_items`, `raw_ocr`, `note`, `receipt`). Script adds `logged_at` automatically.
|
Keys must match `schema.md` (snake_case: `date`, `merchant`, `category`, `amount`, `currency`, `amount_hkd`, `fx_rate`, `fx_date`, `payment_method`, `line_items`, `raw_ocr`, `note`, `receipt`). Script adds `logged_at` automatically.
|
||||||
5. **Report** to the user: the row you wrote and any field you had to guess.
|
5. **Report** to the user: the row you wrote and any field you had to guess.
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ pip install google-api-python-client google-auth
|
|||||||
|
|
||||||
## 4. Skill config
|
## 4. Skill config
|
||||||
```
|
```
|
||||||
cd ~/.claude/skills/bookkeeping
|
cd ~/.openclaw/workspace/skills/bookkeeping
|
||||||
cp config.example.json config.json
|
cp config.example.json config.json
|
||||||
# edit config.json: sheet_id, service_account_path
|
# edit config.json: sheet_id, service_account_path
|
||||||
```
|
```
|
||||||
@@ -34,6 +34,6 @@ cp config.example.json config.json
|
|||||||
## 5. Sanity check
|
## 5. Sanity check
|
||||||
```
|
```
|
||||||
echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' \
|
echo '{"date":"2026-04-20","merchant":"TEST","category":"Other","amount":1,"currency":"HKD","amount_hkd":1,"fx_rate":1,"fx_date":"2026-04-20"}' \
|
||||||
| python ~/.claude/skills/bookkeeping/scripts/append_row.py
|
| python ~/.openclaw/workspace/skills/bookkeeping/scripts/append_row.py
|
||||||
```
|
```
|
||||||
You should see `OK Expenses!A2:N2` (or similar) and a new row in the sheet. Delete the TEST row when done.
|
You should see `OK Expenses!A2:N2` (or similar) and a new row in the sheet. Delete the TEST row when done.
|
||||||
|
|||||||
Reference in New Issue
Block a user