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.
npx skills add YuYY2004/excel-skills --skill excel-sortgit clone --depth 1 https://github.com/YuYY2004/excel-skillsWrote 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.
[](https://agentmods.dev/skills/yuyy2004/excel-skills/excel-sort)<a href="https://agentmods.dev/skills/yuyy2004/excel-skills/excel-sort"><img src="https://agentmods.dev/badge/skills/yuyy2004/excel-skills/excel-sort/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/yuyy2004/excel-skills/excel-sort"><img src="https://agentmods.dev/badge/skills/yuyy2004/excel-skills/excel-sort.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00114 | $0.01898 |
| Opus 5 | $0.00057 | $0.00949 |
| Sonnet 5 | $0.00023 | $0.00380 |
| Haiku 4.5 | $0.00011 | $0.00190 |
Grade A, and why
excel-sort 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 9d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 182 lines — stays where its author put it; the contents beside it link to each section on GitHub.
This skill follows [[excel-safe-workflow]] four-step method. Must scout and confirm sort column and range before execution, and verify correct order after. 本技能遵循 [[excel-safe-workflow]] 四步法。执行前必须勘察确认排序列和范围,执行后验证顺序正确。
Excel Sort / Excel 排序
第零步:需求解析
| 要素 | 常见表述 | 默认值 |
|---|---|---|
| 排序列 | "按公开日排序""E列排序" | 必须明确 |
| 方向 | "从小到大""升序""asc" → asc;"从大到小""降序""desc" → desc | asc |
| 多列排序 | "先按A列再按B列" | 按优先级排列 |
| 数据范围 | 默认包含表头行(第1行),自动识别数据区 | 有表头 |
解析示例
| 用户说 | 提取 |
|---|---|
| "按公开日升序排列" | 列=公开日, asc |
| "按金额从大到小排序" | 列=金额, desc |
| "先按类别排,再按日期排" | 列=[类别,日期], 默认asc |
第一步:勘察
from openpyxl import load_workbook
FILE = '目标文件.xlsx'
wb = load_workbook(FILE)
ws = wb.active
print(f'{ws.max_row}行 x {ws.max_column}列')
# 定位排序列
print('\n=== 表头 ===')
for col_idx in range(1, ws.max_column + 1):
h = ws.cell(row=1, column=col_idx).value
if h:
print(f' 列{col_idx}: {h}')
# 确认数据类型
sort_col = None # 排序列号
print(f'\n排序列数据样本:')
for row in [2, 3, 4, ws.max_row // 2, ws.max_row]:
v = ws.cell(row=row, column=sort_col).value
print(f' 行{row}: {type(v).__name__} = {repr(v)[:40]}')
wb.close()
第二步:执行
策略:大文件统一走「读格式→pandas处理→刷回格式」三步。
import pandas as pd
from openpyxl import load_workbook
from openpyxl.styles import Font, Alignment, PatternFill
from copy import copy
FILE = '目标文件.xlsx'
SORT_COLS = [('列名或列号', 'asc')] # asc/desc
HEADER_ROW = 1
# ====== 第一步:读取格式 ======
print('① 读取格式...')
wb = load_workbook(FILE)
ws = wb.active
header_formats, data_formats, col_widths = {}, {}, {}
for col in range(1, ws.max_column + 1):
header_formats[col] = {
'font': copy(ws.cell(row=HEADER_ROW, column=col).font),
'alignment': copy(ws.cell(row=HEADER_ROW, column=col).alignment),
'fill': copy(ws.cell(row=HEADER_ROW, column=col).fill),
}
data_formats[col] = {
'font': copy(ws.cell(row=HEADER_ROW + 1, column=col).font),
'alignment': copy(ws.cell(row=HEADER_ROW + 1, column=col).alignment),
'fill': copy(ws.cell(row=HEADER_ROW + 1, column=col).fill),
}
col_letter = chr(64 + col) if col <= 26 else ''
if col_letter and col_letter in ws.column_dimensions:
col_widths[col] = ws.column_dimensions[col_letter].width
freeze = ws.freeze_panes
col_names = [ws.cell(row=HEADER_ROW, column=c).value for c in range(1, ws.max_column + 1)]
wb.close()
# ====== 第二步:pandas 排序 ======
print('② 排序...')
df = pd.read_excel(FILE)
# 列名归一化
sort_by = []
ascending = []
for spec, direction in SORT_COLS:
name = col_names[spec - 1] if isinstance(spec, int) else spec
sort_by.append(name)
ascending.append(direction == 'asc')
df = df.sort_values(by=sort_by, ascending=ascending)
print(f'已排序: {list(zip(sort_by, ["asc" if a else "desc" for a in ascending]))}')
# ====== 第三步:写回 + 轻量格式 ======
print('③ 写回并恢复关键格式...')
df.to_excel(FILE, index=False)
wb = load_workbook(FILE)
ws = wb.active
# 核心格式(始终恢复,秒级)
for col in range(1, ws.max_column + 1):
cl = chr(64 + col) if col <= 26 else ''
if col in header_formats:
hf = header_formats[col]
c = ws.cell(row=HEADER_ROW, column=col)
c.font, c.alignment, c.fill = hf['font'], hf['alignment'], hf['fill']
if cl and col in col_widths and col_widths[col]:
ws.column_dimensions[cl].width = col_widths[col]
# 数据格式:仅小文件(<1万行)逐格恢复
if ws.max_row <= 10000 and data_formats:
for row in range(HEADER_ROW + 1, ws.max_row + 1):
for col in range(1, ws.max_column + 1):
if col in data_formats:
df2 = data_formats[col]
c = ws.cell(row=row, column=col)
c.font, c.alignment, c.fill = df2['font'], df2['alignment'], df2['fill']
if freeze: ws.freeze_panes = freeze
wb.save(FILE)
print('完成')
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.
- 9d ago First seen · 182 lines · 114 tokens per session scan A ab96c6b6ef39
excel-sort is a skill published in the GitHub repository YuYY2004/excel-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 114 tokens to every session and 1,898 once invoked, about $0.0006 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.
Other skills, from other repositories
spreadsheets
Use when creating, reading, or fixing spreadsheets (.xlsx, .csv). Covers formulas, formatting, charts, data cleaning, and handling the messy real-world files that are not actually tabular.
Excel工具
A guide for using Excel tools to read, write, and recalculate spreadsheet files. It includes a rule for treating the first row as data when a spreadsheet has no column headings.
huashu-data-pro
All-in-one data analysis and productivity assistant. Covers end-to-end workflows for data processing, analytical insights, report writing, PPT creation, and data visualisation. Always approaches tasks from an expert perspective — thinks one step ahead for the user. Proactively confirms with the user when uncertain.…
xlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or…
thinkcell
Generate, update, and automate think-cell charts and elements in PowerPoint and Excel. Use ANY time the user mentions think-cell, thinkcell, or .ppttc files, or asks to create/update PowerPoint charts following think-cell conventions (waterfall, Mekko, stacked column, Gantt, Harvey ball, scatter/bubble, etc.) …
bug-report-writer
Converts rough notes, casual descriptions, console errors, or quick observations into professional, complete bug reports — exported as a formatted Excel (.xlsx) file ready for Excel, Google Sheets, Jira, or Azure DevOps. Use this skill whenever the user mentions: "write a bug report", "log a bug", "report this issue"…