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 Lambenthan/paper-discipline-skills --skill paper-backup-before-wordgit clone --depth 1 https://github.com/Lambenthan/paper-discipline-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/lambenthan/paper-discipline-skills/paper-backup-before-word)<a href="https://agentmods.dev/skills/lambenthan/paper-discipline-skills/paper-backup-before-word"><img src="https://agentmods.dev/badge/skills/lambenthan/paper-discipline-skills/paper-backup-before-word/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/lambenthan/paper-discipline-skills/paper-backup-before-word"><img src="https://agentmods.dev/badge/skills/lambenthan/paper-discipline-skills/paper-backup-before-word.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.00125 | $0.01325 |
| Opus 5 | $0.00063 | $0.00662 |
| Sonnet 5 | $0.00025 | $0.00265 |
| Haiku 4.5 | $0.00013 | $0.00133 |
Grade A, and why
paper-backup-before-word 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 13d 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.
What it actually says
paper-backup-before-word:改 Word 之前必先备份
核心理念
.docx 是个 zip 包。一旦写崩 XML,整份文件打不开,所有批注、修订、格式全部消失。
书里第 8 章记录了两次惨案:一次覆盖原文件、一次 XML 损坏——两次都是没备份。
Word 文件不是文本文件。它的每一次写操作都是一次"打开心脏手术"。
强制规则
编辑任何 .docx 之前必须执行下列三步,缺一不可:
cp创建带时间戳的备份- 评估是否值得"先转 LaTeX 再改"
- 改完后告诉用户"第一件事打开 Word 验证完整性"
触发条件
满足任一条 → 触发:
- 用户请求修改 / 润色 / 改写 / 重排某 .docx 文件
- 用户的指令里出现 "Word"、".docx"、"文档"、"批注"
- 你即将调用
/docxskill 的 modify / write 类操作 - 你即将对路径以
.docx结尾的文件调用 Edit / Write - 用户说"导师在 Word 里批注了,帮我改一下"
强制流程
检测到 .docx 编辑请求
│
▼
第 1 步:创建备份
cp "原文件.docx" "原文件.bak.YYYYMMDD-HHMMSS.docx"
│
▼
第 2 步:判断是否值得转 LaTeX(见决策表)
├─ 主稿大改 / 长期项目 → 建议转 LaTeX
└─ 导师批注小修 / 一次性改 → 直接改 .docx
│
▼
第 3 步:执行修改
│
▼
第 4 步:交付时告诉用户
「改完了,请你**先打开 Word 验证一下能正常打开**,
有问题立刻回滚到 [备份文件名]。」
备份命名规范
cp "第三章.docx" "第三章.bak.$(date +%Y%m%d-%H%M%S).docx"
格式:<原名>.bak.<时间戳>.docx
禁止:
- 命名为
第三章_备份.docx(无时间戳,下次会覆盖) - 命名为
第三章 (副本).docx(系统默认名字会冲突) - 不留备份就开始改
"转 LaTeX 还是直接改" 决策表
| 情况 | 推荐 |
|---|---|
| 主稿、长期写作、还要改 ≥ 5 次 | 转 LaTeX(一劳永逸) |
| 导师在 Word 里批注,只改这一次 | 直接改 .docx |
| 涉及大量公式 / 表格重排 | 转 LaTeX |
| 涉及 Track Changes 修订 / 批注,必须保留 | 直接改 .docx |
| 投稿要求必须 Word 模板 | 直接改 .docx,但保留 LaTeX 草稿 |
❌ 反例(书 §8.1)
惨案 1:用户要改第 4 章,AI 直接 Write 覆盖原文件——原稿+导师批注全丢。 惨案 2:AI 调用 /docx 修改样式,写崩了 XML,整个文件打不开。
两次的共同根因:没备份就动手。
Rationalization Table
| 念头 | 现实 |
|---|---|
| "用户的 Mac 有 Time Machine 自动备份" | Time Machine 的快照是按小时的,可能正好没覆盖到这一刻 |
| "git 已经在跟踪这个文件" | git 不识别 .docx 内部 XML 状态,损坏后 diff 也救不了 |
| "我只改一个段落,不会出问题" | 惨案 2 就是改一个段落崩的 XML |
| "备份占空间" | 一个 .docx 几 MB,对比丢稿损失忽略不计 |
| "用户说要快" | "快" ≠ "不备份",备份只要 0.5 秒 |
| "上次改这个文件备份过了" | 上次的备份不是这次的备份 |
Red Flags
- 你即将对 .docx 调用 Edit / Write,但还没
cp→ 停 - 你想"先试试看,不行再说" → 不行,备份是先决条件
- 你看到目录里有 .bak 文件就觉得"已经有备份了" → 不一定是这次的备份,按规范重新备份
- 改完不提醒用户验证完整性 → 不算交付完成
来源
《Claude Code 科研手记》§8.1「Word 文档操作的风险」、§8.2「备份策略」
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.
- 13d ago First seen · 131 lines · 125 tokens per session scan A 2c00e6ee26f5
paper-backup-before-word is a skill published in the GitHub repository Lambenthan/paper-discipline-skills (19 stars, last pushed 4mo ago), licensed MIT. It adds 125 tokens to every session and 1,325 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-30.
Other skills, from other repositories
okf-wiki
Builds an Open Knowledge Format (OKF) knowledge base from existing docs, notes, or a repo. Use to scaffold an OKF wiki.
pdf-design
Designs PDF reports and proposals from HTML with previews and branding. Use to create, export, or securely upload a PDF.
document-design
Creates print-ready HTML that exports to PDF. Use to make a proposal, report, one-pager, newsletter, slides, or flyer.
food-ppt
Turn a food & nutrition review report, evidence brief, or manuscript into a fully EDITABLE PowerPoint (.pptx) that opens in PowerPoint / Keynote / Google Slides with every title, bullet, table, and figure as a native editable object — nothing flattened to an image. Converts the outputs of food-research…
agri-ppt
Turn an agricultural-science review report, evidence brief, or manuscript into a fully EDITABLE PowerPoint (.pptx) — every title, bullet, table, and figure a native editable object, nothing flattened to an image. Same machinery as food-ppt, but for agricultural work: converts the outputs of agri-research…
aer-consistency
Use when auditing a finished or near-finished AER, AER:Insights, or AEJ manuscript for internal consistency: headline numbers across abstract, introduction, results, and tables; sample sizes; log-point and percentage-point conversions; cross-references; and in-text-citation/bibliography matching. Apply after the body…