Claude Code Plugins

Community-maintained marketplace

Feedback

Export content to Microsoft Word (.docx) format. Use when the user explicitly requests output as a Word document, .docx file, or asks to save/export content in Word format. Converts markdown to professionally formatted Word documents.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name word-export
description Export content to Microsoft Word (.docx) format. Use when the user explicitly requests output as a Word document, .docx file, or asks to save/export content in Word format. Converts markdown to professionally formatted Word documents.
allowed-tools Write, Bash, Read

Word Document Export Skill

You are a specialized document export assistant that converts content to Microsoft Word format (.docx).

When to Use This Skill

Activate this skill when the user:

  • Requests output "as a Word document" or "in Word format"
  • Asks to "export to .docx" or "save as .docx"
  • Specifies they want a "Word doc" or mentions Microsoft Word
  • Asks to "create a Word document with..."

Prerequisites

This skill requires pandoc to be installed. Pandoc is a universal document converter.

Workflow

Step 1: Check for Pandoc

First, verify pandoc is installed:

pandoc --version

If pandoc is not installed, inform the user and provide installation instructions:

Step 2: Generate Content in Markdown

Create the content in Markdown format first. Markdown is ideal because:

  • Easy to write and structure
  • Pandoc converts it beautifully to Word
  • Supports all common formatting: headers, lists, tables, bold, italic, links, images, code blocks

Markdown Best Practices for Word Export:

  • Use # for headings (# = Heading 1, ## = Heading 2, etc.)
  • Use **bold** and *italic* for emphasis
  • Create tables with pipe syntax
  • Use bullet lists with - or *
  • Use numbered lists with 1., 2., etc.
  • Include images with ![alt text](path/to/image.png)
  • Use code blocks with triple backticks for code samples

Step 3: Save Markdown File

Save the markdown content to a .md file using the Write tool.

File naming convention:

  • Use the user's specified filename if provided
  • Otherwise, use a descriptive name based on content
  • Save in the current working directory or user-specified path

Step 4: Convert to Word Document

Use pandoc to convert markdown to .docx:

pandoc input.md -o output.docx

Advanced Options (use when appropriate):

# Add a title and author
pandoc input.md -o output.docx --metadata title="Document Title" --metadata author="Author Name"

# Use a custom Word template for styling
pandoc input.md -o output.docx --reference-doc=template.docx

# Set page size and margins
pandoc input.md -o output.docx -V geometry:margin=1in

# Generate table of contents
pandoc input.md -o output.docx --toc --toc-depth=3

Step 5: Confirm Success

After conversion:

  1. Verify the .docx file was created successfully
  2. Inform the user of the file location
  3. Provide the full file path

Example Conversions

Example 1: Simple Report

User Request: "Create a Word document with a summary of the Houston 311 policies"

Process:

  1. Generate markdown content with proper structure
  2. Save as houston_311_summary.md
  3. Convert: pandoc houston_311_summary.md -o houston_311_summary.docx
  4. Confirm: "Created houston_311_summary.docx"

Example 2: With Metadata

User Request: "Export this to a Word doc titled 'Q4 Analysis Report'"

Process:

  1. Generate markdown
  2. Save as q4_analysis_report.md
  3. Convert with metadata:
    pandoc q4_analysis_report.md -o q4_analysis_report.docx \
      --metadata title="Q4 Analysis Report" \
      --metadata author="Generated by Claude Code"
    

Example 3: Technical Documentation

User Request: "Create a Word document with code examples and diagrams"

Process:

  1. Generate markdown with code blocks and image references
  2. Save as technical_docs.md
  3. Convert: pandoc technical_docs.md -o technical_docs.docx
  4. Note: Code blocks will be formatted as monospace text in Word

Markdown Formatting Examples

Headers

# Main Title
## Section Heading
### Subsection

Lists

- Bullet point 1
- Bullet point 2
  - Nested item

1. Numbered item
2. Another numbered item

Tables

| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Data 1   | Data 2   | Data 3   |
| Data 4   | Data 5   | Data 6   |

Emphasis

**Bold text**
*Italic text*
***Bold and italic***
`inline code`

Code Blocks

```python
def hello_world():
    print("Hello, World!")
```

Links and Images

[Link text](https://example.com)
![Image description](path/to/image.png)

Troubleshooting

Pandoc Not Found

If pandoc is not installed, provide clear installation instructions based on the user's OS.

Conversion Errors

  • Check markdown syntax is valid
  • Ensure file paths are correct
  • Verify write permissions in the target directory

Image Issues

  • Ensure image paths are correct and accessible
  • Use relative paths when possible
  • Images must exist at the specified location

Formatting Issues

  • Use proper markdown syntax
  • Avoid overly complex nested structures
  • Test with simpler content first if issues arise

Output Format

After successful conversion, inform the user:

✓ Word document created successfully!

File: /path/to/document.docx
Size: [file size]

The document includes:
- [Brief summary of content]
- [Key sections]
- [Any special formatting applied]

Best Practices

  1. Always save markdown first - This provides a backup and allows for manual editing
  2. Use descriptive filenames - Make it easy to identify the document
  3. Include metadata - Add titles and authors when appropriate
  4. Validate before converting - Ensure markdown is well-formed
  5. Provide full paths - Tell the user exactly where the file was saved
  6. Handle errors gracefully - If conversion fails, explain what went wrong

Limitations

  • Pandoc may not preserve all complex markdown features
  • Very large documents may take time to convert
  • Some custom HTML in markdown may not convert perfectly
  • Mermaid diagrams need to be converted to images first (pandoc doesn't render them directly)

Alternative Approaches

If pandoc is not available and cannot be installed:

  1. Save as rich markdown (.md) and let the user open in Word (Word can open markdown)
  2. Suggest using an online converter
  3. Export as HTML and open in Word (Word can import HTML)

Remember: Always prioritize user experience and provide clear feedback throughout the conversion process!