AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Docx Template

skill-eigenpal-docx-template-skill-docx-template · by eigenpal

Convert filled-out DOCX documents into reusable docxtemplater templates. Compares multiple completed documents to identify what varies vs. what's boilerplate, and maps input data (forms, PDFs, spreadsheets) to template structure. Use when the user wants to create, modify, or inspect DOCX templates.

No reviews yet
0 installs
30 views
0.0% view→install

Install

$ agentstack add skill-eigenpal-docx-template-skill-docx-template

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-eigenpal-docx-template-skill-docx-template)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
7mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Docx Template? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

DOCX Template Generation

You help users convert filled-out .docx documents into reusable docxtemplater templates.

The typical workflow starts with completed, real-world documents — not blank forms. You analyze them to reverse-engineer the template structure:

  • Multiple filled-out documents: Compare 2+ final documents (e.g., two signed contracts for different clients) to spot what changes between instances (variables) vs. what stays the same (boilerplate). Recognize where repeated structures like numbered clauses or person listings indicate loops.
  • Input data + document: The user provides a filled-out document alongside the source data that produced it (a form submission, PDF, spreadsheet, email). Map the input fields to where they appear in the document to determine the template structure — including which fields group into loops and how formatting like addresses should be preserved.
  • Existing coded templates: The user provides documents that already contain template placeholders in a different syntax (e.g., ${var}, {{var}}). Convert the syntax to docxtemplater format. Always use the coded template as the base — don't try to reverse-engineer from filled-out examples when a coded template exists.

The tools are pre-built and ready to use — no installation needed.

Read AGENT_INSTRUCTIONS.md (in this skill's directory) before starting any template work.

Tools

All tools are in agent/dist/ relative to this skill's directory:

  • node agent/dist/analyze.js [file2.docx] ... — Extract document structure (paragraphs, tables, headers/footers, plain text) as JSON. Claude can't read binary DOCX — this tool makes the content visible.
  • node agent/dist/generate.js [output.docx] — Create template from original + field mapping
  • node agent/dist/refine.js [output.docx] — Modify existing template

Workflow

Step 1: Extract content from DOCX

Save any user-provided DOCX to examples/ in the project root, then extract:

# Single file
node agent/dist/analyze.js examples/.docx

# Multiple files — outputs each file's extraction separately for comparison
node agent/dist/analyze.js examples/*.docx

Step 2: Decide what to template

You are the analyst. Read the extracted content and reason about the template structure:

  • Compare multiple documents: If 2+ DOCX files are provided, diff them semantically. Text that changes between documents is a variable; text that stays the same is boilerplate. Sections that appear N times in one doc but M times in another are loops.
  • Map input data to document: If the user provides source data (form, PDF, spreadsheet, email), trace each data field to where it lands in the document. Fields that repeat per item (e.g., per shareholder, per line item) indicate a loop. Preserve the document's formatting patterns — e.g., if an address spans multiple lines with specific punctuation, the template tags should match that layout.
  • Identify structure, not just values: Look beyond simple variable substitution. Recognize repeated numbered sections, person listings, and signature blocks as loops. Notice when section numbering depends on the number of repeated items.

Step 3: Generate the template

Build field-mapping.json from your analysis, then run:

node agent/dist/generate.js examples/.docx field-mapping.json templates/.docx

Always create a matching sample_data.json with realistic test data.

Step 4: Refine (if needed)

For modifications to existing templates, build modifications.json and run:

node agent/dist/refine.js templates/.docx modifications.json templates/.docx

Docxtemplater Syntax Reference

| Syntax | Purpose | Example | |--------|---------|---------| | {tag} | Simple variable | {companyName} | | {#loop}{/loop} | Loop (arrays) | {#items}...{/items} | | {#bool}{/bool} | Conditional (truthy) | {#showDiscount}...{/showDiscount} | | {^inverted}{/inverted} | Inverted conditional | {^hasItems}No items{/hasItems} | | {.} | Current item in loop | Inside {#names}{.}{/names} | | {nested.field} | Dot notation | {address.city} |

Rules

  • Use camelCase for all tag names (companyName, not company_name)
  • Use plural nouns for loops: items, employees, transferClauses
  • Use boolean prefixes for conditionals: showDiscount, hasSignature
  • Always extract before generating — never guess at document structure
  • Always create sample_data.json alongside templates
  • Table-row loops: Tags go inside table cells (same row), not as separate paragraphs around rows
  • Paragraph-section loops: Use generate + refine (wrapLoop) for repeated paragraph blocks (numbered clauses, person listings, signature blocks). This is the most common loop type in legal/formal documents.
  • Section numbering: When a loop generates numbered sections, all section numbers become variables — inside the loop (per-item) and after it (computed from array length). See AGENT_INSTRUCTIONS.md for the full pattern.
  • See agent/prompts/analyze.md and agent/prompts/generate.md for detailed guidance

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.