src/server/skills/builtin/document-creator/SKILL.md
Create and edit professional Word (.docx) and Excel (.xlsx) documents. Use to create reports, memos, proposals, financial models, invoices, or modify existing Office documents. Supports rich text, tables, lists, images, formulas, charts, and tracked changes.
npx skillsauth add khoj-ai/pipali document-creatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create professional-grade Word and Excel documents for expert knowledge workers.
| Task | Tool | Command Pattern |
|------|------|-----------------|
| Create Word doc | docx_create.ts | bun run scripts/docx_create.ts --spec spec.json --output doc.docx |
| Edit Word doc | docx_unpack.py + XML editing + docx_pack.py | See Word Editing section |
| Create/Edit Excel | xlsx_create.py | uvx --with openpyxl python scripts/xlsx_create.py --spec spec.json --output file.xlsx |
| Verify formulas | xlsx_recalc.py | uvx --with openpyxl python scripts/xlsx_recalc.py file.xlsx |
What type of document?
├── Word (.docx)
│ ├── Create new → Use docx_create.ts (TypeScript)
│ └── Edit existing → Unpack → Edit XML → Repack (Python)
└── Excel (.xlsx)
└── Create or Edit → Use xlsx_create.py (Python)
Use scripts/docx_create.ts to create new Word documents from a JSON specification.
# From the scripts directory
cd ~/.pipali/skills/document-creator/scripts
bun run docx_create.ts --spec spec.json --output report.docx
# Or with full path
bun run ~/.pipali/skills/document-creator/scripts/docx_create.ts \
--spec spec.json \
--output report.docx
{
"properties": {
"title": "Document Title",
"creator": "Author Name"
},
"styles": {
"defaultFont": "Calibri",
"headingFont": "Cambria",
"fontSize": 11
},
"sections": [
{
"properties": { "type": "continuous" },
"children": [
{ "type": "heading", "level": 1, "text": "Main Title" },
{ "type": "paragraph", "text": "Introduction paragraph." },
{ "type": "heading", "level": 2, "text": "Section 1" },
{ "type": "bulletList", "items": ["First point", "Second point"] },
{ "type": "numberedList", "items": ["Step 1", "Step 2"] },
{
"type": "table",
"headers": ["Column A", "Column B"],
"rows": [
["Cell 1", "Cell 2"],
["Cell 3", "Cell 4"]
]
},
{ "type": "image", "path": "/path/to/image.png", "width": 400 },
{ "type": "pageBreak" }
]
}
]
}
| Type | Required Fields | Optional Fields |
|------|-----------------|-----------------|
| heading | level (1-6), text | style |
| paragraph | text (string or RichText) | bold, italic, alignment, color |
| bulletList | items (array of string or RichText) | level |
| numberedList | items (array of string or RichText) | level |
| table | headers, rows | widths, headerStyle |
| image | path | width, height, caption |
| pageBreak | - | - |
Paragraphs and list items support rich text with inline formatting and links. Text can be:
"Plain text"[{ "text": "bold", "bold": true }, { "text": " normal" }]Auto-linking: URLs (http:// or https://) in text are automatically converted to clickable hyperlinks.
TextSegment properties:
| Property | Type | Description |
|----------|------|-------------|
| text | string | The text content (required) |
| bold | boolean | Bold formatting |
| italic | boolean | Italic formatting |
| underline | boolean | Underline formatting |
| link | string | URL - makes text a clickable hyperlink |
| color | string | Text color as hex (e.g., "#FF0000") |
Examples:
// Simple paragraph (backward compatible)
{ "type": "paragraph", "text": "Plain text paragraph." }
// Paragraph with inline formatting
{ "type": "paragraph", "text": [
{ "text": "This has " },
{ "text": "bold", "bold": true },
{ "text": " and " },
{ "text": "italic", "italic": true },
{ "text": " text." }
]}
// Paragraph with link
{ "type": "paragraph", "text": [
{ "text": "Visit " },
{ "text": "our website", "link": "https://example.com" },
{ "text": " for more info." }
]}
// List with rich text items
{ "type": "bulletList", "items": [
"Simple string item",
[{ "text": "Item with " }, { "text": "bold part", "bold": true }],
[{ "text": "Click ", "link": "https://docs.example.com" }]
]}
// Auto-linked URL (no explicit link property needed)
{ "type": "paragraph", "text": "Check out https://example.com for details." }
See references/docx-js-api.md for complete API reference.
For editing existing documents (especially with tracked changes), use the unpack-edit-repack workflow.
uvx --with defusedxml python ~/.pipali/skills/document-creator/scripts/docx_unpack.py \
input.docx \
--output unpacked_folder/
Edit unpacked_folder/word/document.xml directly. Key elements:
<w:p> - Paragraph<w:r> - Run (text span)<w:t> - Text content<w:ins> - Tracked insertion<w:del> - Tracked deletionUse scripts/docx_edit.py for common operations:
# Find and replace with tracked changes
uvx --with defusedxml python scripts/docx_edit.py \
--folder unpacked_folder/ \
--action replace \
--find "old text" \
--replace "new text" \
--track-changes \
--author "Your Name"
uvx --with defusedxml python ~/.pipali/skills/document-creator/scripts/docx_pack.py \
unpacked_folder/ \
--output output.docx
See references/ooxml-structure.md for XML element reference.
Use scripts/xlsx_create.py for all Excel operations.
uvx --with openpyxl python ~/.pipali/skills/document-creator/scripts/xlsx_create.py \
--spec spec.json \
--output report.xlsx
{
"sheets": [
{
"name": "Summary",
"data": [
["Item", "Q1", "Q2", "Q3", "Total"],
["Revenue", 100000, 120000, 130000, "=SUM(B2:D2)"],
["Costs", 50000, 55000, 60000, "=SUM(B3:D3)"],
["Profit", "=B2-B3", "=C2-C3", "=D2-D3", "=SUM(B4:D4)"]
],
"columnWidths": { "A": 15, "B": 12, "C": 12, "D": 12, "E": 12 },
"formatting": {
"A1:E1": { "bold": true, "fill": "#4472C4", "fontColor": "#FFFFFF" },
"B2:E4": { "numberFormat": "$#,##0" }
}
}
]
}
#0070C0): Input values / assumptions#00B050): Cross-sheet references$#,##0.000.0%@ to prevent 2,024- using conditional formatAfter creating files with formulas, verify them:
uvx --with openpyxl python ~/.pipali/skills/document-creator/scripts/xlsx_recalc.py \
output.xlsx
Returns JSON with any formula errors (#REF!, #DIV/0!, etc.) and their locations.
See references/xlsx-best-practices.md for formula patterns and standards.
fontSize in spec is in points (pt), not half-points"fontSize": 11)#2F5496 (dark blue)#4472C4 (medium blue)#00B050 (green)#FFC000 (amber)#C00000 (red)See references/professional-styling.md for complete style guide.
Pre-built templates are available in assets/templates/:
report-template.docx - Business report with sectionsfinancial-model.xlsx - 3-statement financial modelTo use a template:
If you encounter module errors, run bun install in scripts dir to manually reinstall
The recalc script is optional. Install LibreOffice for formula verification:
brew install --cask libreofficeCheck for XML errors in the unpacked folder. Common issues:
’ for apostrophe, etc.)tools
Always read this skill before answering questions about your capabilities, UI, settings, state including past chats/routines/skills/tools. Use to help user configure you, onboard, navigate UI and troubleshoot issues.
tools
Guide to create effective skills. Use when users want to create a new skill (or update an existing skill) that extends your capabilities with specialized knowledge, workflows, or tool integrations.
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).