agentsclimarketplace

Docx to md

Skill fabioc-aloha/Alex_Skill_Mall/plugins/converters/docx-to-md

284 curated plugins for AI assistants across 16 categories: security, Azure, documentation, code quality, cloud infrastructure, and more. Works with GitHub Copilot. Drop into .github/skills/local/ and go.

Install
npx -y skills add fabioc-aloha/Alex_Skill_Mall --skill docx-to-md

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Convert Word documents (.docx) to clean Markdown with image extraction and pandoc cleanup

SKILL.md

8.4 KB, ~2.0k tokens by cl100k_base, as published. Nobody here has run it

Word to Markdown Conversion

Ingest Word documents into your Markdown workflow — clean, linted, version-control ready

Staleness Watch: See EXTERNAL-API-REGISTRY.md for source URLs and recheck cadence

Convert .docx files into clean, linted Markdown with extracted images, normalized headings, and cleaned table formatting. The reverse converter for ingesting external documents into a Markdown-based workflow.


When to Use

  • Importing Word documents from stakeholders into a Markdown-based workflow
  • Converting legacy documentation to Markdown for version control
  • Extracting content from .docx for further processing (presentations, email, web)
  • Onboarding external resources (SOWs, RFPs, specs) into project repositories
  • Migrating from Word-based documentation to docs-as-code
  • Preparing content for static site generators (VitePress, Docusaurus, etc.)

Supported Content

Content TypeStatusNotes
HeadingsHierarchy normalized to start at H1
Bold/ItalicConverted to Markdown syntax
LinksPreserved as Markdown links
ImagesExtracted to images/ folder
TablesCleaned and aligned
ListsOrdered, unordered, nested
Code blocks⚠️Detected if styled as code
FootnotesConverted to Markdown footnotes
Comments⚠️Stripped with --strip-comments
Track changesAccept/reject before converting
Embedded objectsExtract manually

Key Features

FeatureDetails
Image extractionEmbedded images saved to images/ folder with sequential naming
Pandoc cleanupRemoves escaped brackets, span classes, trailing backslashes
Table normalizationAligns columns, adds proper separators
Heading fixNormalizes hierarchy to start at H1
FrontmatterOptional YAML frontmatter with title and date
Comment strippingRemoves Word review comments

Usage

# Basic conversion
node .github/muscles/docx-to-md.cjs report.docx

# With frontmatter and heading normalization
node .github/muscles/docx-to-md.cjs spec.docx --add-frontmatter --fix-headings

# Strip review comments
node .github/muscles/docx-to-md.cjs reviewed.docx --strip-comments

# Custom output path
node .github/muscles/docx-to-md.cjs input.docx output/document.md

# Debug mode (keeps raw pandoc output)
node .github/muscles/docx-to-md.cjs input.docx --debug

# Full cleanup pipeline
node .github/muscles/docx-to-md.cjs spec.docx --add-frontmatter --fix-headings --strip-comments --clean-tables

Options Reference

OptionDefaultDescription
--extract-imagestrueExtract images to images/ folder
--no-extract-images-Keep images as raw base64 in markdown
--add-frontmatteroffGenerate YAML frontmatter with title/date
--clean-tablestrueNormalize table column widths
--no-clean-tables-Keep pandoc raw table output
--fix-headingsoffNormalize heading hierarchy to start at H1
--wrap N0Wrap lines at N characters (0 = no wrap)
--strip-commentsoffRemove Word comment annotations
--debugoffKeep intermediate pandoc output

Post-Processing Pipeline

The conversion follows a multi-stage cleanup:

.docx → pandoc → raw MD → cleanup → clean MD
                            ↓
                    1. Escaped brackets removed
                    2. Trailing backslashes removed
                    3. Span classes stripped
                    4. Image attributes cleaned
                    5. Comments stripped (optional)
                    6. Headings normalized (optional)
                    7. Tables reformatted
                    8. Images extracted
                    9. Frontmatter added (optional)

Pandoc Cleanup Details

Pandoc QuirkBeforeAfter
Escaped brackets\[text\][text]
Trailing backslashesline\line
Span classes{.underline}(removed)
Image attributes{width="5in"}(removed)
Heading anchors{#section-1}(removed)
Excessive blank lines\n\n\n\n\n\n

Image Extraction

Embedded images are extracted to a sibling images/ folder:

input/
├── document.docx
└── document.md (output)
    └── images/
        ├── image1.png
        ├── image2.png
        └── image3.jpg

Image references in markdown are updated automatically:

![](images/image1.png)

Common Workflows

Stakeholder Document Ingestion

# Convert with full cleanup
node .github/muscles/docx-to-md.cjs stakeholder-spec.docx \
  --add-frontmatter --fix-headings --strip-comments

# Validate output
node .github/muscles/markdown-lint.cjs stakeholder-spec.md

# Review and commit
git add stakeholder-spec.md images/
git commit -m "docs: ingest stakeholder specification"

Legacy Documentation Migration

# Batch convert all Word docs
Get-ChildItem *.docx | ForEach-Object {
  node .github/muscles/docx-to-md.cjs $_.FullName --add-frontmatter --fix-headings
}

Troubleshooting

ProblemCauseSolution
"pandoc not found"pandoc not installedwinget install pandoc
Images missingExtraction failedCheck images/ folder, re-run
Tables misalignedComplex table structureManual cleanup may be needed
Headings start at H3Original doc structureUse --fix-headings
Comments in outputTrack changes not strippedUse --strip-comments
Encoding issuesNon-UTF8 contentRe-save .docx as UTF-8

Limitations

  • Track changes: Accept or reject all changes in Word before converting
  • Embedded objects: Charts, SmartArt, etc. must be extracted manually
  • Complex tables: Merged cells may not convert cleanly
  • Styles: Word styles are lost (only structural elements preserved)
  • Headers/footers: Not extracted (document body only)

Requirements

  • Node.js 24+
  • pandoc (winget install pandoc)

Muscle Script

.github/muscles/docx-to-md.cjs (v1.0.0)


Conversion Acceptance Decision Table

ConditionVerdictAction
All headings mapped to correct # levelsAcceptVerify no skipped heading levels
Headings rendered as bold paragraphs instead of #RejectCheck pandoc --shift-heading-level and source styles
Tables converted to valid Markdown pipe tablesAcceptSpot-check alignment
Complex tables (merged cells) lose structureWarningManual restructure or use HTML table fallback
Images extracted and linked with relative pathsAcceptVerify image files exist in output dir
Images lost or referenced with absolute Windows pathsRejectUse --extract-media with correct output dir
Footnotes converted to Markdown footnote syntaxAcceptVerify numbering is sequential
Footnotes lost or inlined as parenthetical textWarningCheck pandoc footnote handling
Code blocks preserve monospace and indentationAcceptVerify language fence tags present
Track changes / comments stripped from outputAcceptExpected — Markdown has no change tracking
Track changes rendered as visible markupRejectAccept or reject all changes before conversion
Bullet and numbered lists preserve nestingAcceptVerify indent levels match source
Output passes markdownlint with zero errorsAcceptRun lint-clean-markdown post-conversion
Round-trip (docx→md→docx) preserves semantic contentAcceptFormatting differences OK; content loss is not

Related Skills

  • md-to-word — Reverse direction (Markdown to Word)
  • lint-clean-markdown — Post-validate converted Markdown
  • md-scaffold — Template for structuring imported content
  • md-to-html — Convert result to HTML for web
  • md-to-eml — Convert result to email

Skill version: 2.0.0 | Last updated: 2026-04-14 | Category: document-conversion

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.