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".
90%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
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.
{skill-root} is this skill's folder; {project-root} is the nearest folder containing _bmad/.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.<!-- shard-pro:contents -->): read references/update.md fully and follow it.bmad-ingest skill on it when it is installed; otherwise tell the user it needs processing first. Then stop.Run outline on the input. Recommend one outcome with one line on why:
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 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:
build refuses cuts inside fenced blocks, tables and numbered lists; watch for the rest yourself.prd-* glob would load it as another PRD.## 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.Write the plan as JSON in the shape build --help shows.
.source/ and the shards become the document. Build only once they agree.Run build, or toc with the plan for a contents list. To change the plan afterwards, edit it and run build again; it reads the source from .source/ and replaces the old shards.
Then record the outcome and each change or decision the user made in {doc_folder}/.memlog.md, keeping any memlog already there: memlog.py init --workspace {doc_folder} when none exists, then append --type decision|change|event.
Run check on the result, with --rebuild after a faithful split, and fix every failure before you finish.
Report to the user:
.source/;check warns no longer resolve after the split. Shards keep the source's words, so the user decides whether to fix them.Findings go in the report and the memlog, never into shards. A shard says what the source says, and a reader cannot tell your judgement from the author's.
bmad-code-org/BMAD-METHOD
e734d3a
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.