← Back to Skills Marketplace
lnblxj

Document Generator

by lnblxj · GitHub ↗ · v0.1.3 · MIT-0
cross-platform ✓ Security Clean
265
Downloads
0
Stars
1
Active Installs
4
Versions
Install in OpenClaw
/install document-generator
Description
Generate professional Word, Excel, and PDF documents with rich formatting, tables, images, and layouts. Use this skill whenever the user mentions creating do...
README (SKILL.md)

Document Generator Skill

Generate professional Word (.docx), Excel (.xlsx), and PDF documents with comprehensive formatting support including fonts, colors, tables, images, layouts, and more.

When to Use This Skill

Use this skill when the user needs to:

  • Create Word documents with rich formatting (headings, paragraphs, tables, images, styles)
  • Generate Excel spreadsheets with formulas, styling, and data
  • Export content to PDF format with professional layouts
  • Work with document templates and fill them with data
  • Create reports, invoices, data exports, or any formatted document output

Core Capabilities

Word Documents (.docx)

  • Text formatting: font family, size, color, bold, italic, underline
  • Paragraph styles: alignment, spacing, indentation
  • Tables with custom styling and borders
  • Images with positioning and sizing
  • Headers and footers
  • Page layout: margins, orientation, page size
  • Bullet and numbered lists
  • Hyperlinks

Excel Spreadsheets (.xlsx)

  • Cell formatting: font, size, color, background
  • Formulas and calculations
  • Multiple sheets
  • Column widths and row heights
  • Cell borders and alignment
  • Number formatting (currency, percentage, dates)
  • Merged cells
  • Freeze panes

PDF Documents (.pdf)

  • Text with custom fonts, sizes, and colors
  • Paragraphs with alignment
  • Tables with styling
  • Images
  • Page layout and margins
  • Multi-page documents
  • Headers and footers

How to Use

Step 1: Understand the Requirements

Ask clarifying questions if needed:

  • What type of document? (Word/Excel/PDF)
  • What content should it contain?
  • Any specific formatting requirements?
  • Should it use a template?
  • Where should the output be saved?

Step 2: Choose the Right Script

The skill provides three main scripts in the scripts/ directory:

  • generate_word.py - For Word documents
  • generate_excel.py - For Excel spreadsheets
  • generate_pdf.py - For PDF documents

Each script accepts a JSON configuration that describes the document structure and content.

Step 3: Prepare the Configuration

Create a JSON configuration file that describes the document. The structure varies by document type - see the reference files for detailed schemas:

  • references/word_schema.md - Word document configuration
  • references/excel_schema.md - Excel spreadsheet configuration
  • references/pdf_schema.md - PDF document configuration

Step 4: Generate the Document

Run the appropriate script with the configuration:

python document-generator/scripts/generate_word.py config.json output.docx
python document-generator/scripts/generate_excel.py config.json output.xlsx
python document-generator/scripts/generate_pdf.py config.json output.pdf

Step 5: Verify and Iterate

Check the generated document and make adjustments to the configuration if needed.

Working with Templates

All three document types support template-based generation:

  1. Word Templates: Use existing .docx files and replace placeholders
  2. Excel Templates: Use existing .xlsx files and fill in data
  3. PDF Templates: Define reusable layouts in the configuration

To use a template, include a template field in your configuration pointing to the template file path.

Configuration Examples

Simple Word Document

{
  "page_setup": {
    "margins": {"top": 1, "bottom": 1, "left": 1, "right": 1}
  },
  "content": [
    {
      "type": "heading",
      "text": "Monthly Report",
      "level": 1
    },
    {
      "type": "paragraph",
      "text": "This is the report content.",
      "font": {"name": "Arial", "size": 11}
    }
  ]
}

Simple Excel Spreadsheet

{
  "sheets": [
    {
      "name": "Sales Data",
      "data": [
        ["Product", "Quantity", "Price", "Total"],
        ["Widget A", 10, 25.50, "=B2*C2"],
        ["Widget B", 5, 30.00, "=B3*C3"]
      ],
      "formatting": {
        "header_row": 0,
        "column_widths": [15, 10, 10, 10]
      }
    }
  ]
}

Simple PDF Document

{
  "page_setup": {
    "size": "A4",
    "margins": {"top": 20, "bottom": 20, "left": 20, "right": 20}
  },
  "content": [
    {
      "type": "text",
      "text": "Invoice #12345",
      "font": {"name": "Helvetica-Bold", "size": 18}
    },
    {
      "type": "paragraph",
      "text": "Thank you for your business.",
      "font": {"name": "Helvetica", "size": 12}
    }
  ]
}

Best Practices

  1. Start Simple: Begin with basic formatting and add complexity as needed
  2. Use Templates: For recurring document types, create templates to save time
  3. Validate Data: Check that data types match expected formats (numbers, dates, etc.)
  4. Test Incrementally: Generate documents frequently during development to catch issues early
  5. Handle Errors Gracefully: Provide clear error messages if configuration is invalid

Troubleshooting

Missing Dependencies: If scripts fail, ensure required Python packages are installed:

pip install python-docx openpyxl reportlab Pillow

Font Issues: If custom fonts don't work, verify the font name is correct and available on the system.

Image Problems: Ensure image paths are absolute or relative to the script execution directory.

Excel Formulas: Use Excel formula syntax (e.g., =SUM(A1:A10)) as strings in the data array.

Advanced Features

For complex documents, refer to the detailed reference files:

  • references/word_schema.md - Complete Word configuration options
  • references/excel_schema.md - Complete Excel configuration options
  • references/pdf_schema.md - Complete PDF configuration options

These references include examples of:

  • Complex table layouts
  • Image positioning and sizing
  • Advanced styling and themes
  • Multi-page layouts
  • Template variable substitution
  • Conditional formatting
Usage Guidance
This skill appears coherent and focused on generating documents. Before running: (1) review any template or image paths you pass in (they will be read from disk); avoid pointing to sensitive files you don't want used. (2) Install required Python packages from trusted sources (pip install python-docx openpyxl reportlab Pillow). (3) Run the scripts in an environment you control (e.g., local or isolated VM/container) if you are unsure about third-party dependencies. (4) Inspect any provided configs before execution to ensure they don't reference unintended local files. No network activity or secret exfiltration was found in the code.
Capability Analysis
Type: OpenClaw Skill Name: document-generator Version: 0.1.3 The document-generator skill bundle provides legitimate functionality for creating Word, Excel, and PDF files using standard Python libraries (python-docx, openpyxl, and reportlab). The scripts (generate_word.py, generate_excel.py, generate_pdf.py) correctly implement document generation logic based on JSON configurations, including support for templates, formatting, and images. The PDF generator includes cross-platform logic to locate system fonts for CJK support, which is a standard practice. No evidence of data exfiltration, malicious execution, or prompt injection was found.
Capability Assessment
Purpose & Capability
The name/description (document generation) matches the provided scripts and schema references for Word/Excel/PDF. Required files, template/image paths, and formatting features are all appropriate to the stated functionality.
Instruction Scope
SKILL.md instructs the agent to ask clarifying questions, build a JSON config, and run local Python scripts to generate documents. The instructions reference only template files, image paths, and the config schemas—all relevant to document generation. There are no instructions to read unrelated system files, environment variables, or to transmit data externally.
Install Mechanism
No install spec is provided (instruction-only deployment), which is low risk. However, the package includes runnable scripts that require Python and third‑party libraries (python-docx, openpyxl, reportlab, Pillow). The SKILL.md documents these pip dependencies; installing them via pip is the user's responsibility and should be done from trusted sources.
Credentials
The skill requests no environment variables, credentials, or config paths. The scripts access only local filesystem paths supplied in configs (templates, images) which is expected for template-based generation.
Persistence & Privilege
Flags indicate no forced always-on behavior and normal autonomous invocation is allowed (default). The skill does not attempt to modify other skills or system-wide settings; it simply reads configs and writes generated files.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install document-generator
  3. After installation, invoke the skill by name or use /document-generator
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.3
- Major refactor: Simplified architecture, with new, focused scripts for each document type and reference documentation. - Added individual schema/reference files for Word, Excel, and PDF document definitions. - Introduced new scripts: generate_word.py, generate_excel.py, generate_pdf.py (all in scripts/). - Removed legacy scripts and documentation; replaced with a streamlined usage guide and configuration-based workflow. - Updated documentation (SKILL.md) to reflect new usage patterns, simpler configuration, and best practices.
v0.1.2
- Added initial scripts and documentation for document generation. - New files: README.md, USER_GUIDE.md, create_word.py, evals/evals.json, install_dependencies.py. - Introduced install_dependencies.py to simplify required Python package installation. - Added example documentation for generating Word documents. - Provided a user guide and evaluation data for testing purposes.
v0.1.1
- Removed compatibility with "read" and "write" tools; now only "exec" is listed. - Updated dependency installation section: user must install Python packages beforehand; skill no longer runs `apt install` automatically. - Added a "Security Considerations" section explaining that the skill only generates local files and performs no network/system modifications. - Clarified error handling when dependencies are missing—informs user to install them manually. - Minor clarifications in dependency and troubleshooting sections for better user guidance.
v0.1.0
- Initial release of the document-generator skill. - Enables creation of professional Word (.docx), Excel (.xlsx), and PDF documents with rich formatting, tables, images, and dynamic content. - Supports advanced features: multi-level headings, custom styles, template-based generation, and variable substitution using Jinja2. - Includes command-line tools for easy document creation from scratch, structured data, or templates. - Provides detailed usage instructions, examples, and troubleshooting tips for reports, invoices, manuals, and data-driven documents.
Metadata
Slug document-generator
Version 0.1.3
License MIT-0
All-time Installs 2
Active Installs 1
Total Versions 4
Frequently Asked Questions

What is Document Generator?

Generate professional Word, Excel, and PDF documents with rich formatting, tables, images, and layouts. Use this skill whenever the user mentions creating do... It is an AI Agent Skill for Claude Code / OpenClaw, with 265 downloads so far.

How do I install Document Generator?

Run "/install document-generator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Document Generator free?

Yes, Document Generator is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Document Generator support?

Document Generator is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Document Generator?

It is built and maintained by lnblxj (@lnblxj); the current version is v0.1.3.

💬 Comments