← Back to Skills Marketplace
wrannaman

Heath Ledger

by Andrew Pierno · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
583
Downloads
1
Stars
2
Active Installs
1
Versions
Install in OpenClaw
/install 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...
README (SKILL.md)

Heath Ledger

AI bookkeeping skill for Mercury bank accounts.

Quick Start

  1. scripts/init_db.mjs — creates DB + seeds ~90 universal vendor→category rules
  2. scripts/connect_mercury.sh \x3CMERCURY_API_TOKEN> [entity_name] — discovers accounts
  3. (Optional) scripts/connect_stripe.sh \x3Centity_id> \x3Cstripe_api_key> — connect Stripe for exact revenue + fees
  4. (If Stripe connected) scripts/pull_stripe_revenue.sh \x3Centity_id> \x3Cstart_date> \x3Cend_date> — pull monthly revenue data
  5. scripts/pull_transactions.sh \x3Centity_id> \x3Cstart_date> \x3Cend_date>
  6. scripts/categorize.sh \x3Centity_id> — rule-based first, AI for unknowns
  7. Review ambiguous items, correct with scripts/set_category.sh
  8. scripts/generate_books.sh \x3Centity_id> \x3Cstart_date> \x3Cend_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 \x3Centity_id> \x3Cstripe_api_key> Then pull data: scripts/pull_stripe_revenue.sh \x3Centity_id> \x3Cstart_date> \x3Cend_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 Mercuryscripts/connect_mercury.sh \x3Ctoken> [name] discovers accounts, creates entity
  2. Pull transactionsscripts/pull_transactions.sh \x3Centity_id> \x3Cstart_date> \x3Cend_date>
  3. Categorizescripts/categorize.sh \x3Centity_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 \x3Ctransaction_id> \x3Ccategory> [subcategory]
  5. Generate booksscripts/generate_books.sh \x3Centity_id> \x3Cstart_date> \x3Cend_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 \x3C 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
Usage Guidance
What to check before installing/using: - Inspect the small client wrappers (scripts/lib/mercury-client.js and scripts/lib/stripe-client.js) to confirm they call the official API endpoints you expect and do not send data elsewhere. - Understand where credentials are stored: tokens you pass (Mercury/Stripe) are saved plaintext in data/heath.db. If this DB is on a shared machine or backup, treat the tokens as sensitive and consider encrypting the DB or using filesystem protections. - Avoid running developer-only scripts (e.g., those with hardcoded /home/andrew/... paths) unless you review/adjust them; they reference local example directories and could attempt to read files from absolute paths. - If you plan to run categorize -> AI -> categorize_ai_results workflow, be aware AI-inferred rules are written into the DB (source='ai') and the project includes logic to promote rules; review how rules are promoted before using on multiple entities to avoid accidental global rule propagation. - Run the skill in an isolated environment (local VM/container) if you want to limit blast radius and inspect network traffic during initial runs. - If you need stronger protection for API tokens, add encryption at rest or use a secrets manager instead of storing tokens plaintext in the SQLite file. Overall: the package appears coherent and consistent with its stated bookkeeping purpose, but take the above operational/privacy steps before running it with real production credentials.
Capability Analysis
Type: OpenClaw Skill Name: heath-ledger Version: 1.0.0 The skill is classified as suspicious due to critical security vulnerabilities, primarily the unencrypted storage of sensitive API keys. Both Mercury and Stripe API tokens are stored in plain text within the local SQLite database (`data/heath.db`), as seen in `scripts/connect_mercury.mjs` and `scripts/connect_stripe.mjs`. This exposes credentials to any attacker who gains local access to the system running the OpenClaw agent. Additionally, `scripts/categorize.mjs` constructs a JSON prompt for the AI agent, which, while currently benign, represents a potential prompt injection vulnerability if the underlying data used to build the prompt could be manipulated. There is no evidence of intentional malicious behavior such as data exfiltration to unauthorized endpoints or backdoor installation.
Capability Assessment
Purpose & Capability
Name/description (bookkeeping for Mercury accounts, categorization, P&L/BS/Cash Flow generation) match the provided scripts and libraries: connect_mercury, pull_transactions, categorize (rules + AI), optional connect_stripe, generate_books. Requests for Mercury/Stripe tokens as runtime arguments are proportionate to the stated purpose.
Instruction Scope
SKILL.md directs the operator to run local node/bash scripts which read/write a local SQLite DB (data/heath.db), call Mercury/Stripe APIs, produce AI categorization prompts (JSON to stdout) and accept AI results back. This is within bookkeeping scope, but the skill emits AI prompts that rely on the host agent to call an LLM (expected for 'AI categorization') and will persist AI-created rules into the DB. Several scripts reference or default to developer paths (e.g., /home/andrew/clawd/projects/heath-ledger/bookkeeper-examples) — harmless unless you run those scripts and expect them to point at your data. No instructions to send data to unknown external endpoints were found in the visible files.
Install Mechanism
There is no remote install or download; code is bundled with the skill. No brew/npm/go downloads or external archives are fetched during install. This limits supply-chain risk. (That said, review package.json/package-lock if you plan to run npm install to ensure dependencies are acceptable.)
Credentials
The skill declares no required env vars but expects the user to supply Mercury/Stripe API tokens as command-line arguments; those tokens are stored in the local SQLite DB in plaintext (comment in connect_mercury.mjs: 'store token as-is locally — no encryption needed for local SQLite'). Storing access tokens locally is functionally required but has privacy implications; the skill also inserts AI-generated categorization rules into the DB (source='ai'), which may cause cross-entity propagation if rules are promoted to global later. No unrelated credentials are requested.
Persistence & Privilege
always:false (not force-included). The skill stores data in its own SQLite database and writes generated Excel files to a local data/ directory — expected for bookkeeping. It does not request or modify other skills' configurations. Autonomous invocation is allowed by default (not a red flag alone) but combine with caution if you permit full autonomy and provide credentials.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install heath-ledger
  3. After installation, invoke the skill by name or use /heath-ledger
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: AI bookkeeping from Mercury + Stripe. Auto-categorizes transactions, generates P&L/Balance Sheet/Cash Flow Excel workbooks. 93 pre-loaded vendor rules. SQLite-based, zero infrastructure.
Metadata
Slug heath-ledger
Version 1.0.0
License
All-time Installs 2
Active Installs 2
Total Versions 1
Frequently Asked Questions

What is Heath Ledger?

AI bookkeeping agent for Mercury bank accounts. Pulls transactions, categorizes them (rule-based + AI), and generates Excel workbooks with P&L, Balance Sheet... It is an AI Agent Skill for Claude Code / OpenClaw, with 583 downloads so far.

How do I install Heath Ledger?

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

Is Heath Ledger free?

Yes, Heath Ledger is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Heath Ledger support?

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

Who created Heath Ledger?

It is built and maintained by Andrew Pierno (@wrannaman); the current version is v1.0.0.

💬 Comments