document-skills-xlsx
Read, edit, create, or fix spreadsheet files - .xlsx, .xlsm, .xltx, .csv, .tsv. Use this Skill whenever a spreadsheet is the primary input or output: opening…
от MiniMax-AI★ 30 звёзд на GitHub
Установить document-skills-xlsx в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
XLSX workbench
Spreadsheets are where agents do the most damage by being clever: pasted values where formulas
belong, dates written as text, whole-number floats displayed as 3.0000000001. Follow the
contracts below.
Step 0 - Check the toolchain
python -c "import defusedxml, openpyxl; print(openpyxl.__version__, defusedxml.__version__)"
.csv/.tsv-> standard librarycsvmodule is fine and often better (streaming)..xlsx/.xlsm/.xltx-> openpyxl.- Safe package preflight requires
defusedxml==0.7.1; do not fall back to the standard XML parser for untrusted OOXML parts. - Macro preservation: openpyxl keeps VBA in
.xlsmonly withkeep_vba=Trueon load and save. - Before any
openpyxl.load_workbook()of an existing package, copy and use the bounded same-handle loader in references/package.md.read_only=Truedoes not bound shared strings, styles, or other package parts parsed during initialization.
Step 1 - Classify the task
| Request | Route |
|---|---|
| Open, inspect, profile a workbook | references/read.md |
| Edit cells, add sheets, fix formatting | references/edit.md |
| Build a new workbook (data + formulas + chart) | references/create.md |
| CSV/TSV in or out, messy data cleanup | references/csv.md |
| Conditional formatting, structured tables, pivot-style aggregation | references/formatting.md |
| Safely open an existing OOXML package | references/package.md |
Step 2 - Contracts that always apply
- Formulas are formulas. If the user asks for a total/average/lookup, write
=SUM(B2:B10)in the cell - never the computed number - unless the user explicitly asked to freeze values. openpyxl writes the formula; Excel/WPS/LibreOffice calculate on open. data_only=Truereads cached values (last calculated by a real app) and loses formulas on save. Use it only for reading values; never load, edit, and save with it.- Types: write
int/float/datetime/bool, never formatted strings. Dates go in asdatetimewithnumber_format='yyyy-mm-dd'; currency as float plusnumber_format='#,##0.00'(or the locale-appropriate currency format string). - Formulas are not recalculated by openpyxl. After writing formulas, set
wb.calculation.fullCalcOnLoad = Truebefore saving so Excel/WPS/LibreOffice recalculate on open even when the workbook (typically one you loaded, which can carryfullCalcOnLoad=False) uses calculation modemanual- checkwb.calculation.calcMode. You still cannot read results back without opening the file in a real spreadsheet app; verify formula strings and ranges structurally instead (see postcheck). - Dimensions: treat
<dimension>,ws.max_row, andws.max_columnas untrusted hints. Discover logical cells with the sparse worksheet-XML scan in the read route; never expand an unknown rectangular range merely to find its bounds. - Save to a new path first; overwrite only on explicit request.
Step 3 - Postcheck (mandatory)
Save this as postcheck.py, copy load_validated_workbook() and its dependencies from
references/package.md, then pass the output path followed by every
sheet the task should produce, for example python postcheck.py output.xlsx Sales Summary:
import openpyxl
import sys
if len(sys.argv) < 3:
raise SystemExit("usage: python postcheck.py OUTPUT.xlsx EXPECTED_SHEET [...]")
output_path, *expected_sheets = sys.argv[1:]
# Populate this whenever the task requested specific display formats.
expected_number_formats = {
# "Sales": {"D2": "#,##0.00", "E2": "yyyy-mm-dd"},
}
# Populate every formula the task intends to create or preserve.
expected_formulas = {
# "Sales": {"D2": "=C2*1.08"},
}
# Populate every expected sheet with the exact used range required by the task.
expected_dimensions = {
# "Sales": "A1:E20",
# "Summary": "A1:C8",
}
wb = load_validated_workbook(output_path)
def require(condition, message):
if not condition:
raise ValueError(message)
def formula_text(value):
if isinstance(value, str):
return value
if text := getattr(value, "text", None):
return text
fields = ("ref", "r1", "r2", "dt2D", "dtr", "ca", "del1", "del2")
details = ", ".join(
f"{name}={getattr(value, name)!r}" for name in fields if hasattr(value, name)
)
return f"{type(value).__name__}({details})"
print("sheets:", wb.sheetnames)
missing = set(expected_sheets) - set(wb.sheetnames)
require(not missing, f"missing expected sheets: {sorted(missing)}")
require(
set(expected_dimensions) == set(expected_sheets),
"expected_dimensions must declare the exact used range for every expected sheet",
)
calc = wb.calculation
print("calcMode:", getattr(calc, "calcMode", None),
"full
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/create.md
- references/csv.md
- references/edit.md
- references/formatting.md
- references/package.md
- references/read.md
FAQ
Что делает скилл document-skills-xlsx?
Read, edit, create, or fix spreadsheet files - .xlsx, .xlsm, .xltx, .csv, .tsv. Use this Skill whenever a spreadsheet is the primary input or output: opening and inspecting workbooks, editing cells or adding sheets, writing real formulas instead of pasted values, cleaning messy data, adding charts and formatting, converting between tabular formats, or diagnosing corrupted or slow-opening files.
Как установить скилл document-skills-xlsx?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл document-skills-xlsx запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…