bmad-shard-doc

Split markdown documents into section files by level 2 headings.

Updated May 17, 2026
One-click install
npx skills add https://github.com/thuantan2060/facebook-sale-tracking --skill bmad-shard-doc-thuantan2060
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bmad-shard-doc
Source: https://github.com/thuantan2060/facebook-sale-tracking/tree/main/.agents/skills/bmad-shard-doc
Command: npx skills add https://github.com/thuantan2060/facebook-sale-tracking --skill bmad-shard-doc-thuantan2060

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of managing and navigating very large markdown documents by splitting them into smaller, section-based files so readers and tools can work with the content more easily.

Core Features & Use Cases

  • Section-based sharding: Splits a markdown document into smaller files using level 2 (##) sections as the boundaries.
  • Consistent output structure: Creates a destination folder and ensures an index.md is generated for navigation.
  • Operational safety for the original file: Forces an explicit user choice to delete, archive, or keep the original document to avoid duplicated or conflicting sources.
  • Use Case: When you have a long BMAD architecture or research write-up, you can shard it so each major subsection becomes its own file for faster review, targeted updates, and easier downstream retrieval.

Quick Start

Shard document /path/to/your-doc.md into /path/to/your-doc/ and delete the original after verifying the sharded output.

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 section files?

To split a large markdown document, this Skill sections the file by level 2 headings and generates smaller files in a destination folder along with an index.md for navigation. It uses the npx @kayvan/markdown-tree-parser explode command to perform the breakdown.

What is the best way to organize a long markdown knowledge base for easier navigation?

Organizing a long markdown knowledge base is done by sharding the document into focused, section-based files using level 2 headings as boundaries. This process creates a destination folder with an index.md file, enabling targeted reuse and faster review of individual subsections.

How do I shard markdown files by level 2 headings in a BMAD workflow?

Sharding markdown files in a BMAD workflow involves validating the source path, creating a destination folder, and running npx @kayvan/markdown-tree-parser explode with the provided paths. The Skill then verifies the output files and prompts for a delete or archive decision for the original document.

Does this markdown sharding tool delete the original document automatically?

No, this markdown sharding tool does not delete the original document automatically. It forces an explicit user choice to delete, archive, or keep the original file after verifying the sharded output, ensuring operational safety and preventing duplicated sources.

Can I use npx @kayvan/markdown-tree-parser to refactor documentation into individual sections?

Yes, you can use npx @kayvan/markdown-tree-parser explode via this Skill to refactor documentation into individual sections. It splits the source markdown by level 2 headings, outputs the focused files into a confirmed destination folder, and generates an index.md for easy navigation.

What are the limitations of sharding markdown by level 2 sections?

A limitation of sharding markdown by level 2 sections is that content is strictly divided by level 2 headings as boundaries. It requires validating the source markdown extension and path beforehand, and any content not under a level 2 heading may not be optimally organized into the destination folder.