pi-maestro-flow 0.2.0

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 (179) hide show
  1. package/README.md +124 -0
  2. package/agents/aggregator.md +27 -0
  3. package/agents/cli-explore-agent.md +188 -0
  4. package/agents/cross-role-reviewer.md +171 -0
  5. package/agents/delegate.md +19 -0
  6. package/agents/explorer.md +23 -0
  7. package/agents/impeccable-agent.md +99 -0
  8. package/agents/ralph-executor.md +81 -0
  9. package/agents/reference.md +24 -0
  10. package/agents/role-design-author.md +220 -0
  11. package/agents/team-supervisor.md +143 -0
  12. package/agents/team-worker.md +237 -0
  13. package/agents/ui-design-agent.md +270 -0
  14. package/agents/workflow-analyzer.md +116 -0
  15. package/agents/workflow-codebase-mapper.md +77 -0
  16. package/agents/workflow-collab-planner.md +147 -0
  17. package/agents/workflow-debugger.md +104 -0
  18. package/agents/workflow-executor.md +133 -0
  19. package/agents/workflow-external-researcher.md +86 -0
  20. package/agents/workflow-integration-checker.md +83 -0
  21. package/agents/workflow-nyquist-auditor.md +85 -0
  22. package/agents/workflow-phase-researcher.md +85 -0
  23. package/agents/workflow-plan-checker.md +100 -0
  24. package/agents/workflow-planner.md +200 -0
  25. package/agents/workflow-project-researcher.md +74 -0
  26. package/agents/workflow-research-synthesizer.md +70 -0
  27. package/agents/workflow-reviewer.md +82 -0
  28. package/agents/workflow-roadmapper.md +81 -0
  29. package/agents/workflow-verifier.md +120 -0
  30. package/package.json +58 -0
  31. package/skills/codify-to-knowhow/SKILL.md +167 -0
  32. package/skills/delegation-check/SKILL.md +297 -0
  33. package/skills/domain-add/SKILL.md +75 -0
  34. package/skills/insight-challenge/SKILL.md +226 -0
  35. package/skills/learn-decompose/SKILL.md +124 -0
  36. package/skills/learn-follow/SKILL.md +163 -0
  37. package/skills/learn-investigate/SKILL.md +160 -0
  38. package/skills/learn-second-opinion/SKILL.md +128 -0
  39. package/skills/maestro/SKILL.md +239 -0
  40. package/skills/maestro-amend/SKILL.md +169 -0
  41. package/skills/maestro-analyze/SKILL.md +173 -0
  42. package/skills/maestro-blueprint/SKILL.md +159 -0
  43. package/skills/maestro-brainstorm/SKILL.md +193 -0
  44. package/skills/maestro-collab/SKILL.md +181 -0
  45. package/skills/maestro-companion/SKILL.md +536 -0
  46. package/skills/maestro-composer/SKILL.md +192 -0
  47. package/skills/maestro-execute/SKILL.md +193 -0
  48. package/skills/maestro-fork/SKILL.md +104 -0
  49. package/skills/maestro-grill/SKILL.md +151 -0
  50. package/skills/maestro-guard/SKILL.md +124 -0
  51. package/skills/maestro-help/SKILL.md +328 -0
  52. package/skills/maestro-impeccable/SKILL.md +302 -0
  53. package/skills/maestro-init/SKILL.md +151 -0
  54. package/skills/maestro-merge/SKILL.md +90 -0
  55. package/skills/maestro-milestone-audit/SKILL.md +117 -0
  56. package/skills/maestro-milestone-complete/SKILL.md +133 -0
  57. package/skills/maestro-milestone-release/SKILL.md +131 -0
  58. package/skills/maestro-next/SKILL.md +269 -0
  59. package/skills/maestro-overlay/SKILL.md +203 -0
  60. package/skills/maestro-plan/SKILL.md +194 -0
  61. package/skills/maestro-player/SKILL.md +184 -0
  62. package/skills/maestro-quick/SKILL.md +117 -0
  63. package/skills/maestro-ralph/SKILL.md +905 -0
  64. package/skills/maestro-ralph-cli/SKILL.md +976 -0
  65. package/skills/maestro-ralph-cli-execute/SKILL.md +229 -0
  66. package/skills/maestro-ralph-execute/SKILL.md +409 -0
  67. package/skills/maestro-ralph-v2/SKILL.md +1198 -0
  68. package/skills/maestro-roadmap/SKILL.md +157 -0
  69. package/skills/maestro-swarm-workflow/SKILL.md +272 -0
  70. package/skills/maestro-tools-execute/SKILL.md +143 -0
  71. package/skills/maestro-tools-register/SKILL.md +192 -0
  72. package/skills/maestro-ui-codify/SKILL.md +127 -0
  73. package/skills/maestro-universal-workflow/SKILL.md +622 -0
  74. package/skills/maestro-update/SKILL.md +156 -0
  75. package/skills/manage-codebase-rebuild/SKILL.md +111 -0
  76. package/skills/manage-drift-realign/SKILL.md +159 -0
  77. package/skills/manage-harvest/SKILL.md +121 -0
  78. package/skills/manage-issue/SKILL.md +88 -0
  79. package/skills/manage-issue-discover/SKILL.md +104 -0
  80. package/skills/manage-kg-extractors/SKILL.md +147 -0
  81. package/skills/manage-knowhow/SKILL.md +102 -0
  82. package/skills/manage-knowhow-capture/SKILL.md +109 -0
  83. package/skills/manage-knowledge-audit/SKILL.md +147 -0
  84. package/skills/manage-status/SKILL.md +80 -0
  85. package/skills/manage-wiki/SKILL.md +104 -0
  86. package/skills/odyssey-debug/SKILL.md +344 -0
  87. package/skills/odyssey-improve/SKILL.md +423 -0
  88. package/skills/odyssey-planex/SKILL.md +542 -0
  89. package/skills/odyssey-review-test-fix/SKILL.md +392 -0
  90. package/skills/odyssey-ui/SKILL.md +388 -0
  91. package/skills/prompt-generator/SKILL.md +470 -0
  92. package/skills/quality-auto-test/SKILL.md +168 -0
  93. package/skills/quality-debug/SKILL.md +176 -0
  94. package/skills/quality-refactor/SKILL.md +108 -0
  95. package/skills/quality-retrospective/SKILL.md +134 -0
  96. package/skills/quality-review/SKILL.md +169 -0
  97. package/skills/quality-sync/SKILL.md +90 -0
  98. package/skills/quality-test/SKILL.md +183 -0
  99. package/skills/scholar-anti-ai-writing/SKILL.md +173 -0
  100. package/skills/scholar-anti-ai-writing/references/patterns-chinese.md +242 -0
  101. package/skills/scholar-anti-ai-writing/references/patterns-english.md +242 -0
  102. package/skills/scholar-citation-verify/SKILL.md +166 -0
  103. package/skills/scholar-citation-verify/references/api-usage.md +372 -0
  104. package/skills/scholar-citation-verify/references/common-errors.md +384 -0
  105. package/skills/scholar-citation-verify/references/verification-rules.md +399 -0
  106. package/skills/scholar-experiment/SKILL.md +321 -0
  107. package/skills/scholar-ideation/SKILL.md +288 -0
  108. package/skills/scholar-latex-organizer/SKILL.md +186 -0
  109. package/skills/scholar-publish/SKILL.md +220 -0
  110. package/skills/scholar-rebuttal-pro/README.md +313 -0
  111. package/skills/scholar-rebuttal-pro/SKILL.md +511 -0
  112. package/skills/scholar-review/SKILL.md +227 -0
  113. package/skills/scholar-thesis-docx/README.md +111 -0
  114. package/skills/scholar-thesis-docx/README_EN.md +108 -0
  115. package/skills/scholar-thesis-docx/SKILL.md +212 -0
  116. package/skills/scholar-thesis-docx/references/failure-patterns-and-quality-gates.md +178 -0
  117. package/skills/scholar-thesis-docx/references/figure-and-code-rules.md +33 -0
  118. package/skills/scholar-thesis-docx/references/paper-format-workflow.md +68 -0
  119. package/skills/scholar-thesis-docx/references/script-usage.md +157 -0
  120. package/skills/scholar-thesis-docx/scripts/audit_docx_ooxml.py +429 -0
  121. package/skills/scholar-thesis-docx/scripts/check_word_com.ps1 +50 -0
  122. package/skills/scholar-thesis-docx/scripts/export_word_pdf.ps1 +62 -0
  123. package/skills/scholar-thesis-docx/scripts/normalize_word_styles.ps1 +498 -0
  124. package/skills/scholar-thesis-docx/scripts/render_mermaid_figure.ps1 +148 -0
  125. package/skills/scholar-writing/SKILL.md +296 -0
  126. package/skills/security-audit/SKILL.md +244 -0
  127. package/skills/skill-generator/SKILL.md +472 -0
  128. package/skills/skill-iter-tune/SKILL.md +382 -0
  129. package/skills/skill-simplify/SKILL.md +63 -0
  130. package/skills/skill-tuning/SKILL.md +174 -0
  131. package/skills/spec-add/SKILL.md +105 -0
  132. package/skills/spec-load/SKILL.md +98 -0
  133. package/skills/spec-remove/SKILL.md +74 -0
  134. package/skills/spec-setup/SKILL.md +75 -0
  135. package/skills/team-adversarial-swarm/SKILL.md +233 -0
  136. package/skills/team-adversarial-swarm/scripts/__pycache__/pheromone.cpython-313.pyc +0 -0
  137. package/skills/team-adversarial-swarm/scripts/__pycache__/scoring.cpython-313.pyc +0 -0
  138. package/skills/team-adversarial-swarm/scripts/aco.py +473 -0
  139. package/skills/team-adversarial-swarm/scripts/pheromone.py +144 -0
  140. package/skills/team-adversarial-swarm/scripts/scoring.py +92 -0
  141. package/skills/team-adversarial-swarm/scripts/test_aco.py +475 -0
  142. package/skills/team-arch-opt/SKILL.md +158 -0
  143. package/skills/team-brainstorm/SKILL.md +171 -0
  144. package/skills/team-coordinate/SKILL.md +266 -0
  145. package/skills/team-designer/SKILL.md +160 -0
  146. package/skills/team-executor/SKILL.md +189 -0
  147. package/skills/team-frontend/SKILL.md +136 -0
  148. package/skills/team-frontend-debug/SKILL.md +198 -0
  149. package/skills/team-interactive-craft/SKILL.md +141 -0
  150. package/skills/team-issue/SKILL.md +171 -0
  151. package/skills/team-lifecycle-v4/SKILL.md +209 -0
  152. package/skills/team-motion-design/SKILL.md +142 -0
  153. package/skills/team-perf-opt/SKILL.md +175 -0
  154. package/skills/team-planex/SKILL.md +137 -0
  155. package/skills/team-quality-assurance/SKILL.md +147 -0
  156. package/skills/team-review/SKILL.md +147 -0
  157. package/skills/team-roadmap-dev/SKILL.md +169 -0
  158. package/skills/team-swarm/SKILL.md +178 -0
  159. package/skills/team-swarm/scripts/aco.py +473 -0
  160. package/skills/team-swarm/scripts/pheromone.py +144 -0
  161. package/skills/team-swarm/scripts/scoring.py +92 -0
  162. package/skills/team-swarm/scripts/test_aco.py +475 -0
  163. package/skills/team-tech-debt/SKILL.md +128 -0
  164. package/skills/team-testing/SKILL.md +143 -0
  165. package/skills/team-ui-polish/SKILL.md +141 -0
  166. package/skills/team-uidesign/SKILL.md +144 -0
  167. package/skills/team-ultra-analyze/SKILL.md +173 -0
  168. package/skills/team-ux-improve/SKILL.md +151 -0
  169. package/skills/team-visual-a11y/SKILL.md +156 -0
  170. package/skills/workflow-skill-designer/SKILL.md +496 -0
  171. package/src/extension/index.ts +222 -0
  172. package/src/extension/schemas.ts +131 -0
  173. package/src/providers/cli-tools-loader.ts +74 -0
  174. package/src/providers/provider-registry.ts +130 -0
  175. package/src/tools/delegate.ts +85 -0
  176. package/src/tools/explore.ts +134 -0
  177. package/src/tools/moa.ts +213 -0
  178. package/src/tools/status.ts +99 -0
  179. package/src/tools/wait.ts +166 -0
@@ -0,0 +1,178 @@
1
+ # Failure Patterns and Quality Gates
2
+
3
+ Use this reference before bulk thesis formatting and before claiming the
4
+ document is fully checked.
5
+
6
+ ## 1. Common Failure Patterns
7
+
8
+ ### A. Global Over-Normalization
9
+
10
+ Symptoms:
11
+
12
+ - the user asked for headings, but page headers/footers changed too
13
+ - code boxes or table internals changed even though the school guide did not
14
+ regulate them
15
+ - the assistant says "done" after a style pass, but the user immediately finds
16
+ obvious visual regressions
17
+
18
+ Rule:
19
+
20
+ - If the school guide does not define a format, preserve the current state
21
+ unless the user explicitly asks for redesign.
22
+
23
+ ### B. Style Name Looks Right, Effective Formatting Is Wrong
24
+
25
+ Symptoms:
26
+
27
+ - a paragraph uses the expected style name but still looks wrong
28
+ - Word and WPS render the same paragraph differently
29
+
30
+ Likely causes:
31
+
32
+ - direct paragraph formatting overrides the style
33
+ - direct run formatting overrides the style
34
+ - the visual style name is mapped to an unexpected style ID
35
+ - the style inherits hidden indentation or spacing from `Normal`
36
+
37
+ Check:
38
+
39
+ - style ID
40
+ - paragraph direct formatting
41
+ - run direct formatting
42
+ - basedOn chain
43
+
44
+ ### C. Hidden Indentation
45
+
46
+ Symptoms:
47
+
48
+ - headings appear indented even after `firstLineIndent = 0`
49
+ - the user can manually delete what looks like "two leading spaces"
50
+
51
+ Likely causes:
52
+
53
+ - `firstLineChars`
54
+ - numbering indentation
55
+ - direct `w:ind` on the paragraph
56
+
57
+ Check both:
58
+
59
+ - `w:firstLine`
60
+ - `w:firstLineChars`
61
+
62
+ ### D. First-Page Section Drift
63
+
64
+ Symptoms:
65
+
66
+ - some pages have page headers, some do not
67
+ - some pages have page numbers, some do not
68
+ - abstract, TOC, or chapter-first pages behave inconsistently
69
+
70
+ Likely causes:
71
+
72
+ - `differentFirstPageHeaderFooter`
73
+ - `titlePg`
74
+ - broken section references to header/footer parts
75
+
76
+ ### E. Cross-Reference Drift
77
+
78
+ Symptoms:
79
+
80
+ - the caption says `图6-1`, but the body still shows `图5-43`
81
+ - the cross-reference field exists, but the rendered text is stale
82
+ - the field result contains extra leftover text such as `图6-15-43`
83
+
84
+ Likely causes:
85
+
86
+ - REF fields not refreshed in Word
87
+ - stale display text run not removed
88
+ - caption renumbered without updating field result text
89
+
90
+ ### F. Code Box Header Row Clipping
91
+
92
+ Symptoms:
93
+
94
+ - WPS shows the title row correctly, Word shows only the top half
95
+ - title rows look left-aligned even though the table looks centered
96
+
97
+ Likely causes:
98
+
99
+ - title paragraph has direct `jc=left`
100
+ - row height uses `EXACT` and is too small for Word
101
+ - cell margins differ across tables
102
+ - `keepNext` / `keepLines` remain on title paragraphs
103
+
104
+ Preferred fix:
105
+
106
+ - center the paragraph itself
107
+ - clear keep flags
108
+ - use `AT_LEAST` instead of `EXACT` when Word clips glyphs
109
+
110
+ ### G. Punctuation Over-Correction
111
+
112
+ Symptoms:
113
+
114
+ - DOI, URL, code, or English references get rewritten with Chinese punctuation
115
+
116
+ Rule:
117
+
118
+ - Chinese prose, captions, abstracts, acknowledgements: full-width Chinese
119
+ punctuation
120
+ - code, variables, URL, DOI, English references: half-width English punctuation
121
+ - do not mass-rewrite formulas, citations, or technical identifiers without an
122
+ explicit rule
123
+
124
+ ## 2. Required Quality Gates
125
+
126
+ Do not say the thesis is complete until these gates pass.
127
+
128
+ ### Gate 1: Requirements Boundary
129
+
130
+ You must know:
131
+
132
+ - which items are explicitly regulated by the school guide
133
+ - which items are user-specific house rules
134
+ - which items are unspecified and must be preserved
135
+
136
+ ### Gate 2: Structure Audit
137
+
138
+ Check:
139
+
140
+ - page size and margins
141
+ - heading hierarchy
142
+ - abstracts and keywords
143
+ - TOC title and TOC levels
144
+ - figure/table captions
145
+ - references
146
+ - acknowledgements
147
+ - section breaks and page number scheme
148
+
149
+ ### Gate 3: OOXML Audit for Hidden Overrides
150
+
151
+ Check at least when something still looks wrong:
152
+
153
+ - `styleId`
154
+ - `firstLine`
155
+ - `firstLineChars`
156
+ - direct `w:ind`
157
+ - `titlePg`
158
+ - section header/footer references
159
+ - REF field display text
160
+
161
+ ### Gate 4: Word PDF Review
162
+
163
+ Export the Word document to PDF and inspect all pages, not just selected pages.
164
+
165
+ At minimum verify:
166
+
167
+ - cover
168
+ - abstract pages
169
+ - TOC
170
+ - first page of body
171
+ - pages with dense figures or tables
172
+ - references
173
+ - acknowledgements
174
+
175
+ ### Gate 5: Delivery Honesty
176
+
177
+ If any page was not visually reviewed, or if Word automation/PDF export was not
178
+ available, say so explicitly. Do not imply full completion.
@@ -0,0 +1,33 @@
1
+ # Figure and Code Rules
2
+
3
+ ## 1. Mermaid Usage Rules
4
+
5
+ 1. Generate Mermaid only when the user needs an architecture diagram, flow
6
+ chart, E-R diagram, state diagram, or similar thesis figure and has provided
7
+ real source material.
8
+ 2. Base the diagram on actual code, schema definitions, API docs, project docs,
9
+ or thesis text from the user.
10
+ 3. Do not guess entities, fields, relationships, module boundaries, or call
11
+ chains when the evidence is incomplete.
12
+ 4. Ask for the missing material before generating the figure.
13
+
14
+ ## 2. Thesis Diagram Style
15
+
16
+ 1. Keep the structure clean and avoid decorative nodes.
17
+ 2. Use neutral academic terminology.
18
+ 3. Avoid chatty labels and extra explanatory filler.
19
+ 4. Keep directions and relationships faithful to the real system.
20
+ 5. For E-R diagrams, emphasize entities, keys, core attributes, and cardinality.
21
+ 6. For architecture diagrams, emphasize layers, modules, and interactions.
22
+
23
+ ## 3. Code Listing Rules
24
+
25
+ 1. Prefer LaTeX-oriented code typesetting when the thesis includes code.
26
+ 2. Keep only the parts needed for the thesis argument.
27
+ 3. Use real identifiers from the user's code or design.
28
+ 4. Do not fabricate code or pseudocode for padding.
29
+
30
+ ## 4. Output Rules
31
+
32
+ - Every diagram and code listing must be traceable to user-provided material.
33
+ - If any fact is uncertain, ask for evidence instead of guessing.
@@ -0,0 +1,68 @@
1
+ # Thesis Word Formatting Workflow
2
+
3
+ ## 1. Environment Gate
4
+
5
+ 1. 先运行 `scripts/check_word_com.ps1 -Json`。
6
+ 2. 若 `wordInstalled=false` 或 `comAvailable=false` 或 `domAvailable=false`:
7
+ - Stop the automation-heavy plan.
8
+ - Tell the user to install desktop Microsoft Word.
9
+ - Explain that WPS and similar tools often distort styles, pagination,
10
+ captions, tables of contents, and cross-references.
11
+ 3. 只有在 Word COM/DOM 可用时,才进入自动化文档编辑流程。
12
+
13
+ ## 2. Formatting Rules
14
+
15
+ 1. If the user provides a school template, style guide, screenshots, or page
16
+ header/footer rules, follow them strictly.
17
+ 2. If the user does not provide rules, do not invent school-specific standards.
18
+ 3. Control formatting through styles, not scattered manual formatting.
19
+ 4. Reuse and repair existing styles before creating new ones.
20
+
21
+ ## 3. Suggested Style Groups
22
+
23
+ - `Body Text`
24
+ - `Heading 1` / `Heading 2` / `Heading 3`
25
+ - `Figure Caption`
26
+ - `Table Caption`
27
+ - `Code Listing`
28
+ - `References`
29
+ - `Abstract`, `Keywords`, and `Appendix Title`
30
+
31
+ ## 4. Editing Order
32
+
33
+ 1. Read the user requirements and current document structure.
34
+ 2. Separate formatting scope into:
35
+ - school-explicit requirements
36
+ - user-explicit house rules
37
+ - unspecified regions that must be preserved
38
+ 3. Inspect style names, style IDs, fonts, spacing, indentation, numbering,
39
+ section settings, and page-break behavior.
40
+ 4. Map target styles to document styles.
41
+ 5. Normalize only the parts that are justified by the rules.
42
+ 6. Then fix page numbers, table of contents, sections, references, and figure
43
+ numbering.
44
+ 7. Export to PDF from Word and review every page.
45
+ 8. Only after the PDF review passes, describe the task as complete.
46
+
47
+ ## 4.1 Hidden Word Checks
48
+
49
+ When the visual result contradicts the style readout, inspect:
50
+
51
+ - `firstLine`
52
+ - `firstLineChars`
53
+ - direct paragraph `w:ind`
54
+ - numbering indentation
55
+ - `titlePg`
56
+ - `differentFirstPageHeaderFooter`
57
+ - REF field display text
58
+ - direct run formatting
59
+
60
+ Do not assume `python-docx` style inspection is enough for thesis work.
61
+
62
+ ## 5. Do Not Do This
63
+
64
+ - Do not mix heavy direct formatting with style-driven formatting.
65
+ - Do not invent school rules when the template evidence is missing.
66
+ - Do not treat WPS rendering as the final Word result.
67
+ - Do not globally normalize the entire document before finishing a full audit.
68
+ - Do not claim the thesis is fully checked before page-level PDF review.
@@ -0,0 +1,157 @@
1
+ # Script Usage
2
+
3
+ ## 1. Audit DOCX OOXML before risky edits
4
+
5
+ Use `scripts/audit_docx_ooxml.py` before batch formatting when the document has
6
+ already gone through multiple rounds of editing or when the visible result does
7
+ not match the style readout.
8
+
9
+ Example:
10
+
11
+ ```powershell
12
+ python scripts/audit_docx_ooxml.py .\draft.docx `
13
+ --output_json .\draft.audit.json `
14
+ --output_txt .\draft.audit.txt
15
+ ```
16
+
17
+ The script reports:
18
+
19
+ 1. style IDs and key style definitions
20
+ 2. section settings such as `titlePg` and header/footer references
21
+ 3. heading paragraphs with direct indentation overrides
22
+ 4. paragraphs using `firstLineChars`
23
+ 5. suspicious REF fields with multiple result runs
24
+
25
+ The JSON output is suitable for agents and downstream tooling.
26
+ The TXT output is intended for quick human review.
27
+
28
+ Use this script before you decide whether a problem can be fixed through styles
29
+ or requires OOXML-level patching.
30
+
31
+ ## 2. Normalize Word styles
32
+
33
+ Use `scripts/normalize_word_styles.ps1` after `check_word_com.ps1` confirms
34
+ that Word COM automation is available.
35
+
36
+ Example:
37
+
38
+ ```powershell
39
+ powershell -ExecutionPolicy Bypass -File scripts/normalize_word_styles.ps1 `
40
+ -InputPath .\draft.docx `
41
+ -OutputPath .\draft.normalized.docx
42
+ ```
43
+
44
+ Dry-run audit example:
45
+
46
+ ```powershell
47
+ powershell -ExecutionPolicy Bypass -File scripts/normalize_word_styles.ps1 `
48
+ -InputPath .\draft.docx `
49
+ -AuditOnly
50
+ ```
51
+
52
+ The script:
53
+
54
+ 1. Opens the Word document through COM automation.
55
+ 2. Resolves or creates target styles.
56
+ 3. Applies style definitions for body text, Heading 1-3, figure captions, and
57
+ table captions.
58
+ 4. Uses existing style hints first, then falls back to text-pattern detection.
59
+ 5. Saves a new file unless `-InPlace` is provided.
60
+
61
+ When `-AuditOnly` is used, the script does not save document changes. It only
62
+ returns the predicted paragraph-to-style mappings and summary counts.
63
+
64
+ Use `-ConfigPath` to pass a UTF-8 JSON file with custom style names or school
65
+ rules.
66
+
67
+ Repository example:
68
+
69
+ ```text
70
+ examples/word-style-config.sample.json
71
+ examples/final-audit-checklist.sample.md
72
+ ```
73
+
74
+ Example JSON:
75
+
76
+ ```json
77
+ {
78
+ "styles": {
79
+ "Body": {
80
+ "TargetStyleName": "正文",
81
+ "FontName": "Times New Roman",
82
+ "EastAsiaFontName": "宋体",
83
+ "Size": 12,
84
+ "LineSpacingMultiple": 1.5
85
+ },
86
+ "FigureCaption": {
87
+ "TargetStyleName": "图标注"
88
+ },
89
+ "TableCaption": {
90
+ "TargetStyleName": "表标注"
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ ## 3. Render Mermaid figures
97
+
98
+ Use `scripts/render_mermaid_figure.ps1` to render Mermaid source into thesis
99
+ figure assets.
100
+
101
+ Example:
102
+
103
+ ```powershell
104
+ powershell -ExecutionPolicy Bypass -File scripts/render_mermaid_figure.ps1 `
105
+ -InputPath .\architecture.mmd `
106
+ -OutputPath .\figures\architecture.svg `
107
+ -Theme base `
108
+ -Width 1800 `
109
+ -Height 1200 `
110
+ -Scale 2
111
+ ```
112
+
113
+ The script:
114
+
115
+ 1. Prefers local `mmdc` when it exists.
116
+ 2. Falls back to `npx @mermaid-js/mermaid-cli` when needed.
117
+ 3. Generates a clean academic default theme config if no config is provided.
118
+ 4. Produces SVG, PNG, or PDF output depending on the output filename and CLI
119
+ behavior.
120
+
121
+ Repository example:
122
+
123
+ ```text
124
+ examples/architecture.sample.mmd
125
+ ```
126
+
127
+ For thesis work, prefer SVG first, then convert to PNG only when the target
128
+ submission system or Word workflow requires raster images.
129
+
130
+ ## 4. Export Word document to PDF for page audit
131
+
132
+ Use `scripts/export_word_pdf.ps1` after important formatting changes and before
133
+ you claim the thesis is fully checked.
134
+
135
+ Example:
136
+
137
+ ```powershell
138
+ powershell -ExecutionPolicy Bypass -File scripts/export_word_pdf.ps1 `
139
+ -DocPath .\draft.docx `
140
+ -PdfPath .\draft.audit.pdf
141
+ ```
142
+
143
+ The script:
144
+
145
+ 1. Opens the document through Word COM automation.
146
+ 2. Tries to refresh TOC and field results first.
147
+ 3. Exports the document to PDF.
148
+ 4. Produces a stable artifact for page-by-page review.
149
+
150
+ Use this whenever the task involves:
151
+
152
+ - headers/footers
153
+ - page numbers
154
+ - table of contents
155
+ - cross-references
156
+ - figure/table pagination
157
+ - final pre-delivery format review