Use when you have a written implementation plan to execute in a separate session with review checkpoints
npx skills add millord237/10X-Canva-Skills --skill "local-docx-editor"
Install specific skill from multi-skill repository
# Description
|
# SKILL.md
name: local-docx-editor
description: |
Edit Word documents (DOCX) locally without Canva API. Use this skill when user provides
a DOCX file and wants to modify content, update formatting, or restructure document.
Maintains original styles, fonts, spacing, and layout. Does NOT require Canva.
Output goes to output/ folder. Use for: "edit this document", "update section 3", "change Word file".
Local DOCX Editor Skill
Edit and manipulate Word documents locally without requiring Canva API.
⚠️ CRITICAL DESIGN PRESERVATION RULES (MANDATORY)
These rules are NON-NEGOTIABLE. Violating them will break the document design.
🚫 NEVER DO THESE THINGS:
- NEVER create new text boxes - Word documents rarely use text boxes; only modify existing ones
- NEVER add new shapes or elements - Only modify EXISTING elements
- NEVER add new sections from scratch - COPY existing section structure
- NEVER change font sizes - Unless user EXPLICITLY requests it
- NEVER change font styles/colors - Unless user EXPLICITLY requests it
- NEVER change alignments - Unless user EXPLICITLY requests it
- NEVER change margins or spacing - Unless user EXPLICITLY requests it
- NEVER change headers/footers - Unless user EXPLICITLY requests it
- NEVER modify templates/styles - Unless user EXPLICITLY requests it
- NEVER add/remove table columns - Unless user EXPLICITLY requests it
✅ ALWAYS DO THESE THINGS:
- ALWAYS replace text within existing paragraphs only
- ALWAYS preserve all formatting (font, size, color, style, alignment)
- ALWAYS copy existing paragraph/section structure for new content
- ALWAYS analyze document structure first before any modification
- ALWAYS identify body text vs headers/footers/decorative elements
- ALWAYS maintain existing styles when replacing content
How to Add New Content (CORRECT WAY):
# WRONG - Adds completely new paragraph with default formatting
doc.add_paragraph("New text")
# CORRECT - Find similar paragraph, copy its style, then modify
existing_para = doc.paragraphs[5] # Find one with similar purpose
# Use its style for new content
How to Update Content (CORRECT WAY):
# WRONG - Might change formatting
paragraph.text = "New text"
# CORRECT - Replace text while preserving runs and formatting
for run in paragraph.runs:
if "old text" in run.text:
run.text = run.text.replace("old text", "new text")
CRITICAL: Never Modify Original Files
- ALWAYS copy the original to
output/working/first - ALL edits happen on the copy
- SAVE results to
output/docx/ - ORIGINAL file remains untouched
When to Use This Skill
Use this skill when:
- User provides a DOCX/DOC file and wants modifications
- Need to update text while maintaining formatting
- Need to update tables
- Need to update content within existing structure
- User has NOT explicitly asked to use Canva
Capabilities
Read Operations (SAFE - No Risk)
- Extract all text content
- Get document structure (headings, paragraphs)
- Extract images and tables
- Get styles and formatting info
- Identify editable vs structural elements
Write Operations (FOLLOW PRESERVATION RULES)
- Replace text in existing paragraphs (NOT add new paragraphs)
- Update table cells (NOT add/remove columns)
- Replace images in existing image placeholders
- Bulk text replacement across document
❌ Operations NOT Supported (To Preserve Design)
- Adding new text boxes
- Adding new shapes
- Changing fonts/colors/sizes (unless explicitly requested)
- Modifying headers/footers (unless explicitly requested)
- Changing margins or page layout
- Adding/removing table columns
Conversion
- DOCX to PDF
- DOCX to plain text
Running Python Scripts (Virtual Environment)
IMPORTANT: Always use the virtual environment Python:
# Windows
.venv\Scripts\python.exe scripts/local/script_name.py
# macOS/Linux
.venv/bin/python scripts/local/script_name.py
Workflow
Step 1: Create Safe Copy
.venv\Scripts\python.exe scripts/local/safe_copy.py --source "input/document.docx"
Step 2: Analyze
.venv\Scripts\python.exe scripts/local/docx_utils.py "output/working/document_copy.docx"
Step 3: Make Modifications
Use docx_utils.py for:
- Find and replace text
- Update specific paragraphs
- Modify table cells
Step 4: Save Result
Save to output/docx/document_modified.docx
3-Mode Workflow
MODE 1: PLAN
- Analyze document structure
- List sections and word counts
- Document proposed changes
MODE 2: CLARIFY
- Confirm content to modify
- Verify formatting requirements
- Check word count targets
MODE 3: IMPLEMENT
- Create working copy
- Apply modifications
- Save to output folder
Maintaining Format Integrity
Preservation Rules
- Styles - Preserve all named styles
- Spacing - Line and paragraph spacing
- Lists - Bullet and numbering styles
- Tables - Column widths and formatting
Research Capabilities
This skill can:
- Search for Word document best practices
- Look up python-docx documentation
- Research document formatting standards
- Find solutions to specific challenges
Available Scripts
docx_utils.py- Core DOCX analysis and manipulationsafe_copy.py- Create working copies safely
Todo List Tracking (REQUIRED)
ALWAYS use TodoWrite to track progress:
[
{"content": "Create safe working copy", "status": "in_progress", "activeForm": "Creating safe copy"},
{"content": "Analyze document structure", "status": "pending", "activeForm": "Analyzing document"},
{"content": "Apply modifications", "status": "pending", "activeForm": "Applying changes"},
{"content": "Save to output/docx/", "status": "pending", "activeForm": "Saving result"}
]
Output Location
output/docx/- Modified documentsoutput/working/- Working copies
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.