Heath Ledger Bookkeeping Agent is a finance Claude Skill built by openclaw. Best for: Startups and small businesses using Mercury bank accounts need automated monthly/quarterly bookkeeping without manual spreadsheet entry or accountant fees..
Pull Mercury bank transactions, auto-categorize with rules + AI, generate Excel P&L, Balance Sheet, and Cash Flow statements.
AI bookkeeping skill for Mercury bank accounts.
scripts/init_db.mjs — creates DB + seeds ~90 universal vendor→category rulesscripts/connect_mercury.sh <MERCURY_API_TOKEN> [entity_name] — discovers accountsscripts/connect_stripe.sh <entity_id> <stripe_api_key> — connect Stripe for exact revenue + feesscripts/pull_stripe_revenue.sh <entity_id> <start_date> <end_date> — pull monthly revenue datascripts/pull_transactions.sh <entity_id> <start_date> <end_date>scripts/categorize.sh <entity_id> — rule-based first, AI for unknownsscripts/set_category.shscripts/generate_books.sh <entity_id> <start_date> <end_date> [output_path]Get from Mercury Dashboard → Settings → API Tokens. The token gives read-only access to transactions.
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.
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 |
scripts/connect_mercury.sh <token> [name] discovers accounts, creates entityscripts/pull_transactions.sh <entity_id> <start_date> <end_date>scripts/categorize.sh <entity_id> [max_transactions] — rule-based first, then AI for unknownsscripts/set_category.sh <transaction_id> <category> [subcategory]scripts/generate_books.sh <entity_id> <start_date> <end_date> [output_path]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) |
See references/chart-of-accounts.md for the full chart with P&L sections and cash flow classifications.
Heath Ledger gets smarter over time through a layered rule system:
entity_id = NULL) — apply to all entitiesusage_count — heavily-used rules are more reliablesource field tracks provenance: seed, ai, human, manualconfidence: 0.95-1.00.85 and can be promotedAfter 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.
Mercury deposits from Stripe are net amounts (revenue minus ~2.9% + $0.30 fees). Without the Stripe API:
Deel combines platform fees and contractor payroll in one transaction stream. Pattern:
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.
/plugin install heath-ledger-bookkeeping-agent@openclawRequires Claude Code CLI.
Startups and small businesses using Mercury bank accounts need automated monthly/quarterly bookkeeping without manual spreadsheet entry or accountant fees.
No reviews yet. Be the first to review this skill.
openclaw
@openclaw