Document Creator logo

Document Creator

Organization
khoj-ai
document-creator

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.

Overview

Publisherkhoj-ai
Repositorypipali
Skill namedocument-creator
Stars
318
Forks
61
Bundled files
13
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 13 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by khoj-ai on GitHub. Read the source before you install it.

Installation

Install the Document Creator AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/khoj-ai/pipali/tree/main/src/server/skills/builtin/document-creator
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/khoj-ai/pipali.git /tmp/pipali
mkdir -p .claude/skills
cp -r /tmp/pipali/src/server/skills/builtin/document-creator .claude/skills/document-creator
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Document Creator in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Document Creator on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Document Creator is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Document Creator

Create professional-grade Word and Excel documents for expert knowledge workers.

Quick Reference

TaskToolCommand Pattern
Create Word docdocx_create.tsbun run scripts/docx_create.ts --spec spec.json --output doc.docx
Edit Word docdocx_unpack.py + XML editing + docx_pack.pySee Word Editing section
Create/Edit Excelxlsx_create.pyuvx --with openpyxl python scripts/xlsx_create.py --spec spec.json --output file.xlsx
Verify formulasxlsx_recalc.pyuvx --with openpyxl python scripts/xlsx_recalc.py file.xlsx

Decision Tree

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)

Word Document Creation

Use scripts/docx_create.ts to create new Word documents from a JSON specification.

Running the Script

bash
# 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

Specification Format

json
{
  "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" }
      ]
    }
  ]
}

Element Types

TypeRequired FieldsOptional Fields
headinglevel (1-6), textstyle
paragraphtext (string or RichText)bold, italic, alignment, color
bulletListitems (array of string or RichText)level
numberedListitems (array of string or RichText)level
tableheaders, rowswidths, headerStyle
imagepathwidth, height, caption
pageBreak--

Rich Text Support

Paragraphs and list items support rich text with inline formatting and links. Text can be:

  • A simple string: "Plain text"
  • An array of segments with formatting: [{ "text": "bold", "bold": true }, { "text": " normal" }]

Auto-linking: URLs (http:// or https://) in text are automatically converted to clickable hyperlinks.

TextSegment properties:

PropertyTypeDescription
textstringThe text content (required)
boldbooleanBold formatting
italicbooleanItalic formatting
underlinebooleanUnderline formatting
linkstringURL - makes text a clickable hyperlink
colorstringText color as hex (e.g., "#FF0000")

Examples:

json
// 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.

Word Document Editing

For editing existing documents (especially with tracked changes), use the unpack-edit-repack workflow.

Step 1: Unpack

bash
uvx --with defusedxml python ~/.pipali/skills/document-creator/scripts/docx_unpack.py \
  input.docx \
  --output unpacked_folder/

Step 2: Edit XML

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 deletion

Use scripts/docx_edit.py for common operations:

bash
# 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"

Step 3: Repack

bash
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.

Excel Creation and Editing

Use scripts/xlsx_create.py for all Excel operations.

Running the Script

bash
uvx --with openpyxl python ~/.pipali/skills/document-creator/scripts/xlsx_create.py \
  --spec spec.json \
  --output report.xlsx

Specification Format

json
{
  "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" }
      }
    }
  ]
}

Critical Excel Rules

  1. Always use formulas - Never calculate in code and hardcode results
  2. Color coding for financial models:
    • Blue (#0070C0): Input values / assumptions
    • Black: Formulas and calculations
    • Green (#00B050): Cross-sheet references
  3. Number formats:
    • Currency: $#,##0.00
    • Percentages: 0.0%
    • Years: Use text format @ to prevent 2,024
    • Zeros: Display as - using conditional format

Formula Verification

After creating files with formulas, verify them:

bash
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.

Professional Standards

Fonts

  • Body: Calibri 11pt (Windows) or Arial 11pt (cross-platform)
  • Headings: Cambria or Arial Bold
  • Monospace: Consolas or Courier New

Font Sizes (in points)

  • fontSize in spec is in points (pt), not half-points
  • Standard body: 11pt (use "fontSize": 11)
  • Headings: 12-24pt depending on level

Margins

  • Standard: 1 inch (2.54 cm) all sides
  • Narrow: 0.5 inch (1.27 cm) for dense reports

Colors

  • Primary: #2F5496 (dark blue)
  • Accent: #4472C4 (medium blue)
  • Success: #00B050 (green)
  • Warning: #FFC000 (amber)
  • Error: #C00000 (red)

See references/professional-styling.md for complete style guide.

Template Usage

Pre-built templates are available in assets/templates/:

  • report-template.docx - Business report with sections
  • financial-model.xlsx - 3-statement financial model

To use a template:

  1. Copy template to working directory
  2. Use editing scripts to modify content
  3. Save with new filename

Troubleshooting

Dependencies not installed

If you encounter module errors, run bun install in scripts dir to manually reinstall

LibreOffice not found (for xlsx_recalc.py)

The recalc script is optional. Install LibreOffice for formula verification:

  • macOS: brew install --cask libreoffice
  • Windows: Download from libreoffice.org

Document won't open

Check for XML errors in the unpacked folder. Common issues:

  • Unclosed tags
  • Invalid characters (use &#8217; for apostrophe, etc.)
  • Missing namespace declarations

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Document Creator AI skill do?

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.

Why use Document Creator on TypingMind?

Because you install it once and use it with any model. Document Creator is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Document Creator in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/khoj-ai/pipali/tree/main/src/server/skills/builtin/document-creator. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Document Creator?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Document Creator?

As many as you like. As long as a model supports skills, you can use Document Creator with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Document Creator AI skill free?

Yes. It is published on GitHub by khoj-ai under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇