Dan Romero

Tax documents, organized locally

Updated

A prompt that has a coding agent index years of tax documents on your own computer and show what’s missing from year to year, for you and your preparer. Personal data stays out of git, chat and the web, and it gives no tax advice.

874 words

Organize my tax documents on this computer into a searchable index, and show me what’s missing or odd from year to year. This is organizing, not tax advice: raise questions for me and my preparer, and never tell me what to file. First ask, in one short message: where the documents live, which years, whose forms they are (me, a spouse, a trust, a business), and which issuers I expect forms from.

Rules

Build the index

Use Python 3.10 or newer, standard library only (macOS’s built-in python3 is 3.9). SQLite’s FTS5 gives full-text search with no extra packages.

  1. Hash every file with SHA-256, so a file copied into two folders is indexed once and reruns read only new files.
  2. Read the text layer first. OCR only pages with almost no text, on this computer. On a Mac, use a small Swift tool: PDFKit for text and passwords, and Vision’s VNRecognizeTextRequest at .accurate with language correction off, so it doesn’t “fix” numbers. Never a cloud OCR service.
  3. Split packages into forms. One PDF often holds many: a K-1 with its K-3 and state K-1s, a broker’s consolidated 1099, a whole return. Index each form with its pages, year, issuer and recipient.
  4. Skip your own output. Reports you write into the documents folder aren’t source documents.
  5. Print what you couldn’t read: locked files, scans that OCR’d to nothing, formats you skipped.

Traps

Flag

Each flag cites the file and page it rests on, with a severity:

Show me

Put them in one Markdown report outside the repo, or a local page served on 127.0.0.1 with a Content-Security-Policy that blocks network requests. Then ask what to fix first, and stop.

The test that proves it

  1. I name a form, and a search lands on the right file and page.
  2. For one year I’ve already filed, the coverage table matches what my preparer used.
  3. A scratch file in the repo holding the made-up SSN 123-45-6789 fails the pre-commit hook. Delete it after.