kaalia0912/dsh-data-analysis-mode/xlsx-tools
Claude Code and agent skill by kaalia0912/dsh-data-analysis-mode
- community
Checking that the SKILL.md file is still in the repository.
Excel 工作簿(.xlsx/.xlsm)的读取、写入与报表制作(原创技能,MIT):openpyxl/pandas 读写、公式重算(优先 Excel COM,无 Excel 则 LibreOffice)、样式与基础图表。当任务是处理 Excel 文件、生成表格报表、导出数据时加载。Read, write and recalculate Excel workbooks (.xlsx/.xlsm) — openpyxl and pandas I/O, formula recalculation through Excel COM with a LibreOffice fallback, styling and basic charts. Load when a task involves Excel files, spreadsheet reports, or data export.
Install
npx vskill@latest install kaalia0912/dsh-data-analysis-mode/xlsx-toolsSKILL.md
xlsx-tools — Excel 工作簿处理
本技能覆盖 Excel 文件的常用处理路径。与 data-analysis(分析工作流)和 pandas-3x(pandas 技巧)配合使用。
读写路径选择
| 任务 | 工具 | |
|---|---|---|
| 批量读写(整表) | pandas.read_excel / to_excel(快,样式少) | |
| 精细控制(单元格、样式、合并、公式) | openpyxl(load_workbook / Workbook) | |
| 快速预览 | pandas.read_excel(..., nrows=5) 或 openpyxl 读前几行 | |
| 多 sheet / 大文件 | pd.read_excel(path, sheet_name=None) 一次读全部 sheet |
公式处理(关键坑)
openpyxl 写公式只写文本、不计算结果——用 pandas 或 data_only=True 读取公式单元格会得到 None。所以凡含公式的工作簿,交付前必须重算:
recalc_excel.py 输出 JSON:status(success/errors_found)、total_formulas、total_errors、error_summary(错误类型 → 单元格列表)。只有 `error` 键表示重算失败(exit 1);`errors_found` 正常 exit 0,所以看 status 字段,别只看退出码。
重算通过只证明公式「能算」,不证明「算得对」——写完公式先抽查 2-3 个格子的值再铺开。
常用写法
openpyxl 基础
pandas 批量
样式与合并
基础图表(openpyxl)
Windows 环境注意
- 路径用原生 Windows 形式(
C:\...),写文件统一 UTF-8。 - 中文列名/内容没问题;注意 Excel 读取 CSV 时编码:
pd.read_csv(..., encoding="utf-8-sig")(带 BOM,Excel 双击不乱码)。 - 重算脚本会在结束时自动退出 Excel,正常情况下不会残留进程。不要用 `Stop-Process -Name EXCEL -Force` 强杀 Excel(它会终止本机所有 Excel 实例,用户未保存的工作簿会直接丢失);若确实怀疑有残留实例,先向用户确认再处理。
交付检查清单
- [ ] 含公式的工作簿已重算(
status: success或已处理errors_found指出的单元格) - [ ] 表头加粗、列宽合理、数字格式正确(
#,##0.00等) - [ ] 交付前用
data_only=True抽查几个关键单元格的值 - [ ] 假定与硬编码数字在注释或相邻单元格说明
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/xlsx-tools/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kaalia0912/dsh-data-analysis-mode/xlsx-tools)