- Home
- Skills
- Finance & Accounting
- Ledger Integrity Check: Find drift before you migrate
More screenshots
Works with the AI Agents you already use
Ledger Integrity Check: Find drift before you migrate
Before you migrate a ledger, prove the books still balance. Finds unbalanced transactions, bad reversals and stored balances that drifted from the entries, with the transaction for each.
$12
Ledger Integrity Check: Find drift before you migrate
Example session with this skill installed
Review references/bad-journal.json for ledger integrity. Show exact balance
differences, explain whether the reversal cancels its original, and prioritize source checks.
- Read your context and instructions
- Compiled the ledger integrity check
Captured stdout from python3 -I -B scripts/ledger_check.py references/bad-journal.json --format markdown (exit 1):
Ledger integrity: FAIL
Accounts 2, transactions 2, entries 4. Errors 5, warnings 0, info 0.
Findings
| Severity | Code | Transaction | Account | Message |
|---|---|---|---|---|
| error | UNBALANCED | EXAMPLE-reversal | entries must sum to zero per currency (off by USD +100) | |
| error | REVERSAL_MISMATCH | EXAMPLE-reversal | entries are not the original's entries with signs flipped | |
| error | BALANCE_AFTER_MISMATCH | EXAMPLE-reversal | EXAMPLE-cash | running balance is 100 but the entry records 0 |
| error | STORED_BALANCE_MISMATCH | EXAMPLE-cash | stored balance 25 but the entries give 100 | |
| error | TRIAL_BALANCE_NONZERO | all entries together do not sum to zero per currency |
Recomputed balances (minor units, account's own terms)
| Account | Name | Type | Currency | Computed | Stored | Complete |
|---|---|---|---|---|---|---|
| EXAMPLE-cash | Synthetic cash | asset | USD | 100 | 25 | yes |
| EXAMPLE-wallet | Synthetic wallet | liability | USD | 0 | 0 | yes |
Trial balance per currency: USD 100
FAIL with five errors. Check that the export has full history first, then look at the
reversal legs. After that, sort out cash: the snapshot says 25 but replay gives 100,
a gap of 75.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem You're about to migrate a wallet or ledger service, and the numbers don't quite agree. Maybe a reversal didn't fully cancel its original, or a retry posted twice, or the stored balance on an account no longer matches its entries. You want to know which records are wrong before you copy them into the new system.
See it before you buy: real input, real output Command (from the package folder, exit code 1, 0.028 s):
python3 -I -B scripts/ledger_check.py references/bad-journal.json --format markdown
Before: A small JSON journal: a 1000 deposit, then a reversal that posts -900 on the cash account instead of -1000, and a stored cash balance of 25.
After: lines copied from the script's output (excerpt):
# Ledger integrity: FAIL
| error | UNBALANCED | EXAMPLE-reversal | | entries must sum to zero per currency (off by USD +100) |
| error | REVERSAL_MISMATCH | EXAMPLE-reversal | | entries are not the original's entries with signs flipped |
| error | STORED_BALANCE_MISMATCH | | EXAMPLE-cash | stored balance 25 but the entries give 100 |
| error | TRIAL_BALANCE_NONZERO | | | all entries together do not sum to zero per currency |
What the numbers show
- Synthetic data only: a generated journal of 5,000 transactions and 10,000 entries in 3 currencies, with 20 planted defects. All 20 were found, at 0.17 s median.
- The clean journal produced no findings, as JSON (0.16 s) and as CSV (0.13 s).
- I checked all 26 reported errors by hand: 20 are the planted defects and 6 are knock-on effects. Honest limit: no production ledgers, so this is not a real-world catch rate.
What you get
- A single Python script that reads your journal (JSON, or CSV with one row per entry) and, optionally, your account list with stored balances.
- It replays every account from zero and reports each problem with the transaction ID, account ID, and the exact difference in minor units (cents, pence and so on).
- It checks that each transaction sums to zero in every currency, that amounts are whole integers, that idempotency keys weren't reused or posted twice, that reversals exactly flip their original, and that stored and running balances match.
- Output is JSON or Markdown. Exit code 0 means clean, 1 means problems, 2 means the input couldn't be read, so you can use it as a gate in CI.
- 33 test cases, four saved sample reports, six small scenarios, and a generator for a 10,000-entry test journal.
The agent asks what your export covers, runs the script, walks you through errors before warnings, and tells you which source records to look at. It never edits your ledger.
Measured on real data (full detail) I didn't have production ledgers to test on, so the evidence is synthetic. The big test is a generated journal: 156 accounts, 5,000 transactions, 10,000 entries in three currencies. I ran each input five times on Python 3.13.5 and took the median, startup included.
| Input | Result | Time |
|---|---|---|
| Clean journal, JSON | No findings | 0.16s |
| Same journal as CSV | No findings | 0.13s |
| Same journal with 20 planted defects | Found all 20 | 0.17s |
| Six small scenarios from my own ledger project's tests | Two pass, four fail, as expected | 0.03s each |
The 20 defects are four kinds, five of each: off-by-one legs, missing keys, reversals of transactions that don't exist, and stored balances bumped by 7. The report showed 26 errors. I checked all 26 by hand: 20 are the planted defects and six are knock-on effects of them, like a wrong account total. Treat this as proof the checks work, not as a catch rate for real-world bugs.
Known limitations
- Balances replay from zero, so you need full history (or balanced opening entries) and an account snapshot taken at the same point.
- It doesn't match bank statements, do tax or FX, or certify compliance.
- An export can't show missing history or prove the live service is safe under concurrent retries.
- Two identical payments under different keys only get a warning, because they may be intended.
- Reports contain your IDs and the first 64 characters of keys. Nothing is redacted.
Who it's for Engineers who run wallet or ledger services, and finance ops people who can pull a journal export and an account list.
Requires Python 3.8 or newer and a JSON or UTF-8 CSV export in the documented layout. Nothing to install. I tested on Python 3.13.5. The code only uses syntax and library calls available in 3.8, but I didn't run it on 3.8 or 3.12.
It runs locally, with no network calls or telemetry. The script only prints a report. The optional generator writes test data to a folder you choose.
Price and guarantee $12 one time, yours to use with any agent that can run Python. Covered by Agensi's money-back guarantee if it doesn't do what this page promises.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Finance & Accounting.
Requires loading full exports into memory. Does not verify external bank statements or perform FX conversion. Skips stored-balance checks in as-of mode.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 15 days ago
- Software
Python 3
Permissions
Uses terminal execution and file reads for the explicitly supplied journal and optional account export. No network access; nothing is sent anywhere. The checker emits stdout/stderr and changes no records. Saving a report requires user-selected redirection; the optional benchmark generator writes only its explicitly selected output directory.