home / skills / feiwanghub / playground / docx-skill

docx-skill skill

/skills/.trae/skills/docx-skill

This skill reads text from and creates Microsoft Word documents, enabling easy extraction and markdown-driven doc generation.

npx playbooks add skill feiwanghub/playground --skill docx-skill

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
557 B
---
name: docx-skill
description: "Read text from and create Microsoft Word documents (.docx)."
---

# DOCX Skill

This skill provides tools to interact with Microsoft Word documents.

## Capabilities

- **Read**: Extract full text from `.docx` files.
- **Create**: Generate `.docx` files from simple Markdown-formatted text.

## Usage

### Read a Document

```bash
python3 .shared/docx-skill/scripts/docx_tool.py read "document.docx"
```

### Create a Document

```bash
python3 .shared/docx-skill/scripts/docx_tool.py create "content.md" "output.docx"
```

Overview

This skill reads text from and creates Microsoft Word (.docx) documents. It extracts full plain text from existing .docx files and generates new .docx files from simple Markdown-formatted content. The focus is fast, reliable conversion for automation and content pipelines.

How this skill works

The skill inspects .docx files and extracts all readable text, preserving paragraph boundaries and basic ordering. For creation, it converts simple Markdown input into a .docx document, mapping headings, paragraphs, and basic formatting into Word structures. Both operations are available via simple command-line entry points for integration into scripts and CI workflows.

When to use it

  • You need to extract the full text content of .docx files for indexing, search, or analysis.
  • You want to generate Word documents from Markdown source for distribution or reporting.
  • Automating document conversion as part of a content pipeline or batch job.
  • Converting legacy .docx files into plain text for data processing or NLP tasks.

Best practices

  • Provide clean, simple Markdown when creating documents to ensure predictable formatting.
  • Validate .docx files for corruption before processing to avoid extraction errors.
  • Use the tool in batch scripts for large-scale conversions to keep operations repeatable.
  • Check output documents for complex formatting needs; advanced styles may require manual adjustments.

Example use cases

  • Extract text from many .docx reports to build a searchable corpus for enterprise search.
  • Convert Markdown release notes into a polished .docx file to share with stakeholders.
  • Automate nightly conversion of generated Markdown documentation into Word for legal review.
  • Preprocess .docx resumes into plain text before feeding them into an applicant screening pipeline.

FAQ

Does the skill preserve complex Word formatting like tables and images?

It focuses on extracting text and converting simple Markdown. Complex elements like advanced tables, embedded objects, or detailed image placement may not be preserved fully.

What input formats are supported for creation?

Creation accepts simple Markdown-formatted text as input, converting headings and paragraphs into .docx structure.