template-based-document-generation

template-based-document-generation is a skill for Claude Code, Codex from microsoft/cat-agent-skills. It costs 78 tokens per session (3,419 once invoked), scanned A, original, MIT.

A workflow for filling a Microsoft Word document template with structured data. A DOCX file is the standard editable document format used by Microsoft Word.

In plain words
What is it for?
It inspects a template, prepares a data-based fill plan, replaces fields, repeats table rows when needed, and verifies the finished document.
Why use it?
It preserves the template's branding and reports missing or unused values instead of silently guessing or changing unrelated content.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one.

Good fit It inspects a template, prepares a data-based fill plan, replaces fields, repeats table rows when needed, and verifies the finished document.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/microsoft/cat-agent-skills/template-based-document-generation
About the project

microsoft/cat-agent-skills is a static website that catalogs reusable instruction sets and related packages for AI agents. People use it to search, filter, rate, and download skills for Cowork, Copilot Studio, and Scout, along with Copilot plugins and Scout automations. The catalogue entries are the skills, instructions, plugins, and settings displayed by the site.

microsoft/cat-agent-skills · 93 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add microsoft/cat-agent-skills --skill template-based-document-generation
Clone the repo
git clone --depth 1 https://github.com/microsoft/cat-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for template-based-document-generation

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/cat-agent-skills/template-based-document-generation/github.svg)](https://agentmods.dev/skills/microsoft/cat-agent-skills/template-based-document-generation)
Your own site
<a href="https://agentmods.dev/skills/microsoft/cat-agent-skills/template-based-document-generation"><img src="https://agentmods.dev/badge/skills/microsoft/cat-agent-skills/template-based-document-generation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for template-based-document-generation

Your own site · 80×15
<a href="https://agentmods.dev/skills/microsoft/cat-agent-skills/template-based-document-generation"><img src="https://agentmods.dev/badge/skills/microsoft/cat-agent-skills/template-based-document-generation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,419 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00078 $0.03419
Opus 5.5 $0.00031 $0.01368
Sonnet 5.5 $0.00016 $0.00684
Haiku 4.5 $0.00008 $0.00342

Measured 8d ago against content hash 4c74c793c6e4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

template-based-document-generation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 8 executable files (scripts/apply_plan.py, scripts/build_fixtures.py, scripts/inspect_template.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

submissions/template-based-document-generation/SKILL.md · 191 lines

How it starts

The opening of the file, as written. The whole thing — 191 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Template-Based Document Generation

One command inventories the template, you write a plan as data, one command applies and verifies it.

Branding survives: every part the plan does not touch (logo, styles, theme, fonts, numbering, headers and footers with nothing to fill) stays byte-identical, and in a touched part only the runs holding a replaced value are rewritten. Nothing is invented silently: a missing value follows the field's absence policy and is named in the report rather than guessed, every literal, sentinel, empty and unused input is a review item, and every change is verified against the plan or the run fails and nothing is published.

Workflow

  1. python scripts/run_job.py inspect --template <file.docx> --workdir <dir> [--profile <profile.json>] creates <dir>/<job_id>/ with snapshot.docx, manifest.json (paragraph inventory, candidates, findings) and plan.draft.json, and prints a listing: every paragraph with its id and text, every candidate marked ! (needs your decision), ? (optional) or x (cannot be filled, reason given).
  2. Copy plan.draft.json to plan.json and complete it. A complete, working pair to copy the shape from is references/examples/plan.json and references/examples/values.json: every decision kind, typed and formatted fields, a sentinel, a derived literal, a repeated row, a range deletion and a multi-paragraph insert. It is written for assets/fixtures/mixed-conventions.docx and selftest runs it, so every key name in it is current. Read it instead of the contract or the scripts when you need a setting's name.
    • decisions[]: one per ! candidate. field (fill it), literal (ordinary text, leave it), remove_text (delete just that text), remove_paragraph, or keep (leave it and flag it).
    • fields[]: name, type (string, integer, decimal, date, boolean), format, absence_policy (required, sentinel, empty) and source, a path into the data such as client.name or items[0].qty. source is a plain path, traversed key by key: there are no expressions, so it cannot join, compute or summarise. When the value needs working out rather than looking up, put the worked-out value in the field's literal instead of a source; it is always flagged for review. (Careful: literal in decisions[] means the opposite of this one — there it means "this text is real content, leave it alone". In fields[] it is the value you supply.)
    • operations[]: delete_paragraph, delete_range (from and to paragraph ids in the same container; tables in between go too), delete_row, delete_break (one line or page break, so deleting a cover page does not leave a blank first page), repeat_row (an id, any paragraph in the row, a source list; the row's fields carry "repeat": "<id>" and sources relative to each item; add "group": true to a field such as a phase or category to print it only on the first of consecutive rows that share its value), insert_paragraph_after (text or field; a field whose value is a list becomes one paragraph per item, which is how a multi-paragraph answer goes in at an anchor).
    • locale when the document is not English: months, true and false text, separators, date pattern.
    • notes: optional free text for the record, at most 2000 characters. The draft carries a reminder here; remove or replace it.
  3. Write values.json as {"data": <the input, any JSON, shaped however you like>}.
  4. python scripts/run_job.py execute --job <job dir> --dry-run prints every change as before and after text plus every review item, or the errors that stop it. Fix the plan and repeat until it compiles.
  5. python scripts/run_job.py execute --job <job dir> [--out <dir>] applies, verifies, and writes report.json, attempts/<id>/ and, when verification passes, output/<stem>__<job_id>.docx. Exit 0 ok, 2 needs_review, 1 failed. Rerunnable, and a failed rerun never deletes a document an earlier attempt verified.
  6. Deliver the document before you report on it. output/<stem>__<job_id>.docx sits in the job directory, which the user never sees: copy it into the folder this session hands deliverables from, or run step 5 with --out pointing there. A report without the file is not a delivery. If execute exits 1 there is nothing to deliver; say so and name the check that failed.
  7. Relay the result word, the change list and every review item. Each command prints its own elapsed: line; pass those figures on unchanged rather than estimating, if anyone is measuring. ok means mechanically verified against the template and the plan. Nobody has opened the document in Word.

Read the full file on GitHub · 191 lines

Files

What ships with it

51 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 191 lines · 78 tokens per session scan A 4c74c793c6e4

Subscribe to this mod's changes

template-based-document-generation is a skill published in the GitHub repository microsoft/cat-agent-skills (93 stars, last pushed today), licensed MIT. It adds 78 tokens to every session and 3,419 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-20.

Related

Other skills, from other repositories

orbit-notion

Open Orbit briefing skill — selected by the Orbit pipeline when Notion is the user's only connected connector, or when the user explicitly scopes their daily digest to Notion. Pulls the past 24 hours of document edits, comments, mentions, and database row changes from the user's authenticated Notion connection and…

nexu-io/open-design · 117 tokens

instrument-data-to-allotrope

Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full…

anthropics/knowledge-work-plugins · 123 tokens

apify-youtube-transcript-scraper

Get YouTube captions, timestamped quotations, SRT/VTT and translated transcripts for videos, channels and playlists through the harshmaur/youtube-transcript-scraper Apify Actor.

sickn33/agentic-awesome-skills · 48 tokens

legal-hold

Issue, refresh, release, or report on legal holds — drafts the hold notice as .docx, updates legalhold fields in log.yaml, and calendars the next refresh. Use when the user says "issue a hold", "refresh hold", "release hold", or asks for a portfolio-wide hold status report.

anthropics/claude-for-legal · 68 tokens

baoyu-youtube-transcript

A tool for downloading the written captions, subtitles, chapter information, speaker labels, and cover image from a YouTube video using its URL or ID.

JimLiu/baoyu-skills · 107 tokens

feishu

Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.

Hmbown/CodeWhale · 33 tokens