Office Pro

v1.0.0

Enterprise-grade document automation suite for Microsoft Word and Excel. Create professional documents, reports, and spreadsheets with business templates, dy...

0· 18·0 current·0 all-time
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (Word + Excel automation) matches the delivered files and declared runtime requirements (python3 and standard Python libraries such as python-docx, openpyxl, docxtpl, Jinja2, pandas, Pillow, click). Required binaries/env/config paths are none and align with the stated purpose.
Instruction Scope
SKILL.md and code instruct the agent to read/write local template and data files, render templates, and generate bundled templates. The runtime will run the included generator (generate_premium_templates.py) to create assets/templates/ on first run (skill_interface.ensure_templates_exist invokes it via subprocess). All file operations appear limited to local filesystem; path validation and JSON parsing routines are implemented. Note: validate_safe_path rejects any path containing '..' which is a strict (but defensive) policy that may break some legitimate use cases.
Install Mechanism
No automated install spec is provided (instruction-only install). SKILL.md directs the user to pip install well-known packages. No downloads from arbitrary URLs or external release hosts are present in the code. The only subprocess invocation executes the local generator script (generate_premium_templates.py).
Credentials
The skill requests no environment variables, no credentials, and no config paths. Dependencies are typical for Office file processing. No suspicious SECRET/TOKEN variables are required or accessed in the visible code.
Persistence & Privilege
always:false (no forced inclusion). The skill will attempt to generate template assets on first health_check/initialization by executing its local generator; that writes files into the skill's assets directory. This is expected for a template-provisioning feature but does mean the skill can create files on disk when loaded.
Assessment
This skill appears to do exactly what it says: generate and render Word/Excel templates locally. Before installing, consider: (1) run it in a Python virtual environment to avoid dependency conflicts; (2) review generate_premium_templates.py if you want to confirm no network calls — the included code runs the generator locally and writes templates to assets/templates/; (3) SKILL.md asks you to pip install standard packages — avoid running those commands as root; (4) the skill will write files to its assets directory during health checks/first run, so if you want to avoid persistent writes run it in an isolated directory or container first; (5) the path validator is strict (it rejects '..') and may require absolute or sanitized paths for some workflows. Overall the package is coherent and consistent with its stated purpose.

Like a lobster shell, security has layers — review code before you run it.

excelvk979tw7msy30tvwchjpt8gvykh8424a5latestvk979tw7msy30tvwchjpt8gvykh8424a5officevk979tw7msy30tvwchjpt8gvykh8424a5wordvk979tw7msy30tvwchjpt8gvykh8424a5

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

📊 Clawdis
OSLinux · macOS · Windows
Binspython3

SKILL.md

Office Pro - 企业级文档自动化套件

专业级 Microsoft Word 和 Excel 文档自动化工具,提供企业级模板、动态数据绑定和批量处理能力。

核心功能

Word 文档处理 (.docx)

  • 模板引擎:基于 Jinja2 的 docxtpl,支持变量、条件、循环
  • 企业模板:8 个预设专业模板(商务信函、会议纪要、工作报告等)
  • 完整格式支持:段落、表格、图片、页眉页脚、页码、样式
  • 动态内容:邮件合并、批量生成

Excel 表格处理 (.xlsx)

  • 模板驱动:基于 xlsx-template 理念,数据替换保持格式
  • 企业模板:8 个预设专业模板(财务报表、项目进度、库存管理等)
  • 高级功能:图表、透视表、公式、数据验证、条件格式
  • 数据交换:CSV/JSON 互导、Word ↔ Excel 数据交互

批量与自动化

  • 批量文档生成
  • 命令行接口 (CLI)
  • Python API

API Schema

Actions 输入输出规范

word.generate

生成Word文档(基于模板)

{
  "input": {
    "type": "object",
    "required": ["template", "data", "output"],
    "properties": {
      "template": {
        "type": "string",
        "description": "Template filename (e.g., meeting-minutes.docx)"
      },
      "data": {
        "type": "object",
        "description": "Template data as JSON object or path to JSON file"
      },
      "output": {
        "type": "string",
        "description": "Output file path"
      },
      "template_dir": {
        "type": "string",
        "description": "Custom template directory (optional)"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "success": {"type": "boolean"},
      "output_path": {"type": "string"},
      "message": {"type": "string"},
      "error": {"type": "string"},
      "error_code": {"type": "string"}
    }
  }
}

excel.generate

生成Excel报表(基于模板)

{
  "input": {
    "type": "object",
    "required": ["template", "data", "output"],
    "properties": {
      "template": {
        "type": "string",
        "description": "Template filename (e.g., sales-report.xlsx)"
      },
      "data": {
        "type": "object",
        "description": "Template data as JSON object or path to JSON file"
      },
      "output": {
        "type": "string",
        "description": "Output file path"
      },
      "template_dir": {
        "type": "string",
        "description": "Custom template directory (optional)"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "success": {"type": "boolean"},
      "output_path": {"type": "string"},
      "message": {"type": "string"},
      "error": {"type": "string"},
      "error_code": {"type": "string"}
    }
  }
}

templates.list

列出可用模板

{
  "input": {
    "type": "object",
    "properties": {
      "type": {
        "type": "string",
        "enum": ["word", "excel", "all"],
        "default": "all",
        "description": "Template type to list"
      },
      "template_dir": {
        "type": "string",
        "description": "Custom template directory (optional)"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "success": {"type": "boolean"},
      "templates": {
        "type": "object",
        "properties": {
          "word": {"type": "array", "items": {"type": "string"}},
          "excel": {"type": "array", "items": {"type": "string"}}
        }
      }
    }
  }
}

word.create

创建空白Word文档

{
  "input": {
    "type": "object",
    "required": ["output"],
    "properties": {
      "output": {
        "type": "string",
        "description": "Output file path"
      },
      "title": {
        "type": "string",
        "description": "Document title (optional)"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "success": {"type": "boolean"},
      "output_path": {"type": "string"},
      "message": {"type": "string"}
    }
  }
}

excel.create

创建空白Excel工作簿

{
  "input": {
    "type": "object",
    "required": ["output"],
    "properties": {
      "output": {
        "type": "string",
        "description": "Output file path"
      },
      "sheets": {
        "type": "integer",
        "default": 1,
        "description": "Number of sheets to create"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "success": {"type": "boolean"},
      "output_path": {"type": "string"},
      "message": {"type": "string"}
    }
  }
}

Error Codes

CodeDescription
SKILL_404Template not found
SKILL_401Invalid file path (security violation)
SKILL_402Template rendering failed
SKILL_501Dependency not available
SKILL_999Document not loaded

快速开始

安装

# 使用 pip 安装依赖
pip install python-docx openpyxl docxtpl pandas Pillow click

模板初始化

本技能首次运行时会自动生成 16 个专业级模板(8个Word + 8个Excel)。模板将在首次调用时自动创建,无需手动上传。

如果需要手动生成模板:

python generate_premium_templates.py

生成的模板位于 assets/templates/ 目录:

  • Word模板: assets/templates/word/ - 会议纪要、商务信函、简历、项目提案、工作报告、合同、新闻稿、邀请函
  • Excel模板: assets/templates/excel/ - 销售报告、财务报表、预算表、项目时间线、库存管理、CRM、考勤表、数据透视表

使用模板生成 Word 文档

from office_pro import WordProcessor

# 加载模板
wp = WordProcessor()
doc = wp.load_template('meeting-minutes.docx')

# 渲染数据
context = {
    'meeting_title': 'Q1 产品规划会议',
    'date': '2024-03-15',
    'attendees': ['张三', '李四', '王五'],
    'agenda': [
        {'topic': '产品路线图回顾', 'duration': '30分钟'},
        {'topic': '新功能讨论', 'duration': '45分钟'}
    ]
}

# 生成文档
doc.render(context)
doc.save('output/meeting-minutes-2024-03-15.docx')

使用模板生成 Excel 报表

from office_pro import ExcelProcessor

# 加载模板
ep = ExcelProcessor()
wb = ep.load_template('sales-report.xlsx')

# 数据替换
data = {
    'report_date': '2024-03-15',
    'sales_rep': '张三',
    'total_sales': 150000,
    'target': 120000,
    'products': [
        {'name': '产品A', 'quantity': 100, 'revenue': 50000},
        {'name': '产品B', 'quantity': 80, 'revenue': 60000},
        {'name': '产品C', 'quantity': 50, 'revenue': 40000}
    ]
}

# 生成报表
wb.render(data)
wb.save('output/sales-report-2024-03.xlsx')

命令行使用

# Word 文档生成
office-pro word generate --template meeting-minutes.docx --data meeting.json --output meeting-2024-03-15.docx

# Excel 报表生成
office-pro excel generate --template sales-report.xlsx --data sales.json --output sales-march.xlsx

# 查看可用模板
office-pro templates list

# 批量生成
office-pro batch --config batch-config.yaml

许可协议

MIT License - 开源免费使用

Files

10 total
Select a file
Select a file to preview.

Comments

Loading comments…