mcpbeat Sign in

Excel工具 Agent Skill

读取、创建、修改和验证 XLSX,支持模板保留、公式重算和错误检查。

2k tokens
context cost
the whole folder, loaded on every use
4
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
580
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/XiaoMaColtAI/math-modeling-skill --skill Excel工具

The instruction itself

1 sections, as written by the author

Excel 工具

原则

  • 输入表格只读,输出写入 PROJECT_ROOT
  • 普通结果汇总优先 CSV。
  • 题目指定 XLSX、需保留公式、多工作表或模板结构时才使用 XLSX。
  • 不覆盖题目原始附件和 Skill 文件。

读取与写入

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 猜测表头,否则第一行数据会被当成列名。未知表头结构或必须精确保留行时使用无隐式推断的读取工具:

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 隔离重算:

python scripts/recalc.py "<PROJECT_ROOT>/results/结果.xlsx" 60

工具会:

  • 使用唯一临时 LibreOffice 配置;
  • 把重算结果写入临时目录;
  • 检查常见 Excel 错误;
  • 仅在成功后原子替换目标文件;
  • 超时、失败或未生成输出时保留原文件。

DOCX 与 XLSX 共用的 OOXML/LibreOffice 基础代码位于 ../docx/scripts/office/,本工具不再维护重复副本。

检查

  • 公式引用和范围正确。
  • 工作表名、列名、数据类型和单位正确。
  • 已显式声明是否有表头,首行、末行和预期数据行数均已核对。
  • #VALUE!#DIV/0!#REF!#NAME?#NULL!#NUM!#N/A
  • 结果与代码终端输出和论文表格一致。

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take xiaomacoltai/excel工具 from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.