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-formatgit 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-format)<a href="https://agentmods.dev/skills/yuyy2004/excel-skills/excel-format"><img src="https://agentmods.dev/badge/skills/yuyy2004/excel-skills/excel-format/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-format"><img src="https://agentmods.dev/badge/skills/yuyy2004/excel-skills/excel-format.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.00198 | $0.02829 |
| Opus 5 | $0.00099 | $0.01414 |
| Sonnet 5 | $0.00040 | $0.00566 |
| Haiku 4.5 | $0.00020 | $0.00283 |
Grade A, and why
excel-format 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 — 263 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 complete Requirement Parsing→Scout before execution, and Verify after. 本技能遵循 [[excel-safe-workflow]] 四步法。执行前必须完成 需求解析→勘察,执行后验证。
Excel Format Adjustment / Excel 格式调整
第零步:需求解析
自动识别格式需求 / Auto-detect Format Requirements
从用户原话提取所有已明确的格式参数,只追问没说到的。
| 要素 | 常见表述 | 默认值 |
|---|---|---|
| 字体 | "微软雅黑""Arial""Times New Roman" | 不改变 |
| 字号 | "12号""10pt""大一点" | 不改变 |
| 加粗 | "加粗""粗体""bold" | 不改变 |
| 斜体 | "斜体""italic" | 不改变 |
| 颜色 | "红色""蓝色""#FF0000" | 不改变 |
| 水平对齐 | "居中""靠左""靠右""两端对齐" | 不改变 |
| 垂直对齐 | "上下居中""顶部对齐""底部对齐" | 不改变 |
| 列宽 | "列宽15""自适应""自动调整宽度" | 不改变 |
| 行高 | "行高20""自适应" | 不改变 |
| 应用范围 | "表头""全部""E列""第2-10行""数据区" | all(整表) |
解析示例
| 用户说 | 提取 |
|---|---|
| "表头加粗居中,字体改成微软雅黑 12号" | 范围=表头, 加粗, 水平居中, 字体=微软雅黑, 字号=12 |
| "全部改成 Arial 10号,金额列右对齐" | 范围=全部+金额列, 字体=Arial, 字号=10, 金额列=右对齐 |
| "标题行加粗,数据区垂直居中" | 表头=加粗, 数据区=垂直居中 |
| "列宽全部自适应" | 全部列, 自适应列宽 |
| "把表格美化一下" | 全部, 用默认美化方案 |
默认美化方案(用户只说"美化"时启用)/ Default Beautify Preset
| 区域 | 格式 |
|---|---|
| 表头(第1行) | 加粗、水平居中、垂直居中、Arial 10pt |
| 数据区(第2行起) | 垂直居中、Arial 10pt |
| 所有列 | 自适应列宽 |
第一步:勘察
import os, sys
sys.stdout.reconfigure(encoding='utf-8')
from openpyxl import load_workbook
FILE = '目标文件.xlsx'
wb = load_workbook(FILE)
ws = wb.active
print(f'工作表: {ws.title}, 行: {ws.max_row}, 列: {ws.max_column}')
# 展示当前样式状态
print('\n=== 当前格式 ===')
for col_idx in range(1, min(ws.max_column + 1, 8)):
cell = ws.cell(row=1, column=col_idx)
col_letter = chr(64 + col_idx) if col_idx <= 26 else f'col{col_idx}'
print(f' 列{col_letter}表头: font={cell.font.name}/{cell.font.size}, '
f'bold={cell.font.bold}, align={cell.alignment.horizontal}')
# 确认操作范围
print(f'\n格式应用范围: {SCOPE}')
print(f'格式参数: {FORMAT_SPEC}')
第二步:执行
import time
t0 = time.time()
from openpyxl import load_workbook
from openpyxl.styles import Font, Alignment, PatternFill
# ===== 用户配置 =====
FILE = '目标文件.xlsx'
SCOPE = 'all' # 'all' / 'header' / 'data' / 'columns' / 'rows' / 'range'
# 字体配置(None = 不改变)
FONT_NAME = 'Arial' # None 或字体名
FONT_SIZE = 10 # None 或数字
FONT_BOLD = None # True / False / None
FONT_ITALIC = None # True / False / None
FONT_COLOR = None # 'FF0000'(红) / '000000'(黑) / None
# 对齐配置(None = 不改变)
H_ALIGN = None # 'center' / 'left' / 'right' / 'justify' / None
V_ALIGN = None # 'center' / 'top' / 'bottom' / None
# 列宽行高(None = 不改变)
COL_WIDTH = None # 数字 或 'auto'(自适应)
ROW_HEIGHT = None # 数字 或 'auto'
# 范围限定
HEADER_ROW = 1 # 表头行号
DATA_START = 2 # 数据起始行
TARGET_COLS = None # None=全部列, [1,2,5]=指定列
TARGET_ROWS = None # None=全部行(配合SCOPE), [(2,10)]=指定行范围
# ====================
wb = load_workbook(FILE)
ws = wb.active
def build_font():
"""构建字体对象"""
kwargs = {}
if FONT_NAME is not None: kwargs['name'] = FONT_NAME
if FONT_SIZE is not None: kwargs['size'] = FONT_SIZE
if FONT_BOLD is not None: kwargs['bold'] = FONT_BOLD
if FONT_ITALIC is not None: kwargs['italic'] = FONT_ITALIC
if FONT_COLOR is not None: kwargs['color'] = FONT_COLOR
return Font(**kwargs) if kwargs else None
def build_alignment():
"""构建对齐对象"""
kwargs = {}
if H_ALIGN is not None: kwargs['horizontal'] = H_ALIGN
if V_ALIGN is not None: kwargs['vertical'] = V_ALIGN
return Alignment(**kwargs) if kwargs else None
new_font = build_font()
new_align = build_alignment()
# 确定操作范围
cols_to_process = TARGET_COLS if TARGET_COLS else list(range(1, ws.max_column + 1))
if SCOPE == 'all':
rows_to_process = range(1, ws.max_row + 1)
elif SCOPE == 'header':
rows_to_process = [HEADER_ROW]
elif SCOPE == 'data':
rows_to_process = range(DATA_START, ws.max_row + 1)
elif SCOPE == 'columns':
rows_to_process = range(1, ws.max_row + 1)
elif SCOPE == 'rows':
rows_to_process = TARGET_ROWS if TARGET_ROWS else range(1, ws.max_row + 1)
# 应用格式
count = 0
for row in rows_to_process:
for col in cols_to_process:
cell = ws.cell(row=row, column=col)
if new_font:
# 合并现有字体属性(只覆盖指定项)
existing = cell.font
kwargs = {'name': FONT_NAME if FONT_NAME else existing.name,
'size': FONT_SIZE if FONT_SIZE else existing.size,
'bold': FONT_BOLD if FONT_BOLD is not None else existing.bold,
'italic': FONT_ITALIC if FONT_ITALIC is not None else existing.italic,
'color': FONT_COLOR if FONT_COLOR else existing.color}
cell.font = Font(**kwargs)
if new_align:
cell.alignment = new_align
count += 1
if row % 50000 == 0:
print(f' 进度: {row}/{ws.max_row}')
print(f'已格式化 {count} 个单元格')
# 列宽
if COL_WIDTH == 'auto':
# 用 pandas 快速计算每列最大宽度(比 openpyxl 逐格扫快 100 倍)
import pandas as pd, numpy as np
from openpyxl.utils import get_column_letter
df = pd.read_excel(FILE)
for col_idx in cols_to_process:
col_name = df.columns[col_idx - 1]
# 取前 5000 行 + 随机抽样 1000 行估算最大宽度
sample = df[col_name].dropna().head(5000).astype(str)
if len(sample) == 0:
continue
# 中文字符算 2 宽度,其余算 1
def char_width(s):
return sum(2 if ord(c) > 127 else 1 for c in str(s))
max_len = sample.apply(char_width).max()
# 表头也参与计算
header_len = char_width(str(col_name))
max_len = max(max_len, header_len)
col_letter = get_column_letter(col_idx)
ws.column_dimensions[col_letter].width = min(max_len + 3, 50)
elif COL_WIDTH is not None:
from openpyxl.utils import get_column_letter
for col_idx in cols_to_process:
ws.column_dimensions[get_column_letter(col_idx)].width = COL_WIDTH
# 行高
if ROW_HEIGHT == 'auto':
for row in rows_to_process:
ws.row_dimensions[row].height = None # Excel 自动计算
elif ROW_HEIGHT is not None:
for row in rows_to_process:
ws.row_dimensions[row].height = ROW_HEIGHT
print(f'\n保存中...')
wb.save(FILE)
print(f'完成,耗时 {time.time()-t0:.1f}s')
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 · 263 lines · 198 tokens per session scan A 68dc7ce82d6b
excel-format is a skill published in the GitHub repository YuYY2004/excel-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 198 tokens to every session and 2,829 once invoked, about $0.0010 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"…