Create .docx literature reviews from literature-source metadata with Chinese thesis-style numeric citations, clickable Word REF fields, superscript citation markers, and a bibliography that uses real Word automatic numbering paragraphs.
This skill is intentionally strict because Word cross-reference OOXML is fragile. Do not hand-wave the citation layer: generate, inspect, render, and validate.
__pycache__, test DOCX files, temporary JSON, or rendered pages inside the skill package.REF body citations unless the user explicitly asks for a non-numeric in-text citation system..bib, .ris, .json, .csv, .tsv, .txt, .md) or curated reference JSON.scripts/build_docx_from_review_json.py or an equivalent OOXML implementation.scripts/validate_docx_crossrefs.py.Use this default pattern unless the user explicitly asks for a different field-code variant:
REF _RefBibNNN \h.w:numPr) with visible marker format [%1]._RefBibNNN) so body REF fields return a clean digit. This avoids the double-bracket bug produced when REF ... \n reads an already bracketed list marker.Read references/ooxml-ref-fields.md before changing the citation implementation, especially if the user asks for exact REF ... \n \h field codes.
For repeatable generation, create a review JSON object and pass it to the builder:
{
"title": "文献综述",
"references": [
{"gbt": "刘颖. 数字化转型背景下企业人力资源管理模式创新研究[J]. 知识经济, 2025(33): 157-159, 163."}
],
"paragraphs": [
[
"数字化转型正在重塑企业人力资源管理的逻辑。刘颖认为,数据驱动和员工体验重构成为提升人才竞争优势的重要路径",
{"cite": 1},
"。"
]
]
}
Citation values:
{"cite": 1} creates superscript [1].{"cite": [3, 4, 5]} creates superscript [3-5] by default.{"cite": [10, 11], "collapse": false} creates superscript [10,11].Read references/review-json-spec.md for the full JSON schema and examples.
Before delivering a .docx, confirm all of the following:
REF 字段,不是 HYPERLINK。w:numPr。_RefBibNNN 锚点。[3-5]、[4,5] 或 [10,11]。Use:
python scripts/validate_docx_crossrefs.py output.docx --expect-bib-count 12 --forbid-hyperlinks --require-ref --require-superscript --require-auto-numbered-bib
Then render and visually inspect with the available DOCX renderer.
scripts/sources_to_json.py: normalize .bib, .ris, CSL JSON, CSV/TSV, or plain reference lists into JSON candidates.scripts/bibtex_to_json.py: backwards-compatible BibTeX-only parser.scripts/markdown_review_to_json.py: convert Markdown review drafts with [cite:1] or [@key] markers into review JSON.scripts/build_docx_from_review_json.py: build the final .docx from curated review JSON.scripts/validate_docx_crossrefs.py: inspect DOCX OOXML for REF fields, superscript results, forbidden hyperlinks, bookmarks, and bibliography numbering.scripts/self_check.py: run an isolated end-to-end regression check against a real BibTeX fixture; fails on package pollution, invalid frontmatter, malformed scripts, or DOCX cross-reference regressions.共 1 个版本