Excel workbooks
Use this Skill for .xlsx and CSV creation, analysis, editing, restructuring, formula work, and export.
Start here
Call skill_view for this Skill and use its baseDirectory; helpers live under /scripts.
Default to a new output file. Inspect workbook sheets, dimensions, formulas, merged cells, names, tables, charts, validations, hidden content, and external links before modifying an existing file.
Core dependency:
python3 -m pip install openpyxl
Formula recalculation and visual rendering may require LibreOffice. Check first and do not silently install dependencies.
Helpers
- xlsx_read.py: inspect workbook values, formulas, styles, structure, and metadata.
- xlsx_create.py: create a workbook from structured JSON.
- xlsx_edit.py: perform targeted cell, range, formula, style, row, column, and sheet edits.
- xlsx_restructure.py: split, merge, normalize, pivot, or reshape tabular data.
- xlsx_recalc.py: recalculate through LibreOffice when available.
- csv_to_xlsx.py and xlsx_to_csv.py: convert formats.
Run helpers through terminal_exec with python3 and an argument array. Use --help for exact options.
python3 <baseDirectory>/scripts/xlsx_read.py input.xlsx --json
python3 <baseDirectory>/scripts/xlsx_create.py spec.json -o output.xlsx
python3 <baseDirectory>/scripts/xlsx_edit.py input.xlsx edits.json -o output.xlsx
python3 <baseDirectory>/scripts/xlsx_recalc.py output.xlsx
For non-trivial data reshaping, read references/restructuring.md through skill_view.
Workflow
- Inspect the workbook and identify the authoritative sheets, headers, formulas, and units.
- Validate source data types and row counts before transforming data.
- Apply the smallest requested edit into a new workbook.
- Re-read formulas and values. Recalculate when the output depends on formula results.
- For visible formatting or charts, export relevant sheets to PDF with LibreOffice, render the pages with the bundled pdf Skill, and inspect them using view_image.
- Return the absolute path plus any assumptions about formulas, locale, dates, or missing recalculation.
Data integrity
- Never invent missing values. Mark unknown data explicitly.
- Preserve formulas unless the user asks to replace them with values.
- Treat hidden sheets, filters, named ranges, validations, macros, and external links as meaningful.
- .xlsx sheet protection is not encryption; do not represent it as secure access control.
- Do not execute workbook macros or refresh untrusted external data sources.
1---2name: xlsx3description: Create, inspect, edit, restructure, recalculate, convert, and visually verify Excel .xlsx workbooks and CSV data.4---56# Excel workbooks78Use this Skill for .xlsx and CSV creation, analysis, editing, restructuring, formula work, and export.910## Start here1112Call skill_view for this Skill and use its baseDirectory; helpers live under <baseDirectory>/scripts.1314Default to a new output file. Inspect workbook sheets, dimensions, formulas, merged cells, names, tables, charts, validations, hidden content, and external links before modifying an existing file.1516Core dependency:1718 python3 -m pip install openpyxl1920Formula recalculation and visual rendering may require LibreOffice. Check first and do not silently install dependencies.2122## Helpers2324- xlsx_read.py: inspect workbook values, formulas, styles, structure, and metadata.25- xlsx_create.py: create a workbook from structured JSON.26- xlsx_edit.py: perform targeted cell, range, formula, style, row, column, and sheet edits.27- xlsx_restructure.py: split, merge, normalize, pivot, or reshape tabular data.28- xlsx_recalc.py: recalculate through LibreOffice when available.29- csv_to_xlsx.py and xlsx_to_csv.py: convert formats.3031Run helpers through terminal_exec with python3 and an argument array. Use --help for exact options.3233 python3 <baseDirectory>/scripts/xlsx_read.py input.xlsx --json34 python3 <baseDirectory>/scripts/xlsx_create.py spec.json -o output.xlsx35 python3 <baseDirectory>/scripts/xlsx_edit.py input.xlsx edits.json -o output.xlsx36 python3 <baseDirectory>/scripts/xlsx_recalc.py output.xlsx3738For non-trivial data reshaping, read references/restructuring.md through skill_view.3940## Workflow41421. Inspect the workbook and identify the authoritative sheets, headers, formulas, and units.432. Validate source data types and row counts before transforming data.443. Apply the smallest requested edit into a new workbook.454. Re-read formulas and values. Recalculate when the output depends on formula results.465. For visible formatting or charts, export relevant sheets to PDF with LibreOffice, render the pages with the bundled pdf Skill, and inspect them using view_image.476. Return the absolute path plus any assumptions about formulas, locale, dates, or missing recalculation.4849## Data integrity5051- Never invent missing values. Mark unknown data explicitly.52- Preserve formulas unless the user asks to replace them with values.53- Treat hidden sheets, filters, named ranges, validations, macros, and external links as meaningful.54- .xlsx sheet protection is not encryption; do not represent it as secure access control.55- Do not execute workbook macros or refresh untrusted external data sources.