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 agentmods add skills/midnightdarling/collate/diff-reviewnpx skills add MidnightDarling/collate --skill diff-reviewgit clone --depth 1 https://github.com/MidnightDarling/collateWhat 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 | $0.00153 | $0.03508 |
| Opus 5 | $0.00077 | $0.01754 |
| Sonnet 5 | $0.00031 | $0.00702 |
| Haiku 4.5 | $0.00015 | $0.00351 |
Grade A, and why
diff-review 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 2d 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 — 285 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Diff Review — 校对改动核对
Task
校对闭环的最后一关。用户按 raw.review.md 改完 raw.md → final.md 后,用户需要回答三个问题:
- 用户接受了 agent 的哪些建议?(自己脑子里记不住改了哪些)
- 用户拒绝或漏改了哪些?(最常见:手滑漏掉一两条 A 类)
- 清单外修正了哪些 agent 未标注的段?(用于积累校对风格)
不核对就改,等于校对没闭环——用户可能漏了明显的 OCR 错就拿去生成 Word,回头被编辑或读者发现,返工。
这个 skill 生成一份段落级 HTML 对照 + 标注交叉表,用户花 5 分钟扫一遍就能判断闭环是否闭上。
Process
Step 1 — 确认输入
RAW="<raw-md-path>"
FINAL="<final-md-path>"
OCR="$(dirname "$RAW")" # 工作区根 = raw.md 的父目录
REVIEW="${REVIEW:-$OCR/review/raw.review.md}"
test -f "$RAW" || { echo "raw.md 不存在:$RAW"; exit 1; }
test -f "$FINAL" || { echo "final.md 不存在:$FINAL"; exit 1; }
# review 可选;无则降级为纯 diff
如果用户没显式传 --review,默认去 $OCR/review/raw.review.md 找清单(proofread 的默认输出位置)。找到就带上,找不到降级为纯 diff,不做标注关联,并告知用户。
Step 2 — 调 diff 脚本
mkdir -p "$OCR/previews" "$OCR/review"
python3 "${CLAUDE_PLUGIN_ROOT}/skills/diff-review/scripts/md_diff.py" \
--raw "$RAW" \
--final "$FINAL" \
$( [ -f "$REVIEW" ] && echo "--review $REVIEW" ) \
--out "$OCR/previews/diff-review.html" \
--summary "$OCR/review/diff-summary.md"
固定路径约定(权威规范见插件
references/workspace-layout.md):
- HTML 预览 →
previews/diff-review.html- Markdown 摘要 →
review/diff-summary.md不再用${FINAL%.md}.diff.html这种衍生路径 —— 那会把过程文件落在工作区根部,反规范。
Step 3 — 脚本必须实现的行为规范
md_diff.py 的职责边界由以下规范强制定义。实现时不许偷工——以下每条都是契约,不是建议。
3.1 段落切分
两份文件都按「连续非空行 = 一段」规则切分。每段保留:
raw_line_start/raw_line_end(在 raw.md 中的起止行号)final_line_start/final_line_end(在 final.md 中的起止行号)paragraph_text(段落文本,保留段内换行)
保留原始行号是为了和 raw.review.md 的 "Line N" 标注做锚定。
3.2 段落对齐
用 difflib.SequenceMatcher 以段落为 opcode 粒度(不是行、不是字符)做对齐。产出四类 opcode:
| opcode | 含义 | HTML 显示 |
|---|---|---|
equal |
段落完全一致 | 折叠,默认只显示"第 N 段未修改",可展开查看 |
replace |
段落被改写 | 左栏 raw(删除高亮)+ 右栏 final(新增高亮),段内做字符级 diff |
delete |
raw 有 final 无 | 左栏显示 + 标签"已删除整段" |
insert |
final 有 raw 无 | 右栏显示 + 标签"新增段落" |
不允许用行级对齐。中文一段可能 300 字一行,行级 diff 会把"改一个字"显示为"删一整行 + 增一整行",噪音压过信号。
What ships with it
1 file 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.
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.
- 2d ago First seen · 285 lines · 153 tokens per session scan A c5b01c89a3f7
diff-review is a skill published in the GitHub repository MidnightDarling/collate (6 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 153 tokens to every session and 3,508 once invoked, about $0.0008 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
puppetmaster
Operate and supervise Puppetmaster through MCP or CLI. Use for non-trivial edits, implementations, audits, reviews, broad investigations, CodeGraph lookups, routing decisions, long-running start jobs, MCP disconnects, stuck/empty/degraded jobs, and any request to monitor or recover Puppetmaster work.
honey-px
Read huge read-only text as PNG pages; big input cut.
honey-debt
Harvest honey shortcut markers into a debt ledger.
honey-memory
Per-project persistent memory files indexed in MEMORY.md.
honey-hive
Delegate search/review to subagents; compressed returns.
review-full
Run a comprehensive multi-perspective code review on recent changes. Also triggers on 'is this secure?', 'security review', 'check for vulnerabilities', 'could this be exploited?' for security-focused review. Produces: GO/NO-GO verdict + findings table (Severity | Category | File:Line | Issue | Recommendation)…