Skip to content

moonlight-lupin/agent-skills / productivity/fill-template

fill-template

Verified

Use when 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. Bulk-fills ONE master template — a Word (.docx) letter/form or an Excel (.xlsx) form — from a data table, one filled file per row (mail-merge); or the reverse: extract a reusable tokenised .docx template + data-table skeleton from a filled example document, confirm the mapping, then fill. 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.

FileKindSize
README.mdmarkdown1.2 KB
SKILL.mdskill md11.3 KB
examples/example-run.mdmarkdown2.6 KB
references/tokenising-guide.mdmarkdown4.5 KB
requirements.txtmanifest129 B
scripts/fill_template.pyscript46.4 KB
tests/__init__.pyscript0 B
tests/test_fill_template.pyscript61.7 KB
# fill-template

Mail-merge skill for AI agents: take **one master template** (`.docx` letter/form or `.xlsx` form)
and a **data table**, and produce **one filled file per row** — tokenise → confirm → generate, with a
never-invent MISSING flag. The reverse path extracts a reusable tokenised `.docx` plus a CSV
skeleton from a filled example (`extract_template`). Fully local; generates files only.

## Structure

```
fill-template/
├── SKILL.md                       # Workflow: extract (optional) → analyse → tokenise → confirm → generate → report
├── scripts/
│   └── fill_template.py           # Engine: extract_template, read_content, tokenise, tokens_in, load_rows, generate
├── references/
│   └── tokenising-guide.md        # Choosing/naming tokens, extract, exact-match rule, MISSING flag
└── examples/
    └── example-run.md             # Worked end-to-end run (bring your own master + data)
```

No binary templates are shipped — bring your own master `.docx`/`.xlsx` and a `.csv`/`.xlsx` data
table. The example walks through the format.

## Requirements

- Python 3.8+
- `pip install python-docx openpyxl`
- No network access and no credentials — fully local file I/O.

## License

MIT
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall