Spreadsheets

From gabrielmoreira/agent-skills-mirror · View interactive version

Spreadsheets is an AI agent skill from the GitHub repository gabrielmoreira/agent-skills-mirror. Create, read, edit, analyze, convert, chart, and validate spreadsheet files including XLSX, XLSM, XLS, CSV, and TSV. Use when a spreadsheet is a primary input or deliverable, or when tabular data must remain editable and auditable in workbook form.

How to use this skill

Skill file

Work with spreadsheets

Use openpyxl for XLSX/XLSM authoring, xlrd for legacy XLS reading, pandas for substantial data cleaning or analysis, and the standard csv module for simple CSV/TSV work. Preserve the source unless the user explicitly requests an in-place edit.

Choose the workflow

  1. For a read-only question, inspect only the relevant sheets, labels, values, formulas, tables, charts, and comments. Do not export a modified copy.
  2. For an existing workbook, study its structure and formatting before editing. Apply the smallest local change and extend nearby formulas, validation, conditional formatting, tables, and charts when the edited range requires it.
  3. For a new workbook, separate inputs, calculations, and outputs when the task contains derived values. Keep calculations visible and auditable.
  4. Save to a new file, reopen it, validate formulas and structure, and render every populated sheet when a renderer is available.

Use the bundled inspector before unfamiliar edits:

python <this-skill-directory>/scripts/inspect_workbook.py input.xlsx

Respect format boundaries

Keep formulas auditable

openpyxl writes formulas but does not calculate them. If formulas must be recalculated, open and save a copy with LibreOffice or Excel when available, then reopen the result with data_only=False and data_only=True. Never replace formulas with calculated constants merely to make validation pass. Read formulas.md for the detailed validation contract.

Format by meaning

Read formatting.md before creating or substantially redesigning a workbook.

Use charts deliberately

Read charts.md before creating or editing charts. Create a chart only when it improves comparison, trend, distribution, ranking, progress, or relationship understanding.

Convert CSV or TSV

Use the bundled converter for a clean, typed, filterable workbook:

python <this-skill-directory>/scripts/csv_to_xlsx.py input.csv output.xlsx
python <this-skill-directory>/scripts/csv_to_xlsx.py input.tsv output.xlsx --delimiter tab

The converter infers conservative scalar types, freezes the header, creates a table, applies number formats, and caps column widths. Inspect identifiers and locale-specific dates before accepting inferred types.

Validate and render

Run structural validation after every create or edit operation:

python <this-skill-directory>/scripts/validate_workbook.py output.xlsx

When LibreOffice and a PDF renderer are available, render the workbook:

python <this-skill-directory>/scripts/render_workbook.py output.xlsx rendered

Inspect every rendered page at normal zoom. Check for clipped headers or values, unexpected blank pages, broken charts, unreadable colors, bad page breaks, missing glyphs, formula errors, and content outside the visible area. Rendering does not prove formula correctness; structural and formula validation remain required.

If rendering is unavailable, report that only structural validation was completed. Do not imply that a workbook passed visual QA.

Finish

Deliver only the requested workbook or tabular output unless the user asks for previews or intermediates. Report the output path, important sheets or changes, formula/recalculation status, validation performed, and any limitation involving macros, legacy XLS, unsupported formulas, fonts, or rendering.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.