/bmad-core-tools:bmad-shard-profrom bmad-core-tools
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".
Ships in bmad-core-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.
{project-root} is the nearest folder containing _bmad/, from the working directory upward (in a linked git worktree, fall back to walking up from the parent of git rev-parse --path-format=absolute --git-common-dir), or the working directory when standalone.{skill-root} is this skill's folder.uv run "{skill-root}/scripts/shard_tool.py" --project-root "{project-root}"; run it with --help, or <command> --help, for arguments.{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. There are three outcomes: leave it as it is; a contents list, where the file stays one file and gains a detailed list of its sections near the top; or a faithful split, where the source is cut word for word into shards with a map, which loses nothing and is checked by script. Small, well-named files serve agents better than one long file, so a long document that is kept and edited is split unless something needs it whole. Pick the outcome with these steps and recommend it with one line on why:
Under about 50,000 characters: leave it as it is. An agent reads it whole for little.
Otherwise, ask what the document cannot show, in one message, leaving out what the request already says:
With no user present, treat a project document (a PRD, spec, architecture or plan) as kept and edited, a third-party or signed document as a fixed reference, and neither as having to stay one file unless the request says so.
Contents list when it has to stay one file, is a fixed reference, or its sections lean on each other so much that no cut leaves shards that read on their own (steps that run across sections, frequent "as above"). When it already has an accurate contents list in its first 200 lines, leave it as it is instead.
Faithful split otherwise.
When the user asked for a particular outcome ("shard this", "add a table of contents"), recommend it unless these steps point elsewhere; then name the answer that points elsewhere, in one line, and do what they choose.
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.related on a shard to the shards a change to it would also touch: the other shard of a conflict, and shards its text points to or that point to it. Leave it out when none do.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 before anyone edits the shards, edit it and run build again; it reads the source from .source/ and replaces the old shards. Once the shards have been edited, build refuses; make the change as references/update.md says instead.
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, never into shards. A shard says what the source says, and a reader cannot tell your judgement from the author's.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub bmad-code-org/bmad-plugins --plugin bmad-core-tools12 skills in this plugin
/bmadBMad advisor, router, and installation manager across all installed modules. Use when the user addresses BMad directly ("hey bmad", "/bmad", "bmad, ...", "ask bmad", "use bmad help") — always load this skill first — or asks for BMad help, a capabilities overview or tutorial, what to do next, or where to start; to set up, update, repair, doctor, migrate or check installation status; to list available modules, or add, install or remove a module; or to see or change the active initiative. Not for drafting or authoring documents directly (use bmad-facilitate or a specialist agent) or editing skill or template overrides (use bmad-customize)./bmad-advanced-elicitationPushes a draft off its first answer with critique methods and proposes one revision. Use when the user or another skill names bmad-advanced-elicitation, or the user says "advanced elicitation". Not for a critique or a named method such as pre-mortem without that name./bmad-brainstormingFacilitate a brainstorming session using diverse creative techniques. Use when the user says 'help me brainstorm' or 'help me ideate'Other plugins' skills for the same job