bmad-shard-doc
大規模なMarkdownドキュメントを、見出しレベル2(デフォルト)に基づいて、より小さく整理されたファイルに分割し、ドキュメントを構造化して扱いやすくするSkill。
📜 元の英語説明(参考)
Splits large markdown documents into smaller, organized files based on level 2 (default) sections. Use if the user says perform shard document
🇯🇵 日本人クリエイター向け解説
大規模なMarkdownドキュメントを、見出しレベル2(デフォルト)に基づいて、より小さく整理されたファイルに分割し、ドキュメントを構造化して扱いやすくするSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o bmad-shard-doc.zip https://jpskill.com/download/23707.zip && unzip -o bmad-shard-doc.zip && rm bmad-shard-doc.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/23707.zip -OutFile "$d\bmad-shard-doc.zip"; Expand-Archive "$d\bmad-shard-doc.zip" -DestinationPath $d -Force; ri "$d\bmad-shard-doc.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
bmad-shard-doc.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
bmad-shard-docフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
シャードドキュメント
目的: npx @kayvan/markdown-tree-parser を使用して、大きな Markdown ドキュメントをレベル 2 のセクションに基づいて、より小さく整理されたファイルに分割します。
重要なルール
- 必須: 実行セクションのすべてのステップを正確な順序で実行してください。
- ステップをスキップしたり、順序を変更したりしないでください。
- 停止条件が満たされた場合は、直ちに停止してください。
- 各ステップ内の各アクションは、そのステップを完了するために必須のアクションです。
実行
ステップ 1: ソースドキュメントの取得
- ソースドキュメントのパスがまだ提供されていない場合は、ユーザーに尋ねます。
- ファイルが存在し、アクセス可能であることを確認します。
- ファイルが Markdown 形式(.md 拡張子)であることを確認します。
- ファイルが見つからないか、Markdown 形式でない場合は、エラーメッセージを表示して停止します。
ステップ 2: 宛先フォルダーの取得
- デフォルトの宛先を決定します: ソースファイルと同じ場所で、.md 拡張子なしのソースファイル名で命名されたフォルダー
- 例:
/path/to/architecture.md-->/path/to/architecture/
- 例:
- ユーザーに宛先フォルダーのパスを尋ねます(デフォルトの使用を確認する場合は
[y]、それ以外の場合は新しいパスを入力します:[suggested-path])。 - ユーザーがデフォルトを受け入れた場合は、提案された宛先パスを使用します。
- ユーザーがカスタムパスを提供した場合は、カスタム宛先パスを使用します。
- 宛先フォルダーが存在するか、作成可能であることを確認します。
- 宛先への書き込み権限を確認します。
- 権限が拒否された場合は、エラーメッセージを表示して停止します。
ステップ 3: シャーディングの実行
- シャーディングが開始されることをユーザーに通知します。
- コマンドを実行します:
npx @kayvan/markdown-tree-parser explode [source-document] [destination-folder] - コマンドの出力とエラーをキャプチャします。
- コマンドが失敗した場合は、停止してユーザーにエラーを表示します。
ステップ 4: 出力の検証
- 宛先フォルダーにシャードファイルが含まれていることを確認します。
- 宛先フォルダーに index.md が作成されたことを確認します。
- 作成されたファイルの数を数えます。
- ファイルが作成されなかった場合は、エラーメッセージを表示して停止します。
ステップ 5: 完了レポート
- ユーザーに完了レポートを表示します。これには以下が含まれます。
- ソースドキュメントのパスと名前
- 宛先フォルダーのパス
- 作成されたセクションファイルの数
- index.md が作成されたことの確認
- ツールからの出力または警告
- シャーディングが正常に完了したことをユーザーに通知します。
ステップ 6: 元のドキュメントの処理
重要: 元のバージョンとシャード化されたバージョンの両方を保持すると、シャーディングの目的が失われ、混乱を招く可能性があります。
元のドキュメントについてユーザーにオプションを提示します。
元のドキュメント
[source-document-name]をどうしますか?オプション:
[d]削除 - 元のファイルを削除します(推奨 - シャードはいつでも再結合できます)[m]アーカイブに移動 - 元のファイルをバックアップ/アーカイブ場所に移動します[k]保持 - 元のファイルをそのまま残します(非推奨 - シャーディングの目的が失われます)選択してください (d/m/k):
ユーザーが d (削除) を選択した場合
- 元のソースドキュメントファイルを削除します。
- ユーザーに削除を確認します: "元のドキュメントが削除されました: [source-document-path]"
- 注: ドキュメントは、すべてのセクションファイルを順番に連結することでシャードから再構築できます。
ユーザーが m (移動) を選択した場合
- デフォルトのアーカイブ場所を決定します: ソースと同じディレクトリ内の
archiveサブフォルダー- 例:
/path/to/architecture.md-->/path/to/archive/architecture.md
- 例:
- 尋ねます: アーカイブ場所(デフォルトを使用する場合は
[y]、またはカスタムパスを指定します:[default-archive-path]) - ユーザーがデフォルトを受け入れた場合は、デフォルトのアーカイブパスを使用します。
- ユーザーがカスタムパスを提供した場合は、カスタムアーカイブパスを使用します。
- アーカイブディレクトリが存在しない場合は作成します。
- 元のドキュメントをアーカイブ場所に移動します。
- ユーザーに移動を確認します: "元のドキュメントが移動されました: [archive-path]"
ユーザーが k (保持) を選択した場合
- ユーザーに警告を表示します。
- 元のバージョンとシャード化されたバージョンの両方を保持することは推奨されません。
- discover_inputs プロトコルが間違ったバージョンをロードする可能性があります。
- 一方への更新が他方に反映されません。
- 重複したコンテンツがスペースを占有します。
- 元のドキュメントを削除またはアーカイブすることを検討してください。
- ユーザーの選択を確認します: "元のドキュメントは次の場所に保持されました: [source-document-path]"
停止条件
- npx コマンドが失敗した場合、または出力ファイルが生成されなかった場合は停止します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Shard Document
Goal: Split large markdown documents into smaller, organized files based on level 2 sections using npx @kayvan/markdown-tree-parser.
CRITICAL RULES
- MANDATORY: Execute ALL steps in the EXECUTION section IN EXACT ORDER
- DO NOT skip steps or change the sequence
- HALT immediately when halt-conditions are met
- Each action within a step is a REQUIRED action to complete that step
EXECUTION
Step 1: Get Source Document
- Ask user for the source document path if not provided already
- Verify file exists and is accessible
- Verify file is markdown format (.md extension)
- If file not found or not markdown: HALT with error message
Step 2: Get Destination Folder
- Determine default destination: same location as source file, folder named after source file without .md extension
- Example:
/path/to/architecture.md-->/path/to/architecture/
- Example:
- Ask user for the destination folder path (
[y]to confirm use of default:[suggested-path], else enter a new path) - If user accepts default: use the suggested destination path
- If user provides custom path: use the custom destination path
- Verify destination folder exists or can be created
- Check write permissions for destination
- If permission denied: HALT with error message
Step 3: Execute Sharding
- Inform user that sharding is beginning
- Execute command:
npx @kayvan/markdown-tree-parser explode [source-document] [destination-folder] - Capture command output and any errors
- If command fails: HALT and display error to user
Step 4: Verify Output
- Check that destination folder contains sharded files
- Verify index.md was created in destination folder
- Count the number of files created
- If no files created: HALT with error message
Step 5: Report Completion
- Display completion report to user including:
- Source document path and name
- Destination folder path
- Number of section files created
- Confirmation that index.md was created
- Any tool output or warnings
- Inform user that sharding completed successfully
Step 6: Handle Original Document
Critical: Keeping both the original and sharded versions defeats the purpose of sharding and can cause confusion.
Present user with options for the original document:
What would you like to do with the original document
[source-document-name]?Options:
[d]Delete - Remove the original (recommended - shards can always be recombined)[m]Move to archive - Move original to a backup/archive location[k]Keep - Leave original in place (NOT recommended - defeats sharding purpose)Your choice (d/m/k):
If user selects d (delete)
- Delete the original source document file
- Confirm deletion to user: "Original document deleted: [source-document-path]"
- Note: The document can be reconstructed from shards by concatenating all section files in order
If user selects m (move)
- Determine default archive location: same directory as source, in an
archivesubfolder- Example:
/path/to/architecture.md-->/path/to/archive/architecture.md
- Example:
- Ask: Archive location (
[y]to use default:[default-archive-path], or provide custom path) - If user accepts default: use default archive path
- If user provides custom path: use custom archive path
- Create archive directory if it does not exist
- Move original document to archive location
- Confirm move to user: "Original document moved to: [archive-path]"
If user selects k (keep)
- Display warning to user:
- Keeping both original and sharded versions is NOT recommended
- The discover_inputs protocol may load the wrong version
- Updates to one will not reflect in the other
- Duplicate content taking up space
- Consider deleting or archiving the original document
- Confirm user choice: "Original document kept at: [source-document-path]"
HALT CONDITIONS
- HALT if npx command fails or produces no output files