Customization
Before executing, check for user customizations at:
~/.opencode/PAI/USER/SKILLCUSTOMIZATIONS/Documents/
If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior. If the directory does not exist, proceed with skill defaults.
🚨 MANDATORY: Voice Notification (REQUIRED BEFORE ANY ACTION)
You MUST send this notification BEFORE doing anything else when this skill is invoked.
Send voice notification:
curl -s -X POST http://localhost:8888/notify \
-H "Content-Type: application/json" \
-d '{"message": "Running the WORKFLOWNAME workflow in the Documents skill to ACTION"}' \
> /dev/null 2>&1 &
Output text notification:
Running the **WorkflowName** workflow in the **Documents** skill to ACTION...
This is not optional. Execute this curl command immediately upon skill invocation.
Documents Skill
🎯 Load Full PAI Context
Before starting any task with this skill, load complete PAI context:
read ~/.opencode/PAI/SKILL.md
When to Activate This Skill
Word Documents (DOCX)
- User wants to create, edit, or analyze Word documents
- User mentions "tracked changes", "redlining", "document review"
- User needs to convert documents to other formats
- User wants to work with document structure, comments, or formatting
PDF Files
- User wants to create, merge, split, or manipulate PDFs
- User mentions "extract text from PDF", "PDF tables", "fill PDF form"
- User needs to convert PDFs to/from other formats
- User wants to add watermarks, passwords, or extract images
PowerPoint Presentations (PPTX)
- User wants to create or edit presentations
- User mentions "slides", "presentation template", "speaker notes"
- User needs to convert presentations to other formats
- User wants to work with slide layouts or design elements
Excel Spreadsheets (XLSX)
- User wants to create or edit spreadsheets
- User mentions "formulas", "financial model", "data analysis"
- User needs to work with Excel tables, charts, or pivot tables
- User wants to convert spreadsheets to/from other formats
🔀 Document Type Routing
This skill organizes document processing across 4 document types:
Word Documents (DOCX)
Reference Documentation:
docx/SKILL.md - Complete DOCX processing guide
docx/docx-js.md - Creating new documents with JavaScript
docx/ooxml.md - Editing existing documents with OOXML
Routing Logic:
- "Create Word document", "new docx" → Create workflow (docx-js)
- "Edit Word document", "tracked changes", "redlining" → Edit workflow (OOXML)
- "Read Word document", "extract text from docx" → Read workflow (pandoc)
- "Document review", "track changes" → Redlining workflow
Supporting Resources:
- Scripts:
~/.opencode/skills/documents/docx/Scripts/
- OOXML tools:
~/.opencode/skills/documents/docx/ooxml/
- License:
~/.opencode/skills/documents/docx/LICENSE.txt
Key Capabilities:
- Create professional documents with docx-js
- Edit with tracked changes (redlining workflow)
- Extract text/comments with pandoc
- Convert to images for visual inspection
- Work with raw OOXML for advanced features
PDF Processing
Reference Documentation:
pdf/SKILL.md - Complete PDF processing guide
pdf/forms.md - Filling PDF forms
pdf/reference.md - Advanced features and troubleshooting
Routing Logic:
- "Create PDF" → Creation workflow (reportlab)
- "Merge PDFs", "split PDF" → Manipulation workflow (pypdf)
- "Extract text from PDF" → Extraction workflow (pdfplumber)
- "Fill PDF form" → Forms workflow (pdf-lib or pypdf)
- "Extract tables from PDF" → Table extraction (pdfplumber + pandas)
Supporting Resources:
- Scripts:
~/.opencode/skills/documents/pdf/Scripts/
- License:
~/.opencode/skills/documents/pdf/LICENSE.txt
Key Capabilities:
- Create PDFs with reportlab
- Extract text/tables with pdfplumber
- Merge/split with pypdf or qpdf
- Fill forms programmatically
- Add watermarks and password protection
- Extract images from PDFs
PowerPoint Presentations (PPTX)
Reference Documentation:
pptx/SKILL.md - Complete PPTX processing guide
pptx/html2pptx.md - Creating presentations from HTML
pptx/ooxml.md - Editing existing presentations
Routing Logic:
- "Create presentation", "new slides" → Creation workflow (html2pptx)
- "Edit presentation", "modify slides" → Edit workflow (OOXML)
- "Use presentation template" → Template workflow
- "Extract slide text" → Read workflow (markitdown)
- "Create thumbnail grid" → Thumbnail workflow
Supporting Resources:
- Scripts:
~/.opencode/skills/documents/pptx/Scripts/
- OOXML tools:
~/.opencode/skills/documents/pptx/ooxml/
- License:
~/.opencode/skills/documents/pptx/LICENSE.txt
Key Capabilities:
- Create presentations with html2pptx (HTML → PPTX)
- Professional design with color palettes and layouts
- Edit with OOXML for advanced features
- Work with templates (rearrange, inventory, replace)
- Generate thumbnail grids for visual analysis
- Convert to images for inspection
Excel Spreadsheets (XLSX)
Reference Documentation:
xlsx/SKILL.md - Complete XLSX processing guide
xlsx/recalc.py - Formula recalculation script
Routing Logic:
- "Create spreadsheet", "new Excel file" → Creation workflow (openpyxl)
- "Edit spreadsheet", "modify Excel" → Edit workflow (openpyxl)
- "Analyze data", "read Excel" → Analysis workflow (pandas)
- "Financial model", "formulas" → Financial modeling workflow
- "Recalculate formulas" → Recalculation workflow (recalc.py)
Supporting Resources:
- Recalc script:
~/.opencode/skills/documents/xlsx/recalc.py
- License:
~/.opencode/skills/documents/xlsx/LICENSE.txt
Key Capabilities:
- Create spreadsheets with formulas (openpyxl)
- Data analysis with pandas
- Financial modeling with color coding standards
- Formula recalculation with LibreOffice
- Error detection and validation
- Preserve formatting and formulas when editing
📋 Document Processing Principles
DOCX Best Practices
- Tracked Changes - Use redlining workflow for professional document review
- Minimal Edits - Only mark text that actually changes, preserve original RSIDs
- Batch Changes - Group related edits (3-10 changes) for efficient processing
- Verification - Always convert to markdown to verify changes applied correctly
PDF Best Practices
- Library Selection - pypdf for basic ops, pdfplumber for text/tables, reportlab for creation
- OCR for Scanned - Use pytesseract + pdf2image for scanned documents
- Form Filling - Follow forms.md for programmatic form completion
- Command Line - Use qpdf/pdftotext for simple operations
PPTX Best Practices
- Design First - Analyze content and choose appropriate colors/layouts before coding
- Web-Safe Fonts - Only use web-safe fonts (Arial, Helvetica, Times, etc.)
- Visual Verification - Always generate thumbnails to inspect layout issues
- Template Analysis - Create inventory before using templates to understand structure
XLSX Best Practices
- Use Formulas - ALWAYS use Excel formulas, NEVER hardcode calculated values
- Zero Errors - Deliver with zero formula errors (#REF!, #DIV/0!, etc.)
- Recalculate - Run recalc.py after creating/editing to update formula values
- Financial Standards - Follow color coding (blue inputs, black formulas, green links)
Examples
Example 1: Create proposal with tracked changes
User: "Create a consulting proposal doc with redlining"
→ Routes to DOCX workflows
→ Creates document with docx-js
→ Enables tracked changes for review workflow
→ Outputs professional .docx with revision marks
Example 2: Fill a PDF form programmatically
User: "Fill out this NDA PDF with my info"
→ Routes to PDF workflows
→ Reads form fields from PDF
→ Fills fields programmatically with pdf-lib
→ Outputs completed, flattened PDF
Example 3: Build financial model spreadsheet
User: "Create a revenue projection spreadsheet"
→ Routes to XLSX workflows
→ Creates workbook with openpyxl
→ Adds formulas (never hardcoded values)
→ Runs recalc.py to update calculations
🔗 Integration with Other Skills
Feeds Into:
- writing skill - Creating documents for blog posts and newsletters
- business skill - Creating consulting proposals and financial models
- research skill - Extracting data from research documents
Uses:
- media skill - Creating images for document illustrations
- development skill - Building document processing automation
- system skill - Command-line tools and scripting
🎯 Key Principles
Document Creation
- Quality First - Professional formatting and structure from the start
- Template Reuse - Leverage existing templates when available
- Validation - Always verify output (visual inspection, error checking)
- Automation - Use scripts for repetitive tasks
Document Editing
- Preserve Intent - Maintain original formatting and structure
- Track Changes - Use proper workflows for document review
- Batch Processing - Group related operations for efficiency
- Error Prevention - Validate before finalizing
Document Analysis
- Right Tool - Choose appropriate library/tool for the task
- Data Integrity - Preserve original data when extracting/converting
- Format Awareness - Understand document structure (OOXML, PDF structure, etc.)
- Performance - Use efficient methods for large documents
📚 Full Reference Documentation
Word Documents (DOCX):
- Main Guide:
~/.opencode/skills/documents/docx/SKILL.md
- Creation Reference:
~/.opencode/skills/documents/docx/docx-js.md
- Editing Reference:
~/.opencode/skills/documents/docx/ooxml.md
PDF Processing:
- Main Guide:
~/.opencode/skills/documents/pdf/SKILL.md
- Forms Guide:
~/.opencode/skills/documents/pdf/forms.md
- Advanced Reference:
~/.opencode/skills/documents/pdf/reference.md
PowerPoint Presentations (PPTX):
- Main Guide:
~/.opencode/skills/documents/pptx/SKILL.md
- Creation Reference:
~/.opencode/skills/documents/pptx/html2pptx.md
- Editing Reference:
~/.opencode/skills/documents/pptx/ooxml.md
Excel Spreadsheets (XLSX):
- Main Guide:
~/.opencode/skills/documents/xlsx/SKILL.md
- Recalc Script:
~/.opencode/skills/documents/xlsx/recalc.py
Summary
The documents skill provides comprehensive document processing:
- DOCX - Create, edit, analyze Word documents with tracked changes support
- PDF - Create, manipulate, extract from PDFs with form filling capabilities
- PPTX - Create, edit presentations with professional design and templates
- XLSX - Create, edit spreadsheets with formulas and financial modeling
Reference-based organization - Each document type has complete guides and tooling
Routing is automatic - Analyzes user intent and activates appropriate document type workflow
Professional quality - Standards and best practices for production-ready documents
1---2name: documents3description: Document processing. USE WHEN document, process file. SkillSearch('documents') for docs.4---56## Customization78**Before executing, check for user customizations at:**9`~/.opencode/PAI/USER/SKILLCUSTOMIZATIONS/Documents/`1011If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior. If the directory does not exist, proceed with skill defaults.121314## 🚨 MANDATORY: Voice Notification (REQUIRED BEFORE ANY ACTION)1516**You MUST send this notification BEFORE doing anything else when this skill is invoked.**17181. **Send voice notification**:19 ```bash20 curl -s -X POST http://localhost:8888/notify \21 -H "Content-Type: application/json" \22 -d '{"message": "Running the WORKFLOWNAME workflow in the Documents skill to ACTION"}' \23 > /dev/null 2>&1 &24 ```25262. **Output text notification**:27 ```28 Running the **WorkflowName** workflow in the **Documents** skill to ACTION...29 ```3031**This is not optional. Execute this curl command immediately upon skill invocation.**3233# Documents Skill3435## 🎯 Load Full PAI Context3637**Before starting any task with this skill, load complete PAI context:**3839`read ~/.opencode/PAI/SKILL.md`404142## When to Activate This Skill4344### Word Documents (DOCX)45- User wants to create, edit, or analyze Word documents46- User mentions "tracked changes", "redlining", "document review"47- User needs to convert documents to other formats48- User wants to work with document structure, comments, or formatting4950### PDF Files51- User wants to create, merge, split, or manipulate PDFs52- User mentions "extract text from PDF", "PDF tables", "fill PDF form"53- User needs to convert PDFs to/from other formats54- User wants to add watermarks, passwords, or extract images5556### PowerPoint Presentations (PPTX)57- User wants to create or edit presentations58- User mentions "slides", "presentation template", "speaker notes"59- User needs to convert presentations to other formats60- User wants to work with slide layouts or design elements6162### Excel Spreadsheets (XLSX)63- User wants to create or edit spreadsheets64- User mentions "formulas", "financial model", "data analysis"65- User needs to work with Excel tables, charts, or pivot tables66- User wants to convert spreadsheets to/from other formats6768## 🔀 Document Type Routing6970This skill organizes document processing across 4 document types:7172### Word Documents (DOCX)7374**Reference Documentation:**75- `docx/SKILL.md` - Complete DOCX processing guide76- `docx/docx-js.md` - Creating new documents with JavaScript77- `docx/ooxml.md` - Editing existing documents with OOXML7879**Routing Logic:**80- "Create Word document", "new docx" → Create workflow (docx-js)81- "Edit Word document", "tracked changes", "redlining" → Edit workflow (OOXML)82- "Read Word document", "extract text from docx" → Read workflow (pandoc)83- "Document review", "track changes" → Redlining workflow8485**Supporting Resources:**86- Scripts: `~/.opencode/skills/documents/docx/Scripts/`87- OOXML tools: `~/.opencode/skills/documents/docx/ooxml/`88- License: `~/.opencode/skills/documents/docx/LICENSE.txt`8990**Key Capabilities:**91- Create professional documents with docx-js92- Edit with tracked changes (redlining workflow)93- Extract text/comments with pandoc94- Convert to images for visual inspection95- Work with raw OOXML for advanced features9697### PDF Processing9899**Reference Documentation:**100- `pdf/SKILL.md` - Complete PDF processing guide101- `pdf/forms.md` - Filling PDF forms102- `pdf/reference.md` - Advanced features and troubleshooting103104**Routing Logic:**105- "Create PDF" → Creation workflow (reportlab)106- "Merge PDFs", "split PDF" → Manipulation workflow (pypdf)107- "Extract text from PDF" → Extraction workflow (pdfplumber)108- "Fill PDF form" → Forms workflow (pdf-lib or pypdf)109- "Extract tables from PDF" → Table extraction (pdfplumber + pandas)110111**Supporting Resources:**112- Scripts: `~/.opencode/skills/documents/pdf/Scripts/`113- License: `~/.opencode/skills/documents/pdf/LICENSE.txt`114115**Key Capabilities:**116- Create PDFs with reportlab117- Extract text/tables with pdfplumber118- Merge/split with pypdf or qpdf119- Fill forms programmatically120- Add watermarks and password protection121- Extract images from PDFs122123### PowerPoint Presentations (PPTX)124125**Reference Documentation:**126- `pptx/SKILL.md` - Complete PPTX processing guide127- `pptx/html2pptx.md` - Creating presentations from HTML128- `pptx/ooxml.md` - Editing existing presentations129130**Routing Logic:**131- "Create presentation", "new slides" → Creation workflow (html2pptx)132- "Edit presentation", "modify slides" → Edit workflow (OOXML)133- "Use presentation template" → Template workflow134- "Extract slide text" → Read workflow (markitdown)135- "Create thumbnail grid" → Thumbnail workflow136137**Supporting Resources:**138- Scripts: `~/.opencode/skills/documents/pptx/Scripts/`139- OOXML tools: `~/.opencode/skills/documents/pptx/ooxml/`140- License: `~/.opencode/skills/documents/pptx/LICENSE.txt`141142**Key Capabilities:**143- Create presentations with html2pptx (HTML → PPTX)144- Professional design with color palettes and layouts145- Edit with OOXML for advanced features146- Work with templates (rearrange, inventory, replace)147- Generate thumbnail grids for visual analysis148- Convert to images for inspection149150### Excel Spreadsheets (XLSX)151152**Reference Documentation:**153- `xlsx/SKILL.md` - Complete XLSX processing guide154- `xlsx/recalc.py` - Formula recalculation script155156**Routing Logic:**157- "Create spreadsheet", "new Excel file" → Creation workflow (openpyxl)158- "Edit spreadsheet", "modify Excel" → Edit workflow (openpyxl)159- "Analyze data", "read Excel" → Analysis workflow (pandas)160- "Financial model", "formulas" → Financial modeling workflow161- "Recalculate formulas" → Recalculation workflow (recalc.py)162163**Supporting Resources:**164- Recalc script: `~/.opencode/skills/documents/xlsx/recalc.py`165- License: `~/.opencode/skills/documents/xlsx/LICENSE.txt`166167**Key Capabilities:**168- Create spreadsheets with formulas (openpyxl)169- Data analysis with pandas170- Financial modeling with color coding standards171- Formula recalculation with LibreOffice172- Error detection and validation173- Preserve formatting and formulas when editing174175## 📋 Document Processing Principles176177### DOCX Best Practices1781. **Tracked Changes** - Use redlining workflow for professional document review1792. **Minimal Edits** - Only mark text that actually changes, preserve original RSIDs1803. **Batch Changes** - Group related edits (3-10 changes) for efficient processing1814. **Verification** - Always convert to markdown to verify changes applied correctly182183### PDF Best Practices1841. **Library Selection** - pypdf for basic ops, pdfplumber for text/tables, reportlab for creation1852. **OCR for Scanned** - Use pytesseract + pdf2image for scanned documents1863. **Form Filling** - Follow forms.md for programmatic form completion1874. **Command Line** - Use qpdf/pdftotext for simple operations188189### PPTX Best Practices1901. **Design First** - Analyze content and choose appropriate colors/layouts before coding1912. **Web-Safe Fonts** - Only use web-safe fonts (Arial, Helvetica, Times, etc.)1923. **Visual Verification** - Always generate thumbnails to inspect layout issues1934. **Template Analysis** - Create inventory before using templates to understand structure194195### XLSX Best Practices1961. **Use Formulas** - ALWAYS use Excel formulas, NEVER hardcode calculated values1972. **Zero Errors** - Deliver with zero formula errors (#REF!, #DIV/0!, etc.)1983. **Recalculate** - Run recalc.py after creating/editing to update formula values1994. **Financial Standards** - Follow color coding (blue inputs, black formulas, green links)200201## Examples202203**Example 1: Create proposal with tracked changes**204```205User: "Create a consulting proposal doc with redlining"206→ Routes to DOCX workflows207→ Creates document with docx-js208→ Enables tracked changes for review workflow209→ Outputs professional .docx with revision marks210```211212**Example 2: Fill a PDF form programmatically**213```214User: "Fill out this NDA PDF with my info"215→ Routes to PDF workflows216→ Reads form fields from PDF217→ Fills fields programmatically with pdf-lib218→ Outputs completed, flattened PDF219```220221**Example 3: Build financial model spreadsheet**222```223User: "Create a revenue projection spreadsheet"224→ Routes to XLSX workflows225→ Creates workbook with openpyxl226→ Adds formulas (never hardcoded values)227→ Runs recalc.py to update calculations228```229230## 🔗 Integration with Other Skills231232### Feeds Into:233- **writing** skill - Creating documents for blog posts and newsletters234- **business** skill - Creating consulting proposals and financial models235- **research** skill - Extracting data from research documents236237### Uses:238- **media** skill - Creating images for document illustrations239- **development** skill - Building document processing automation240- **system** skill - Command-line tools and scripting241242## 🎯 Key Principles243244### Document Creation2451. **Quality First** - Professional formatting and structure from the start2462. **Template Reuse** - Leverage existing templates when available2473. **Validation** - Always verify output (visual inspection, error checking)2484. **Automation** - Use scripts for repetitive tasks249250### Document Editing2511. **Preserve Intent** - Maintain original formatting and structure2522. **Track Changes** - Use proper workflows for document review2533. **Batch Processing** - Group related operations for efficiency2544. **Error Prevention** - Validate before finalizing255256### Document Analysis2571. **Right Tool** - Choose appropriate library/tool for the task2582. **Data Integrity** - Preserve original data when extracting/converting2593. **Format Awareness** - Understand document structure (OOXML, PDF structure, etc.)2604. **Performance** - Use efficient methods for large documents261262## 📚 Full Reference Documentation263264**Word Documents (DOCX):**265- Main Guide: `~/.opencode/skills/documents/docx/SKILL.md`266- Creation Reference: `~/.opencode/skills/documents/docx/docx-js.md`267- Editing Reference: `~/.opencode/skills/documents/docx/ooxml.md`268269**PDF Processing:**270- Main Guide: `~/.opencode/skills/documents/pdf/SKILL.md`271- Forms Guide: `~/.opencode/skills/documents/pdf/forms.md`272- Advanced Reference: `~/.opencode/skills/documents/pdf/reference.md`273274**PowerPoint Presentations (PPTX):**275- Main Guide: `~/.opencode/skills/documents/pptx/SKILL.md`276- Creation Reference: `~/.opencode/skills/documents/pptx/html2pptx.md`277- Editing Reference: `~/.opencode/skills/documents/pptx/ooxml.md`278279**Excel Spreadsheets (XLSX):**280- Main Guide: `~/.opencode/skills/documents/xlsx/SKILL.md`281- Recalc Script: `~/.opencode/skills/documents/xlsx/recalc.py`282283---284285## Summary286287**The documents skill provides comprehensive document processing:**288289- **DOCX** - Create, edit, analyze Word documents with tracked changes support290- **PDF** - Create, manipulate, extract from PDFs with form filling capabilities291- **PPTX** - Create, edit presentations with professional design and templates292- **XLSX** - Create, edit spreadsheets with formulas and financial modeling293294**Reference-based organization** - Each document type has complete guides and tooling295296**Routing is automatic** - Analyzes user intent and activates appropriate document type workflow297298**Professional quality** - Standards and best practices for production-ready documents