docx-template-translator

docx-template-translator is a skill for Codex from zouchenzhen/docx-template-translator-skill. It costs 87 tokens per session (6,770 once invoked), scanned A, original, Apache-2.0.

A conversion workflow that turns LaTeX, PDF, Markdown, or rough Word documents into a complete Word document using a supplied Word template. It adapts the conversion to the specific template instead of assuming the template’s meaning.

In plain words
What is it for?
Use it for theses, dissertations, reports, or other documents that must follow an existing Word template.
Why use it?
It helps preserve institutional formatting that basic document conversion may miss, such as cover pages, declarations, contents pages, numbered headings, and captions.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it for theses, dissertations, reports, or other documents that must follow an existing Word template.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zouchenzhen/docx-template-translator-skill/docx-template-translator
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 zouchenzhen/docx-template-translator-skill --skill docx-template-translator
Clone the repo
git clone --depth 1 https://github.com/zouchenzhen/docx-template-translator-skill

Made for: 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 docx-template-translator

README.md
[![agentmods](https://agentmods.dev/badge/skills/zouchenzhen/docx-template-translator-skill/docx-template-translator/github.svg)](https://agentmods.dev/skills/zouchenzhen/docx-template-translator-skill/docx-template-translator)
Your own site
<a href="https://agentmods.dev/skills/zouchenzhen/docx-template-translator-skill/docx-template-translator"><img src="https://agentmods.dev/badge/skills/zouchenzhen/docx-template-translator-skill/docx-template-translator/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 docx-template-translator

Your own site · 80×15
<a href="https://agentmods.dev/skills/zouchenzhen/docx-template-translator-skill/docx-template-translator"><img src="https://agentmods.dev/badge/skills/zouchenzhen/docx-template-translator-skill/docx-template-translator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,770 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.00087 $0.06770
Opus 5 $0.00044 $0.03385
Sonnet 5 $0.00017 $0.01354
Haiku 4.5 $0.00009 $0.00677

Measured 11d ago against content hash 86e7dfd61d74, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

docx-template-translator 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 11d ago.

The scan reads SKILL.md. This mod also ships 8 executable files (scripts/adaptive_docx_pipeline.py, scripts/finalize_word_docx.py, scripts/inject_toc_field.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.

skills/docx-template-translator/SKILL.md · 197 lines

How it starts

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

DOCX Template Translator

Core Idea

Treat the input file as the content source and the Word template as the formatting source. Do not expect pandoc or PDF import to infer template semantics. Build a project-specific Python postprocessor after inspecting the template and the converted body document.

Do not treat the bundled starter pipeline or a preset JSON file as a finished converter for institutional templates. For thesis/dissertation templates, you must create or patch a project-specific pipeline for the concrete template and source project before claiming success.

Workflow

  1. Identify inputs:
    • Source: .tex project, .pdf, .md, or an existing rough .docx.
    • Template: required .docx.
    • Output location and document metadata.
  2. Inspect the template with the real CLI form:
    • python scripts/inspect_docx_template.py template.docx --out template_report.json
  3. Create a rough body .docx:
    • LaTeX/Markdown: use pandoc when available.
    • PDF: try Word COM import or pdf2docx; prefer PDF only when the original source is unavailable.
    • Existing DOCX: use it as the rough body source.
  4. Write or patch a project-specific Python pipeline:
    • Start from scripts/adaptive_docx_pipeline.py.
    • Copy it into the run/output directory or project workspace before patching; do not edit the bundled script in place for a one-off conversion.
    • Decide, from the template inspection, which template paragraphs/tables/sections are reusable and which are sample placeholders to delete.
    • Mark protected native-template regions before coding. For thesis templates, cover pages, English cover pages, originality/declaration pages, authorization pages, signatures, and their section breaks are protected by default until the first generated abstract/body marker.
    • Replace or fill template front matter such as cover pages, declarations, abstracts, keywords, TOC placeholders, headers, footers, page numbering, and section breaks when the source provides those fields.
    • In protected regions, replace text inside existing paragraphs/runs/tables without deleting and rebuilding the paragraph. Preserve paragraph styles, run fonts/sizes/bold, alignment, spacing, and page breaks unless the user explicitly asks to alter the template.
    • Insert the rough body at the real body start or rebuild the document around the template parts. Do not blindly append the rough body to the end of the template.
    • Copy template front matter if needed.
    • Append rough body content while remapping DOCX relationships.
    • Remap copied style IDs by visible style name before applying formatting; otherwise Heading 1/2/3 can silently become an unrelated template style when source and template style IDs collide.
    • Remap styles to the template's real body, heading, caption, reference, and TOC styles.
    • Scope global formatting passes to generated content only, for example with formatting_start_marker. Never run body-style remapping across native cover/declaration pages.
    • Clean or rebuild section header/footer references when deleting sample template sections; stale back-matter headers such as 致谢 must not appear on body pages.
    • Add or repair figure/table captions, table borders, hyperlinks, bookmarks, citations, and page breaks.
  5. Finalize with Microsoft Word when available:
    • Use scripts/finalize_word_docx.py to update fields/TOC and export a PDF preview.
  6. Automated and visual verification:
    • Use scripts/validate_docx_conversion.py final.docx --template template.docx --protected-until "中 文 摘 要" --pdf final.pdf --out validation.json for placeholder/order/header/image/table checks plus protected-front-matter format checks. Choose the real first generated marker for non-Zhengzhou templates.
    • Then run scripts/validate_docx_render.py final.docx --pdf final.pdf --out validation_render.json for render-level checks: TOC field presence, numId↔abstractNum consistency, multilevel heading format, reference-counter independence, body-header static-text leakage, and PDF field-error strings. The structural validator can return PASS while the document is visibly broken; the render validator is what catches "empty TOC", "chapters not auto-numbered", "references start at [47]", "body header still says 致谢", and "STYLEREF prints 错误!使用'开始'选项卡…".
    • Use scripts/render_pdf_preview.py to inspect cover pages, abstracts, TOC, representative tables, figures, formulas, and references.

Read the full file on GitHub · 197 lines

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. 11d ago First seen · 197 lines · 87 tokens per session scan A 86e7dfd61d74

Subscribe to this mod's changes

docx-template-translator is a skill published in the GitHub repository zouchenzhen/docx-template-translator-skill (71 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 87 tokens to every session and 6,770 once invoked, about $0.0004 per session on Opus 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-08-30.

Related

Other skills, from other repositories

pdf-to-editable-word

Convert PDF to Word or PDF to DOCX while preserving the original page layout and keeping text editable, searchable, and selectable. Use for PDF-to-Word conversion, editable DOCX creation, fixed-layout documents, table-heavy PDFs, vertical text, resumable long-document conversion, or output validation. Works as a…

longligooo/pdf-to-editable-word-skill · 102 tokens

cnipa-patent-writer

A Chinese patent-application writing skill that creates a formatted DOCX document, including the abstract, claims, description, and technical drawings. CNIPA is China’s government agency for patent applications.

fnjialun/cnipa-patent-writer · 297 tokens

pdf-to-editable-word

Convert PDF to Word or PDF to DOCX while preserving the original page layout and keeping text editable, searchable, and selectable. Use for PDF-to-Word conversion, editable DOCX creation, fixed-layout documents, table-heavy PDFs, vertical text, resumable long-document conversion, or output validation. Works as a…

longligooo/pdf-to-editable-word-skill · 102 tokens

all2md

Convert, read, generate, search, and compare documents with the all2md CLI and Python library. Use whenever a task involves reading or extracting text/tables from a document (PDF, Word, PowerPoint, Excel, HTML, email, EPUB, Jupyter, images, or 100+ source-code and text file types); converting between formats…

thomas-villani/all2md · 181 tokens

paper-format-agent

Use this skill when a user needs to inspect, score, repair, or regression-test academic paper formatting in DOCX files, especially thesis, journal, or conference documents with a separate format specification. The skill guides Codex through local-first document handling, rule extraction, formatting repair, report…

zxyasfas/paper_format_agent · 68 tokens

thesis-defense-pptx

Create, polish, and quality-check editable undergraduate or graduate thesis defense PowerPoint decks from a local thesis PDF/LaTeX project and an existing PPTX template. Use when the user asks for a formal defense PPT, thesis presentation, academic答辩PPT, template-matched PPTX, or local PowerPoint deck generation with…

zouchenzhen/thesis-defense-pptx-skill · 77 tokens