business-document-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Business Document Generator

商务文档生成器

Overview

概述

Generate professional business documents (Project Proposals, Business Plans, Annual Budgets) from high-quality PDF templates. Use the bundled Python script to fill templates with user-provided data and output polished PDF documents ready for distribution.
通过高质量PDF模板生成专业商务文档(项目提案、商业计划、年度预算表)。使用附带的Python脚本,将用户提供的数据填充到模板中,输出可直接分发的精美PDF文档。

When to Use This Skill

何时使用此Skill

Activate this skill when the user asks to:
  • Create a business proposal or project proposal
  • Generate a business plan document
  • Develop an annual budget plan
  • Create any professional business document based on the available templates
  • Fill in business templates with specific data
当用户提出以下需求时,激活此Skill:
  • 创建商务提案或项目提案
  • 生成商业计划文档
  • 制定年度预算计划
  • 根据可用模板创建任何专业商务文档
  • 用特定数据填充商务模板

Available Document Types

支持的文档类型

This skill supports three types of professional business documents:
  1. Project Proposal - Professional proposals for client projects
    • Template:
      assets/templates/Professional Proposal Template.pdf
    • Use case: Pitching projects to clients, stakeholders
  2. Business Plan - Comprehensive business planning documents
    • Template:
      assets/templates/Comprehensive Business Plan Template.pdf
    • Use case: Startup planning, investor presentations, strategic planning
  3. Annual Budget - Detailed budget planning documents
    • Template:
      assets/templates/Annual Budget Plan Template.pdf
    • Use case: Financial planning, budget proposals, fiscal year planning
此Skill支持三类专业商务文档:
  1. 项目提案 - 面向客户项目的专业提案
    • 模板:
      assets/templates/Professional Proposal Template.pdf
    • 使用场景:向客户、利益相关者推介项目
  2. 商业计划 - 全面的商业规划文档
    • 模板:
      assets/templates/Comprehensive Business Plan Template.pdf
    • 使用场景:初创企业规划、投资者演示、战略规划
  3. 年度预算表 - 详细的预算规划文档
    • 模板:
      assets/templates/Annual Budget Plan Template.pdf
    • 使用场景:财务规划、预算提案、财年规划

Quick Start Workflow

快速开始流程

Step 1: Understand User Requirements

步骤1:了解用户需求

Gather information from the user about:
  • Document type needed (proposal, business plan, or budget)
  • Key data to include (company name, client info, dates, etc.)
  • Any specific customization needs
收集用户的以下信息:
  • 需要的文档类型(提案、商业计划或预算表)
  • 需包含的关键数据(公司名称、客户信息、日期等)
  • 任何特定的定制需求

Step 2: Prepare the Data

步骤2:准备数据

Create a JSON file with the document data. Reference the data schemas in
references/document_schemas.md
for field requirements.
Example for Proposal:
json
{
  "title": "Digital Transformation Initiative",
  "subtitle": "A Comprehensive Plan for Acme Corporation",
  "client_org": "Acme Corporation",
  "client_contact": "Jane Smith, CTO",
  "company_name": "TechSolutions Inc.",
  "contact_info": "contact@techsolutions.com",
  "date": "November 3, 2025"
}
Note: Check
assets/examples/
for complete example JSON files:
  • proposal_example.json
  • business_plan_example.json
  • budget_example.json
创建包含文档数据的JSON文件。参考
references/document_schemas.md
中的数据架构了解字段要求。
提案示例:
json
{
  "title": "Digital Transformation Initiative",
  "subtitle": "A Comprehensive Plan for Acme Corporation",
  "client_org": "Acme Corporation",
  "client_contact": "Jane Smith, CTO",
  "company_name": "TechSolutions Inc.",
  "contact_info": "contact@techsolutions.com",
  "date": "November 3, 2025"
}
注意: 完整的示例JSON文件可在
assets/examples/
中查看:
  • proposal_example.json
  • business_plan_example.json
  • budget_example.json

Step 3: Install Dependencies (First Time Only)

步骤3:安装依赖(首次使用)

The generation script requires Python packages. Install them:
bash
pip install pypdf reportlab
生成脚本需要Python包,执行以下命令安装:
bash
pip install pypdf reportlab

Step 4: Generate the Document

步骤4:生成文档

Run the generation script:
bash
python3 scripts/generate_document.py <document_type> <data_file> \
  --templates-dir assets/templates \
  --output-dir <output_directory>
Parameters:
  • <document_type>
    : One of
    proposal
    ,
    business_plan
    , or
    budget
  • <data_file>
    : Path to JSON file with document data
  • --templates-dir
    : Directory containing PDF templates (default:
    assets/templates
    )
  • --output-dir
    : Where to save generated PDFs (default:
    output
    )
  • --output-filename
    : Optional custom filename
Example:
bash
python3 scripts/generate_document.py proposal my_proposal_data.json \
  --templates-dir assets/templates \
  --output-dir ./generated_docs
运行生成脚本:
bash
python3 scripts/generate_document.py <document_type> <data_file> \
  --templates-dir assets/templates \
  --output-dir <output_directory>
参数说明:
  • <document_type>
    :可选值为
    proposal
    business_plan
    budget
  • <data_file>
    :包含文档数据的JSON文件路径
  • --templates-dir
    :存放PDF模板的目录(默认:
    assets/templates
  • --output-dir
    :生成PDF的保存目录(默认:
    output
  • --output-filename
    :可选的自定义文件名
示例:
bash
python3 scripts/generate_document.py proposal my_proposal_data.json \
  --templates-dir assets/templates \
  --output-dir ./generated_docs

Step 5: Deliver the Document

步骤5:交付文档

The script outputs a PDF file in the specified output directory. Verify the document was generated successfully and inform the user of the file location.
脚本会在指定的输出目录中生成PDF文件。验证文档生成成功后,告知用户文件位置。

Detailed Usage Instructions

详细使用说明

Creating a Project Proposal

创建项目提案

  1. Collect proposal information:
    • Project title and subtitle
    • Client organization and contact
    • Your company name and contact info
    • Project details (problem, solution, timeline, budget)
  2. Create a JSON data file with proposal fields (see
    references/document_schemas.md
    )
  3. Run the script:
    bash
    python3 scripts/generate_document.py proposal proposal_data.json \
      --templates-dir assets/templates
  4. Output: Professional PDF proposal with cover page and content sections
  1. 收集提案信息:
    • 项目标题和副标题
    • 客户机构和联系人
    • 贵公司名称和联系信息
    • 项目详情(问题、解决方案、时间线、预算)
  2. 创建包含提案字段的JSON数据文件(参考
    references/document_schemas.md
  3. 运行脚本:
    bash
    python3 scripts/generate_document.py proposal proposal_data.json \
      --templates-dir assets/templates
  4. 输出结果:包含封面和内容章节的专业PDF提案

Creating a Business Plan

创建商业计划

  1. Collect business plan information:
    • Company name and legal structure
    • Mission and vision statements
    • Target market details
    • Financial projections
  2. Create a JSON data file with business plan fields
  3. Run the script:
    bash
    python3 scripts/generate_document.py business_plan plan_data.json \
      --templates-dir assets/templates
  4. Output: Comprehensive business plan PDF template
  1. 收集商业计划信息:
    • 公司名称和法律架构
    • 使命和愿景声明
    • 目标市场详情
    • 财务预测
  2. 创建包含商业计划字段的JSON数据文件
  3. 运行脚本:
    bash
    python3 scripts/generate_document.py business_plan plan_data.json \
      --templates-dir assets/templates
  4. 输出结果:全面的商业计划PDF模板

Creating an Annual Budget

创建年度预算表

  1. Collect budget information:
    • Fiscal year
    • Company name
    • Budget assumptions (inflation, growth targets)
    • Revenue and expense forecasts
  2. Create a JSON data file with budget fields
  3. Run the script:
    bash
    python3 scripts/generate_document.py budget budget_data.json \
      --templates-dir assets/templates
  4. Output: Annual budget plan PDF with tables and projections
  1. 收集预算信息:
    • 财年
    • 公司名称
    • 预算假设(通货膨胀、增长目标)
    • 收入和支出预测
  2. 创建包含预算字段的JSON数据文件
  3. 运行脚本:
    bash
    python3 scripts/generate_document.py budget budget_data.json \
      --templates-dir assets/templates
  4. 输出结果:包含表格和预测内容的年度预算表PDF

Important Notes

重要说明

Script Functionality

脚本功能

The
scripts/generate_document.py
script:
  • Reads PDF templates from the assets directory
  • Overlays user data on template pages (primarily cover pages)
  • Generates a new PDF with filled information
  • Preserves the original template structure and formatting
scripts/generate_document.py
脚本:
  • 从assets目录读取PDF模板
  • 在模板页面上叠加用户数据(主要是封面)
  • 生成包含填充信息的新PDF
  • 保留原始模板的结构和格式

Current Limitations

当前限制

The script currently fills in cover page information (titles, names, dates). The template body content serves as a professional framework that users can follow when creating their documents manually or through other PDF editing tools.
脚本目前仅填充封面信息(标题、名称、日期)。模板正文内容作为专业框架,用户可手动或通过其他PDF编辑工具补充内容。

Extending the Script

扩展脚本

To fill additional fields beyond the cover page, the script can be enhanced to:
  • Parse form fields in PDFs
  • Add text overlays on specific coordinates for each page
  • Replace placeholder text programmatically
Modify
scripts/generate_document.py
to add more sophisticated PDF manipulation as needed.
若要填充封面以外的更多字段,可对脚本进行增强,实现:
  • 解析PDF中的表单字段
  • 在每个页面的特定坐标添加文本叠加层
  • 以编程方式替换占位符文本
根据需要修改
scripts/generate_document.py
,添加更复杂的PDF操作功能。

Data Schema Reference

数据架构参考

For detailed information about required and optional fields for each document type, consult:
  • references/document_schemas.md
    - Complete data structure documentation
如需了解每种文档类型的必填和可选字段的详细信息,请参考:
  • references/document_schemas.md
    - 所有文档类型的完整数据结构文档

Example Files

示例文件

Find complete working examples in
assets/examples/
:
  • proposal_example.json
    - Sample project proposal data
  • business_plan_example.json
    - Sample business plan data
  • budget_example.json
    - Sample budget plan data
Use these as starting templates when creating new documents.
完整的可用示例位于
assets/examples/
  • proposal_example.json
    - 示例项目提案数据
  • business_plan_example.json
    - 示例商业计划数据
  • budget_example.json
    - 示例预算计划数据
创建新文档时,可将这些作为起始模板。

Troubleshooting

故障排除

Import errors when running the script:
  • Install required packages:
    pip install pypdf reportlab
Template not found:
  • Verify
    --templates-dir
    points to
    assets/templates
  • Check that PDF template files exist in the templates directory
Generated PDF is blank or missing data:
  • Verify JSON data file is properly formatted
  • Check that required fields are present (see
    references/document_schemas.md
    )
Need to customize templates:
  • Original templates are in
    assets/templates/
  • Modify templates using PDF editing software
  • Keep original filenames or update
    TEMPLATE_MAP
    in the script
运行脚本时出现导入错误:
  • 安装所需包:
    pip install pypdf reportlab
未找到模板:
  • 验证
    --templates-dir
    指向
    assets/templates
  • 检查模板目录中是否存在PDF模板文件
生成的PDF为空或缺少数据:
  • 验证JSON数据文件格式正确
  • 检查是否包含必填字段(参考
    references/document_schemas.md
需要定制模板:
  • 原始模板位于
    assets/templates/
  • 使用PDF编辑软件修改模板
  • 保留原始文件名,或更新脚本中的
    TEMPLATE_MAP

Resources

资源说明

scripts/

scripts/

Contains the Python script for document generation:
  • generate_document.py
    - Main document generation script with CLI interface
This script can be executed directly without loading into context for token efficiency. It may be read if modifications or debugging are needed.
包含用于文档生成的Python脚本:
  • generate_document.py
    - 带CLI界面的主文档生成脚本
为提高令牌效率,可直接执行此脚本,无需加载到上下文。如需修改或调试,可读取脚本内容。

references/

references/

Documentation to reference while working:
  • document_schemas.md
    - Complete JSON data structure for all document types
工作时可参考的文档:
  • document_schemas.md
    - 所有文档类型的完整JSON数据结构

assets/

assets/

Files used in the document generation output:
  • templates/
    - Professional PDF templates for each document type
    • Professional Proposal Template.pdf
    • Comprehensive Business Plan Template.pdf
    • Annual Budget Plan Template.pdf
  • examples/
    - Sample JSON data files demonstrating proper structure
    • proposal_example.json
    • business_plan_example.json
    • budget_example.json
These templates and examples are not loaded into context but referenced during generation.
文档生成输出中使用的文件:
  • templates/
    - 每种文档类型的专业PDF模板
    • Professional Proposal Template.pdf
    • Comprehensive Business Plan Template.pdf
    • Annual Budget Plan Template.pdf
  • examples/
    - 展示正确结构的示例JSON数据文件
    • proposal_example.json
    • business_plan_example.json
    • budget_example.json
这些模板和示例不会加载到上下文,仅在生成过程中被引用。