xlsx-official
它能做什么
这个技能处理 xlsx、xlsm 和 csv 等电子表格文件,从新建工作簿到修改已有工作簿都可以。适用于处理预算、模型和数据表的人。
适用场景
- ✓当你想创建一个带有公式和合计的新工作簿时。
- ✓当你需要更新、清理或检查已有的电子表格时。
- ✓当你想把表格导出为 CSV 或生成工作簿以便查看时。
技能链接
https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/xlsx-official/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我做一个月度预算工作簿,用公式计算合计。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会选择处理方式:用 openpyxl 或 pandas 新建文件、编辑已有工作簿,或读取数据进行分析。交回结果前会先进行检查。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
XLSX Skill
An Apache-2.0 toolkit for producing, editing, and reading Microsoft Excel
(.xlsx) files. Written from scratch against the public
ECMA-376 / ISO/IEC 29500 (SpreadsheetML)
specification and built on permissively-licensed tooling
(openpyxl MIT, pandas BSD-3-Clause, lxml BSD-3-Clause,
optional xlsxwriter BSD-2-Clause, optional external binary soffice
MPL 2.0) so it can be reused in commercial projects without restriction.
Decision matrix
| Situation | Path | Read first |
|---|---|---|
| Build a workbook from a prompt / dataframe / raw values | Author with openpyxl (formulas + formatting) or pandas (bulk data) |
create.md |
Edit an existing .xlsx — add rows, patch cells, refresh formulas |
Load with openpyxl, preserve formulas & styles |
edit.md |
| Only need to read the data out (analysis, ETL, quick QA) | pandas.read_excel + openpyxl for structural inspection |
read.md |
| Clean, aggregate, or transform tabular data before writing back | pandas pipeline, then hand back to openpyxl for final polish | analyze.md |
| Deep structural edits (custom XML parts, defined names, VBA-free surgery) | Unpack → edit XML → repack | edit.md → Raw XML workflow |
| Recompute formula values before shipping | scripts/bake.py via LibreOffice |
see QA below |
If the task mixes several of these, do them in this order: read → plan → edit/create → recalc → validate.
One-time environment setup
Bundled runtime: when the
MIMO_PYTHONenvironment variable is set, skip the pip installs below — run every command withpython3/uv runreplaced by"$MIMO_PYTHON"(e.g."$MIMO_PYTHON" scripts/overview.py book.xlsx). openpyxl/pandas/lxml/xlsxwriter are preinstalled in that interpreter; pip console scripts are unavailable, so always go through"$MIMO_PYTHON" -m <module>. A bundled LibreOffice (forbake.py/pdf_out.py) is exposed asMIMO_SOFFICEand picked up automatically.
python3 -m pip install --upgrade openpyxl pandas lxml
# Optional but recommended:
python3 -m pip install --upgrade xlsxwriter
# For formula recalc and PDF export:
# macOS brew install --cask libreoffice
# Debian/Ubuntu apt-get install -y libreoffice
Every script under scripts/ uses only the standard library plus openpyxl
and pandas. No proprietary dependencies.
Common commands
# 1. Describe a workbook (sheets, dimensions, formula count, sample rows)
python scripts/overview.py input.xlsx
# 2. Recalculate every formula, then flag any residual #REF! / #DIV/0! / etc.
python scripts/bake.py output.xlsx # default 30s LibreOffice timeout
python scripts/bake.py output.xlsx --timeout 60 # custom timeout
# 3. Validate ZIP integrity, XML well-formedness, and openpyxl load
python scripts/audit.py output.xlsx
# 4. Convert to CSV (one file per sheet, or a single sheet by name/index)
python scripts/csv_out.py input.xlsx out_dir/ # all sheets
python scripts/csv_out.py input.xlsx out.csv --sheet 0 # first sheet
# 5. Convert to PDF for visual QA (needs LibreOffice)
python scripts/pdf_out.py output.xlsx # writes output.pdf next to it
# 6. Unpack an .xlsx into readable XML parts (for surgical edits)
python scripts/explode.py input.xlsx unpacked/
# 7. Repack an unpacked directory into a fresh .xlsx
python scripts/assemble.py unpacked/ output.xlsx
Every script is a small, self-contained Python file. Read the top of the file for full CLI options.
Authoring principles
Excel is a live calculation surface, not a static table renderer. Users open workbooks and expect to change numbers, watch the rest update, and trust what they see. Keep that in mind:
- Use formulas, not hardcoded values. Compute totals with
=SUM(...), not with a Pythonsum()written into the cell. When source data changes, the workbook must recompute itself. - Put assumptions in dedicated input cells. Reference them from formulas
(
=B5*(1+$B$6)), never inline (=B5*1.05). This is the single biggest determinant of whether a model is usable. - One sheet per idea. Inputs on one sheet, calculations on another, output
on a third. Cross-sheet references (
Inputs!B5) make dependencies explicit. - Named styles beat ad-hoc formatting. For anything reused (headers,
常见问题
编辑时会保留我的公式吗?
该技能涵盖编辑已有工作簿,并会保持公式和样式完整。
需要额外的软件吗?
它使用 openpyxl 和 pandas 等 Python 库,如果已安装 LibreOffice,还可以用它来渲染。
它能读取 CSV 吗?
可以。该技能包括读取和导出 CSV 与 TSV 文件。
详情
作者的原始描述
Spreadsheet toolkit. Reach for it whenever the artifact on either side of the conversation is a workbook file — .xlsx, .xlsm, .xltx, .csv, .tsv — and the user wants that artifact produced, changed, cleaned, or read. Typical triggers: 'build me a model', 'update this sheet', 'add a column', 'compute the totals as formulas', 'sanity-check this xlsx', 'export sheet 2 to CSV', 'render the workbook as PDF', 'the spreadsheet in ~/Downloads is a mess, fix it'. Applies equally to financial models, ops reports, data cleanups, and template fills. Skip it when the workbook is only source material and the
repo: XiaomiMiMo/MiMo-Code
热度
- GitHub 星标
- 14k
- 排名
- #11371
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
effect
14k帮你的智能体通过查看源代码和文档来回答关于 Effect TypeScript 框架的问题,而不是依赖记忆。
arxiv
14k帮你的智能体在 arXiv 上搜索、阅读、引用和跟踪学术论文,包括摘要、BibTeX 引用、PDF 下载和引用关系。
claude-code
14k帮你的智能体把编程任务交给 Claude Code 命令行工具,可以是一次性运行、交互式会话或后台任务。
codex
14k帮你的智能体在没有聊天窗口的情况下运行 OpenAI Codex 命令行工具,用于编程任务、脚本和自动化流程。