bmad-shard-doc

Split markdown documents into section files by level 2 headings.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ImaginerLabs/skill-manager --skill bmad-shard-doc-imaginerlabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bmad-shard-doc
Source: https://github.com/ImaginerLabs/skill-manager/tree/main/.trae/skills/bmad-shard-doc
Command: npx skills add https://github.com/ImaginerLabs/skill-manager --skill bmad-shard-doc-imaginerlabs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Splits large markdown documents into smaller, well-organized files by level 2 sections to avoid manual copy-paste and make long-form documentation easier to navigate and maintain.

Core Features & Use Cases

  • Deterministic sharding using the markdown tree parser to explode a single markdown file into a folder of section files and an index.
  • Robust validation of source path, markdown format, destination creation, and write permissions with clear halt conditions on failure.
  • Post-processing options for the original document including delete, archive (move), or keep, plus a completion report summarizing outputs and warnings.
  • Use Case: Break a lengthy architecture.md or product-spec into per-section files for repository modularization, improved editing, and easier reuse.

Quick Start

Confirm the source markdown file and accept or provide a destination folder when prompted, then run the sharding operation to split the document into separate section files.

Frequently Asked Questions about bmad-shard-doc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split a large markdown document into smaller files by section?

This Skill splits large markdown documents by extracting level 2 headings into separate section files within a destination folder. It uses a markdown tree parser to automate the sharding process and generates an index for improved navigation.

What is the best way to break down a lengthy product spec for repository modularization?

The best way to break down a lengthy product spec is deterministic sharding, which explodes the single markdown file into a folder of section files. This approach improves repository modularization, editing, and reuse while generating an index.

How do I automate markdown file sharding using npx?

You automate markdown file sharding by executing npx @kayvan/markdown-tree-parser to explode the source file into a destination folder. The process validates paths, permissions, and index creation before splitting the document.

Can I archive or delete the original markdown file after sharding it into sections?

Yes, you can archive or delete the original markdown file after sharding. Post-processing options allow you to delete, move to archive, or keep the source document, plus a completion report summarizes the outputs and any warnings.

Does the markdown sharding process validate destination folder permissions?

Yes, the markdown sharding process includes robust validation of the source path, markdown format, destination creation, and write permissions. It enforces clear halt conditions on failure to ensure file management integrity.

When do I need to shard markdown documentation into separate files?

You need to shard markdown documentation when long-form manuals or architecture documents become difficult to navigate and maintain. Splitting by level 2 sections makes per-section files easier to edit and import into other tools.