anthropics/skills

xlsx

保留可编辑公式,生成并核对真正能用的电子表格

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

xlsx 是什么?

Anthropic 的 xlsx Skill 处理以电子表格为主要输入或交付物的任务:读取、清洗、编辑和生成工作簿,设置公式、格式与图表。它用 openpyxl 处理公式与格式,用 pandas 处理批量数据,并要求对含公式的文件实际重算。

中文说明由本站依据来源整理;英文原文保留在页面下方。

适合用在

  • 修改已有Excel、整理CSV/TSV,或生成随输入变化而更新的预算、报价和统计表。

这些情况不适合

  • 主要交付Word、HTML报告或Google Sheets API集成的任务;不能因为出现表格数据就当成同一个流程。
  • 用Python算完数字后全写成常量,导致用户改输入后结果不再更新。
按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 xlsx,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 xlsx

请在 Codex 的当前工作环境中安装并检查 xlsx 这个 Skill。

项目身份:anthropics/skills / xlsx
来源:https://github.com/anthropics/skills/blob/e4bb5d960d87126ff3b3a8af1a104b7db67560ba/skills/xlsx/SKILL.md
已定位的源文件:skills/xlsx/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 提供原工作簿或原始数据、准确的工作表名与列名,以及允许修改的输入区域。运行环境需实际可用的 openpyxl、pandas;公式重算需附带的 scripts/recalc.py 与LibreOffice。

会得到什么

  • 保留公式、具有合适数字格式的电子表格,以及真实重算结果、未计算函数和必要假设。

实际使用顺序

  1. 先读取结构和约定。已有模型分别用默认加载读取公式、data_only=True读取缓存值;后者不能直接保存为最终文件,否则公式会变成常量。
  2. 只改用户授权的输入区,保留原公式与样式;新建表把假设值放入可见、带标签的单元格,用公式引用它们,并给使用者简短填写说明。
  3. 写出后对含公式的文件运行 python scripts/recalc.py output.xlsx;检查返回JSON的status、error与not_computed,不能只看进程退出码。
  4. 先核对少量代表公式是否引用正确,再检查整表错误、数字格式与图表。重算没有错误只证明公式可计算,不证明业务逻辑或引用范围正确。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

使用 anthropics/skills 的 xlsx 新建 quote.xlsx,工作表名为“报价”。列为项目、数量、单价、小计;数据A/2/100、B/1/350、C/3/80。小计和总价必须用Excel公式,不写死计算结果,金额显示两位小数;标清用户可改的数量与单价。生成后运行来源的重算脚本,检查代表单元格和总价,分别报告计算结果与未能验证的部分。
预期结果

预期公式小计为200、350、240,总价790;更改数量或单价后结果应重算。此为教学示例,本站未实际生成或重算。

使用前先看这些限制

使用条件与边界

  • 来源说明部分新版Excel函数与外部工作簿链接无法被其LibreOffice环境计算;这些要单列,不能以0或旧值伪装成新结果。
  • .xlsm需保留VBA;openpyxl保存某些图形、文本框和切片器可能丢失,编辑前应检查文件结构并选择处理方式。
针对这个 Skill 的疑问

常见问题

为什么刚生成的公式单元格读取为None?

openpyxl写入的是公式字符串,没有生成缓存值。来源要求先重算,再读取缓存结果;不能因此把公式全部替换成Python计算值。

recalc.py退出码为0就能交付吗?

不能。来源说明 errors_found 也可能退出0,应检查JSON里的status、total_errors和not_computed,并核对实际引用是否符合任务。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-17T10:48:38.510Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

skills/xlsx/SKILL.md · 抓取时间 2026-11-17T10:48:38.510Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Use 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 .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

查看源文件章节 / Source sections
  • 原文:XLSX creation, editing, and analysis
  • 原文:Requirements for every output
  • 原文:Recalculate (mandatory whenever the file contains formulas)
  • 原文:Choosing formulas that survive verification
  • 原文:openpyxl gotchas
  • 原文:Financial models
  • 原文:Dependencies
原文:XLSX creation, editing, and analysis

| Task | Approach | |---|---| | **Create** or **edit** with formulas/formatting | `openpyxl` — see gotchas below | | **Bulk data** in or out | `pandas` (`read_excel`, `to_excel`) | | **Quick look** at a sheet | `markitdown file.xlsx` — `## SheetName` per sheet; reads `.xlsm` too. No cell coordinates, so don't plan edits from it | | **Read** a model (formulas *and* values) | two `load_workbook` passes — see gotchas | > `openpyxl`, `pandas`, and `markitdown` are preinstalled — do not run `pip install` first; write the script and import directly. Only if an import fails (or the `markitdown` command is missing): `pip install` the missing package. > Script paths below are relative to this skill's directory.

原文:Requirements for every output

- **Professional font** (Arial, Times New Roman) throughout, unless the user says otherwise. - **Zero formula errors.** Never ship while `recalc.py` reports `errors_found`; the one exception is under `not_computed` below. If you think an error predates you, prove it: load the *original* with `data_only=True` and look at that cell. An error you introduced looks exactly like one you inherited. - **Use formulas, never hardcoded results.** Write `sheet['B10'] = '=SUM(B2:B9)'`, not the Python-computed total. The sheet must recalculate when its inputs change. - **Follow the user's spec literally.** Exact tab names, exact column headers, and the formula they spelled out. A redesign that computes something else fails, however elegant. - **Document every assumption and hardcoded number** where the reader will see it — a cell comment, or an adjacent cell at a table's end. Cite a real source when one exists (`Source: Company 10-K, FY2024, Page 45, Revenue Note, [SEC EDGAR URL]`); when the number came from the user, say so plainly. - **A workbook *you create* for someone to fill in** needs a short legend naming which cells to edit, and one example row of realistic values showing the expected format. Never add such a row to a file you were asked to edit. - **Editing an existing file: match its conventions exactly.** They override every guideline here. Find its designated input cells first — a distinct font color, fill, or shading marks them — write only there, and leave every existing formula untouched.

原文:Recalculate (mandatory whenever the file contains formulas)

openpyxl writes formulas as strings with **no cached values**. Until you recalculate, every formula cell reads back as `None` to anything reading cached values — `pandas`, `load_workbook(data_only=True)`, and most previewers. ```bash python scripts/recalc.py output.xlsx [timeout_seconds] # default 30 ``` LibreOffice computes the formulas **on a copy**, only their values go into your file, and you get JSON: `status` (`success` | `errors_found`), `total_formulas`, `total_errors`, and an `error_summary` naming up to 100 cells per error type (`locations_truncated` says how many it withheld — trust `total_errors`, not the length of the list). Fix what it names and run it again. **JSON with an `error` key instead of a `status` means nothing was recalculated**, and only that case exits non-zero — `errors_found` exits 0, so never treat a clean exit as a clean workbook. **A green recalc proves your formulas *evaluate*, not that they are *right*.** An off-by-one range or a reference to the wrong row yields a clean, error-free file with wrong numbers. Write 2–3 formulas first and check they pull the values you expect, before building out a grid. **`not_computed` lists formulas LibreOffice cannot evaluate, even on `success`**: a function it lacks (`_xlfn.XLOOKUP`, `_xlfn.LET`…) or a link to another workbook (`='[1]Returns Analysis'!$B$2`). They keep what they held: after an openpyxl save, nothing until Excel opens it. For their numbers sooner, read the original with `data_only=True`; keep the formulas. A sound formula depending on a listed one, directly or not, reports `#NAME?` too: leave it and tell the user. A cell that tests one (`IFERROR(B1,0)`) gets LibreOffice's fallback, and a kept value may be stale: say so. After editing sheet XML, delete each changed formula's `<v>`: a mistake that keeps its value is listed, not reported.

原文:Choosing formulas that survive verification

LibreOffice implements fewer functions than Excel, and a formula it cannot evaluate has no value until Excel opens the file. - **Prefer Excel-2007-era functions** — `SUMIFS`, `INDEX`, `MATCH`, `IFERROR`, `SUMPRODUCT` — which need no prefix. - **Six post-2007 functions work, but only with an `_xlfn.` prefix**, because openpyxl writes your formula into the XML verbatim and Excel stores post-2007 names prefixed (its UI hides the prefix): `_xlfn.TEXTJOIN`, `_xlfn.CONCAT`, `_xlfn.IFS`, `_xlfn.SWITCH`, `_xlfn.MAXIFS`, `_xlfn.MINIFS`. Written bare, each yields `#NAME?`. - **Never use `XLOOKUP`, `XMATCH`, `SORT`, `FILTER`, `UNIQUE`, or `SEQUENCE`.** The runtime's LibreOffice cannot evaluate them, and one that can fills only the top-left cell of their result, since an openpyxl-written file has no spill metadata. Use `INDEX`/`MATCH` for lookups, and sort, filter, and de-duplicate in Python before writing the cells. - A missing `)` is reported as `unbalanced brackets`. Too few arguments (`=ROUND(A1)`) is not: LibreOffice returns a value, and Excel may offer to repair the file.

原文:openpyxl gotchas

- **Reading a model takes two loads.** `data_only=True` yields cached values with the formulas gone; the default yields formula strings with no values. One pass cannot give you both. - **`data_only=True` is destructive if you save.** That workbook has no formulas left, so saving replaces every one with a literal — permanently. - **`data_only=True` on a file openpyxl just wrote returns `None` everywhere** — run `recalc.py` first. (A formula whose result is `""` also reads back as `None`.) - **Merged cells: write the top-left anchor only.** Every other cell in the range is a `MergedCell` whose `.value` is read-only. - **`.xlsm` loses its macros unless you pass `keep_vba=True`** to `load_workbook`. - **A sheet name containing a space must be quoted** in a cross-sheet reference: `='Assumptions Inputs'!$B$5`. Unquoted, it evaluates to `#VALUE!`. - **Saving an upload drops its text boxes, shapes and slicers.** First search `xl/drawings/` for `<xdr:sp ` (with the space) and look for an `xl/slicers/` part; if found, tell the user or edit the sheet XML directly. - **Nothing mends a malformed workbook**: an unclosed quote in a number format (`'0.00 "USD'`), a defined name starting with `=`, or duplicate or empty table headers are saved as written, and Excel may offer to repair the file. - **Partly bold or italic cell text is flattened** unless `load_workbook(rich_text=True)`; such a `.value` is then a `CellRichText`, not a `str`. - **Every new formula needs its own `number_format`** (date, %, currency): nothing infers it, so a date shows as `45337` and 30% as `0.3`. - **On every new chart set `chart.roundedCorners = False`, `.overlay = False` on its legend and on each title you gave it (`chart.legend`, `chart.title`, `chart.x_axis.title`…), and, if it has axes (not pie or doughnut), `chart.x_axis.delete = False` and `chart.y_axis.delete = False`**, or Excel may draw the title or legend over the plot, round the frame, or draw no axes. - **With a `DateAxis`, set `chart.y_axis.crossAx = 500`**, or Excel may offer to repair the file.

原文:Financial models

Unless the user says otherwise, or the existing file already does something else. **Color:** blue text (`0,0,255`) for hardcoded inputs and scenario levers · black for formulas · green (`0,128,0`) for links to another sheet · red (`255,0,0`) for links to another file · yellow fill (`255,255,0`) for key assumptions and cells the user should fill in. **Numbers:** currency `$#,##0`, with the unit named in the header (`Revenue ($mm)`) · zeros render as `-`, including in percentages (`$#,##0;($#,##0);-`) · negatives in parentheses · percentages `0.0%`, **stored as fractions** (`0.15` renders `15.0%`; storing `15` renders `1500.0%`) · valuation multiples `0.0x` · years as text (`"2024"`, never `2,024`). **Structure:** every assumption in its own labeled cell, referenced by the formulas that use it (`=B5*(1+$B$6)`, never `=B5*1.05`) · formulas consistent across every projection period, since a lone edited cell mid-row is the commonest silent error · guard denominators that can be zero.

文件 SHA256:f32b1c2b5d5d31e02964df110d6489613d9345f86830c118cfe24159d8448ce6

仓库许可证记录:未提供;skill-declaration-captured-not-interpreted,查看来源。

Skills.sh收录简介 · 2026-07-28

Use 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…

查看历史简介来源

这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。

历史收录数据

Skill标识xlsx
来源仓库anthropics/skills
榜单快照2026-07-28
榜单口径Skills.sh累计安装量
快照名次183
快照累计安装量142283

历史资料说明

  • 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
  • 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。

此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源