--- name: fill-template description: > Bulk-fill ONE master template — a Word (.docx) letter/form or an Excel (.xlsx) form — from a data table, one filled file per row (mail-merge). Also the reverse: extract a reusable tokenised .docx template + data-table skeleton from a filled example document, confirm the mapping, then fill. Use whenever the user wants to "fill in this letter for each person", "mail merge", "generate letters for this list", "turn this filled letter into a template", or hands over a template plus a list. The skill reads the master, proposes a TOKENISED version (varying parts become {{tokens}}), confirms the mapping, then regenerates one output per data row, preserving the master's layout exactly. Data is an .xlsx or .csv (one row per output); outputs are one named file per record. Never invents: a token with no data is a VISIBLE flag, never a silent blank. Runs fully local and generates files only — it does not send, post or sign. Extract is .docx only this round (not .xlsx). Not a substitute for a hand-crafted single letter. license: MIT metadata: version: 1.0.0 author: moonlight-lupin platforms: [linux, macos, windows] --- # Fill Template (mail-merge) Turn **one master template** + **a data table** into **many filled copies** — one per row — swapping only the parts that vary and leaving the master's layout and styling untouched. Document generation only: nothing is sent, posted or signed. ## Scope and routing Use this skill when the user has **one** template and **a list**, and wants a filled copy per row; or when they have a **filled/example .docx** and want a reusable tokenised template derived from it (`extract_template`). Do **not** use it to produce a single bespoke letter (just edit one document), or where the host environment mandates a different document pipeline. Extract of `.xlsx` forms is out of scope this round. ## Inputs the user provides 1. **The master template** — a `.docx` letter or form, **or** a `.xlsx` form. One master per run. This is the source of truth for layout and styling. 2. **The data table** — a `.xlsx` or `.csv`, **one row per output**, with a header row. Columns supply the values that vary (names, amounts, dates, references…). 3. **(Optional) a naming pattern** — how each output file is named, e.g. `Letter_{Name}`. Defaults to `