docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.

Install

Hot:31

Download and extract to your skills directory

Copy command and send to AI Agent for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-skills-docx&locale=en&source=copy

DOCX Document Processing Skill

Skill Overview


The DOCX skill is a comprehensive Word document (.docx) processing tool. It supports creating, editing, and analyzing Microsoft Word documents through code, enabling developers to programmatically generate professionally formatted reports, contracts, memoranda, and other types of documents.

Use Cases

1. Batch Generation of Professional Documents


When you need to automate the generation of large numbers of properly formatted Word documents, this skill can help you create professional documents containing complete elements such as tables, images, headers and footers, and tables of contents. Examples include batch-generating customer reports, automatically generating contract templates, and dynamically creating invoices or quotations.

2. Editing and Converting Existing Documents


When you need to perform batch modifications, extract content from, or convert existing .docx files, this skill provides comprehensive document-processing capabilities. Examples include batch-replacing document content, accepting tracked changes, converting .doc files to .docx, and converting Word documents to PDF or images.

3. Programmatic Document Operations


When you need to integrate Word document processing into an application, this skill provides flexible API interfaces. Examples include generating reports from database data, adding Word export functionality to web applications, and automating document-processing workflows in office environments.

Core Features

1. Creating Word Documents with JavaScript


Based on the docx-js library, this skill provides a complete JavaScript API for creating .docx documents. It supports adding various document elements, including headings, paragraphs, tables, images, headers and footers, tables of contents, hyperlinks, footnotes, and page breaks. It also allows customization of page size, styles, multi-column layouts, and other formatting settings.

2. Editing Existing Documents via XML


Using a three-step process—unpack → edit XML → repack—you can directly manipulate the underlying XML structure of .docx files. This approach is suitable for advanced editing needs such as precisely modifying document content, adding comments, handling tracked changes, and adjusting formatting.

3. Document Analysis and Conversion


The skill provides a variety of document-processing tools, including using pandoc to extract text, using LibreOffice for format conversion, and generating document preview images. It supports converting Word documents to PDF, extracting them as plain text, and accepting all tracked changes.

Frequently Asked Questions

How do I create a Word document with JavaScript?


You can use the docx-js library to create a .docx file with JavaScript code. First, install it with npm install -g docx, then import the required components (such as Document, Paragraph, and Table) in your code, configure the document structure and content, and finally generate the file using Packer.toBuffer(). This skill supports creating professional documents containing complete elements such as tables, images, headers and footers, and tables of contents.

What Word document features does the DOCX skill support?


This skill supports comprehensive Word document processing capabilities, including creating and editing documents; adding various elements such as paragraphs, headings, tables, images, hyperlinks, and footnotes; configuring page formatting such as size, margins, orientation, and multi-column layouts; adding headers, footers, and page numbers; generating tables of contents; handling lists and numbering; and adding comments and tracked changes. It also supports document format conversion, such as converting .doc to .docx, Word to PDF, and Word to images.

How do I edit an existing .docx file?


Editing an existing document follows a three-step process: first, use python scripts/office/unpack.py to extract the document and obtain the XML files; then directly edit the XML files to modify the content or formatting; and finally use python scripts/office/pack.py to repackage the files and generate a new .docx file. This method supports precisely modifying document content, adding comments, handling tracked changes, and adjusting styles. The tools automatically validate and fix common XML issues.