md-swarm

md-swarm is a skill for Claude Code from pwya/md-paper. It costs 310 tokens per session (12,381 once invoked), scanned B, original, Apache-2.0.

A workflow for applying many confirmed edits to a Markdown source document. It has separate agents draft changes, then collects and applies them in order to the main manuscript file.

In plain words
What is it for?
Use it to apply a reviewed change list to manuscript.md when there are too many edits for a small manual update. It is intended for Markdown documents, not Word files or tracked revisions.
Why use it?
It reduces the risk and effort of handling a large, messy list of revisions by hand. A confirmation step and final review help prevent unapproved changes or accidental removal of citations.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; names the AskUserQuestion tool; mentions Claude Code.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is **三省制**(架构理念·详见 `../md-技能套件·用户完全手册.md`):triage 管「提」(整理意图)不管写、写手管「行」(起草 patch)不管审、D/E 管「审」(只读审计)不管写。**D/E 只出报告**,发现的漏 / 半拉子 / 跑偏 / 矛盾 → **主控重派写手** agent(套写手契约)起草.

Good fit Use it to apply a reviewed change list to manuscript.md when there are too many edits for a small manual update. It is intended for Markdown documents, not Word files or tracked revisions.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/pwya/md-paper
agentmods
npx agentmods add skills/pwya/md-paper/md-swarm

Made for: Claude Code.

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 md-swarm

README.md
[![agentmods](https://agentmods.dev/badge/skills/pwya/md-paper/md-swarm/github.svg)](https://agentmods.dev/skills/pwya/md-paper/md-swarm)
Your own site
<a href="https://agentmods.dev/skills/pwya/md-paper/md-swarm"><img src="https://agentmods.dev/badge/skills/pwya/md-paper/md-swarm/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.

agentmods 80×15 button for md-swarm

Your own site · 80×15
<a href="https://agentmods.dev/skills/pwya/md-paper/md-swarm"><img src="https://agentmods.dev/badge/skills/pwya/md-paper/md-swarm.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 310 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 12,381 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00310 $0.12381
Opus 5 $0.00155 $0.06191
Sonnet 5 $0.00062 $0.02476
Haiku 4.5 $0.00031 $0.01238

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

Security

Grade B, and why

md-swarm scanned grade B with 1 finding 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.

The scan reads SKILL.md. This mod also ships 18 executable files (_citescan.py, _zotero.py, apply_formatted_changeset.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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

两个 hook 需在本机 `~/.claude/settings.json` 注册一次(见 `../INSTALL.md`)。**apply 和两个钩子一个字都不要动**(验证过的安全底座)。
md-swarm/SKILL.md · 363 lines

How it starts

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

md-swarm — 批量并行改 Markdown 真源(第三代·Phase 2·并行)

路由铁律:本 skill 属第三代 md-*,是改稿的后端(Phase 2)。整理意见 → 写 md_triage.md 那一步(旧 Phase 1)已独立成前端 md-triage。本 skill 只做:读已确认的 md_triage.md → 按 Task 并行起草 → 确定性落盘 → 终审。改的是 manuscript.md(纯文本),碰 docx、走修订模式。改完交 /md-build 出 Word。 🧭 什么时候用:手改扛不动的大批量乱意见才走 md-triage → md-swarm。小修直接手改 manuscript.md/md-build;让 AI 改某一两处用 md-iterate。别为小修启动本套重机械。 2026-06-21 架构:Phase 1(整理)→ 独立 skill md-triage;本 skill = Phase 2(并行落地)。旧的串行编排归档不随发布版分发。

格式保留项目(有 manifest/format_profile.json)通过 md-swarm/apply_formatted_changeset.py 进入落盘流程。它先调用原 apply 引擎生成临时候选稿、校验格式和对象绑定,再调用原引擎写入真源;无格式档案的旧项目兼容转交原引擎。原 apply_md_changeset.py 仍是唯一写入者,人工确认钩子由入口直接复用。普通文字改稿保留 custom-style、对象和分节标记;不要为消除报错自行添加 --allow-format-change--allow-structure-change,这两个参数仅用于用户已经明确要求的格式或结构变更。

前置(缺一不可,先查)

  1. manuscript.md(真源)存在 —— 由 md-unpack 从原稿摄取。没有 → 先 /md-unpack
  2. swarm/md_triage.md 存在、且顶部令牌 = **人工确认:** 已确认 —— 由 md-triage 产出 + 人工审过确认。
    • 没有 md_triage.md → 本 skill 先用 Skill 工具调 md-triage 生成、停在人工闸等你审确认,再回来继续 Phase 2(像 md-unpack 内部调 docx-unpack)。
    • 有但令牌还是「待确认」→ ,让用户审完改令牌。⛔ AI 不得自行确认。

当前会话 hook live-probe(写入型 md-swarm 必查):第一次在本会话跑 md-swarm,或用户刚换过 CC Switch / provider / 模型代理 / 新开供应商后,先跑:

py "<本skill>\probe_live_hooks.py" --prepare

然后按脚本打印的 ACTION 1/2 原样做:Claude Code 用 Write/Edit + PowerShell/Bash;Codex 用 apply_patch + shell_command。先尝试写临时 manuscript.md,再尝试 apply 临时 机改 changeset;必须亲眼看到两次都被 DENY,再跑脚本打印的 --check--cleanup

⛔ 弱模型适配铁律:不许只读这个脚本、不许直接调用 hook .ps1、不许把 --check 的“没落盘”当成已通过--check 只能发现“真的落盘了”的失败,不能区分 DENY 和你偷懒没做。没看到两个 DENY → 硬停,不运行任何写入型 md-swarm/md-iterate。Claude Code 重跑 verify_hooks.ps1 并开全新会话;Codex 只在缺安装/缺 Trust 时各补一次。若 /hooks 已显示 Active/Trusted 而真实动作仍落盘,不得循环重装、Trust、重启:这是 Codex 已知的上游 Hook 调度回归(https://github.com/openai/codex/issues/21639),切换到已亲眼通过双 DENY 的宿主(当前推荐 Claude Code),待宿主版本或配置真正变化后再复测。

Read the full file on GitHub · 363 lines

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. 2d ago Changed · +12 lines 2c3d7b9a3a12
  2. 9d ago First seen · 351 lines · 310 tokens per session scan B 25fb4c330d71

Subscribe to this mod's changes

md-swarm is a skill published in the GitHub repository pwya/md-paper (10 stars, last pushed 3d ago), licensed Apache-2.0. It adds 310 tokens to every session and 12,381 once invoked, about $0.0015 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

research-academic-plotting

Generates publication-quality figures for ML papers from research context. Given a paper section or description, extracts system components and relationships to generate architecture diagrams via G...

GrayCodeAI/starling · 38 tokens

pandoc-docx-template

Use this skill when converting Markdown to Word DOCX or DOCX back to Markdown with Pandoc, especially when the output should use the bundled Chinese Word reference templates, heading numbering variants, list indentation variants, SCI paper templates, and Lua filters for HTML tags, image captions, font color, and…

Achuan-2/pandoc_docx_template · 69 tokens

md-to-office

This skill enables conversion from Markdown to various Office formats using Pandoc - the universal document converter. Convert your Markdown files to professional Word documents, PowerPoint presentations, PDFs, and more while preserving formatting and structure.

claude-office-skills/skills · 5 tokens

Генерация PDF из Markdown с точным академическим форматированием через Pandoc и LaTeX

A document workflow that turns Markdown text into PDF files using Pandoc and a custom LaTeX template. It applies specified academic page settings such as 14-point text, 1.5 line spacing, and A4 paper.

ECNU-ICALK/AutoSkill · 87 tokens

latex-workflow

Write, compile, and submit LaTeX papers: IMRaD structure, key packages, bibliography management, arXiv preparation, and common error fixes.

xjtulyc/awesome-rosetta-skills · 36 tokens

slide-excellence

Multi-agent comprehensive slide review (visual + pedagogy + proofreading, plus TikZ / parity / substance conditionally). Use when user says "full review", "excellence pass", "comprehensive check", "review everything", "pre-release review", "slide excellence", or before teaching / shipping a deck. Fanout wrapper — for…

pedrohcgs/claude-code-my-workflow · 94 tokens