跳到正文
Skillpedia
技术文档55k · #3360

bmad-shard-pro

它能做什么

这个技能通过把长文档拆分为带标签的部分并附上目录,让 AI 智能体更容易浏览它们。适合规格说明或 PRD 太长、智能体无法一次读完的团队。

适用场景

  • ✓当文档太长,AI 智能体无法一次读完的时候。
  • ✓当你希望有目录,以便智能体找到特定章节的时候。
  • ✓当你需要更新一份已经被拆分的文档的时候。

技能链接

https://github.com/bmad-code-org/BMAD-METHOD/blob/main/skills/bmad-shard-pro/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/bmad-code-org/BMAD-METHOD/blob/main/skills/bmad-shard-pro/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“这份 PRD 对我的智能体来说太长了。请把它拆分成章节,并附上它能使用的目录。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体决定在哪里切分,以及如何命名每个部分,然后由脚本执行拆分,确保没有任何文字丢失或被改动。结果是一个带目录的主文件,以及相互链接的各个章节。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Shard Pro

You make a long document cheap and safe for an agent to read later. That reader may or may not search, and may see only the first 200 lines of a file before deciding what else to open. From what it sees there, it must be able to tell where any fact lives. Nothing in the source may be lost or changed on the way: you choose where to cut and what to call things, and the script does the cutting. The user maintains the result afterwards, so it must also be easy to update.

Conventions

  • {skill-root} is this skill's folder; {project-root} is the nearest folder containing _bmad/.
  • This skill's script is uv run {skill-root}/scripts/shard_tool.py; run it with --help, or <command> --help, for arguments. The memlog script is uv run {project-root}/_bmad/scripts/memlog.py; without _bmad/, skip memlog writes and say so once.
  • {doc_folder} is the folder that holds the result. For a split, it is the input's own folder when that folder is named after it (prd-x/prd-x.md), otherwise a new folder beside the input, named after its stem; the main file is named after the folder. For a contents list, it is the file's own folder.

On activation

  • The document's main file opens with the sharded-document note, or the document has a contents list this skill made (it starts with <!-- shard-pro:contents -->): read references/update.md fully and follow it.
  • A transcript, chat export, email thread or pile of meeting notes: this is input to process into decisions, actions and notes, not a document to shard. Say so and invoke the bmad-ingest skill on it when it is installed; otherwise tell the user it needs processing first. Then stop.
  • Any other file that is not markdown or plain text (.docx, PDF, HTML): ask the user to convert it to markdown first, with a tool they use or by asking you to, then go on from the converted file.
  • Any other document: go to Assess.

Assess

Run outline on the input. Recommend one outcome with one line on why:

  • Leave it as it is. It is short enough to read whole, or already well signposted.
  • Contents list. The file stays one file and gains a detailed contents list near the top. It is the smaller change, and the one to choose when readers search or follow line ranges, when tools or skills expect the document as one file, or when you cannot tell how it will be read.
  • Faithful split. The source is cut word for word into shards with a map. Choose it when readers load whole files, so each one should load only a part, or when the document will be maintained piece by piece. It loses nothing and is checked by script.

Splitting costs every later reader a hop through the map, so recommend it only when a reader would otherwise pay more. When the user asked for a particular outcome ("shard this", "add a table of contents"), recommend that one unless the outline shows it would make the document worse to read, and then say why.

For Leave it as it is, tell the user why and stop. The other two go on to Plan.

Plan from the outline

Plan from the outline and read only the ranges you need. Holding a long document whole in your context is the expensive mistake. Start from the proposed cut and change it where the content asks:

  • Shards run about 3 to 14 KB, measured in characters, because line lengths vary too much to measure by lines. A shorter shard on one subject beats a merged one that joins unrelated subjects.
  • Never cut inside a table, a step list or a diagram. build refuses cuts inside fenced blocks, tables and numbered lists; watch for the rest yourself.
  • Name each shard from what it covers, in kebab-case. Never start a name with the document type's prefix, because a prd-* glob would load it as another PRD.
  • When a heading is a bare identifier (## 3, ### C-2), name the shard from its content (the outline shows the first line under each such heading) and keep the identifier in the title.
  • Before you use the source's own index or numbering rules, check them against the body. They are often from an older edition.
  • Keep an aggregate view (a matrix, a register, a glossary) whole, because a reader counting rows needs it in one place. Small ones may share a shard.
  • Write each map summary so a reader with a question can tell this is the shard. When a shard's content is later superseded in the source, its summary says so.
  • When the source states two values for one thing, the summary of each shard holding one says so and names the other shard. Never p
常见问题

拆分会改变任何文字吗?

不会。该技能说明,原文中没有任何内容丢失或被改动,因为切分工作由脚本完成。

拆分之后可以再更新吗?

可以。该技能对已拆分的文档提供更新模式。

拆分出的文件放在哪里?

它们会放在以文档命名的文件夹中,或放在它旁边的一个新文件夹中。

详情

作者的原始描述

Makes long documents easy for agents to navigate. Use when the user says "shard this document", "this file is too long for agents", "turn this document into a wiki", "add a table of contents so agents can find things", or "update the sharded document".

repo: bmad-code-org/BMAD-METHOD

热度

GitHub 星标
55k
排名
#3360
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能