Document Template Engine
Auto-fill document templates with data - mail merge for any format
You need to generate 200 personalized contracts from a spreadsheet but Word mail merge can't handle your complex template with conditional sections. This playbook auto-fills document templates with data from any source — like mail merge but for any format, with logic, loops, and conditional content.
Who it's for: operations managers generating hundreds of personalized documents from spreadsheet data, legal teams producing customized contracts from client data templates, HR departments automating offer letters and onboarding documents, sales teams creating personalized proposals from CRM data, administrative staff producing certificates, invoices, or reports from data sources
Example
"Generate 150 personalized vendor agreements from our contractor spreadsheet" → Template engine pipeline: template design with placeholder fields and conditional sections, data source connection to spreadsheet or CSV, field mapping between data columns and template variables, batch document generation with per-record customization, and output as individual PDFs or DOCX files named by vendor
CLAUDE.md Template
New here? 3-minute setup guide → | Already set up? Copy the template below.
npx ccplaybooks add template-engine# Template Engine
## Overview
This workflow enables template-based document generation - define templates with placeholders, then automatically fill them with data. Works with Word, Excel, PowerPoint, and more.
## How to Use
1. Describe what you want to accomplish
2. Provide any required input data or files
3. I'll execute the appropriate operations
Get new playbooks like this one
One email a week with new Claude Code workflows. Free, like everything here.
No spam. Unsubscribe anytime.
What This Does
This workflow enables template-based document generation - define templates with placeholders, then automatically fill them with data. Works with Word, Excel, PowerPoint, and more.
Quick Start
Step 1: Create a Project Folder
mkdir -p ~/Documents/TemplateEngine
Step 2: Download the Template
Click Download above, then:
mv ~/Downloads/CLAUDE.md ~/Documents/TemplateEngine/
Step 3: Start Working
cd ~/Documents/TemplateEngine
claude
How to Use
- Describe what you want to accomplish
- Provide any required input data or files
- I'll execute the appropriate operations
Example prompts:
- "Mail merge for bulk letters/contracts"
- "Generate personalized reports from data"
- "Create certificates from templates"
- "Auto-fill forms with user data"
Best Practices
- Use clear placeholder naming ({{client_name}})
- Validate data before rendering
- Handle missing data gracefully
- Keep templates version-controlled
Installation
# Install required dependencies
pip install python-docx openpyxl python-pptx reportlab jinja2