chaojixinren/helloagents-go/docx
Claude Code and agent skill by chaojixinren/helloagents-go
- community
Checking that the SKILL.md file is still in the repository.
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When GLM needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks
Install
npx vskill@latest install chaojixinren/helloagents-go/docxSKILL.md
The same SKILL.md was published earlier as chaojixinren/helloagents-go/docx.
DOCX creation, editing, and analysis
Overview
A user may ask you to create, edit, or analyze the contents of a .docx file. A .docx file is essentially a ZIP archive containing XML files and other resources that you can read or edit. You have different tools and workflows available for different tasks.
Design requiremnet
Deliver studio-quality Word documents with deep thought on content, functionality, and styling. Users often don't explicitly request advanced features (covers, TOC, backgrounds, back covers, footnotes, charts)—deeply understand needs and proactively extend. The document must have 1.3x line spacing and have charts centered horizontally.
Available color(choose one)
- "Ink & Zen" Color Palette (Wabi-Sabi Style)
The design uses a grayscale "Ink" palette to differentiate from standard business blue/morandi styles. Primary (Titles):#0B1220 Body Text:#0F172A Secondary (Subtitles):#2B2B2B Accent (UI / Decor):#9AA6B2 Table Header / Subtle Background:#F1F5F9
- Wilderness Oasis": Sage & Deep Forest
Primary (Titles): #1A1F16 (Deep Forest Ink) Body Text: #2D3329 (Dark Moss Gray) Secondary (Subtitles): #4A5548 (Neutral Olive) Accent (UI/Decor): #94A3B8 (Steady Silver) Table/Background: #F8FAF7 (Ultra-Pale Mint White)
- "Terra Cotta Afterglow": Warm Clay & Greige
Commonly utilized by top-tier consulting firms and architectural studios, this scheme warms up the gray scale to create a tactile sensation similar to premium cashmere. Primary (Titles): #26211F (Deep Charcoal Espresso) Body Text: #3D3735 (Dark Umber Gray) Secondary (Subtitles): #6B6361 (Warm Greige) Accent (UI/Decor): #C19A6B (Terra Cotta Gold / Muted Ochre) Table/Background: #FDFCFB (Off-White / Paper Texture)
- "Midnight Code": High-Contrast Slate & Silver
Ideal for cutting-edge technology, AI ventures, or digital transformation projects. This palette carries a slight "electric" undertone that provides superior visual penetration. Primary (Titles): #020617 (Midnight Black) Body Text: #1E293B (Deep Slate Blue) Secondary (Subtitles): #64748B (Cool Blue-Gray) Accent (UI/Decor): #94A3B8 (Steady Silver) Table/Background: #F8FAFC (Glacial Blue-White)
Chinese plot PNG method**
If using Python to generate PNGs containing Chinese characters, note that Matplotlib defaults to the DejaVu Sans font which lacks Chinese support; since the environment already has the SimHei font installed, you should set it as the default by configuring:
matplotlib.font_manager.fontManager.addfont('/usr/share/fonts/truetype/chinese/SimHei.ttf') plt.rcParams['font.sans-serif'] = ['SimHei'] plt.rcParams['axes.unicode_minus'] = False
Specialized Element Styling
- Table Borders: Use a "Single" line style with a size of 12 and the Primary Ink color. Internal vertical borders should be set to Nil (invisible) to create a clean, modern horizontal-only look.
- CRITICAL: Table Cell Margins - ALL tables MUST set
marginsproperty at the Table level to prevent text from touching borders. This is mandatory for professional document quality.
Alignment and Typography
CJK body: justify + 2-char indent. English: left. Table numbers: right. Headings: no indent. For both languages, Must use a line spacing of 1.3x (250 twips). Do not use single line spacing !!!
CRITICAL: Chinese Quotes in JavaScript/TypeScript Code
MANDATORY: When writing JavaScript/TypeScript code for docx-js, ALL Chinese quotation marks (""", ''') inside strings MUST be escaped as Unicode escape sequences:
- Left double quote "\u201c" (")
- Right double quote "\u201d" (")
- Left single quote "\u2018" (')
- Right single quote "\u2019" (')
Example - INCORRECT (will cause syntax error):
Example - CORRECT:
Alternative - Use template literals:
Workflow Decision Tree
Reading/Analyzing Content
Use "Text extraction" or "Raw XML access" sections below.
Creating New Document
Use "Creating a new Word document" workflow.
Editing Existing Document
- Your own document + simple changes
Use "Basic OOXML editing" workflow
- Someone else's document
Use "Redlining workflow" (recommended default)
- Legal, academic, business, or government docs
Use "Redlining workflow" (required)
Reading and analyzing content
Note: For .doc (legacy format), first convert with libreoffice --convert-to docx file.doc.
Text extraction
If you just need to read the text contents of a document, you should convert the document to markdown using pandoc. Pandoc provides excellent support for preserving document structure and can show tracked changes:
Raw XML access
You need raw XML access for: comments, complex formatting, document structure, embedded media, and metadata. For any of these features, you'll need to unpack a document and read its raw XML contents.
Unpacking a file
python ooxml/scripts/unpack.py <office_file> <output_directory>
Key file structures
word/document.xml- Main document contentsword/comments.xml- Comments referenced in document.xmlword/media/- Embedded images and media files- Tracked changes use
<w:ins>(insertions) and<w:del>(deletions) tags
Creating a new Word document
When creating a new Word document from scratch, use docx-js, but use bun instead of node to implement it. which allows you to create Word documents using JavaScript/TypeScript.
Workflow
- MANDATORY - READ ENTIRE FILE: Read `docx-js.md` (~560 lines) completely from start to finish. NEVER set any range limits when reading this file. Read the full file content for detailed syntax, critical formatting rules, and best practices before proceeding with document creation.
- Create a JavaScript/TypeScript file using Document, Paragraph, TextRun components (You can assume all dependencies are installed, but if not, refer to the dependencies section below)
- Export as .docx using Packer.toBuffer()
TOC (Table of Contents)
If the document has more than three sections, generate a table of contents.
Implementation: Use docx-js TableOfContents component to create a live TOC that auto-populates from document headings.
CRITICAL: For TOC to work correctly:
- All document headings MUST use
HeadingLevel(e.g.,HeadingLevel.HEADING_1) - Do NOT add custom styles to heading paragraphs
- Place TOC before the actual heading content so it can scan them
Hint requirement: A hint paragraph MUST be added immediately after the TOC component with these specifications:
- Position: Immediately after the TOC component
- Alignment: Center-aligned
- Color: Gray (e.g., "999999")
- Font size: 18 (9pt)
- Language: Matches user conversation language
- Text content: Inform the user to right-click the TOC and select "Update Field" to show correct page numbers
TOC Placeholders (Required Post-Processing)
REQUIRED: After generating the DOCX file, you MUST add placeholder TOC entries that appear on first open (before the user updates the TOC). This prevents showing an empty TOC initially.
Implementation: Always run the add_toc_placeholders.py script after generating the DOCX file:
Note: The script supports up to 3 TOC levels for placeholder entries.
Entry format:
level: Heading level (1, 2, or 3)text: The heading textpage: Estimated page number (will be corrected when TOC is updated)
Auto-generating entries: You can extract the actual headings from the document structure to generate accurate entries. Match the heading text and hierarchy from your document content.
Benefits:
- Users see TOC content immediately on first open
- Placeholders are automatically replaced when user updates the TOC
- Improves perceived document quality and user experience
Document Formatting Rules
Page Break Restrictions Page breaks are ONLY allowed in these specific locations:
- Between cover page and table of contents (if TOC exists)
- Between cover page and main content (if NO TOC exists)
- Between table of contents and main content (if TOC exists)
All content after the table of contents must flow continuously WITHOUT page breaks.
Text and Paragraph Rules
- Complete sentences before starting a new line — do not break sentences across lines
- Use single, consistent style for each complete sentence
- Only start a new paragraph when the current paragraph is logically complete
List and Bullet Point Formatting
- Use left-aligned formatting (NOT justified alignment)
- Insert a line break after each list item
- Never place multiple items on the same line (justification stretches text)
Editing an existing Word document
Note: For .doc (legacy format), first convert with libreoffice --convert-to docx file.doc.
When editing an existing Word document, use the Document library (a Python library for OOXML manipulation). The library automatically handles infrastructure setup and provides methods for document manipulation. For complex scenarios, you can access the underlying DOM directly through the library.
Workflow
- MANDATORY - READ ENTIRE FILE: Read `ooxml.md` (~600 lines) completely from start to finish. NEVER set any range limits when reading this file. Read the full file content for the Document library API and XML patterns for directly editing document files.
- Unpack the document:
python ooxml/scripts/unpack.py <office_file> <output_directory> - Create and run a Python script using the Document library (see "Document Library" section in ooxml.md)
- Pack the final document:
python ooxml/scripts/pack.py <input_directory> <office_file>
The Document library provides both high-level methods for common operations and direct DOM access for complex scenarios.
Adding Comments (批注)
Comments (批注) allow you to add annotations to documents without modifying the actual content. This is useful for review feedback, explanations, or questions about specific parts of a document.
Recommended Method: Using python-docx (简单推荐)
The simplest and most reliable way to add comments is using the python-docx library:
Key points:
- Install:
pip install python-docxorbun add python-docx - Works directly on .docx files (no need to unpack/pack)
- Simple API, reliable results
- Comments appear in Word's comment pane with Z.ai as author
Common patterns:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/docx/SKILL.md
Popularity
- Repository stars
- 89
- Repository forks
- 21
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/chaojixinren/helloagents-go/docx)