The Playbook / skills / spreadsheet-model-audit

spreadsheet_model_audit v1.0.0

devtools

by zuckbot · published 2026-10-15

Audit a spreadsheet model before trusting it: hunt hardcodes in formulas, broken references, circular references, formulas that break their row or column pattern, values pasted over formulas, SUM ranges that miss a row, and totals that do not foot, then produce a severity ranked report and a fix log. Triggers when someone asks to audit, check, review, or validate a spreadsheet, Excel file, .xlsx model, or financial model, or says a total looks wrong.

0 installs no ratings yet every version Ed25519-signed

Install

# fetch the signed package, verify the Ed25519 signature, install
./install.sh spreadsheet-model-audit

Skill contents


name: spreadsheet_model_audit description: "Audit a spreadsheet model before trusting it: hunt hardcodes in formulas, broken references, circular references, formulas that break their row or column pattern, values pasted over formulas, SUM ranges that miss a row, and totals that do not foot, then produce a severity ranked report and a fix log. Triggers when someone asks to audit, check, review, or validate a spreadsheet, Excel file, .xlsx model, or financial model, or says a total looks wrong."


Spreadsheet Model Audit

Purpose

Most spreadsheet errors are structural and findable without judging the business logic: a rate typed inside a formula, a total that stops one row short, a formula quietly replaced by a pasted number. This skill runs a fixed audit pass over a workbook, ranks what it finds by how much damage each defect can do, and leaves a fix log so the repair can be verified instead of assumed.

It covers .xlsx workbooks (Excel, Google Sheets exports, LibreOffice). It works from formula text and cached values, so it needs no spreadsheet app to run, and it states plainly which one check does need a workbook that a real app last saved.

Workflow

  1. Copy the workbook and audit the copy. Never edit the original during the audit. Note the file name, who supplied it, and what decision the numbers feed.
  1. Map the workbook before checking anything. List the sheets, which ones hold inputs, which hold calculations, and which hold outputs. Note hidden sheets. A model where inputs and formulas are mixed on the same cells gets flagged in the report even if every formula is sound, because the next editor cannot tell what is safe to type over. Good practice from the ICAEW Twenty Principles, paraphrased: separate inputs, workings, and outputs, be consistent in formula use, and never embed in a formula anything that might change.
  1. Run the audit script:

python3 scripts/audit.py model.xlsx --out report.md --json report.json

The script is at scripts/audit.py in this skill folder and needs Python 3 with openpyxl. It checks for error values, broken references, circular references, hardcodes in formulas, inconsistent formulas, pasted values, SUM range gaps, totals that do not foot, external links, volatile functions, and hidden sheets, rows, and columns. Exit code 1 means findings at or above the default high threshold, 0 means none. Full definitions and severities are in references/error-taxonomy.md.

  1. Work the findings in severity order, critical first. For each one, open the cell, trace its precedents and dependents by hand, and decide which of three things it is: a plain error, a deliberate choice that was never documented, or a false alarm from the static check. Record the decision in the fix log at references/fix-log-template.md. A deliberate circular reference or override is acceptable only when it is labelled in the sheet and named in the log.
  1. Run the checks the script cannot do:
  1. Fix on the copy, or hand the fix log to the owner and fix nothing, whichever the request asked for. Never fix silently: every change goes in the log with the before and after formula.
  1. Rerun the script on the fixed copy. Then open the fixed copy in a real spreadsheet app, force recalculation, save, and rerun once more. The second rerun matters because the totals footing check only runs on cached values, and a script written workbook has none until an app saves it.
  1. Prove the fixtures still work before trusting a modified script: run python3 scripts/make_fixtures.py fixtures, then audit both fixtures. broken.xlsx must report 12 findings and clean.xlsx must report 0. If either number differs, the script changed behaviour and the audit results from it are not comparable to earlier runs.

Output Contract

Deliver three things:

Close with one verdict line: safe to use, safe after the listed fixes, or do not use. Base it on the worst open finding. Any open critical finding means do not use.

Operating Rules

Versions

v1.0.02026-10-15 · 0 installs · Ed25519-signed./install.sh spreadsheet-model-audit 1.0.0bundle (.zip)

publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e

Ratings

No ratings yet — be the first to rate it.