# Legacy Task Conversion Report **Generated**: 2025-10-26 **Converted By**: BMad Builder Agent **Conversion Type**: Legacy Task → v6 XML Task --- ## Source Information - **Original Location**: https://github.com/bmad-code-org/BMAD-METHOD/blob/main/bmad-core/tasks/shard-doc.md - **Original Format**: Markdown task (v4/legacy format) - **Original Type**: Document sharding utility task --- ## Target Information - **New Location**: `/Users/brianmadison/dev/BMAD-METHOD/src/core/tasks/shard-doc.xml` - **New Format**: v6 XML task format - **Task ID**: `bmad/core/tasks/shard-doc` - **Task Name**: Shard Document --- ## Conversion Summary ### Components Converted ✅ **Task Structure**: Converted from markdown to XML format ✅ **Execution Flow**: 6 steps properly structured in `` section (simplified to tool-only) ✅ **Critical Instructions**: Moved to `` section ✅ **Validation Rules**: Extracted to `` section ✅ **Halt Conditions**: Extracted to `` section ✅ **Special Guidelines**: Moved to `` section ✅ **Output Format**: Documented in `` section ✅ **Tool Information**: Preserved in `` section ### Key Features Preserved - **Automated Tool**: Uses @kayvan/markdown-tree-parser exclusively - **Simplified Flow**: Removed all manual steps, tool handles everything - **Code Block Awareness**: Tool automatically handles ## inside code blocks - **Content Preservation**: Tool preserves all markdown formatting and special content - **Heading Adjustment**: Tool automatically reduces heading levels by one - **Index Generation**: Tool automatically creates index.md - **Validation Steps**: Verification of tool installation and output - **Error Handling**: Halt conditions for tool and file system issues ### v6 Conventions Applied - ✅ Proper `` wrapper with id and name attributes - ✅ `` section with mandatory instructions - ✅ `` section with numbered `` elements - ✅ Used `` tags for required actions - ✅ Used `` tags for instruction lists and context - ✅ Conditional logic with `if` attributes on actions - ✅ Optional steps marked with `optional="true"` - ✅ Supporting sections for validation, halt conditions, output format - ✅ Consistent with existing v6 tasks (workflow.xml, adv-elicit.xml, index-docs.xml) --- ## Structural Comparison ### Legacy Format (Markdown) ```markdown # Document Sharding Task ## Primary Method: Automated Approach ## Manual Method (Fallback) 1. Identify target location 2. Parse sections ... ## Critical Guidelines ``` ### v6 Format (XML) ```xml ... ... ... ... ... ... ```yaml --- ## Validation Results ### XML Structure - ✅ Valid XML syntax - ✅ Properly nested elements - ✅ All tags closed correctly - ✅ Attributes properly formatted ### v6 Compliance - ✅ Matches v6 task conventions - ✅ Follows existing core task patterns - ✅ Uses standard v6 tag set - ✅ Proper section organization ### Content Integrity - ✅ All original instructions preserved - ✅ No functionality lost in conversion - ✅ Critical warnings maintained - ✅ Tool information preserved - ✅ Validation logic intact ### File System - ✅ Saved to correct location: `src/core/tasks/` - ✅ Proper filename: `shard-doc.xml` - ✅ Follows core task naming convention --- ## Usage Notes ### How to Invoke This Task From an agent or workflow, reference: ```xml {project-root}/bmad/core/tasks/shard-doc.xml ``` Or from agent menu: ```yaml menu: - trigger: shard description: 'Split large document into organized files' exec: '{project-root}/bmad/core/tasks/shard-doc.xml'