Andrew Pierno

Heath Ledger

专业领域v1.0.0
作者:Andrew Pierno更新于 2026-05-18heath-ledger@clawhub_wrannaman/heath-ledger
金融分析

据 AlphaMoat 统计,截至 2026-09,Heath Ledger 累计下载 1,954 次、获 1 个星标,在全部 5,078 个 AI 技能中排名第 4,461 位,在「专业领域」分类(465 个)中排名第 391 位。

累计安装
597
累计下载
1,954
星标
1
全站排名
#4,461
全站前 88% · 「专业领域」前 85%
平台累计安装累计下载星标评论
ClawHub ↗411,5031-
SkillHub ↗5971,9541—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

拉取交易记录后按规则加模型分类,输出现金流量表、资产负债表、利润表与交易明细的 Excel 工作簿。初始化会建立数据库并预置常用供应商到科目的规则,连接账户时会自动发现名下账户;令牌对交易只有只读权限。 凭据及详细银行/Stripe 数据会以明文保存在本地;保护工作目录、控制台输出、数据库与工作簿。复核模型分类,并用权威会计记录核对报表。

资料发布于 2026-10-27

可以用来做什么

  • 把一个月流水分类并生成利润表。
  • 做季度结账时导出交易明细与现金流量表。

什么时候用

  • 需要按月或按季出账时。
  • 流水科目混乱、想先做规则化分类时。

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

帮我把上个月的流水分类并出一份利润表。
导出这个季度的交易明细和现金流量表。

月度数据趋势

累计下载1,954
9411,4852,0292026-03 · 累计下载 1,0162026-05 · 累计下载 1,2532026-07 · 累计下载 1,4822026-08 · 累计下载 1,5492026-09 · 累计下载 1,95426-0326-09
星标1
0122026-03 · 星标 12026-05 · 星标 12026-07 · 星标 12026-08 · 星标 12026-09 · 星标 126-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-091,954—1
2026-081,549+4.5%1
2026-071,482—1
2026-051,253—1
2026-031,016—1

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

7.0 KB · ClawHub v1.0.0
---
name: heath-ledger
description: "AI bookkeeping agent for Mercury bank accounts. Pulls transactions, categorizes them (rule-based + AI), and generates Excel workbooks with P&L, Balance Sheet, Cash Flow, and transaction detail. Use when the user wants to do bookkeeping, generate financial statements, categorize bank transactions, connect Mercury, or produce monthly/quarterly/annual books. Triggers on: bookkeeping, P&L, profit and loss, balance sheet, cash flow, financial statements, Mercury bank, categorize transactions, generate books, monthly close."
---

# Heath Ledger

AI bookkeeping skill for Mercury bank accounts.

## Quick Start
展开全部(共 136 行)

1. `scripts/init_db.mjs` — creates DB + seeds ~90 universal vendor→category rules
2. `scripts/connect_mercury.sh <MERCURY_API_TOKEN> [entity_name]` — discovers accounts
3. *(Optional)* `scripts/connect_stripe.sh <entity_id> <stripe_api_key>` — connect Stripe for exact revenue + fees
4. *(If Stripe connected)* `scripts/pull_stripe_revenue.sh <entity_id> <start_date> <end_date>` — pull monthly revenue data
5. `scripts/pull_transactions.sh <entity_id> <start_date> <end_date>`
5. `scripts/categorize.sh <entity_id>` — rule-based first, AI for unknowns
6. Review ambiguous items, correct with `scripts/set_category.sh`
7. `scripts/generate_books.sh <entity_id> <start_date> <end_date> [output_path]`

## Setup Flow

### Mercury API Key (Required)
Get from Mercury Dashboard → Settings → API Tokens. The token gives read-only access to transactions.

### Stripe API Key (Optional but Recommended)
Without Stripe API: Mercury shows **net** Stripe deposits (revenue minus fees). The system estimates gross revenue using a configurable fee rate (default 2.3% + $0.30).

With Stripe API: You get **exact** gross revenue, exact fees, and proper refund tracking. Always prefer this when available.

To connect: `scripts/connect_stripe.sh <entity_id> <stripe_api_key>`
Then pull data: `scripts/pull_stripe_revenue.sh <entity_id> <start_date> <end_date>`

The P&L generator automatically uses Stripe data when available, falling back to Mercury estimates otherwise.

### Entity Settings
Configure per-entity via the `entity_settings` table:

| Setting | Default | Description |
|---------|---------|-------------|
| `accounting_basis` | `accrual` | `accrual` or `cash` — cash basis uses posted dates only |
| `month_offset` | `1` | Fiscal year month offset (1 = calendar year) |
| `stripe_fee_rate` | `0.023` | Stripe percentage fee for gross-up calculation |
| `stripe_fee_fixed` | `0.30` | Stripe fixed fee per transaction |
| `amortization_monthly` | `null` | Monthly amortization amount for acquired assets |

## Workflow

1. **Connect Mercury** — `scripts/connect_mercury.sh <token> [name]` discovers accounts, creates entity
2. **Pull transactions** — `scripts/pull_transactions.sh <entity_id> <start_date> <end_date>`
3. **Categorize** — `scripts/categorize.sh <entity_id> [max_transactions]` — rule-based first, then AI for unknowns
4. **Review ambiguous** — Script outputs low-confidence items. Ask user, then update with `scripts/set_category.sh <transaction_id> <category> [subcategory]`
5. **Generate books** — `scripts/generate_books.sh <entity_id> <start_date> <end_date> [output_path]`

## Scripts Reference

All scripts are in `scripts/`. Run with bash or node. Database is SQLite at `data/heath.db`.

| Script | Purpose |
|--------|---------|
| `init_db.mjs` | Create/migrate SQLite database + seed rules |
| `connect_mercury.sh` | Connect Mercury API, discover accounts |
| `pull_transactions.sh` | Pull transactions for date range |
| `categorize.sh` | Categorize transactions (rules + AI) |
| `set_category.sh` | Manually set category for a transaction |
| `add_rule.sh` | Add/update a categorization rule |
| `generate_books.sh` | Generate Excel workbook |
| `list_entities.sh` | List all entities |
| `connect_stripe.sh` | Connect Stripe API to an entity |
| `pull_stripe_revenue.sh` | Pull Stripe balance transactions by month |
| `status.sh` | Show entity status (accounts, tx counts) |

## Chart of Accounts

See `references/chart-of-accounts.md` for the full chart with P&L sections and cash flow classifications.

## Learning & Compounding System

Heath Ledger gets smarter over time through a layered rule system:

### Rule Hierarchy
1. **Entity-specific rules** (highest priority) — per-company overrides
2. **Global rules** (`entity_id = NULL`) — apply to all entities
3. **Seed rules** — universal vendor mappings shipped with the skill
4. **AI categorization** — used when no rule matches

### How Learning Works
- Every manual correction creates or updates a categorization rule
- Rules track `usage_count` — heavily-used rules are more reliable
- `source` field tracks provenance: `seed`, `ai`, `human`, `manual`
- Human-confirmed rules get `confidence: 0.95-1.0`
- AI-generated rules start at `0.85` and can be promoted
- Entity-specific rules can be promoted to global when they prove universal

### The Compounding Effect
After categorizing ~5,000 transactions across 2 entities, the system now auto-categorizes **~95%** of transactions without AI. Each new entity benefits from all previous learnings.

## Known Limitations

### Stripe Net vs Gross (Without Stripe API)
Mercury deposits from Stripe are **net** amounts (revenue minus ~2.9% + $0.30 fees). Without the Stripe API:
- We estimate gross revenue using configurable fee rates
- This creates "synthetic" Stripe Fee entries
- Accuracy depends on your actual Stripe fee rate (varies by plan, card type, international)
- **Solution**: Connect Stripe API for exact numbers

### Deel Fee Splitting
Deel combines platform fees and contractor payroll in one transaction stream. Pattern:
- **Small fixed amounts** (~$2-5) → Deel Platform Fee → categorize as "Software expenses"
- **Larger variable amounts** → Contractor Payroll → categorize as "Wages & Salaries"
- The system learns this pattern but may need initial human guidance

### Mercury API Limitations
- Only returns posted transactions (not pending)
- Some counterparty names are truncated or normalized differently
- Wire descriptions may include reference numbers that create duplicate rules

### Multi-Currency
- Wise transfers create both a debit (USD) and may show FX fees separately
- International wire fees from Mercury appear as separate line items
- FX gains/losses are not tracked (would need multi-currency ledger)

## AI Categorization

The `categorize.sh` script calls the host agent's model via stdin/stdout JSON protocol. It sends transaction batches and expects category assignments back. The script writes a prompt to stdout that the agent should process and return results for.

When AI confidence < 0.85, transactions are flagged as ambiguous for user review.

## Key Details

- **Cash or accrual basis** — configurable per entity
- **Multiple entities supported** — each with own connections and rules
- **Rules persist** — categorization rules saved to SQLite, reused across runs
- **Seed rules** — ~90 universal vendor mappings loaded on init
- **Excel output** — 4-tab workbook: P&L, Balance Sheet, Cash Flow, Transaction Detail

「专业领域」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。