- Home
- Skills
- Finance & Accounting
- Bank CSV & Invoice Reconciliation Gate
Works with the AI Agents you already use
Bank CSV & Invoice Reconciliation Gate
Matches every bank CSV line to your ledger one-to-one with Decimal-exact math, flags duplicates and sign flips, and certifies the month only when opening + delta equals the closing balance.
$19
About this skill
Above-the-Fold Hook (3-Second Value)
Stop letting your AI agent "reconcile" bank CSVs in its head — it flips signs, matches one invoice twice, and invents adjustment lines that force a fake zero balance.
Bank CSV & Invoice Reconciliation Gate adds a deterministic 3-layer guardrail (SKILL.md SOP + JSON bank-map/policy contracts + zero-dependency Python 3 stdlib gate) that matches every bank line to your ledger one-to-one with exact decimal.Decimal math, flags duplicates and sign flips, and certifies the month only when opening + bank delta == closing — to the cent, or the run is blocked with the difference printed in plain sight.
What's Inside (3-Layer Architecture + 60-Second Test Pack)
- Layer 1 — Operational SOP (
SKILL.md): Strict Declare Run -> Map Columns -> Normalize Ledger -> Run Gate -> Chase Violations -> Sign Off workflow for Claude Code, Cursor, and Codex CLI, with non-negotiable rules: the model never sums money, never plugs a difference, never silently drops a duplicate. - Layer 2 — JSON Schema Draft 2020-12 Contracts (
schemas/):schemas/bank_map.schema.json: One map per bank/export flavour — column names (separate debit/credit columns OR a single signed amount column with optionalflip_sign), the bank's realdate_format, and number locale (thousands/decimal separators, so European1.234,56exports parse correctly).schemas/recon_policy.schema.json: Opening/closing balances as decimal strings, tolerance (default0.00— to the cent), and the date window for timing matches.
- Layer 3 — Zero-Dependency Python Gate (
scripts/reconciliation_gate.py): Pure Python 3 standard library (csv,json,decimal,datetime,hashlib,argparse,pathlib,re) that:- Parses the bank CSV under the map and the ledger under canonical columns (
date,reference,description,amount). - Matches rows one-to-one in four passes: exact (date+amount) -> shared reference -> sign-flip detection -> likely/timing (same amount inside the date window).
- Hashes every row (SHA-256 over date|amount|description) to catch exact duplicate lines on either side.
- Verifies the balance equation and exits
0on PASS,1on FAIL, with a--jsonmode for pipelines.
- Parses the bank CSV under the map and the ledger under canonical columns (
- 60-Second Test Pack (
examples/):examples/bank_map_generic.json+examples/policy_pass.json/policy_fail.json: ready-to-run map and policies.examples/bank_statement_pass.csv+examples/ledger_pass.csv: a clean month — 4 exact matches, 1 timing match, balance holds to the cent.examples/bank_statement_fail.csv+examples/ledger_fail.csv: a dirty month — a duplicated +350.00 payment line, a sign-flipped fuel entry (±200.00), and a 20.00 balance break.
Who This Is For & Prerequisites
Built for:
- Freelancers, micro-bookkeepers, and solo founders reconciling monthly bank CSV statements against invoice/ledger exports with Claude Code.
- Anyone burned by an LLM "balancing" a spreadsheet with a plug figure, or paying $29+/month for a cloud statement converter that requires uploading private bank data to a third-party server.
Prerequisites:
- Python 3.9+ (standard library only — zero
pip install, zero external packages, zero API keys). - Works cross-platform on Windows (cp1252-safe ASCII output), macOS, and Linux. Runs 100% offline: your statements never leave your machine.
60-Second Quick-Start
Run directly from the skill folder:
# 1. Run the FAIL fixture (duplicate line + sign flip + 20.00 balance break)
python scripts/reconciliation_gate.py \
--bank examples/bank_statement_fail.csv \
--ledger examples/ledger_fail.csv \
--map examples/bank_map_generic.json \
--policy examples/policy_fail.json
# 2. Run the PASS fixture (clean month, certified to the cent)
python scripts/reconciliation_gate.py \
--bank examples/bank_statement_pass.csv \
--ledger examples/ledger_pass.csv \
--map examples/bank_map_generic.json \
--policy examples/policy_pass.json
# 3. Machine-readable verdict for pipelines
python scripts/reconciliation_gate.py \
--bank examples/bank_statement_fail.csv \
--ledger examples/ledger_fail.csv \
--map examples/bank_map_generic.json \
--policy examples/policy_fail.json --json
Real Terminal Proof
1. FAIL Gate — Duplicate, Sign Flip & Balance Break (exit code 1)
$ python scripts/reconciliation_gate.py --bank examples/bank_statement_fail.csv --ledger examples/ledger_fail.csv --map examples/bank_map_generic.json --policy examples/policy_fail.json
========================================================================
BANK CSV RECONCILIATION GATE -- MATCH & BALANCE REPORT
========================================================================
Bank File : examples/bank_statement_fail.csv (Generic Bank Export (debit/credit columns))
Ledger File : examples/ledger_fail.csv
Policy : opening 5,000.00 | closing 6,300.00 | tolerance 0.00 | window 3d
Rows Loaded : bank 5 | ledger 3 | parse errors 0
------------------------------------------------------------------------
Matched : 2 (exact/reference) | 0 likely (same amount, date-shifted)
Bank Only : 2 | Ledger Only: 0
bank-only line 5: 2026-11-06 350.00 'Payment INV-2002 - Delta Co'
bank-only line 6: 2026-11-09 -120.00 'Bank fee - November'
Delta Check : 5,000.00 + 1,280.00 = 6,280.00 vs closing 6,300.00 (diff 20.00)
------------------------------------------------------------------------
[BLOCKED] Reconciliation refused: 3 violation(s):
1. [FAIL] [CRITICAL] DUPLICATE_SUSPECT (bank lines 4, 5)
Identical row appears 2x: 2026-11-06 350.00 'Payment INV-2002 - Delta Co'. Only one copy can match; the rest stay unexplained.
2. [FAIL] [CRITICAL] SIGN_FLIP_SUSPECT (bank line 3 vs ledger line 3)
Bank shows -200.00 on 2026-11-04 but the ledger shows 200.00: 'Fuel - Petrolimex' / 'Petrolimex fuel'. One side has the sign wrong.
3. [FAIL] [CRITICAL] BALANCE_BREAK (closing balance)
Opening 5,000.00 + bank delta 1,280.00 = 6,280.00, but the stated closing balance is 6,300.00. Difference of 20.00 is NOT plugged.
Recommended Remediation:
- Confirm the repeated line against the bank's own export. Re-export or annotate it in the ledger -- never delete it silently.
- Hunt the difference in the source files. Do NOT post an 'adjustment' or 'plug' line to force the balance -- a plugged reconciliation is a false one.
- One side of the pair carries the wrong sign. Correct the wrong side at its source, then re-run the gate.
========================================================================
# Exit code: 1
2. PASS Gate — Clean Month Certified (exit code 0)
$ python scripts/reconciliation_gate.py --bank examples/bank_statement_pass.csv --ledger examples/ledger_pass.csv --map examples/bank_map_generic.json --policy examples/policy_pass.json
========================================================================
BANK CSV RECONCILIATION GATE -- MATCH & BALANCE REPORT
========================================================================
Bank File : examples/bank_statement_pass.csv (Generic Bank Export (debit/credit columns))
Ledger File : examples/ledger_pass.csv
Policy : opening 10,000.00 | closing 13,450.00 | tolerance 0.00 | window 3d
Rows Loaded : bank 5 | ledger 5 | parse errors 0
------------------------------------------------------------------------
Matched : 4 (exact/reference) | 1 likely (same amount, date-shifted)
Bank Only : 0 | Ledger Only: 0
Delta Check : 10,000.00 + 3,450.00 = 13,450.00 vs closing 13,450.00 (diff 0.00)
------------------------------------------------------------------------
[PASS] Reconciliation certified: the closing balance holds to
the cent, no duplicate rows, no sign flips, every bank
line matched or explained as a timing difference.
========================================================================
# Exit code: 0
3. Machine-Readable JSON Mode (--json, FAIL fixture, exit code 1)
{
"status": "FAIL",
"exit_code": 1,
"summary": {
"bank_rows": 5,
"ledger_rows": 3,
"parse_errors": 0,
"matched": 2,
"likely": 0,
"bank_only": 2,
"ledger_only": 0,
"opening": "5000.00",
"bank_delta": "1280.00",
"expected_closing": "6280.00",
"closing": "6300.00",
"diff": "20.00"
},
"violations": [
{ "type": "DUPLICATE_SUSPECT", "severity": "CRITICAL", "where": "bank lines 4, 5" },
{ "type": "SIGN_FLIP_SUSPECT", "severity": "CRITICAL", "where": "bank line 3 vs ledger line 3" },
{ "type": "BALANCE_BREAK", "severity": "CRITICAL", "where": "closing balance" }
]
}
MCP Search Keywords
bank reconciliation, csv reconciliation gate, bank statement matching, invoice ledger matching, bookkeeping close, duplicate transaction detector, sign flip checker, decimal money math, month-end close, offline bookkeeping, claude code accounting, python stdlib validator, json schema draft 2020-12
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.
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 today
- Software
Python