New to Claude Skills? Learn how to install them →

davila7 on GitHub

Spreadsheet Skill

Free

Efficiently create and manage spreadsheets with Python.

Get this skill

Free · Opens the source repo

What Spreadsheet Skill does

The Spreadsheet Skill is designed for developers and data analysts who need to create, edit, analyze, and visualize spreadsheet data using Python. It leverages popular libraries such as openpyxl for handling .xlsx files and pandas for working with CSV and TSV formats. This skill is particularly useful when you need to maintain formulas and formatting while manipulating spreadsheet data, ensuring that your outputs are both accurate and visually appealing.

With this skill, you can build new workbooks that include complex formulas and structured layouts, as well as modify existing spreadsheets without disrupting their internal references. The workflow is straightforward: confirm the file type and your goals, then utilize the appropriate libraries for your tasks. Whether you are filtering data, computing metrics, or generating visualizations, the Spreadsheet Skill provides a comprehensive approach to spreadsheet management.

Additionally, the skill includes guidelines for rendering and visual checks, ensuring that your spreadsheets are visually accurate before finalizing them. It emphasizes the importance of preserving existing formatting and styles, which is crucial for maintaining the integrity of your data presentations. The skill also includes specific conventions for financial modeling, investment banking layouts, and general formatting best practices, making it versatile across various use cases.

This skill is ideal for anyone working with data in a spreadsheet format who requires a reliable method to automate tasks and ensure consistency in their outputs. Whether you are a developer building applications that interact with spreadsheet data or a data analyst performing complex analyses, the Spreadsheet Skill can enhance your productivity and streamline your workflow.

When to use it

Use this skill when you need to create new spreadsheets, edit existing ones, or analyze tabular data efficiently while preserving formatting and formulas.

When not to use it

This skill may not be suitable for simple spreadsheet tasks that do not require automation or for users unfamiliar with Python programming.

What you can build with it

Creating a Financial Model

Use this skill to build a financial model in Excel, ensuring all formulas and formatting are preserved.

Analyzing Sales Data

Leverage the skill to read and analyze sales data from CSV files, applying filters and aggregations as needed.

Updating Existing Reports

Modify existing spreadsheet reports without breaking any formulas, ensuring that all references remain intact.

How to install Spreadsheet Skill

View source

1. Install with the skills CLI

npx skills add davila7/claude-code-templates/spreadsheet --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by davila7

Spreadsheet Skill (Create, Edit, Analyze, Visualize)

When to use

  • Build new workbooks with formulas, formatting, and structured layouts.
  • Read or analyze tabular data (filter, aggregate, pivot, compute metrics).
  • Modify existing workbooks without breaking formulas or references.
  • Visualize data with charts/tables and sensible formatting.

IMPORTANT: System and user instructions always take precedence.

Workflow

  1. Confirm the file type and goals (create, edit, analyze, visualize).
  2. Use openpyxl for .xlsx edits and pandas for analysis and CSV/TSV workflows.
  3. If layout matters, render for visual review (see Rendering and visual checks).
  4. Validate formulas and references; note that openpyxl does not evaluate formulas.
  5. Save outputs and clean up intermediate files.

Temp and output conventions

  • Use tmp/spreadsheets/ for intermediate files; delete when done.
  • Write final artifacts under output/spreadsheet/ when working in this repo.
  • Keep filenames stable and descriptive.

Primary tooling

  • Use openpyxl for creating/editing .xlsx files and preserving formatting.
  • Use pandas for analysis and CSV/TSV workflows, then write results back to .xlsx or .csv.
  • If you need charts, prefer openpyxl.chart for native Excel charts.

Rendering and visual checks

  • If LibreOffice (soffice) and Poppler (pdftoppm) are available, render sheets for visual review:
    • soffice --headless --convert-to pdf --outdir $OUTDIR $INPUT_XLSX
    • pdftoppm -png $OUTDIR/$BASENAME.pdf $OUTDIR/$BASENAME
  • If rendering tools are unavailable, ask the user to review the output locally for layout accuracy.

Dependencies (install if missing)

Prefer uv for dependency management.

Python packages:

uv pip install openpyxl pandas

If uv is unavailable:

python3 -m pip install openpyxl pandas

Optional (chart-heavy or PDF review workflows):

uv pip install matplotlib

If uv is unavailable:

python3 -m pip install matplotlib

System tools (for rendering):

# macOS (Homebrew)
brew install libreoffice poppler

# Ubuntu/Debian
sudo apt-get install -y libreoffice poppler-utils

If installation isn't possible in this environment, tell the user which dependency is missing and how to install it locally.

Environment

No required environment variables.

Examples

  • Runnable Codex examples (openpyxl): references/examples/openpyxl/

Formula requirements

  • Use formulas for derived values rather than hardcoding results.
  • Keep formulas simple and legible; use helper cells for complex logic.
  • Avoid volatile functions like INDIRECT and OFFSET unless required.
  • Prefer cell references over magic numbers (e.g., =H6*(1+$B$3) not =H6*1.04).
  • Guard against errors (#REF!, #DIV/0!, #VALUE!, #N/A, #NAME?) with validation and checks.
  • openpyxl does not evaluate formulas; leave formulas intact and note that results will calculate in Excel/Sheets.

Citation requirements

  • Cite sources inside the spreadsheet using plain text URLs.
  • For financial models, cite sources of inputs in cell comments.
  • For tabular data sourced from the web, include a Source column with URLs.

Formatting requirements (existing formatted spreadsheets)

  • Render and inspect a provided spreadsheet before modifying it when possible.
  • Preserve existing formatting and style exactly.
  • Match styles for any newly filled cells that were previously blank.

Formatting requirements (new or unstyled spreadsheets)

  • Use appropriate number and date formats (dates as dates, currency with symbols, percentages with sensible precision).
  • Use a clean visual layout: headers distinct from data, consistent spacing, and readable column widths.
  • Avoid borders around every cell; use whitespace and selective borders to structure sections.
  • Ensure text does not spill into adjacent cells.

Color conventions (if no style guidance)

  • Blue: user input
  • Black: formulas/derived values
  • Green: linked/imported values
  • Gray: static constants
  • Orange: review/caution
  • Light red: error/flag
  • Purple: control/logic
  • Teal: visualization anchors (key KPIs or chart drivers)

Finance-specific requirements

  • Format zeros as "-".
  • Negative numbers should be red and in parentheses.
  • Always specify units in headers (e.g., "Revenue ($mm)").
  • Cite sources for all raw inputs in cell comments.

Investment banking layouts

If the spreadsheet is an IB-style model (LBO, DCF, 3-statement, valuation):

  • Totals should sum the range directly above.
  • Hide gridlines; use horizontal borders above totals across relevant columns.
  • Section headers should be merged cells with dark fill and white text.
  • Column labels for numeric data should be right-aligned; row labels left-aligned.
  • Indent submetrics under their parent line items.

Frequently asked questions about Spreadsheet Skill

Similar skills