Docx from template
Universal Agent Skill for Claude Code, Codex, and Cursor: generate delivery Word/Excel docs by mirroring a template structure
npx -y skills add jingua1234/docx-from-templateAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 16 days oldThe repository was created 16 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Generates Word (.docx) or Excel (.xlsx) delivery documents by mirroring a reference template's structure (headings, tables, columns) and filling content from the current codebase. Use when the user says 按照/参考格式, attaches a .docx/.xlsx template, or asks for 交付文档, 产品部署文档, 代码提交记录,核心技术说明, Bug跟踪表, 环境审查, 二进制文件清单, 开源组件清单, or 源代码架构说明.
SKILL.md
2.6 KB, 758 tokens by cl100k_base, as published. Nobody here has run it
按模板生成交付文档
何时使用
用户给出参考 .docx / .xlsx,要求「按照这个格式」写新产品部署、提交记录、国产化/测评类交付物等时,必须使用本 Skill。PDF 任务改用 pdf Skill。
依赖
python -m pip install python-docx openpyxl
工作流(必须按序)
复制清单并跟踪进度:
任务进度:
- [ ] 1. 解析模板结构
- [ ] 2. 按文档类型收集代码库证据
- [ ] 3. 按模板版式生成文档
- [ ] 4. 回读自检
1. 解析模板结构
先跑检查脚本,禁止只凭文件名猜栏目:
python scripts/inspect_docx.py "path/to/template.docx"
# Excel:
python scripts/inspect_docx.py "path/to/template.xlsx"
记录:标题层级与样式名、表格列头、示例行模式、列表/编号习惯。复杂结构可再读 reference.md。
2. 收集证据
按文档类型从代码库取证(见 reference.md)。缺证据处写「待确认」或留空并在回复中列出,禁止编造提交哈希、版本号、证书编号等。
3. 对齐版式并写出
- 标题层级、表头列名、章节顺序与模板一致
- Word 用
python-docx;Excel 用openpyxl - 默认输出到项目
doc/;若无该目录则用用户指定路径,或询问后再写 - 文件名:模板语义 + 项目/范围后缀(例:
代码提交记录-四项目.docx)
4. 自检
对输出再跑 inspect_docx.py,核对:
- 章节数与标题文案大致对齐模板
- 表头列名一致、无整表空白未说明
- 无工具残留占位符(如
TODO、lorem、未替换的{{...}})
输出约定
- 回复中给出:输出路径、相对模板的主要差异、仍待确认的条目
- 中间提取结果可放
doc/_tmp_*.txt,交付完成后可删
反模式
- 不改模板源文件(除非用户明确要求改模板)
- 不把 PDF 流程塞进本 Skill
- 不在无 git 历史时伪造真实 commit;可按用户要求生成「合理示意记录」并标明为示意
Gives 0 of the 12 instructions most pdf office docs skills give in 758 tokens
Counted across 636 of the 690 authors here whose files we hold, read 2026-08-07
- extract text using pdfplumberin 89 of 636, across 23 files
- create PDFs using reportlabin 83 of 636, across 16 files
- read forms.md to fill out pdf formsin 80 of 636, across 13 files
- OCR scanned PDFs using pytesseractin 77 of 636, across 10 files
- merge or split PDFs using qpdfin 70 of 636, across 3 files
- use excel formulas instead of hardcoded calculated valuesin 68 of 636, across 13 files
- unpack edit xml and repack existing documentsin 63 of 636, across 8 files
- document sources for hardcoded valuesin 61 of 636, across 9 files
- write minimal python code without unnecessary commentsin 59 of 636, across 7 files
- run the recalculation script after adding or modifying formulasin 59 of 636, across 7 files
- fix all identified formula errors and recalculatein 58 of 636, across 6 files
- format years as text stringsin 57 of 636, across 5 files
Said here and by no other author read
- run the inspection script on the template
- collect evidence from the codebase by document type
- match heading levels and table headers to the template
- output to the project doc directory by default
- verify headers match with no unexplained blank tables
- report the output path, major differences, and pending items
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.