SKILL: Format Markdown
Last Updated: February 5, 2026
Table of Contents
1. Overview
Validates Markdown files against RULE_Markdown.md (formatting) and RULE_Document.md (content).
Use when: Preparing, creating, or updating Markdown documentation.
Do NOT use when: File is not Markdown format, or only reading without intent to modify.
2. Execution Workflow
Step 1: Load Rules
- •Read RULE_Markdown.md for formatting standards
- •Read RULE_Document.md for content rules
Step 2: Analyze Target File
- •Read target Markdown file
- •Detect file type by prefix (SNIPPET, IDEA, SKILL, RULE, AUDIT, SUMMARY)
Step 3: Validate by Priority
- •🚨 CRITICAL: Heading numbering, TOC, Last Updated date
- •❌ HIGH: Path notation, code snippets, table column alignment
- •⚠️ MEDIUM: Emoji usage, date format
Step 4: Check File-Specific Rules
- •SNIPPET: Section alignment with corresponding IDEA file
- •IDEA: No language/framework specifics
- •SKILL: YAML metadata present
- •RULE/SKILL: Restaurant app examples
Step 5: Apply Fixes
- •Fix identified issues
- •Update Last Updated date only if content changed
Step 6: Self-Verify
- •Run self-assessment checklist (Section 4)
- •Verify all changes applied correctly
Output (File): Edited target file (template: none) Output (Console): Validation summary (template: assets/TEMPLATE_Summary_SelfAssessment.md)
3. Best Practices
3.1 Large File Processing
For files ≥1,000 lines, use batch processing:
Per Batch:
- •Process 3-5 H2 sections at a time
- •Report progress: "Batch X of Y (Sections M-N)"
- •On failure: Reduce to 1-2 sections, retry
Completion: Final full-file verification before presenting results.
3.2 Table Validation
Algorithm:
- •Count longest cell content per column (include ALL characters)
- •Calculate column width as max content length plus 2 (one space padding each side)
- •Set separator dashes equal to column width exactly
- •Pad all cells to column width with trailing spaces
🚨 Post-Fix Verification: Re-read file, re-count columns after every change.
4. Self-Assessment Protocol
🚨 CRITICAL: Before presenting results, verify:
- • Re-read modified file after changes
- • All changes applied correctly
- • Last Updated: Updated only if content changed
- • TOC: Present with all H2/H3 anchor links
- • Heading numbers sequential (H2: 1, 2, 3; H3: 1.1, 1.2)
- • Table column width equals longest content plus 2 spaces padding
- • Separator dashes match column width exactly
- • No emojis in table headers or cells
- • Emojis followed by UPPERCASE text
5. Variable Reference
| Variable | Description | Example |
|---|---|---|
{filename} | Name of the validated file | IDEA_MenuService.md |
{file_type} | Document type prefix | IDEA |
{line_number} | Line number of issue | 42 |
{description} | Issue description | Column width mismatch |
{current_state} | Current problematic content | ❌ wrong |
{required_state} | Required correct format | ❌ WRONG |