docs/how-to/shard-large-documents.md
Use the bmad-shard-doc tool if you need to split large markdown files into smaller, organized files for better context management.
:::caution[Deprecated] This is no longer recommended, and soon with updated workflows and most major LLMs and tools supporting subprocesses this will be unnecessary. :::
Only use this if you notice your chosen tool / model combination is failing to load and read all the documents as input when needed.
Document sharding splits large markdown files into smaller, organized files based on level 2 headings (## Heading).
Before Sharding:
_bmad-output/planning-artifacts/
└── PRD.md (large 50k token file)
After Sharding:
_bmad-output/planning-artifacts/
└── prd/
├── index.md # Table of contents with descriptions
├── overview.md # Section 1
├── user-requirements.md # Section 2
├── technical-requirements.md # Section 3
└── ... # Additional sections
/bmad-shard-doc
Agent: Which document would you like to shard?
User: docs/PRD.md
Agent: Default destination: docs/prd/
Accept default? [y/n]
User: y
Agent: Sharding PRD.md...
✓ Created 12 section files
✓ Generated index.md
✓ Complete!
BMad workflows use a dual discovery system:
document-name.mddocument-name/index.mdAll BMM workflows support both formats: