/cpa-skills:bank-statement-to-excelfrom cpa-skills
Converts PDF bank, credit card, brokerage, and merchant statements into a structured Excel workbook with dates, descriptions, debits, credits, and running balance. Validates extraction completeness by tying to opening/closing balances. Runs fully local.
Ships in cpa-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
You are extracting the transaction detail from a statement PDF into a workbook that a preparer, reviewer, or auditor can rely on without re-reading the PDF.
The standard is not "did you get most of the rows." The standard is: the extraction mathematically ties to the statement's own opening and closing balance. If it doesn't tie, the file is not delivered — it's flagged. A silently incomplete statement extract is worse than no extract at all, because it will be relied on.
Decimal. Do not round anything; carry
two decimal places as presented.List every PDF in scope. For each, capture: file name, page count, account number (last 4 only in filenames and tab names — never write a full account number into an output filename), statement period, and whether the page has a real text layer or is a scan.
python3 scripts/extract_text.py --input <folder-or-file> --out work/
This writes, per PDF:
<name>.text.txt — page-delimited text layer<name>.words.jsonl — every word with x0/x1/top/bottom coordinates (needed when columns
collide or descriptions wrap)<name>.meta.json — page count, per-page character count, scanned: true|falseA page with near-zero extractable characters is a scan. Route those through Step 2. Do not attempt to read numbers off a scan from the text layer — you will get silent blanks.
If scanned: true, and ocrmypdf/tesseract are available locally:
python3 scripts/extract_text.py --input <file.pdf> --out work/ --ocr
If OCR tooling is not installed, say so plainly and stop — offer the install command
(brew install ocrmypdf / apt install ocrmypdf tesseract-ocr). Do not send the document
to a cloud OCR service. These are client bank records.
OCR-specific vigilance. On OCR'd output, treat these as suspect until confirmed against
the balance column: 0/O, 1/l/I, 5/S, 8/B, 6/G, comma-vs-period decimal separators,
and dropped leading digits (1,240.00 read as 240.00). The balance proof in Step 4 is
what catches these — which is exactly why it is mandatory on OCR'd statements.
Read the text and word-coordinate output and build a normalized table. You are doing the layout reasoning here; the scripts do the arithmetic and the file writing.
Columns:
| Field | Rule |
|---|---|
row_id | Sequential from 1, in statement order. Never re-sorted. |
source_file | PDF filename |
source_page | 1-based page number |
txn_date | ISO YYYY-MM-DD. See year-assignment rule below. |
post_date | ISO, if the statement shows a separate posting date; else blank |
description | Full description, wrapped lines joined with a single space |
check_no | If present |
reference | Bank reference / trace / confirmation number if present |
debit | Withdrawals/charges. Blank if not a debit. |
credit | Deposits/payments. Blank if not a credit. |
balance | Running balance as printed on the statement. Blank if the statement doesn't print one per line. |
section | e.g. Deposits, Checks Paid, Electronic Withdrawals, Fees |
Year assignment. Most statements print MM/DD. Derive the year from the statement
period, and handle the December/January rollover explicitly: on a statement period of
12/16/2025–01/15/2026, a 12/28 row is 2025 and a 01/03 row is 2026. Getting this wrong
silently misstates a fiscal year cutoff. If a date cannot be resolved to a year with
certainty, it is an exception — not a guess.
Lines that are not transactions. Exclude, and do not count toward totals: Balance Forward, Beginning Balance, Ending Balance, Total Deposits, Total Withdrawals,
Continued on next page, subtotals, column headers repeated on continuation pages, daily
balance summary tables, interest-rate disclosures, and the check-image grid. These are the
single most common source of double-counting. If you include a subtotal as a transaction,
your proof will fail by exactly that subtotal — which is a useful tell.
Wrapped descriptions. A description continuing on the next physical line has no date and no amount. Join it to the transaction above. Use the word coordinates to confirm it starts in the description column, not the date column.
Multi-account statements. Some PDFs contain several accounts. Split by account into separate normalized tables and separate worksheet tabs. Never commingle — each account gets its own independent balance proof.
Write the normalized table to work/<name>.transactions.csv.
python3 scripts/build_workbook.py \
--transactions work/<name>.transactions.csv \
--opening <opening balance from statement> \
--closing <closing balance from statement> \
--out "<Client> - <Bank> x<last4> - <Period> - Transactions.xlsx"
Three independent tests run, all of which must pass:
opening + Σcredits − Σdebits = closing, using the
opening and closing balances printed on the statement. Any difference is reported to the
cent.prior balance ± amount = printed balance. This isolates which
row is wrong rather than just telling you the total is off — it is the fastest debugging
tool you have and it catches OCR digit errors precisely.If any test fails, the script exits non-zero and writes a break report. Do not hand the workbook over. Go find the row. In practice the cause is one of five things, in descending order of frequency: a subtotal captured as a transaction, a wrapped description line captured as a zero-amount transaction, a transaction on a continuation page missed entirely, a debit classified as a credit, or an OCR digit misread. Test C tells you which.
The workbook has four tabs, in this order:
source_page visible. A Recomputed Balance column sits beside the printed balance so a reviewer can see they agree.0.00). This is
the tab a reviewer looks at first. It is what makes the file signable.Then report in chat, briefly: statements processed, period covered, transaction count, total debits and credits, proof result, and the exception count. If anything failed, lead with that.
For a 12-month or multi-account set, run each statement independently — each gets its own proof — then add a Continuity tab: each statement's closing balance must equal the next statement's opening balance, in date order. A gap here means a missing statement month, and that is worth flagging loudly. It is the failure that most often makes it all the way to a lender or an auditor unnoticed.
Everything runs locally: pdfplumber for extraction, optional local ocrmypdf/tesseract,
openpyxl for output. No network calls, no cloud OCR, no uploads, no telemetry. Original
PDFs are opened read-only and never modified. Intermediate files land in work/ and can be
deleted after delivery — tell the user they exist so they can shred them under their
document-retention policy.
pip install pdfplumber openpyxl
# optional, for scanned statements:
# macOS: brew install ocrmypdf
# Debian: sudo apt install ocrmypdf tesseract-ocr
Built by Adopt AI — free to use and modify.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub adoptai/cpa-skills --plugin cpa-skills43 skills in this plugin
/accrual-proposalsPropose month-end accruals from open POs received but not yet invoiced (GRNI), recurring vendor spend patterns, and preparer-supplied one-time items, cross-checked against the AP register so nothing is double-booked, with every line carrying a stated basis and an auto-reversal flag for reviewer approval. Never books anything - output is a proposed JE batch for a Controller to approve before it posts to the GL. Use whenever the user mentions month-end accruals, accrual proposals, what should we accrue this month, GRNI, goods received not invoiced, a recurring accrual estimate, or the accrual JE batch for close. Also trigger on "propose accruals," "draft the accrual entries," "what are we missing on the accrual side," or when an open PO report, AP register, or vendor spend history is supplied together at month end. Inverts cutoff-and-unrecorded-liabilities: that proves a search for what was missed is complete; this proposes what to book. Runs fully local - no client data leaves the machine./ar-aging-tie-outTie the accounts receivable aging to the general ledger control account and test it properly — recomputing every ageing bucket from the invoice date rather than trusting the report, grossing up netted credit balances, and flagging stale balances, unapplied cash, and cutoff errors. Use this whenever the user mentions AR aging, accounts receivable aging, tying the aging to the GL, an AR subledger that does not agree to the control account, stale or uncollectible receivables, the allowance for doubtful accounts, unapplied cash or credits, or receivable confirmations. Also trigger on "does our AR aging tie," "reconcile accounts receivable," "which receivables are old," "check the allowance," "why is AR off," "review the aging," or when an AR aging report and a trial balance are provided together. Runs fully local — no customer or receivable data leaves the machine.Other plugins' skills for the same job