
bmad-shard-pro
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".
- Installs
- 5.2K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/bmad-code-org/bmad-method --skill bmad-shard-pro- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads bmad-shard-pro automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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 isuv 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 -->): readreferences/update.mdfully 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-ingestskill 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.
buildrefuses 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 pick one, even where the source declares a precedence rule.
- Set a lookup pattern only when readers arrive with identifiers the map titles do not already resolve, such as hundreds of requirement IDs.
Write the plan as JSON in the shape build --help shows.
Agree the plan
- A user is present: show the outcome, why, where the result will go, and the shard list (titles and one-line summaries), then wait. For a split, say that the input moves into
.source/and the shards become the document. Build only once they agree. - The user asked you to run without stopping, or another skill invoked this one with no user present: go on, and report at the end.
Build
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.
Check, then report
Run check on the result, with --rebuild after a faithful split, and fix every failure before you finish.
Report to the user:
- the outcome, and where the main file is;
- for a split, that the input now sits in
.source/; - what you found in the source: conflicts with both values and where each sits, index errors, suspected errors;
- links
checkwarns 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.
FAQ
What does the bmad-shard-pro skill do?
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".
How do I install bmad-shard-pro?
Run npx skills add https://github.com/bmad-code-org/bmad-method --skill bmad-shard-pro in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/bmad-shard-pro/ (personal) or .claude/skills/bmad-shard-pro/ (project).
Which AI agents can use bmad-shard-pro?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is bmad-shard-pro safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains bmad-shard-pro?
It is published by bmad-code-org in bmad-code-org/bmad-method. It has 5,248 recorded installs.
More from bmad-code-org/bmad-method
bmad
bmad-code-org/bmad-method
Answers BMad questions and recommends the next skill from what is installed. Use when the user asks bmad for help, what to do next or where to start; to set up, update, repair, doctor, migrate or check the status of the installation, or add modules; or to see or change the active initiative.
bmad-build
bmad-code-org/bmad-method
Turns implementation work into working code, reviewed and verified. Use when the user delegates a feature, story, bug fix, or meaningful change; a bare story or issue link counts. Skip obvious, low-risk mechanical maintenance such as small ignore-file, typo-only, formatting-only, or configuration-hygiene edits. Explicit BMAD requests always qualify. Do not volunteer for user-directed interactive edits or version-control operations that only record existing work.
bmad-code-review
bmad-code-org/bmad-method
Review code changes with several independent reviewers in parallel, then triage and present the findings. Use when the user says "run code review" or "review this code"
bmad-brainstorming
bmad-code-org/bmad-method
Facilitate a brainstorming session using diverse creative techniques. Use when the user says 'help me brainstorm' or 'help me ideate'
bmad-agent-pm
bmad-code-org/bmad-method
Product manager for PRD creation and requirements discovery. Use when the user asks to talk to John or requests the product manager
bmad-agent-architect
bmad-code-org/bmad-method
System architect and technical design leader. Use when the user asks to talk to Winston or requests the architect
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.