xlsx

xlsx is a skill for Codex from MrSGSA/math-modeling-skill-dify. It costs 24 tokens per session (940 once invoked), scanned A, original, MIT.

A spreadsheet-handling guide for reading and writing Excel files, including rules for detecting row counts and avoiding accidental treatment of the first data row as column headings.

In plain words
What is it for?
Use it to inspect spreadsheet attachments, validate their rows, create CSV summaries, and write XLSX results when formulas, multiple sheets, or templates must be preserved.
Why use it?
It prevents input data from being changed or misread and requires expected row counts to come from the current task rather than copied assumptions.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to inspect spreadsheet attachments, validate their rows, create CSV summaries, and write XLSX results when formulas, multiple sheets, or templates must be preserved.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mrsgsa/math-modeling-skill-dify/xlsx
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add MrSGSA/math-modeling-skill-dify --skill xlsx
Clone the repo
git clone --depth 1 https://github.com/MrSGSA/math-modeling-skill-dify

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for xlsx

README.md
[![agentmods](https://agentmods.dev/badge/skills/mrsgsa/math-modeling-skill-dify/xlsx.svg)](https://agentmods.dev/skills/mrsgsa/math-modeling-skill-dify/xlsx)
Your own site
<a href="https://agentmods.dev/skills/mrsgsa/math-modeling-skill-dify/xlsx"><img src="https://agentmods.dev/badge/skills/mrsgsa/math-modeling-skill-dify/xlsx.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 940 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.00940
Opus 5 $0.00012 $0.00470
Sonnet 5 $0.00005 $0.00188
Haiku 4.5 $0.00002 $0.00094

Measured 7d ago against content hash f98ad1359d61, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

xlsx scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/read_rows.py, scripts/recalc.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/math-modeling/tools/xlsx/SKILL.md · 90 lines

How it starts

The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Excel 工具

许可:专有;完整条款见 LICENSE.txt

原则

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

读取与写入

import pandas as pd

# 第一行就是数据时必须显式使用 header=None。
data = pd.read_excel("data/input.xlsx", sheet_name=0, header=None)
# 从题目数据合同、附件说明或独立原始计数填写;未知时保留 None 并先完成核验。
expected_rows = None
if expected_rows is None:
    raise ValueError("请先从当前题目建立 expected_rows,不能沿用其他题数值")
if len(data) != expected_rows:
    raise ValueError(f"行数异常: 实际 {len(data)},预期 {expected_rows}")

def write_result_table(names, values, output_path):
    """names/values 必须来自真实运行结果,output_path 必须位于 PROJECT_ROOT。"""
    if len(names) != len(values):
        raise ValueError("方案名与目标值数量不一致")
    result = pd.DataFrame({"方案": names, "目标值": values})
    result.to_excel(output_path, index=False)

禁止依赖 pandas.read_excel() 默认的 header=0 猜测表头,否则第一行数据会被当成列名。未知表头结构或必须精确保留行时使用无隐式推断的读取工具:

from scripts.read_rows import read_excel_rows

expected_rows = None  # 从当前题目合同填写
if expected_rows is None:
    raise ValueError("请先建立当前题目的预期行数")
rows = read_excel_rows(
    "data/input.xlsx",
    header=False,
    expected_rows=expected_rows,
)
# 与原始附件独立抽取的首末行哨兵核对,不能在 Skill 中硬编码某道题的数值。
expected_first_row = None
expected_last_row = None
if expected_first_row is None or expected_last_row is None:
    raise ValueError("请先记录当前附件的首末行哨兵")
if rows[0] != expected_first_row or rows[-1] != expected_last_row:
    raise ValueError("首行或末行哨兵与原始附件不一致")

读取后必须核对首行、末行、原始工作表有效行数和题目声明的记录数;行数不符时立即报错,不得静默继续建模。

使用模板时用 openpyxl.load_workbook() 打开,写入指定单元格后另存新文件。不要删除未知工作表、命名区域、公式或验证规则。

公式重算

openpyxl 不计算公式。修改含公式的工作簿后使用 LibreOffice 隔离重算:

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

工具会:

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

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

检查

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

Read the full file on GitHub · 90 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 90 lines · 24 tokens per session scan A f98ad1359d61

Subscribe to this mod's changes

xlsx is a skill published in the GitHub repository MrSGSA/math-modeling-skill-dify (4 stars, last pushed 1mo ago), licensed MIT. It adds 24 tokens to every session and 940 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.