The xlsx skill is the spreadsheet guide from Anthropic’s public skills repository, one of the document skills that power Claude’s file creation features. It triggers whenever a spreadsheet file is the main input or output: opening, editing or fixing an .xlsx, .xlsm, .xltx, .csv or .tsv file, building a new workbook, converting between tabular formats, or cleaning messy tabular data into a proper sheet. It picks the tool by task: openpyxl to create or edit with formulas and formatting, pandas for bulk data, markitdown for a quick look, and two openpyxl loads to read both formulas and values.
The guide sets rules for every output: a professional font, formulas instead of hardcoded results, the user’s spec followed literally, every assumption documented, and an existing file’s conventions matched exactly. Its centre is a mandatory recalculation step: a bundled script has LibreOffice compute the formulas on a copy, writes only the values back, and reports each formula error by cell, so the agent fixes them before shipping. It adds advice on which Excel functions survive that check, a list of openpyxl gotchas, and color, number-format and structure conventions for financial models.
What You Get
- A SKILL.md guide with a task table: openpyxl for formulas and formatting, pandas for bulk data, markitdown for a quick look, and two loads for reading formulas and values together
- Requirements for every output: professional fonts, zero formula errors, formulas instead of hardcoded results, literal adherence to the user’s spec and documented assumptions
- recalc.py, which recalculates a workbook through LibreOffice and returns JSON with the status, formula count, errors by type and cell, and the formulas it could not compute
- Guidance on functions: prefer Excel 2007-era ones, prefix six newer ones with _xlfn., and avoid XLOOKUP, FILTER, UNIQUE and other dynamic-array functions
- A list of openpyxl gotchas covering data_only loads, merged cells, macros in .xlsm, quoted sheet names, dropped shapes and slicers, rich text, number formats and chart settings
- Financial model conventions for input and formula colors, currency, percentage and multiple formats, and assumption cells referenced by formulas
Common Use Cases
- Building a financial model or budget whose totals and projections stay live formulas
- Editing an existing workbook’s input cells without disturbing its formulas or formatting
- Cleaning a CSV or TSV with malformed rows and misplaced headers into a proper spreadsheet
- Adding columns, formulas, formatting or charts to a spreadsheet a user uploaded
- Checking a workbook for #REF!, #DIV/0!, #NAME? and other formula errors before handing it over
What Makes It Unique
Like the docx and pptx skills from the same repository, it is Anthropic’s own reference for a complex document skill used in production, but where those render their output to images to check it, this one checks a spreadsheet by computing it: every formula is recalculated in LibreOffice and errors are reported by cell. It insists on formulas over Python-computed results so the sheet keeps working when its inputs change, and it is candid about the limits of its own check: a clean recalc proves formulas evaluate, not that they are right, and functions LibreOffice lacks are listed separately rather than counted as passing.
Under The Hood
The guide has the agent run shell commands: it writes and runs its own Python scripts with openpyxl and pandas, which it expects to be preinstalled and installs with pip only if an import fails, calls the markitdown command for a quick read, and runs python scripts/recalc.py on the output. recalc.py copies the workbook into a temporary folder, creates a throwaway LibreOffice profile, writes a small LibreOffice Basic macro into it that recalculates and saves, and runs soffice headless on the copy. It then reads the computed values out of the copy and splices only those into the original’s sheet XML, writing a new file beside it and swapping it in, so the workbook it was given is rewritten in place. It scans the result for Excel error values and flags formulas that call functions LibreOffice lacks or link to another workbook. soffice.py runs LibreOffice with a headless display setting; where the sandbox blocks Unix sockets it writes a small C shim to the temp folder, compiles it with gcc and loads it with LD_PRELOAD, and before rendering to PDF or images it cuts links to outside files from a copy. The shared office folder also carries validate.py, its validators and helpers, including a rezip function that writes a packed document beside its target and swaps it in; this skill’s guide does not use them, and validate.py performs no schema validation for xlsx files.