zcode-app-cli 3.3.5-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +642 -0
  3. package/bin/zcode.js +848 -0
  4. package/config.example.json +110 -0
  5. package/package.json +81 -0
  6. package/vendor/.node-bundle-meta.json +6 -0
  7. package/vendor/extraction.json +11 -0
  8. package/vendor/node_modules/@zcode/tui/dist/index.js +161875 -0
  9. package/vendor/node_modules/@zcode/tui/package.json +14 -0
  10. package/vendor/packages/android-emulator-plugin/.mcp.json +19 -0
  11. package/vendor/packages/android-emulator-plugin/.zcode-plugin/plugin.json +63 -0
  12. package/vendor/packages/android-emulator-plugin/README.md +134 -0
  13. package/vendor/packages/android-emulator-plugin/commands/android-dev.md +11 -0
  14. package/vendor/packages/android-emulator-plugin/dist/lib/path.d.ts +4 -0
  15. package/vendor/packages/android-emulator-plugin/dist/lib/path.js +17 -0
  16. package/vendor/packages/android-emulator-plugin/dist/lib/result.d.ts +5 -0
  17. package/vendor/packages/android-emulator-plugin/dist/lib/result.js +22 -0
  18. package/vendor/packages/android-emulator-plugin/dist/lib/run.d.ts +18 -0
  19. package/vendor/packages/android-emulator-plugin/dist/lib/run.js +99 -0
  20. package/vendor/packages/android-emulator-plugin/dist/mcp/server.d.ts +3 -0
  21. package/vendor/packages/android-emulator-plugin/dist/mcp/server.js +47607 -0
  22. package/vendor/packages/android-emulator-plugin/dist/providers/app.d.ts +39 -0
  23. package/vendor/packages/android-emulator-plugin/dist/providers/app.js +50 -0
  24. package/vendor/packages/android-emulator-plugin/dist/providers/avd.d.ts +37 -0
  25. package/vendor/packages/android-emulator-plugin/dist/providers/avd.js +185 -0
  26. package/vendor/packages/android-emulator-plugin/dist/providers/build.d.ts +68 -0
  27. package/vendor/packages/android-emulator-plugin/dist/providers/build.js +131 -0
  28. package/vendor/packages/android-emulator-plugin/dist/providers/config.d.ts +7 -0
  29. package/vendor/packages/android-emulator-plugin/dist/providers/config.js +29 -0
  30. package/vendor/packages/android-emulator-plugin/dist/providers/device.d.ts +20 -0
  31. package/vendor/packages/android-emulator-plugin/dist/providers/device.js +91 -0
  32. package/vendor/packages/android-emulator-plugin/dist/providers/logs.d.ts +15 -0
  33. package/vendor/packages/android-emulator-plugin/dist/providers/logs.js +31 -0
  34. package/vendor/packages/android-emulator-plugin/dist/providers/preflight.d.ts +15 -0
  35. package/vendor/packages/android-emulator-plugin/dist/providers/preflight.js +123 -0
  36. package/vendor/packages/android-emulator-plugin/dist/providers/project-template.d.ts +13 -0
  37. package/vendor/packages/android-emulator-plugin/dist/providers/project-template.js +211 -0
  38. package/vendor/packages/android-emulator-plugin/dist/providers/project.d.ts +33 -0
  39. package/vendor/packages/android-emulator-plugin/dist/providers/project.js +195 -0
  40. package/vendor/packages/android-emulator-plugin/dist/providers/screenshot.d.ts +14 -0
  41. package/vendor/packages/android-emulator-plugin/dist/providers/screenshot.js +73 -0
  42. package/vendor/packages/android-emulator-plugin/dist/providers/sdk.d.ts +14 -0
  43. package/vendor/packages/android-emulator-plugin/dist/providers/sdk.js +185 -0
  44. package/vendor/packages/android-emulator-plugin/dist/providers/ui.d.ts +92 -0
  45. package/vendor/packages/android-emulator-plugin/dist/providers/ui.js +146 -0
  46. package/vendor/packages/android-emulator-plugin/hooks/hooks.json +3 -0
  47. package/vendor/packages/android-emulator-plugin/package.json +35 -0
  48. package/vendor/packages/android-emulator-plugin/skills/android-dev/INSTALL_ENVIRONMENT.md +357 -0
  49. package/vendor/packages/android-emulator-plugin/skills/android-dev/SKILL.md +73 -0
  50. package/vendor/packages/android-emulator-plugin/templates/compose-app/README.md +5 -0
  51. package/vendor/packages/document-skills-plugin/.zcode-plugin/plugin.json +8 -0
  52. package/vendor/packages/document-skills-plugin/package.json +8 -0
  53. package/vendor/packages/document-skills-plugin/skills/docx/LICENSE.txt +13 -0
  54. package/vendor/packages/document-skills-plugin/skills/docx/SKILL.md +201 -0
  55. package/vendor/packages/document-skills-plugin/skills/docx/references/chart-templates.md +386 -0
  56. package/vendor/packages/document-skills-plugin/skills/docx/references/common-rules.md +419 -0
  57. package/vendor/packages/document-skills-plugin/skills/docx/references/decorations.md +537 -0
  58. package/vendor/packages/document-skills-plugin/skills/docx/references/design-system.md +1797 -0
  59. package/vendor/packages/document-skills-plugin/skills/docx/references/docx-js-advanced.md +257 -0
  60. package/vendor/packages/document-skills-plugin/skills/docx/references/docx-js-core.md +332 -0
  61. package/vendor/packages/document-skills-plugin/skills/docx/references/faq.md +323 -0
  62. package/vendor/packages/document-skills-plugin/skills/docx/references/math-formulas.md +276 -0
  63. package/vendor/packages/document-skills-plugin/skills/docx/references/ooxml.md +222 -0
  64. package/vendor/packages/document-skills-plugin/skills/docx/references/toc.md +264 -0
  65. package/vendor/packages/document-skills-plugin/skills/docx/routes/comment.md +88 -0
  66. package/vendor/packages/document-skills-plugin/skills/docx/routes/create.md +207 -0
  67. package/vendor/packages/document-skills-plugin/skills/docx/routes/edit.md +115 -0
  68. package/vendor/packages/document-skills-plugin/skills/docx/routes/format.md +120 -0
  69. package/vendor/packages/document-skills-plugin/skills/docx/routes/read.md +114 -0
  70. package/vendor/packages/document-skills-plugin/skills/docx/scenes/academic.md +783 -0
  71. package/vendor/packages/document-skills-plugin/skills/docx/scenes/contract.md +463 -0
  72. package/vendor/packages/document-skills-plugin/skills/docx/scenes/copywriting.md +139 -0
  73. package/vendor/packages/document-skills-plugin/skills/docx/scenes/exam.md +698 -0
  74. package/vendor/packages/document-skills-plugin/skills/docx/scenes/official-doc.md +411 -0
  75. package/vendor/packages/document-skills-plugin/skills/docx/scenes/report.md +340 -0
  76. package/vendor/packages/document-skills-plugin/skills/docx/scenes/resume.md +534 -0
  77. package/vendor/packages/document-skills-plugin/skills/docx/scripts/__init__.py +1 -0
  78. package/vendor/packages/document-skills-plugin/skills/docx/scripts/add_toc_placeholders.py +749 -0
  79. package/vendor/packages/document-skills-plugin/skills/docx/scripts/document.py +1333 -0
  80. package/vendor/packages/document-skills-plugin/skills/docx/scripts/postcheck.py +807 -0
  81. package/vendor/packages/document-skills-plugin/skills/docx/scripts/templates/comments.xml +3 -0
  82. package/vendor/packages/document-skills-plugin/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  83. package/vendor/packages/document-skills-plugin/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  84. package/vendor/packages/document-skills-plugin/skills/docx/scripts/templates/commentsIds.xml +3 -0
  85. package/vendor/packages/document-skills-plugin/skills/docx/scripts/templates/people.xml +3 -0
  86. package/vendor/packages/document-skills-plugin/skills/docx/scripts/utilities.py +374 -0
  87. package/vendor/packages/document-skills-plugin/skills/docx/setup.sh +177 -0
  88. package/vendor/packages/document-skills-plugin/skills/pdf/LICENSE.txt +13 -0
  89. package/vendor/packages/document-skills-plugin/skills/pdf/SKILL.md +919 -0
  90. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/academic.md +1058 -0
  91. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/creative.md +770 -0
  92. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/poster.md +702 -0
  93. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/process-advanced.md +284 -0
  94. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/process.md +319 -0
  95. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/report.md +1659 -0
  96. package/vendor/packages/document-skills-plugin/skills/pdf/configs/components.md +153 -0
  97. package/vendor/packages/document-skills-plugin/skills/pdf/configs/fonts.md +93 -0
  98. package/vendor/packages/document-skills-plugin/skills/pdf/configs/visual_framework.md +263 -0
  99. package/vendor/packages/document-skills-plugin/skills/pdf/references/resume-academic.tex +130 -0
  100. package/vendor/packages/document-skills-plugin/skills/pdf/references/resume-altacv.tex +190 -0
  101. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/cover_validate.js +367 -0
  102. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/design_engine.py +2816 -0
  103. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/html2pdf-next.js +754 -0
  104. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/html2poster.js +256 -0
  105. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/pdf.py +2959 -0
  106. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/pdf_qa.py +901 -0
  107. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/poster_validate.py +1337 -0
  108. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/setup.sh +269 -0
  109. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/toc_validate.py +2075 -0
  110. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/charts.md +320 -0
  111. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/cover-backgrounds.md +384 -0
  112. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/cover.md +1442 -0
  113. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/fill-engine.md +527 -0
  114. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/geometry.md +142 -0
  115. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/overflow.md +630 -0
  116. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/pagination.md +367 -0
  117. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/palette.md +217 -0
  118. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/typography.md +20 -0
  119. package/vendor/packages/ios-simulator-plugin/.mcp.json +15 -0
  120. package/vendor/packages/ios-simulator-plugin/.zcode-plugin/plugin.json +34 -0
  121. package/vendor/packages/ios-simulator-plugin/README.md +111 -0
  122. package/vendor/packages/ios-simulator-plugin/commands/ios-dev.md +11 -0
  123. package/vendor/packages/ios-simulator-plugin/dist/lib/path.d.ts +4 -0
  124. package/vendor/packages/ios-simulator-plugin/dist/lib/path.js +18 -0
  125. package/vendor/packages/ios-simulator-plugin/dist/lib/result.d.ts +5 -0
  126. package/vendor/packages/ios-simulator-plugin/dist/lib/result.js +20 -0
  127. package/vendor/packages/ios-simulator-plugin/dist/lib/run.d.ts +17 -0
  128. package/vendor/packages/ios-simulator-plugin/dist/lib/run.js +83 -0
  129. package/vendor/packages/ios-simulator-plugin/dist/mcp/server.d.ts +3 -0
  130. package/vendor/packages/ios-simulator-plugin/dist/mcp/server.js +46833 -0
  131. package/vendor/packages/ios-simulator-plugin/dist/providers/build.d.ts +112 -0
  132. package/vendor/packages/ios-simulator-plugin/dist/providers/build.js +99 -0
  133. package/vendor/packages/ios-simulator-plugin/dist/providers/logs.d.ts +21 -0
  134. package/vendor/packages/ios-simulator-plugin/dist/providers/logs.js +26 -0
  135. package/vendor/packages/ios-simulator-plugin/dist/providers/preflight.d.ts +12 -0
  136. package/vendor/packages/ios-simulator-plugin/dist/providers/preflight.js +62 -0
  137. package/vendor/packages/ios-simulator-plugin/dist/providers/project.d.ts +35 -0
  138. package/vendor/packages/ios-simulator-plugin/dist/providers/project.js +288 -0
  139. package/vendor/packages/ios-simulator-plugin/dist/providers/screenshot.d.ts +22 -0
  140. package/vendor/packages/ios-simulator-plugin/dist/providers/screenshot.js +30 -0
  141. package/vendor/packages/ios-simulator-plugin/dist/providers/sim.d.ts +60 -0
  142. package/vendor/packages/ios-simulator-plugin/dist/providers/sim.js +116 -0
  143. package/vendor/packages/ios-simulator-plugin/dist/providers/ui.d.ts +57 -0
  144. package/vendor/packages/ios-simulator-plugin/dist/providers/ui.js +67 -0
  145. package/vendor/packages/ios-simulator-plugin/hooks/hooks.json +3 -0
  146. package/vendor/packages/ios-simulator-plugin/package.json +35 -0
  147. package/vendor/packages/ios-simulator-plugin/skills/ios-dev/SKILL.md +45 -0
  148. package/vendor/packages/ios-simulator-plugin/templates/swiftui-app/README.md +5 -0
  149. package/vendor/packages/restore-legacy-sessions-plugin/.zcode-plugin/plugin.json +9 -0
  150. package/vendor/packages/restore-legacy-sessions-plugin/README.md +35 -0
  151. package/vendor/packages/restore-legacy-sessions-plugin/commands/restore-legacy-sessions.md +11 -0
  152. package/vendor/packages/restore-legacy-sessions-plugin/package.json +8 -0
  153. package/vendor/packages/restore-legacy-sessions-plugin/skills/restore-legacy-sessions/SKILL.md +92 -0
  154. package/vendor/packages/restore-legacy-sessions-plugin/skills/restore-legacy-sessions/scripts/restore-conversation.mjs +648 -0
  155. package/vendor/packages/restore-legacy-sessions-plugin/skills/restore-legacy-sessions/scripts/scan-legacy-sessions.mjs +422 -0
  156. package/vendor/packages/skill-creator-plugin/.zcode-plugin/plugin.json +8 -0
  157. package/vendor/packages/skill-creator-plugin/package.json +8 -0
  158. package/vendor/packages/skill-creator-plugin/skills/skill-creator/SKILL.md +159 -0
  159. package/vendor/packages/zcode-guide-plugin/.zcode-plugin/plugin.json +8 -0
  160. package/vendor/packages/zcode-guide-plugin/README.md +22 -0
  161. package/vendor/packages/zcode-guide-plugin/package.json +8 -0
  162. package/vendor/packages/zcode-guide-plugin/skills/diagnosing-commands/SKILL.md +66 -0
  163. package/vendor/packages/zcode-guide-plugin/skills/diagnosing-hooks/SKILL.md +66 -0
  164. package/vendor/packages/zcode-guide-plugin/skills/diagnosing-mcp/SKILL.md +97 -0
  165. package/vendor/packages/zcode-guide-plugin/skills/diagnosing-plugins/SKILL.md +59 -0
  166. package/vendor/packages/zcode-guide-plugin/skills/diagnosing-skills/SKILL.md +61 -0
  167. package/vendor/packages/zcode-guide-plugin/skills/zcode-configuration-guide/SKILL.md +99 -0
  168. package/vendor/zcode.cjs +2926 -0
  169. package/zcode-runtime.lock.json +8 -0
@@ -0,0 +1,783 @@
1
+ # Scene: Academic / Thesis
2
+
3
+ ## Palette
4
+
5
+ **Academic Dark** (Cool + Heavy + Calm) — Academic papers use **pure black body text**. Palette only for cover decoration and minimal title scenarios.
6
+
7
+ ```js
8
+ const palette = {
9
+ primary: "#000000", // Title — pure black
10
+ body: "#000000", // Body — pure black
11
+ secondary: "#333333", // Header/caption — dark grey
12
+ accent: "#8B7E5A", // Cover decoration line — cover only
13
+ surface: "#F5F7FA", // Table header light bg — three-line tables only
14
+ };
15
+ ```
16
+
17
+ ⚠️ **Body text color must be pure black `"000000"`**. No decorative dark-blue-grey. Academic papers require print-friendly, black-and-white clarity.
18
+
19
+ → Placeholder convention & universal prohibitions — see `references/common-rules.md`
20
+ → **Note:** This scene uses Profile A fonts with academic-specific overrides below.
21
+
22
+ ---
23
+
24
+ ## Page Layout
25
+
26
+ | Property | Value | Twips |
27
+ |----------|-------|-------|
28
+ | Top margin | 2.54 cm | 1440 |
29
+ | Bottom margin | 2.54 cm | 1440 |
30
+ | Left margin | 3.00 cm | 1701 |
31
+ | Right margin | 2.50 cm | 1417 |
32
+ | Header distance | 1.5 cm | 850 |
33
+ | Footer distance | 1.75 cm | 992 |
34
+
35
+ ```js
36
+ page: {
37
+ size: { width: 11906, height: 16838 },
38
+ margin: { top: 1440, bottom: 1440, left: 1701, right: 1417, header: 850, footer: 992 },
39
+ }
40
+ ```
41
+
42
+ For binding margin, add 0.5–1.0 cm to left (i.e., left: 1985–2268).
43
+
44
+ ---
45
+
46
+ ## Font Specifications
47
+
48
+ | Element | CN Font | EN Font | Size | half-pt | Style |
49
+ |---------|---------|---------|------|---------|-------|
50
+ | Thesis title | SimHei | Times New Roman | Xiao Er 18pt | 36 | Bold, centered |
51
+ | H1 | SimHei | Times New Roman | San Hao 16pt | 32 | Bold, centered |
52
+ | H2 | SimHei | Times New Roman | Xiao San 15pt | 30 | Bold, left |
53
+ | H3 | SimHei | Times New Roman | Si Hao 14pt | 28 | Bold, left |
54
+ | Body | SimSun | Times New Roman | Xiao Si 12pt | 24 | Normal, justified |
55
+ | Abstract title | SimHei | Times New Roman Bold | San Hao 16pt | 32 | Bold, centered |
56
+ | Abstract body | SimSun | Times New Roman | Xiao Si 12pt | 24 | Normal, justified |
57
+ | Keywords label | SimHei | Times New Roman Bold | Xiao Si 12pt | 24 | Bold |
58
+ | Keywords content | SimSun | Times New Roman | Xiao Si 12pt | 24 | Normal |
59
+ | Header | SimSun | Times New Roman | Xiao Wu 9pt | 18 | Centered, color 333333 |
60
+ | Page number | — | Times New Roman | Xiao Wu 10.5pt | 21 | Centered |
61
+ | Footnote | SimSun | Times New Roman | Xiao Wu 9pt | 18 | Normal |
62
+ | Figure/table caption | SimSun | Times New Roman | Wu Hao 10.5pt | 21 | Centered |
63
+
64
+ ### Paragraph Format
65
+ - Body: justified, first-line indent 2 chars (`firstLine: 480`, SimSun Xiao Si = 480 twips)
66
+ - Line spacing: 1.5x (`line: 360`); if school requires fixed 22pt, use `line: 440, lineRule: "exact"`
67
+ - Body paragraph spacing: before/after 0pt; heading spacing per styles below
68
+
69
+ ```js
70
+ styles: {
71
+ default: {
72
+ document: {
73
+ run: { font: { ascii: "Times New Roman", eastAsia: "SimSun" }, size: 24, color: "000000" },
74
+ paragraph: { spacing: { line: 360 } },
75
+ },
76
+ heading1: {
77
+ run: { font: { ascii: "Times New Roman", eastAsia: "SimHei" }, size: 32, bold: true, color: "000000" },
78
+ paragraph: { alignment: AlignmentType.CENTER, spacing: { before: 480, after: 360, line: 360 } },
79
+ },
80
+ heading2: {
81
+ run: { font: { ascii: "Times New Roman", eastAsia: "SimHei" }, size: 30, bold: true, color: "000000" },
82
+ paragraph: { spacing: { before: 360, after: 240, line: 360 } },
83
+ },
84
+ heading3: {
85
+ run: { font: { ascii: "Times New Roman", eastAsia: "SimHei" }, size: 28, bold: true, color: "000000" },
86
+ paragraph: { spacing: { before: 240, after: 120, line: 360 } },
87
+ },
88
+ },
89
+ }
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Heading Numbering System (Mandatory)
95
+
96
+ ### Format
97
+
98
+ | Level | Format | Example |
99
+ |-------|--------|---------|
100
+ | H1 | Chapter X + title | 第一章 绪论 (Chapter 1 Introduction) |
101
+ | H2 | X.X + section title | 1.1 Research Background |
102
+ | H3 | X.X.X + subsection | 1.1.1 Domestic Research Status |
103
+
104
+ ### Mandatory Rules
105
+ 1. **H1 must use "第X章" format** — not "一、", not "Chapter 1", not "第1章"
106
+ 2. **H2/H3 use Arabic decimal numbering** (1.1, 1.1.1) — no "(一)", "1)"
107
+ 3. **No mixing multiple numbering systems**
108
+ 4. **No level-skipping** (cannot jump from H1 to H3)
109
+ 5. **All body headings must use `heading: HeadingLevel.HEADING_X`** (TOC depends on this)
110
+
111
+ ```js
112
+ // ✅ Correct
113
+ new Paragraph({
114
+ heading: HeadingLevel.HEADING_1,
115
+ children: [new TextRun({ text: "第一章 绪论", bold: true, size: 32, font: { eastAsia: "SimHei", ascii: "Times New Roman" } })]
116
+ })
117
+ new Paragraph({
118
+ heading: HeadingLevel.HEADING_2,
119
+ children: [new TextRun({ text: "1.1 研究背景", bold: true, size: 30, font: { eastAsia: "SimHei", ascii: "Times New Roman" } })]
120
+ })
121
+ ```
122
+
123
+ ### Non-Body Headings
124
+ Abstract, Table of Contents, References, Appendices, Acknowledgments:
125
+ - Use H1 style (San Hao SimHei centered) for TOC indexing
126
+ - But **no numbering** (write directly: "摘 要", "参考文献", etc. — these are non-numbered standalone section headings)
127
+
128
+ ---
129
+
130
+ ## Document Structure & Multi-Section Architecture
131
+
132
+ Theses must use **multi-section structure** for independent page numbering and header/footer per section.
133
+
134
+ ### Complete Structure
135
+
136
+ ```
137
+ Section 1: Cover → No page number, no header/footer
138
+ Section 2: Chinese Abstract → Roman numerals starting from i
139
+ Section 3: English Abstract → Roman numerals continued
140
+ Section 4: Table of Contents → Roman numerals continued
141
+ Section 5: Body (all chapters) → Arabic numerals from 1
142
+ Section 6: References → Arabic numerals continued
143
+ Section 7: Appendices (if any) → Arabic numerals continued
144
+ Section 8: Acknowledgments (if any) → Arabic numerals continued
145
+ ```
146
+
147
+ ### Page Number Implementation
148
+
149
+ ```js
150
+ const { NumberFormat } = require("docx");
151
+
152
+ // Section 1: Cover — no page number
153
+ {
154
+ properties: {
155
+ page: { margin: { top: 0, bottom: 0, left: 0, right: 0 } },
156
+ titlePage: true,
157
+ },
158
+ children: buildCover(...),
159
+ }
160
+
161
+ // Section 2: Abstract — Roman numerals from i
162
+ {
163
+ properties: {
164
+ type: SectionType.NEXT_PAGE,
165
+ page: {
166
+ margin: { top: 1440, bottom: 1440, left: 1701, right: 1417, header: 850, footer: 992 },
167
+ pageNumbers: { start: 1, formatType: NumberFormat.UPPER_ROMAN },
168
+ },
169
+ },
170
+ headers: { default: buildHeader("Thesis Title") },
171
+ footers: { default: buildPageNumberFooter() },
172
+ children: buildAbstractCN(...),
173
+ }
174
+
175
+ // Section 3: English Abstract — Roman numerals continued (no reset)
176
+ {
177
+ properties: {
178
+ type: SectionType.NEXT_PAGE,
179
+ page: {
180
+ margin: { top: 1440, bottom: 1440, left: 1701, right: 1417, header: 850, footer: 992 },
181
+ pageNumbers: { formatType: NumberFormat.UPPER_ROMAN }, // no start → continues from previous
182
+ },
183
+ },
184
+ headers: { default: buildHeader("Thesis Title") },
185
+ footers: { default: buildPageNumberFooter() },
186
+ children: buildAbstractEN(...),
187
+ }
188
+
189
+ // Section 5: Body — Arabic numerals from 1
190
+ {
191
+ properties: {
192
+ type: SectionType.NEXT_PAGE,
193
+ page: {
194
+ margin: { top: 1440, bottom: 1440, left: 1701, right: 1417, header: 850, footer: 992 },
195
+ pageNumbers: { start: 1, formatType: NumberFormat.DECIMAL },
196
+ },
197
+ },
198
+ headers: { default: buildHeader("Thesis Title") },
199
+ footers: { default: buildPageNumberFooter() },
200
+ children: buildMainContent(...),
201
+ }
202
+ // Section 6+: References/Appendices/Acknowledgments — Arabic continued
203
+ ```
204
+
205
+ ### Header & Footer Helpers
206
+
207
+ ```js
208
+ function buildHeader(title) {
209
+ return new Header({ children: [
210
+ new Paragraph({ alignment: AlignmentType.CENTER,
211
+ border: { bottom: { style: BorderStyle.SINGLE, size: 1, color: "000000" } },
212
+ children: [new TextRun({ text: title, size: 18, color: "333333",
213
+ font: { ascii: "Times New Roman", eastAsia: "SimSun" } })],
214
+ }),
215
+ ] });
216
+ }
217
+
218
+ function buildPageNumberFooter() {
219
+ return new Footer({ children: [
220
+ new Paragraph({ alignment: AlignmentType.CENTER,
221
+ children: [
222
+ new TextRun({ text: "- ", size: 21 }),
223
+ new TextRun({ children: [PageNumber.CURRENT], size: 21 }),
224
+ new TextRun({ text: " -", size: 21 }),
225
+ ],
226
+ }),
227
+ ] });
228
+ }
229
+ ```
230
+
231
+ ### Page Break Rules
232
+ - Cover is a separate section (no PageBreak needed)
233
+ - Chinese abstract, English abstract, TOC each in their own section
234
+ - All body chapters in **one section** (no forced page breaks between chapters unless user requests)
235
+ - References, appendices, acknowledgments each in their own section
236
+ - **Never use blank lines instead of section breaks**
237
+
238
+ ---
239
+
240
+ ## Cover
241
+
242
+ ### Information Fields
243
+
244
+ Cover must include (use placeholders for missing info):
245
+
246
+ | Field | Format | Placeholder |
247
+ |-------|--------|-------------|
248
+ | University name | Er Hao SimHei, centered | ×××University |
249
+ | Thesis title (CN) | Xiao Er SimHei, centered | (user-provided) |
250
+ | Thesis title (EN) | San Hao Times New Roman, centered | (translated from CN) |
251
+ | College | Si Hao SimSun | ×××College |
252
+ | Major | Si Hao SimSun | ×××Major |
253
+ | Author | Si Hao SimSun | ××× |
254
+ | Student ID | Si Hao SimSun | ××××××× |
255
+ | Advisor | Si Hao SimSun | ×××Professor |
256
+ | Date | Si Hao SimSun | 2026/XX |
257
+
258
+ ### Cover Style
259
+
260
+ Use Recipe R5 (Clean White) or academic-specific `buildAcademicCover()` — never use commercial-style covers.
261
+
262
+ ### Cover Layout Order (Mandatory)
263
+
264
+ The visual order on academic covers must follow this hierarchy from top to bottom:
265
+
266
+ 1. School name (top)
267
+ 2. Document type label (e.g., "Undergraduate Thesis", "Thesis Proposal Report")
268
+ 3. **Thesis title** (prominent, centered)
269
+ 4. Thesis English title (if bilingual)
270
+ 5. **Author information table** (college, major, author, student ID, advisor)
271
+ 6. Date (bottom)
272
+
273
+ ⚠️ **Title MUST appear ABOVE the author info table.** The screenshot issue of info table appearing above the title is caused by incorrect element ordering. The `buildAcademicCover()` and `buildProposalCover()` functions below enforce correct order.
274
+
275
+ ⚠️ **Layout must be vertically balanced** — use dynamic spacing to distribute whitespace evenly. Do not cram all elements into the top half or let large gaps appear between elements.
276
+
277
+ ```js
278
+ function buildAcademicCover(info) {
279
+ const { school, title, titleEN, college, major, author, studentId, advisor, date } = info;
280
+
281
+ // ⚠️ Use safeText() for all values — never output "undefined"
282
+ const infoRows = [
283
+ ["College", safeText(college, "【College】")],
284
+ ["Major", safeText(major, "【Major】")],
285
+ ["Author", safeText(author, "【Author】")],
286
+ ["Student ID", safeText(studentId, "【Student ID】")],
287
+ ["Advisor", safeText(advisor, "【Advisor】")],
288
+ ];
289
+
290
+ const infoTable = new Table({
291
+ width: { size: 60, type: WidthType.PERCENTAGE },
292
+ alignment: AlignmentType.CENTER,
293
+ borders: { top: NB, bottom: NB, left: NB, right: NB, insideHorizontal: NB, insideVertical: NB },
294
+ rows: infoRows.map(([label, value]) => new TableRow({
295
+ cantSplit: true,
296
+ children: [
297
+ new TableCell({
298
+ width: { size: 35, type: WidthType.PERCENTAGE },
299
+ borders: { bottom: { style: BorderStyle.SINGLE, size: 1, color: "000000" }, top: NB, left: NB, right: NB },
300
+ margins: { top: 60, bottom: 60, left: 120, right: 120 },
301
+ children: [new Paragraph({
302
+ alignment: AlignmentType.RIGHT,
303
+ children: [new TextRun({ text: label + ":", size: 28, font: { eastAsia: "SimHei", ascii: "Times New Roman" } })],
304
+ })],
305
+ }),
306
+ new TableCell({
307
+ borders: { bottom: { style: BorderStyle.SINGLE, size: 1, color: "000000" }, top: NB, left: NB, right: NB },
308
+ margins: { top: 60, bottom: 60, left: 120, right: 120 },
309
+ children: [new Paragraph({
310
+ alignment: AlignmentType.CENTER,
311
+ children: [new TextRun({ text: value, size: 28, font: { eastAsia: "SimSun", ascii: "Times New Roman" } })],
312
+ })],
313
+ }),
314
+ ],
315
+ })),
316
+ });
317
+
318
+ // ⚠️ Correct order: school → doc type → TITLE → info table → date
319
+ // ★ Rule 8: All large-font paragraphs must set explicit line spacing
320
+ return [
321
+ new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 1200, after: 400, line: Math.ceil(22 * 23), lineRule: "atLeast" },
322
+ children: [new TextRun({ text: safeText(school, "【University Name】"), size: 44, bold: true, font: { eastAsia: "SimHei" } })] }),
323
+ new Paragraph({ alignment: AlignmentType.CENTER, spacing: { after: 800, line: Math.ceil(18 * 23), lineRule: "atLeast" },
324
+ children: [new TextRun({ text: "Undergraduate Thesis", size: 36, font: { eastAsia: "SimHei" } })] }),
325
+ new Paragraph({ alignment: AlignmentType.CENTER, spacing: { after: 200, line: Math.ceil(18 * 23), lineRule: "atLeast" },
326
+ children: [new TextRun({ text: safeText(title, "【Thesis Title】"), size: 36, bold: true, font: { eastAsia: "SimHei", ascii: "Times New Roman" } })] }),
327
+ titleEN ? new Paragraph({ alignment: AlignmentType.CENTER, spacing: { after: 1200, line: Math.ceil(16 * 23), lineRule: "atLeast" },
328
+ children: [new TextRun({ text: titleEN, size: 32, font: { ascii: "Times New Roman" } })] })
329
+ : new Paragraph({ spacing: { after: 1200 }, children: [] }),
330
+ infoTable,
331
+ new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 1200, line: Math.ceil(14 * 23), lineRule: "atLeast" },
332
+ children: [new TextRun({ text: safeText(date, "2026/XX"), size: 28, font: { eastAsia: "SimSun" } })] }),
333
+ ];
334
+ }
335
+ ```
336
+
337
+ ### Thesis Proposal Report Cover (开题报告)
338
+
339
+ Thesis proposal reports use a similar cover layout but with different document type label. The key layout rule is the same: **title above author info, evenly spaced**.
340
+
341
+ ⚠️ **CRITICAL — Proposal cover MUST be an independent section:**
342
+ The proposal cover MUST be placed in its **own section** (with margin: 0 and a 16838 wrapper table), completely separate from the body content. The body content starts in the **next section** (with `SectionType.NEXT_PAGE` or as a separate section entry). **Never place the cover elements and body content in the same section** — this causes them to render on the same page without any page break, which is the #1 proposal report formatting failure.
343
+
344
+ ```js
345
+ // ✅ Correct — cover and body in separate sections
346
+ sections: [
347
+ {
348
+ properties: { page: { margin: { top: 0, bottom: 0, left: 0, right: 0 } } },
349
+ children: buildProposalCover(info), // standalone cover section
350
+ },
351
+ {
352
+ properties: { page: { margin: { top: 1440, bottom: 1440, left: 1701, right: 1417 } } },
353
+ children: [...bodyContent], // body starts here
354
+ },
355
+ ]
356
+
357
+ // ❌ WRONG — cover and body in same section (no page separation!)
358
+ sections: [
359
+ {
360
+ children: [...coverElements, ...bodyContent], // everything on one continuous flow
361
+ },
362
+ ]
363
+ ```
364
+
365
+ ```js
366
+ function buildProposalCover(info) {
367
+ const { school, year, title, subtitle, college, major, author, studentId, advisor, date } = info;
368
+
369
+ // ⚠️ Use safeText() for all values
370
+ const infoRows = [
371
+ ["姓名 (Name)", safeText(author, "XXX")],
372
+ ["专业 (Major)", safeText(major, "XXX")],
373
+ ["入学时间 (Enrollment)", safeText(info.enrollment, "XXX")],
374
+ ];
375
+
376
+ const infoTable = new Table({
377
+ width: { size: 60, type: WidthType.PERCENTAGE },
378
+ alignment: AlignmentType.CENTER,
379
+ borders: { top: NB, bottom: NB, left: NB, right: NB, insideHorizontal: NB, insideVertical: NB },
380
+ rows: infoRows.map(([label, value]) => new TableRow({
381
+ children: [
382
+ new TableCell({
383
+ width: { size: 35, type: WidthType.PERCENTAGE },
384
+ borders: { bottom: { style: BorderStyle.SINGLE, size: 1, color: "000000" }, top: NB, left: NB, right: NB },
385
+ margins: { top: 60, bottom: 60, left: 120, right: 120 },
386
+ children: [new Paragraph({
387
+ alignment: AlignmentType.CENTER,
388
+ children: [new TextRun({ text: label, size: 28, bold: true, font: { eastAsia: "SimHei", ascii: "Times New Roman" } })],
389
+ })],
390
+ }),
391
+ new TableCell({
392
+ borders: { bottom: { style: BorderStyle.SINGLE, size: 1, color: "000000" }, top: NB, left: NB, right: NB },
393
+ margins: { top: 60, bottom: 60, left: 120, right: 120 },
394
+ children: [new Paragraph({
395
+ alignment: AlignmentType.CENTER,
396
+ children: [new TextRun({ text: value, size: 28, font: { eastAsia: "SimSun", ascii: "Times New Roman" } })],
397
+ })],
398
+ }),
399
+ ],
400
+ })),
401
+ });
402
+
403
+ // ⚠️ Correct order: doc type label → info table → "论文题目" label → TITLE → subtitle
404
+ // Layout balanced: upper 40% for header + info, middle 20% for title, lower 40% for whitespace
405
+ // ★ Rule 8: All large-font paragraphs must set explicit line spacing
406
+ return [
407
+ new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 1500, after: 600, line: Math.ceil(18 * 23), lineRule: "atLeast" },
408
+ children: [new TextRun({ text: safeText(year, "2025") + " 届本科毕业论文开题报告",
409
+ size: 36, bold: true, font: { eastAsia: "SimHei", ascii: "Times New Roman" } })] }),
410
+ infoTable,
411
+ new Paragraph({ spacing: { before: 1200 } }), // Balanced whitespace
412
+ new Paragraph({ alignment: AlignmentType.CENTER, spacing: { after: 200 },
413
+ children: [new TextRun({ text: "论文题目", size: 28, font: { eastAsia: "SimSun", ascii: "Times New Roman" } })] }),
414
+ new Paragraph({ alignment: AlignmentType.CENTER, spacing: { after: 200, line: Math.ceil(16 * 23), lineRule: "atLeast" },
415
+ children: [new TextRun({ text: safeText(title, "【Thesis Title】"), size: 32, bold: true,
416
+ font: { eastAsia: "SimHei", ascii: "Times New Roman" } })] }),
417
+ subtitle ? new Paragraph({ alignment: AlignmentType.CENTER, spacing: { after: 800 },
418
+ children: [new TextRun({ text: "——" + subtitle, size: 28,
419
+ font: { eastAsia: "SimSun", ascii: "Times New Roman" } })] })
420
+ : new Paragraph({ spacing: { after: 800 }, children: [] }),
421
+ ];
422
+ }
423
+ ```
424
+
425
+ ### ⚠️ WPS Compatibility Notes for Academic Covers
426
+
427
+ Both thesis cover and proposal cover use info tables. These MUST follow the cross-engine rules:
428
+ - Table uses **percentage widths** (`WidthType.PERCENTAGE`), NOT DXA — WPS renders DXA widths differently in nested contexts
429
+ - Table width: adaptive 55–75%, centered via `alignment: CENTER` (calculated by `calcR5MetaLayout()`)
430
+ - Label column: **LEFT aligned**, plain text + ":", NO full-width space padding, NO borders
431
+ - Value column: **LEFT aligned**, `bottom: single sz=4` border = fixed-length underline
432
+ - Cell `margins.top/bottom: 60` is acceptable (small values) but avoid larger values
433
+ - All paragraphs with font size > 12pt (body) must set `spacing: { line: Math.ceil(fontPt * 23), lineRule: "atLeast" }` to prevent top clipping (Rule 8)
434
+ - ⚠️ Do NOT use DXA widths, full-width space padding (`\u3000`), tab stops, or right-alignment for meta info
435
+
436
+ ⚠️ **Proposal cover must fit on one page.** Use the same height-budget approach as commercial covers — total content height must stay within 15638 twips (1200 twips safety margin). If the title is very long, reduce font size (minimum 24pt).
437
+ ```
438
+
439
+ ---
440
+
441
+ ## Section Content Standards
442
+
443
+ ### Chinese Abstract
444
+ **Format:**
445
+ - Title: "摘 要" (space in middle), San Hao SimHei centered, H1 style
446
+ - Body: Xiao Si SimSun, justified, first-line indent 480 twips
447
+ - Keywords: "关键词:" SimHei bold + content SimSun normal, 3–8 keywords, semicolon-separated
448
+
449
+ **Content structure (mandatory):**
450
+ 1. Research background (1–2 sentences)
451
+ 2. Research problem/purpose (1 sentence)
452
+ 3. Research method (1–2 sentences)
453
+ 4. Main results/findings (2–3 sentences)
454
+ 5. Research significance/value (1 sentence)
455
+
456
+ ⚠️ **Abstract is NOT a TOC summary.** Must not read as "Chapter 1 introduces... Chapter 2 analyzes..."
457
+
458
+ ### English Abstract
459
+ - Title: "Abstract", San Hao Times New Roman Bold, centered, H1 style
460
+ - Body: Xiao Si Times New Roman, justified
461
+ - Keywords: bold label + normal content, 3–8 keywords, comma-separated
462
+ - **Must be consistent with Chinese abstract** — no significant shrinkage
463
+ - Use formal academic English, avoid Chinglish
464
+
465
+ ### Table of Contents
466
+ - Title: "目 录", San Hao SimHei centered
467
+ - Use `TableOfContents` field for auto-generation, display at least H1–H2, recommend H3
468
+ - Run `"$DOCX_SCRIPTS/add_toc_placeholders.py" --auto` after generation
469
+ - TOC on its own page
470
+
471
+ ---
472
+
473
+ ## Body Chapter Structure
474
+
475
+ ### Standard Structure (6-chapter)
476
+
477
+ ```
478
+ Chapter 1: Introduction
479
+ 1.1 Research Background
480
+ 1.2 Research Purpose & Significance
481
+ 1.3 Literature Review (Domestic & International)
482
+ 1.4 Research Content & Methods
483
+ 1.5 Thesis Structure
484
+
485
+ Chapter 2: Theoretical Framework & Literature Review
486
+ 2.1 Core Concept Definitions
487
+ 2.2 Theoretical Basis
488
+ 2.3 Literature Review
489
+ 2.4 Research Gap & Entry Point
490
+
491
+ Chapter 3: Research Design / Method / Model
492
+ 3.1 Research Framework
493
+ 3.2 Method Design / System Architecture / Algorithm
494
+ 3.3 Variables / Data Sources / Experimental Environment
495
+
496
+ Chapter 4: Empirical Analysis / Case Study / Results
497
+ 4.1 Data Analysis / Case Description / Experiment Process
498
+ 4.2 Results Presentation
499
+ 4.3 Results Interpretation
500
+
501
+ Chapter 5: Discussion
502
+ 5.1 Key Findings
503
+ 5.2 Comparison with Existing Research
504
+ 5.3 Limitations
505
+
506
+ Chapter 6: Conclusions & Outlook
507
+ 6.1 Research Conclusions
508
+ 6.2 Contributions
509
+ 6.3 Limitations
510
+ 6.4 Future Research Directions
511
+ ```
512
+
513
+ ### Chapter Content Requirements
514
+
515
+ **Chapter 1 (Introduction):** Must state background, purpose, significance, methods, content, structure.
516
+
517
+ **Chapter 2 (Literature Review):** Must be systematically organized by theme/method/stage — **never a chronological dump of papers**. Must identify contributions, gaps, and research opportunities.
518
+
519
+ **Chapter 3 (Method):** Must explain why this method was chosen and its rationale. Content must be understandable, executable, reproducible.
520
+
521
+ **Chapter 4 (Results):** Must be specific, not vague. Must be consistent with Chapter 3 design.
522
+
523
+ **Chapter 5 (Discussion):** Must not merely repeat Chapter 4 results. Must explain what results mean and what conclusions they support.
524
+
525
+ **Chapter 6 (Conclusions):** Must summarize concisely, state contributions, acknowledge limitations, propose future directions. Must end formally — no abrupt ending.
526
+
527
+ ---
528
+
529
+ ## Discipline-Adaptive Routing
530
+
531
+ Auto-adjust research methods and chapter emphasis by discipline. **When user doesn't specify method, choose the most appropriate research paradigm for the discipline — never mechanically apply "empirical + survey + regression" template.**
532
+
533
+ ### 1. Humanities & Social Sciences (Literature, History, Philosophy, Arts)
534
+ **Preferred methods:** Literature analysis, theoretical research, text analysis, comparative studies, historical research
535
+ **Adjustments:** Ch.2 focuses on theoretical lineage; Ch.4 becomes text analysis/case argumentation; minimize "variables", "hypotheses", "regression" terminology
536
+
537
+ ### 2. Management / Economics / Public Administration
538
+ **Preferred methods:** Case analysis, surveys, model analysis, institutional research, empirical research
539
+ **Adjustments:** Ch.3 focuses on hypotheses, variables, framework; Ch.4 on data collection & analysis; Ch.5 adds management implications/policy recommendations
540
+
541
+ ### 3. Computer Science / Engineering / IT
542
+ **Preferred methods:** Method design, system architecture, experimental comparison, performance evaluation, algorithm analysis
543
+ **Adjustments:** Ch.3 becomes system/algorithm design; Ch.4 becomes experiments (environment, parameters, control experiments, metric comparison); minimize "interviews", "surveys"
544
+
545
+ ### 4. Education / Linguistics / Communication
546
+ **Preferred methods:** Teaching experiments, text analysis, survey research, interview research, case studies
547
+ **Adjustments:** Ch.3 focuses on subjects, dimensions, samples; Ch.4 on teaching practice/communication case analysis; Ch.5 adds educational implications/communication strategies
548
+
549
+ ### 5. Law / Marxism / Policy Studies
550
+ **Preferred methods:** Normative analysis, statutory interpretation, case studies, institutional comparison, theoretical analysis
551
+ **Adjustments:** Ch.2 focuses on legal/policy framework; Ch.4 becomes case analysis/institutional comparison; Ch.5 focuses on normative evaluation, reform recommendations
552
+
553
+ ---
554
+
555
+ ## Figure/Table/Formula Numbering (By Chapter)
556
+
557
+ ### Numbering Rules
558
+
559
+ | Type | Format | Example |
560
+ |------|--------|---------|
561
+ | Figure | Figure X-Y | Figure 3-1, Figure 4-2 |
562
+ | Table | Table X-Y | Table 2-1, Table 4-3 |
563
+ | Formula | Eq. (X-Y) | Eq. (3-1), Eq. (5-2) |
564
+
565
+ Where X = chapter number, Y = sequential number within chapter.
566
+
567
+ ### Figures
568
+ - Caption **below** figure, Wu Hao SimSun, centered
569
+ - Format: "Figure X-Y Description"
570
+ - Must be referenced in text: "as shown in Figure 3-1"
571
+
572
+ ```js
573
+ new Paragraph({ alignment: AlignmentType.CENTER,
574
+ children: [new ImageRun({ data: imgBuf, transformation: { width: w, height: h }, type: "png" })] }),
575
+ new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 60, after: 200 },
576
+ children: [new TextRun({ text: "图3-1 System Architecture", size: 21,
577
+ font: { eastAsia: "SimSun", ascii: "Times New Roman" } })] }),
578
+ ```
579
+
580
+ ### Tables
581
+ - Caption **above** table, Wu Hao SimSun, centered, `keepNext: true`
582
+ - Format: "Table X-Y Description"
583
+ - Must use three-line table (mandatory for academic papers)
584
+ - Must be referenced in text: "as shown in Table 2-1"
585
+
586
+ ### Formulas
587
+ - Formula centered, number **right-aligned**
588
+ - Use Tab for center + right alignment
589
+ - Text reference: "from Eq. (3-1)"
590
+
591
+ ```js
592
+ new Paragraph({
593
+ alignment: AlignmentType.CENTER,
594
+ tabStops: [
595
+ { type: TabStopType.CENTER, position: 4500 },
596
+ { type: TabStopType.RIGHT, position: 9000 },
597
+ ],
598
+ children: [
599
+ new TextRun({ text: "\t" }),
600
+ new TextRun({ text: "E = mc²" }),
601
+ new TextRun({ text: "\t(3-1)" }),
602
+ ],
603
+ }),
604
+ ```
605
+
606
+ ### Mandatory Rules
607
+ 1. Figures/tables/formulas **must be referenced in text** — never placed without explanation
608
+ 2. Must have introductory and analytical text before/after
609
+ 3. Must not exceed page margins
610
+ 4. Insert only when analytically valuable — not for decoration
611
+
612
+ ---
613
+
614
+ ## Citation & Reference System
615
+
616
+ ### In-Text Citation (Sequential Numbering)
617
+
618
+ Default: **GB/T 7714 sequential numbering** — `[1]`, `[2]` in text, references listed in order of appearance.
619
+
620
+ ```js
621
+ new TextRun({ text: "[1]", superScript: true, size: 18, font: { ascii: "Times New Roman" } })
622
+ ```
623
+
624
+ ### Citation Rules
625
+ 1. In-text numbers must **correspond one-to-one** with reference list
626
+ 2. **Same source reused keeps the same number**
627
+ 3. **Do not mix footnote citations and endnote references** (unless user explicitly requests)
628
+ 4. Footnotes are for supplementary notes only, not primary citations
629
+
630
+ ### Reference Format (GB/T 7714)
631
+ ```
632
+ [1] Author. Title[J]. Journal, Year, Vol(No): Pages.
633
+ [2] Author. Book Title[M]. Place: Publisher, Year: Pages.
634
+ [3] Author. Title[D]. Location: Institution, Year.
635
+ [4] Author. Title[EB/OL]. (Published)[Cited]. URL.
636
+ ```
637
+
638
+ ### Reference Formatting
639
+ ```js
640
+ // Reference title — H1 style
641
+ new Paragraph({ heading: HeadingLevel.HEADING_1, alignment: AlignmentType.CENTER,
642
+ children: [new TextRun({ text: "References", bold: true, size: 32, font: { eastAsia: "SimHei" } })] }),
643
+ // Each entry — hanging indent
644
+ new Paragraph({
645
+ indent: { left: 420, hanging: 420 },
646
+ spacing: { line: 360 },
647
+ children: [new TextRun({ text: "[1] Author. Title[J]. Journal, 2024, 59(3): 45-62.",
648
+ size: 21, font: { eastAsia: "SimSun", ascii: "Times New Roman" } })],
649
+ }),
650
+ ```
651
+
652
+ ### Reference Count Guidelines
653
+
654
+ | Thesis Type | Suggested Count |
655
+ |------------|----------------|
656
+ | Course paper (3000–5000 words) | 10–15 |
657
+ | Undergraduate thesis | 15–30 |
658
+ | Master's thesis | 40–80 |
659
+ | Doctoral dissertation | 80–150 |
660
+
661
+ If user specifies APA, MLA, Chicago, or school-specific format, follow that instead.
662
+
663
+ ---
664
+
665
+ ## Three-Line Table (Mandatory for Academic Papers)
666
+
667
+ All tables in academic papers **must use three-line tables** — no full-border tables.
668
+
669
+ ```js
670
+ const threeLineTable = new Table({
671
+ width: { size: 100, type: WidthType.PERCENTAGE },
672
+ borders: {
673
+ top: { style: BorderStyle.SINGLE, size: 4, color: "000000" },
674
+ bottom: { style: BorderStyle.SINGLE, size: 4, color: "000000" },
675
+ left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
676
+ insideHorizontal: { style: BorderStyle.NONE }, insideVertical: { style: BorderStyle.NONE },
677
+ },
678
+ rows: [
679
+ new TableRow({
680
+ tableHeader: true, cantSplit: true,
681
+ children: headerCells.map(text => new TableCell({
682
+ borders: { bottom: { style: BorderStyle.SINGLE, size: 2, color: "000000" },
683
+ top: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
684
+ margins: { top: 60, bottom: 60, left: 120, right: 120 },
685
+ children: [new Paragraph({ alignment: AlignmentType.CENTER,
686
+ children: [new TextRun({ text, bold: true, size: 21, font: { eastAsia: "SimSun", ascii: "Times New Roman" } })] })],
687
+ })),
688
+ }),
689
+ ...dataRows, // All borders NONE
690
+ ],
691
+ });
692
+ ```
693
+
694
+ ---
695
+
696
+ ## Content Quality Constraints (Mandatory)
697
+
698
+ ### Truthfulness & Conservatism
699
+ 1. **Never fabricate** unverifiable statistics, survey response counts, significance levels, interview subject identities, experimental precision, government document numbers
700
+ 2. **Never invent** non-existent classic theories, authoritative scholar opinions, regulation names, core data sources
701
+ 3. When user provides no real data → prefer **theoretical analysis, literature research, case studies, comparative analysis** (low-risk methods)
702
+ 4. If example data must be constructed → keep scale reasonable, results conservative; never produce "significantly superior" or "dramatically improved" high-risk claims
703
+ 5. Research conclusions must be **restrained** — do not overstate contributions, effects, or applicability
704
+ 6. Research limitations must be **honestly disclosed**
705
+
706
+ ### Language Style
707
+ 1. Formal academic register throughout
708
+ 2. **Forbidden:** "I think", "everyone knows", "obviously", "it is well known" (subjective expressions)
709
+ 3. **Forbidden:** Sloganeering, propaganda, advertising-style expressions
710
+ 4. First occurrence of CN/EN terms should include English original
711
+ 5. CN/EN punctuation, spacing, and number formats must be consistent throughout
712
+
713
+ ### Structural Consistency
714
+ 1. Abstract, body, and conclusions **must be consistent** — no self-contradiction
715
+ 2. Must form complete loop: "research question → method → analysis → findings → conclusions & outlook"
716
+ 3. Terminology consistent throughout — no concept drift
717
+ 4. All chapters balanced and substantive — no padding
718
+
719
+ ### Document Cleanliness
720
+ 1. **No residual** comments, tracked changes, field codes, template default text
721
+ 2. **No** "TBD", "omitted", "user modifies", "insert figure here" expressions
722
+ 3. **No** Markdown syntax, HTML tags, code blocks wrapping body text
723
+ 4. **No** consecutive blank lines, abnormal page breaks, chaotic numbering
724
+ 5. Final document must be clean, well-formatted, ready for submission
725
+
726
+ ---
727
+
728
+ ## School Standard Override Rule
729
+
730
+ ⚠️ **When user specifies school/journal-specific format requirements, those requirements OVERRIDE all defaults above.**
731
+
732
+ Common override items:
733
+ - Margins (binding margin left 3.5 cm common)
734
+ - Body font (some schools require FangSong)
735
+ - Line spacing (some schools require fixed 28pt)
736
+ - Cover layout (varies significantly by school)
737
+ - Reference format (APA, MLA, etc.)
738
+ - Heading numbering (some schools use "1", "2" instead of "Chapter 1", "Chapter 2")
739
+
740
+ ### Common Variants
741
+
742
+ | Thesis Type | Common Differences |
743
+ |------------|-------------------|
744
+ | Top universities | Strict GB/T 7714, often require STXiaoBiaoSong cover |
745
+ | Regular undergraduate | More flexible, SimSun/SimHei sufficient |
746
+ | Master's thesis | Requires English abstract, longer lit review, innovation statement |
747
+ | Doctoral dissertation | Requires innovation statement, publication list, originality declaration |
748
+
749
+ ---
750
+
751
+ ## Scene-Specific Quality Checks
752
+
753
+ In addition to universal checks (see `references/common-rules.md`):
754
+
755
+ ### Structure & Content
756
+ - [ ] Cover, abstract, English abstract, TOC, body, references all present
757
+ - [ ] Cover info complete (school/title/EN title/college/major/name/ID/advisor/date)
758
+ - [ ] Abstract contains 5 elements: background + problem + method + results + significance
759
+ - [ ] English abstract consistent with Chinese abstract
760
+ - [ ] All chapters balanced, substantive, logical loop complete
761
+ - [ ] Literature review is thematic, not chronological dump
762
+ - [ ] Conclusions respond to research questions
763
+
764
+ ### Format & Layout
765
+ - [ ] Heading numbering consistent (Chapter X / X.X / X.X.X), no mixing
766
+ - [ ] All body headings use `heading: HeadingLevel.HEADING_X`
767
+ - [ ] Body text pure black `"000000"`
768
+ - [ ] Three-line tables used consistently (no full-border tables)
769
+ - [ ] Figure captions below, table captions above, numbered by chapter
770
+ - [ ] Formulas centered, numbers right-aligned
771
+ - [ ] In-text citations match reference list one-to-one
772
+ - [ ] References use hanging indent, consistent format
773
+ - [ ] Page numbers: front matter Roman, body Arabic from 1
774
+ - [ ] Cover has no page number
775
+ - [ ] Headers formal and concise
776
+ - [ ] No extra blank pages
777
+
778
+ ### Cleanliness
779
+ - [ ] No comment/revision residuals
780
+ - [ ] No "TBD" / "omitted" expressions
781
+ - [ ] No Markdown/HTML/code block residuals
782
+ - [ ] No consecutive blank lines or abnormal page breaks
783
+ - [ ] No fabricated high-risk data or exaggerated conclusions