bmad-shard-doc

Shard Markdown documents into files by level 2 sections with index.md via markdown parser.

1|Updated May 16, 2026
One-click install
npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill bmad-shard-doc-enigmaicon-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bmad-shard-doc
Source: https://github.com/enigmaicon-eng/AI-Enterprise-OS/tree/main/examples/BMAD-METHOD/src/core-skills/bmad-shard-doc
Command: npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill bmad-shard-doc-enigmaicon-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of unwieldy, monolithic Markdown documents by automatically splitting them into smaller, navigable files.

Core Features & Use Cases

  • Level-2 Section Sharding: Splits a large Markdown document into organized files based on level 2 (##) sections.
  • Deterministic Document Structure: Uses npx @kayvan/markdown-tree-parser to produce a consistent sharded output layout.
  • Sharded Index Creation: Ensures the destination includes an index.md to preserve entry/navigation for the split content.
  • Original Document Handling: Guides you to delete, archive (move), or keep the original document after sharding to avoid duplicate-content confusion.

Quick Start

Use the bmad-shard-doc skill to shard an existing Markdown file by providing its source path and (optionally) confirming the destination folder.

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?

To split a large Markdown document, provide a valid .md source path and a writable destination folder. The skill shards the file into smaller files organized by level 2 sections, generating section files and an index.md for navigation.

What is the best way to organize unwieldy Markdown documentation for easier maintenance?

Organizing unwieldy Markdown documentation is achieved through sharding, which splits monolithic files into clean section files. This process uses a deterministic document structure to ensure the output layout remains consistent and navigable.

Does this Markdown sharding tool create an index for the split files?

Yes, the Markdown sharding tool creates an index.md file in the destination folder. This sharded index creation ensures there is a preserved entry point for navigating the newly generated section files.

What should I do with the original Markdown file after sharding it into section files?

After sharding, you should handle the original Markdown document by deleting, archiving, or keeping it. This original document handling step prevents duplicate-content confusion in your documentation repository.

How does the level 2 section splitting mechanism work for knowledge management files?

The level 2 section splitting mechanism works by parsing the Markdown document tree and extracting content under each ## heading. It executes a markdown-tree-parser to explode the source file into individual section files and an index.

Do I need a specific destination folder setup to shard Markdown documents?

You need a valid .md source path and a writable destination folder to shard Markdown documents. The process validates output presence in this destination folder after generating the section files and index.