Excel工具 SKILL.md skillA
Excel工具 from xiaomacoltai/math-modeling-skill is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add xiaomacoltai/math-modeling-skill/Excel工具@git:20260815.5bb9419Pins git:20260815.5bb9419 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- xiaomacoltai/math-modeling-skill
- Path
dsh-plugin/math-modeling-agent/skills/math-modeling/tools/xlsx/SKILL.md- Versions recorded
- 1
- Latest version
- git:20260815.5bb9419, committed Aug 15, 2026
- Size
- 2,325 bytes
- Repository stars
- 1,886
- License
- none declared
读取、创建、修改和验证 XLSX,支持模板保留、公式重算和错误检查。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Excel 工具
## 原则
- 输入表格只读,输出写入 `PROJECT_ROOT`。
- 普通结果汇总优先 CSV。
- 题目指定 XLSX、需保留公式、多工作表或模板结构时才使用 XLSX。
- 不覆盖题目原始附件和 Skill 文件。
## 读取与写入
```python
import pandas as pd
# 第一行就是数据时必须显式使用 header=None。
data = pd.read_excel("data/input.xlsx", sheet_name=0, header=None)
assert len(data) == 7470, f"行数异常: {len(data)}"
result = pd.DataFrame({"方案": names, "目标值": values})
result.to_excel("results/结果.xlsx", index=False)
```
禁止依赖 `pandas.read_excel()` 默认的 `header=0` 猜测表头,否则第一行数据会被当成列名。未知表头结构或必须精确保留行时使用无隐式推断的读取工具:
```python
from scripts.read_rows import read_excel_rows
rows = read_excel_rows(
"data/input.xlsx",
header=False,
expected_rows=7470,
)
assert rows[0][0] == 399.6747
```
读取后必须核对首行、末行、原始工作表有效行数和题目声明的记录数;行数不符时立即报错,不得静默继续建模。
使用模板时用 `openpyxl.load_workbook()` 打开,写入指定单元格后另存新文件。不要删除未知工作表、命名区域、公式或验证规则。
## 公式重算
`openpyxl` 不计算公式。修改含公式的工作簿后使用 LibreOffice 隔离重算:
```powershell
python scripts/recalc.py "<PROJECT_ROOT>/results/结果.xlsx" 60
```
工具会:
1. 使用唯一临时 LibreOffice 配置;
2. 把重算结果写入临时目录;
3. 检查常见 Excel 错误;
4. 仅在成功后原子替换目标文件;
5. 超时、失败或未生成输出时保留原文件。
DOCX 与 XLSX 共用的 OOXML/LibreOffice 基础代码位于 `../docx/scripts/office/`,本工具不再维护重复副本。
## 检查
- 公式引用和范围正确。
- 工作表名、列名、数据类型和单位正确。
…Read the whole file at its exact version.
How to install
mdr add xiaomacoltai/math-modeling-skill/Excel工具@sha256:582e00a939b2d3caThe line at the top of this page pins the label git:20260815.5bb9419, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_apma3kfapps4fovn)
5 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 1 version of this file, committed on Aug 15, 2026.
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (2325 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
xiaomacoltai/math-modeling-skill · 1,886 stars · license none declared · pushed 2026-10-22 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_apma3kfapps4fovn GET https://markdownregistry.com/api/v1/resolve?ref=xiaomacoltai/math-modeling-skill/Excel工具 GET https://markdownregistry.com/api/v1/blob/582e00a939b2d3cadf41a2da4bdfeefcfb8d4a02d8c7b6faab3f5b6a5476e85a
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.
More from xiaomacoltai/math-modeling-skill
Every file in xiaomacoltai/math-modeling-skill