dimcode-darwin-x64 0.1.2-beta.1 → 0.1.2

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 (148) hide show
  1. package/bin/dimcode +0 -0
  2. package/package.json +1 -1
  3. package/bin/runtime/sandbox/dim-sandbox-runner +0 -0
  4. package/bin/runtime/sandbox/manifest.json +0 -15
  5. package/bin/skills-assets/deep-investigate/SKILL.md +0 -101
  6. package/bin/skills-assets/deep-investigate/references/prompts.md +0 -75
  7. package/bin/skills-assets/deep-investigate/references/templates.md +0 -73
  8. package/bin/skills-assets/deep-investigate/references/thinking-tools.md +0 -36
  9. package/bin/skills-assets/docs-sprint/SKILL.md +0 -73
  10. package/bin/skills-assets/docs-sprint/agents/openai.yaml +0 -4
  11. package/bin/skills-assets/docs-sprint/references/contract-discipline.md +0 -30
  12. package/bin/skills-assets/docs-sprint/references/delivery-plan.md +0 -162
  13. package/bin/skills-assets/docs-sprint/references/documentation-system.md +0 -109
  14. package/bin/skills-assets/docs-sprint/references/ui-layout.md +0 -73
  15. package/bin/skills-assets/docs-sprint/references/worktree-guide.md +0 -45
  16. package/bin/skills-assets/docx/SKILL.md +0 -273
  17. package/bin/skills-assets/docx/assets/styles/academic_styles.xml +0 -250
  18. package/bin/skills-assets/docx/assets/styles/corporate_styles.xml +0 -284
  19. package/bin/skills-assets/docx/assets/styles/default_styles.xml +0 -449
  20. package/bin/skills-assets/docx/assets/xsd/aesthetic-rules.xsd +0 -470
  21. package/bin/skills-assets/docx/assets/xsd/business-rules.xsd +0 -130
  22. package/bin/skills-assets/docx/assets/xsd/common-types.xsd +0 -159
  23. package/bin/skills-assets/docx/assets/xsd/wml-subset.xsd +0 -589
  24. package/bin/skills-assets/docx/references/cjk_typography.md +0 -357
  25. package/bin/skills-assets/docx/references/cjk_university_template_guide.md +0 -184
  26. package/bin/skills-assets/docx/references/comments_guide.md +0 -191
  27. package/bin/skills-assets/docx/references/design_good_bad_examples.md +0 -829
  28. package/bin/skills-assets/docx/references/design_principles.md +0 -819
  29. package/bin/skills-assets/docx/references/openxml_element_order.md +0 -308
  30. package/bin/skills-assets/docx/references/openxml_encyclopedia_part1.md +0 -4061
  31. package/bin/skills-assets/docx/references/openxml_encyclopedia_part2.md +0 -2820
  32. package/bin/skills-assets/docx/references/openxml_encyclopedia_part3.md +0 -3381
  33. package/bin/skills-assets/docx/references/openxml_namespaces.md +0 -82
  34. package/bin/skills-assets/docx/references/openxml_units.md +0 -72
  35. package/bin/skills-assets/docx/references/scenario_a_create.md +0 -284
  36. package/bin/skills-assets/docx/references/scenario_b_edit_content.md +0 -295
  37. package/bin/skills-assets/docx/references/scenario_c_apply_template.md +0 -456
  38. package/bin/skills-assets/docx/references/track_changes_guide.md +0 -200
  39. package/bin/skills-assets/docx/references/troubleshooting.md +0 -506
  40. package/bin/skills-assets/docx/references/typography_guide.md +0 -294
  41. package/bin/skills-assets/docx/references/xsd_validation_guide.md +0 -158
  42. package/bin/skills-assets/docx/scripts/doc_to_docx.sh +0 -40
  43. package/bin/skills-assets/docx/scripts/docx_preview.sh +0 -37
  44. package/bin/skills-assets/docx/scripts/dotnet/Docx.Cli/Docx.Cli.csproj +0 -19
  45. package/bin/skills-assets/docx/scripts/dotnet/Docx.Cli/Program.cs +0 -18
  46. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/AnalyzeCommand.cs +0 -147
  47. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/ApplyTemplateCommand.cs +0 -322
  48. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/CreateCommand.cs +0 -324
  49. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/DiffCommand.cs +0 -155
  50. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/EditContentCommand.cs +0 -487
  51. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/FixOrderCommand.cs +0 -108
  52. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/MergeRunsCommand.cs +0 -122
  53. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/ValidateCommand.cs +0 -107
  54. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Docx.Core.csproj +0 -15
  55. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/CommentSynchronizer.cs +0 -169
  56. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/ElementOrder.cs +0 -80
  57. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/NamespaceConstants.cs +0 -42
  58. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/RunMerger.cs +0 -81
  59. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/StyleAnalyzer.cs +0 -81
  60. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/TrackChangesHelper.cs +0 -99
  61. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/UnitConverter.cs +0 -23
  62. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples.cs +0 -1832
  63. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch1.cs +0 -910
  64. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch2.cs +0 -999
  65. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch3.cs +0 -1048
  66. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch4.cs +0 -1038
  67. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/CharacterFormattingSamples.cs +0 -1020
  68. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/DocumentCreationSamples.cs +0 -1121
  69. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/FieldAndTocSamples.cs +0 -624
  70. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/FootnoteAndCommentSamples.cs +0 -675
  71. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/HeaderFooterSamples.cs +0 -838
  72. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ImageSamples.cs +0 -917
  73. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ListAndNumberingSamples.cs +0 -826
  74. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ParagraphFormattingSamples.cs +0 -1199
  75. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/StyleSystemSamples.cs +0 -1487
  76. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/TableSamples.cs +0 -1163
  77. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/TrackChangesSamples.cs +0 -595
  78. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/CjkHelper.cs +0 -39
  79. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/FontDefaults.cs +0 -24
  80. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/PageSizes.cs +0 -20
  81. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/BusinessRuleValidator.cs +0 -224
  82. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/GateCheckValidator.cs +0 -148
  83. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/ValidationResult.cs +0 -23
  84. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/XsdValidator.cs +0 -69
  85. package/bin/skills-assets/docx/scripts/dotnet/Docx.slnx +0 -4
  86. package/bin/skills-assets/docx/scripts/env_check.sh +0 -196
  87. package/bin/skills-assets/docx/scripts/setup.ps1 +0 -274
  88. package/bin/skills-assets/docx/scripts/setup.sh +0 -504
  89. package/bin/skills-assets/pdf/README.md +0 -222
  90. package/bin/skills-assets/pdf/SKILL.md +0 -191
  91. package/bin/skills-assets/pdf/design/design.md +0 -381
  92. package/bin/skills-assets/pdf/scripts/cover.py +0 -1579
  93. package/bin/skills-assets/pdf/scripts/fill_inspect.py +0 -200
  94. package/bin/skills-assets/pdf/scripts/fill_write.py +0 -242
  95. package/bin/skills-assets/pdf/scripts/make.sh +0 -491
  96. package/bin/skills-assets/pdf/scripts/merge.py +0 -112
  97. package/bin/skills-assets/pdf/scripts/palette.py +0 -521
  98. package/bin/skills-assets/pdf/scripts/reformat_parse.py +0 -374
  99. package/bin/skills-assets/pdf/scripts/render_body.py +0 -1052
  100. package/bin/skills-assets/pdf/scripts/render_cover.js +0 -111
  101. package/bin/skills-assets/pptx-generator/SKILL.md +0 -248
  102. package/bin/skills-assets/pptx-generator/references/design-system.md +0 -392
  103. package/bin/skills-assets/pptx-generator/references/editing.md +0 -162
  104. package/bin/skills-assets/pptx-generator/references/pitfalls.md +0 -112
  105. package/bin/skills-assets/pptx-generator/references/pptxgenjs.md +0 -420
  106. package/bin/skills-assets/pptx-generator/references/slide-types.md +0 -413
  107. package/bin/skills-assets/skill-creator/SKILL.md +0 -368
  108. package/bin/skills-assets/skill-creator/agents/openai.yaml +0 -5
  109. package/bin/skills-assets/skill-creator/assets/skill-creator-small.svg +0 -3
  110. package/bin/skills-assets/skill-creator/assets/skill-creator.png +0 -0
  111. package/bin/skills-assets/skill-creator/license.txt +0 -202
  112. package/bin/skills-assets/skill-creator/references/openai_yaml.md +0 -49
  113. package/bin/skills-assets/skill-creator/scripts/generate_openai_yaml.py +0 -226
  114. package/bin/skills-assets/skill-creator/scripts/init_skill.py +0 -397
  115. package/bin/skills-assets/skill-creator/scripts/quick_validate.py +0 -101
  116. package/bin/skills-assets/skill-installer/LICENSE.txt +0 -202
  117. package/bin/skills-assets/skill-installer/SKILL.md +0 -58
  118. package/bin/skills-assets/skill-installer/agents/openai.yaml +0 -5
  119. package/bin/skills-assets/skill-installer/assets/skill-installer-small.svg +0 -3
  120. package/bin/skills-assets/skill-installer/assets/skill-installer.png +0 -0
  121. package/bin/skills-assets/skill-installer/scripts/github_utils.py +0 -21
  122. package/bin/skills-assets/skill-installer/scripts/install-skill-from-github.py +0 -308
  123. package/bin/skills-assets/skill-installer/scripts/list-skills.py +0 -107
  124. package/bin/skills-assets/xlsx/SKILL.md +0 -137
  125. package/bin/skills-assets/xlsx/references/create.md +0 -691
  126. package/bin/skills-assets/xlsx/references/edit.md +0 -684
  127. package/bin/skills-assets/xlsx/references/fix.md +0 -37
  128. package/bin/skills-assets/xlsx/references/format.md +0 -768
  129. package/bin/skills-assets/xlsx/references/ooxml-cheatsheet.md +0 -231
  130. package/bin/skills-assets/xlsx/references/read-analyze.md +0 -97
  131. package/bin/skills-assets/xlsx/references/validate.md +0 -772
  132. package/bin/skills-assets/xlsx/scripts/formula_check.py +0 -422
  133. package/bin/skills-assets/xlsx/scripts/libreoffice_recalc.py +0 -248
  134. package/bin/skills-assets/xlsx/scripts/shared_strings_builder.py +0 -163
  135. package/bin/skills-assets/xlsx/scripts/style_audit.py +0 -575
  136. package/bin/skills-assets/xlsx/scripts/xlsx_add_column.py +0 -395
  137. package/bin/skills-assets/xlsx/scripts/xlsx_insert_row.py +0 -274
  138. package/bin/skills-assets/xlsx/scripts/xlsx_pack.py +0 -87
  139. package/bin/skills-assets/xlsx/scripts/xlsx_reader.py +0 -362
  140. package/bin/skills-assets/xlsx/scripts/xlsx_shift_rows.py +0 -396
  141. package/bin/skills-assets/xlsx/scripts/xlsx_unpack.py +0 -130
  142. package/bin/skills-assets/xlsx/templates/minimal_xlsx/[Content_Types].xml +0 -9
  143. package/bin/skills-assets/xlsx/templates/minimal_xlsx/_rels/.rels +0 -6
  144. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/_rels/workbook.xml.rels +0 -19
  145. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/sharedStrings.xml +0 -33
  146. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/styles.xml +0 -160
  147. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/workbook.xml +0 -30
  148. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/worksheets/sheet1.xml +0 -70
@@ -1,470 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!-- ============================================================================ -->
3
- <!-- Aesthetic Rules Schema for docx -->
4
- <!-- ============================================================================ -->
5
- <!-- Purpose: Validates whether a document follows basic aesthetic rules that -->
6
- <!-- produce visually harmonious results. This is a "taste checker" that flags -->
7
- <!-- common ugly patterns. -->
8
- <!-- -->
9
- <!-- IMPORTANT: XSD validates STRUCTURE and VALUE RANGES, not SEMANTICS. -->
10
- <!-- Many aesthetic rules require cross-element comparison (e.g., "H1 must be -->
11
- <!-- larger than H2") which XSD cannot express. These rules are documented in -->
12
- <!-- comments and must be enforced by a programmatic validator. -->
13
- <!-- -->
14
- <!-- Rules that CAN be expressed in XSD: -->
15
- <!-- - Font size ranges (body 10-14pt, headings 10-26pt) -->
16
- <!-- - Line spacing ranges (1.0x to 2.33x) -->
17
- <!-- - Margin minimums (at least 0.5in on all sides) -->
18
- <!-- - Table cell padding minimums -->
19
- <!-- -->
20
- <!-- Rules that CANNOT be expressed in XSD (enforce programmatically): -->
21
- <!-- - H1 sz > H2 sz > H3 sz > body sz (hierarchy) -->
22
- <!-- - Maximum 3 font families across all styles -->
23
- <!-- - Heading space-before >= space-after -->
24
- <!-- - Color contrast ratio between text and background -->
25
- <!-- - Consistent font family within heading vs body groups -->
26
- <!-- - Line spacing and font size harmony (larger text needs tighter spacing) -->
27
- <!-- -->
28
- <!-- MIT License - docx project -->
29
- <!-- ============================================================================ -->
30
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
31
- xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
32
- targetNamespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
33
- elementFormDefault="qualified">
34
-
35
- <!-- ============================================================ -->
36
- <!-- RULE 1: Body Font Size Range -->
37
- <!-- ============================================================ -->
38
- <!-- Body text must be 10-14pt (half-points: 20-28). -->
39
- <!-- WHY: Below 10pt is hard to read for most adults. -->
40
- <!-- Above 14pt body text looks childish or wasteful. -->
41
- <!-- The sweet spot is 10.5-12pt for most font families. -->
42
- <!-- ============================================================ -->
43
- <xs:simpleType name="ST_AestheticBodyFontSize">
44
- <xs:annotation>
45
- <xs:documentation>
46
- Body text font size in half-points.
47
- Acceptable range: 20-28 (10pt-14pt).
48
- - 10pt (20): minimum for comfortable reading
49
- - 11pt (22): modern default (Calibri, Aptos)
50
- - 12pt (24): traditional default (Times New Roman)
51
- - 14pt (28): maximum before body text looks oversized
52
- </xs:documentation>
53
- </xs:annotation>
54
- <xs:restriction base="xs:positiveInteger">
55
- <xs:minInclusive value="20"/> <!-- 10pt minimum -->
56
- <xs:maxInclusive value="28"/> <!-- 14pt maximum -->
57
- </xs:restriction>
58
- </xs:simpleType>
59
-
60
- <!-- ============================================================ -->
61
- <!-- RULE 2: Heading Font Size Range -->
62
- <!-- ============================================================ -->
63
- <!-- Headings must be 12-26pt (half-points: 24-52). -->
64
- <!-- WHY: Below 12pt, a heading cannot be visually distinguished -->
65
- <!-- from body text by size alone. -->
66
- <!-- Above 26pt is poster-sized and wastes vertical space. -->
67
- <!-- NOTE: Some academic styles use 12pt headings (same as body) -->
68
- <!-- and differentiate via bold/italic/centering instead. -->
69
- <!-- The lower bound of 24 (12pt) accommodates this. -->
70
- <!-- ============================================================ -->
71
- <xs:simpleType name="ST_AestheticHeadingFontSize">
72
- <xs:annotation>
73
- <xs:documentation>
74
- Heading font size in half-points.
75
- Acceptable range: 24-52 (12pt-26pt).
76
- - 12pt (24): APA-style (hierarchy via bold/italic, not size)
77
- - 16pt (32): typical H2/H3
78
- - 20pt (40): typical H1
79
- - 26pt (52): maximum before headings dominate the page
80
- </xs:documentation>
81
- </xs:annotation>
82
- <xs:restriction base="xs:positiveInteger">
83
- <xs:minInclusive value="24"/> <!-- 12pt minimum -->
84
- <xs:maxInclusive value="52"/> <!-- 26pt maximum -->
85
- </xs:restriction>
86
- </xs:simpleType>
87
-
88
- <!-- ============================================================ -->
89
- <!-- RULE 3: Line Spacing Range -->
90
- <!-- ============================================================ -->
91
- <!-- Line spacing (in auto mode) must be 240-560 (1.0x-2.33x). -->
92
- <!-- WHY: Below 1.0x, ascenders/descenders overlap — unreadable. -->
93
- <!-- Above 2.33x, lines appear disconnected. -->
94
- <!-- Sweet spots: 1.15x (276) for sans, 1.5x (360) for -->
95
- <!-- generous layouts, 2.0x (480) for academic. -->
96
- <!-- ============================================================ -->
97
- <xs:simpleType name="ST_AestheticLineSpacing">
98
- <xs:annotation>
99
- <xs:documentation>
100
- Line spacing value for auto line-spacing rule.
101
- In 240ths of single spacing: 240 = 1.0x, 480 = 2.0x.
102
- Acceptable range: 240-560 (1.0x to 2.33x).
103
- Common values:
104
- - 240: single spacing (dense, technical)
105
- - 259: Word's 1.08x default
106
- - 276: 1.15x (modern corporate default)
107
- - 336: 1.4x (executive/generous)
108
- - 360: 1.5x (generous/minimal)
109
- - 480: 2.0x (academic double spacing)
110
- </xs:documentation>
111
- </xs:annotation>
112
- <xs:restriction base="xs:positiveInteger">
113
- <xs:minInclusive value="240"/> <!-- 1.0x single spacing -->
114
- <xs:maxInclusive value="560"/> <!-- ~2.33x — beyond double feels disconnected -->
115
- </xs:restriction>
116
- </xs:simpleType>
117
-
118
- <!-- ============================================================ -->
119
- <!-- RULE 3b: Fixed Line Spacing Range -->
120
- <!-- ============================================================ -->
121
- <!-- For lineRule="exact", line value is in DXA (twentieths of pt) -->
122
- <!-- Range: 200-720 DXA (10pt-36pt fixed line height) -->
123
- <!-- Chinese government standard uses 560 DXA (28pt). -->
124
- <!-- ============================================================ -->
125
- <xs:simpleType name="ST_AestheticFixedLineSpacing">
126
- <xs:annotation>
127
- <xs:documentation>
128
- Fixed line spacing value (lineRule="exact") in DXA.
129
- Acceptable range: 200-720 (10pt-36pt).
130
- - 560: Chinese government standard (28pt, for 16pt body)
131
- - 480: double-space equivalent for 12pt body
132
- </xs:documentation>
133
- </xs:annotation>
134
- <xs:restriction base="xs:positiveInteger">
135
- <xs:minInclusive value="200"/> <!-- 10pt minimum fixed height -->
136
- <xs:maxInclusive value="720"/> <!-- 36pt maximum fixed height -->
137
- </xs:restriction>
138
- </xs:simpleType>
139
-
140
- <!-- ============================================================ -->
141
- <!-- RULE 4: Margin Minimums -->
142
- <!-- ============================================================ -->
143
- <!-- All margins must be at least 720 DXA (0.5 inch). -->
144
- <!-- WHY: Below 0.5in, most printers clip content. -->
145
- <!-- Also, narrow margins create a cramped, unprofessional -->
146
- <!-- appearance. Even "full bleed" designs need internal -->
147
- <!-- text margins. -->
148
- <!-- Max set to 4320 DXA (3 inches) to prevent absurd margins. -->
149
- <!-- ============================================================ -->
150
- <xs:simpleType name="ST_AestheticMargin">
151
- <xs:annotation>
152
- <xs:documentation>
153
- Page margin in DXA. Minimum 720 (0.5 inch), maximum 4320 (3 inches).
154
- Common values:
155
- - 720: 0.5in (minimum printable)
156
- - 1440: 1.0in (standard US)
157
- - 1588: 28mm (Chinese government left margin)
158
- - 1800: 1.25in (executive/premium)
159
- - 2160: 1.5in (binding margin or narrow-column design)
160
- </xs:documentation>
161
- </xs:annotation>
162
- <xs:restriction base="xs:positiveInteger">
163
- <xs:minInclusive value="720"/> <!-- 0.5in — minimum for print safety -->
164
- <xs:maxInclusive value="4320"/> <!-- 3in — beyond this is absurd -->
165
- </xs:restriction>
166
- </xs:simpleType>
167
-
168
- <!-- Top/bottom margins: signed because negative values can create -->
169
- <!-- overlap effects, but we still enforce a reasonable minimum. -->
170
- <xs:simpleType name="ST_AestheticVerticalMargin">
171
- <xs:annotation>
172
- <xs:documentation>
173
- Vertical (top/bottom) page margin in DXA.
174
- Range: 360 to 4320 (0.25in to 3in).
175
- Slightly more permissive than horizontal margins because
176
- header/footer areas may reduce effective vertical margin.
177
- </xs:documentation>
178
- </xs:annotation>
179
- <xs:restriction base="xs:integer">
180
- <xs:minInclusive value="360"/> <!-- 0.25in — tighter vertical is sometimes acceptable -->
181
- <xs:maxInclusive value="4320"/>
182
- </xs:restriction>
183
- </xs:simpleType>
184
-
185
- <!-- ============================================================ -->
186
- <!-- RULE 5: Paragraph Spacing Ranges -->
187
- <!-- ============================================================ -->
188
- <!-- Space before/after paragraphs should be 0-960 DXA (0-48pt). -->
189
- <!-- WHY: More than 48pt of space before/after creates awkward -->
190
- <!-- gaps that disrupt reading flow. -->
191
- <!-- ============================================================ -->
192
- <xs:simpleType name="ST_AestheticParaSpacing">
193
- <xs:annotation>
194
- <xs:documentation>
195
- Paragraph spacing (before/after) in DXA.
196
- Range: 0-960 (0pt-48pt).
197
- Common values:
198
- - 0: academic style (uses first-line indent instead)
199
- - 80: 4pt (tight, used after H2/H3)
200
- - 120: 6pt (moderate)
201
- - 160: 8pt (standard modern spacing)
202
- - 200: 10pt (generous/executive)
203
- - 240: 12pt (very generous/minimal)
204
- - 480: 24pt (heading before — creates section break)
205
- </xs:documentation>
206
- </xs:annotation>
207
- <xs:restriction base="xs:nonNegativeInteger">
208
- <xs:minInclusive value="0"/>
209
- <xs:maxInclusive value="960"/> <!-- 48pt max — beyond this is a page break, not spacing -->
210
- </xs:restriction>
211
- </xs:simpleType>
212
-
213
- <!-- ============================================================ -->
214
- <!-- RULE 6: Table Cell Padding Minimum -->
215
- <!-- ============================================================ -->
216
- <!-- Table cells need at least 28 DXA (~1.4pt) padding. -->
217
- <!-- WHY: Without padding, text touches cell borders — visually -->
218
- <!-- cramped and hard to read. Even borderless tables need -->
219
- <!-- padding for column separation. -->
220
- <!-- ============================================================ -->
221
- <xs:simpleType name="ST_AestheticCellPadding">
222
- <xs:annotation>
223
- <xs:documentation>
224
- Table cell padding in DXA. Minimum 28 DXA (~1.4pt).
225
- Recommended: 57 DXA (~2.85pt) for comfortable spacing.
226
- Maximum: 288 DXA (~14pt) — beyond this wastes space.
227
- </xs:documentation>
228
- </xs:annotation>
229
- <xs:restriction base="xs:nonNegativeInteger">
230
- <xs:minInclusive value="28"/> <!-- ~1.4pt minimum breathing room -->
231
- <xs:maxInclusive value="288"/> <!-- ~14pt — more than this is excessive -->
232
- </xs:restriction>
233
- </xs:simpleType>
234
-
235
- <!-- ============================================================ -->
236
- <!-- RULE 7: Border Size Range -->
237
- <!-- ============================================================ -->
238
- <!-- Border size (in eighth-points) should be 2-24 (0.25pt-3pt). -->
239
- <!-- WHY: Below 0.25pt borders may not render or print. -->
240
- <!-- Above 3pt borders look heavy and distracting. -->
241
- <!-- ============================================================ -->
242
- <xs:simpleType name="ST_AestheticBorderSize">
243
- <xs:annotation>
244
- <xs:documentation>
245
- Border width in eighth-points.
246
- Range: 2-24 (0.25pt to 3pt).
247
- Common values:
248
- - 4: 0.5pt (thin, standard)
249
- - 6: 0.75pt (header separator in three-line tables)
250
- - 8: 1.0pt (medium, good for framing borders)
251
- - 12: 1.5pt (heavy, used for top/bottom in three-line tables)
252
- - 24: 3.0pt (maximum before borders dominate)
253
- </xs:documentation>
254
- </xs:annotation>
255
- <xs:restriction base="xs:positiveInteger">
256
- <xs:minInclusive value="2"/> <!-- 0.25pt minimum visible -->
257
- <xs:maxInclusive value="24"/> <!-- 3pt maximum tasteful -->
258
- </xs:restriction>
259
- </xs:simpleType>
260
-
261
- <!-- ============================================================ -->
262
- <!-- RULE 8: Color Value Format -->
263
- <!-- ============================================================ -->
264
- <!-- Colors must be valid 6-digit hex (RRGGBB) or "auto". -->
265
- <!-- This is structural validation, not aesthetic validation. -->
266
- <!-- ============================================================ -->
267
- <xs:simpleType name="ST_AestheticColor">
268
- <xs:annotation>
269
- <xs:documentation>
270
- Color value: 6-digit hex (RRGGBB) or "auto".
271
- Examples: "000000", "1F3864", "2C3E50", "auto".
272
- </xs:documentation>
273
- </xs:annotation>
274
- <xs:restriction base="xs:string">
275
- <xs:pattern value="[0-9A-Fa-f]{6}|auto"/>
276
- </xs:restriction>
277
- </xs:simpleType>
278
-
279
- <!-- ============================================================ -->
280
- <!-- RULE 9: First-Line Indent Range -->
281
- <!-- ============================================================ -->
282
- <!-- If first-line indent is used, it should be 360-1440 DXA -->
283
- <!-- (0.25in - 1.0in). -->
284
- <!-- WHY: Below 0.25in the indent is barely visible. -->
285
- <!-- Above 1.0in the indent looks like a tab error. -->
286
- <!-- ============================================================ -->
287
- <xs:simpleType name="ST_AestheticFirstLineIndent">
288
- <xs:annotation>
289
- <xs:documentation>
290
- First-line indent in DXA. Range: 0-1440 (0in to 1.0in).
291
- - 0: no indent (modern style with space-after)
292
- - 480: 0.33in (compact)
293
- - 640: ~0.44in (2 Chinese characters at 16pt)
294
- - 720: 0.5in (standard APA/academic)
295
- - 1440: 1.0in (maximum before it looks wrong)
296
- </xs:documentation>
297
- </xs:annotation>
298
- <xs:restriction base="xs:nonNegativeInteger">
299
- <xs:minInclusive value="0"/>
300
- <xs:maxInclusive value="1440"/>
301
- </xs:restriction>
302
- </xs:simpleType>
303
-
304
- <!-- ============================================================ -->
305
- <!-- COMPOSITE TYPE: Aesthetic Run Properties Check -->
306
- <!-- ============================================================ -->
307
- <!-- Validates run-level properties for aesthetic compliance. -->
308
- <!-- ============================================================ -->
309
- <xs:complexType name="CT_AestheticRPr">
310
- <xs:annotation>
311
- <xs:documentation>
312
- Aesthetic run properties validator.
313
- Checks font size and color format at the run level.
314
- </xs:documentation>
315
- </xs:annotation>
316
- <xs:all>
317
- <xs:element name="sz" minOccurs="0">
318
- <xs:complexType>
319
- <xs:attribute name="val" type="w:ST_AestheticBodyFontSize" use="required"/>
320
- </xs:complexType>
321
- </xs:element>
322
- <xs:element name="szCs" minOccurs="0">
323
- <xs:complexType>
324
- <xs:attribute name="val" type="w:ST_AestheticBodyFontSize" use="required"/>
325
- </xs:complexType>
326
- </xs:element>
327
- <xs:element name="color" minOccurs="0">
328
- <xs:complexType>
329
- <xs:attribute name="val" type="w:ST_AestheticColor" use="required"/>
330
- </xs:complexType>
331
- </xs:element>
332
- </xs:all>
333
- </xs:complexType>
334
-
335
- <!-- ============================================================ -->
336
- <!-- COMPOSITE TYPE: Aesthetic Spacing Check -->
337
- <!-- ============================================================ -->
338
- <xs:complexType name="CT_AestheticSpacing">
339
- <xs:annotation>
340
- <xs:documentation>
341
- Aesthetic spacing validator for paragraph spacing properties.
342
- Validates line spacing and before/after spacing are in range.
343
- </xs:documentation>
344
- </xs:annotation>
345
- <xs:attribute name="line" type="w:ST_AestheticLineSpacing" use="optional"/>
346
- <xs:attribute name="before" type="w:ST_AestheticParaSpacing" use="optional"/>
347
- <xs:attribute name="after" type="w:ST_AestheticParaSpacing" use="optional"/>
348
- <xs:attribute name="lineRule" use="optional">
349
- <xs:simpleType>
350
- <xs:restriction base="xs:string">
351
- <xs:enumeration value="auto"/>
352
- <xs:enumeration value="exact"/>
353
- <xs:enumeration value="atLeast"/>
354
- </xs:restriction>
355
- </xs:simpleType>
356
- </xs:attribute>
357
- </xs:complexType>
358
-
359
- <!-- ============================================================ -->
360
- <!-- COMPOSITE TYPE: Aesthetic Page Margins Check -->
361
- <!-- ============================================================ -->
362
- <xs:complexType name="CT_AestheticPageMargins">
363
- <xs:annotation>
364
- <xs:documentation>
365
- Aesthetic page margin validator.
366
- Ensures all margins meet minimum print-safe thresholds.
367
- </xs:documentation>
368
- </xs:annotation>
369
- <xs:attribute name="top" type="w:ST_AestheticVerticalMargin" use="required"/>
370
- <xs:attribute name="bottom" type="w:ST_AestheticVerticalMargin" use="required"/>
371
- <xs:attribute name="left" type="w:ST_AestheticMargin" use="required"/>
372
- <xs:attribute name="right" type="w:ST_AestheticMargin" use="required"/>
373
- <xs:attribute name="header" type="xs:nonNegativeInteger" use="optional"/>
374
- <xs:attribute name="footer" type="xs:nonNegativeInteger" use="optional"/>
375
- <xs:attribute name="gutter" type="xs:nonNegativeInteger" use="optional"/>
376
- </xs:complexType>
377
-
378
- <!-- ============================================================ -->
379
- <!-- COMPOSITE TYPE: Aesthetic Table Cell Margin Check -->
380
- <!-- ============================================================ -->
381
- <xs:complexType name="CT_AestheticTableCellMargin">
382
- <xs:annotation>
383
- <xs:documentation>
384
- Aesthetic table cell margin validator.
385
- Ensures minimum padding for readability.
386
- </xs:documentation>
387
- </xs:annotation>
388
- <xs:attribute name="w" type="w:ST_AestheticCellPadding" use="required"/>
389
- <xs:attribute name="type" use="required">
390
- <xs:simpleType>
391
- <xs:restriction base="xs:string">
392
- <xs:enumeration value="dxa"/>
393
- <xs:enumeration value="nil"/>
394
- <xs:enumeration value="pct"/>
395
- <xs:enumeration value="auto"/>
396
- </xs:restriction>
397
- </xs:simpleType>
398
- </xs:attribute>
399
- </xs:complexType>
400
-
401
- <!-- ============================================================ -->
402
- <!-- PROGRAMMATIC RULES (cannot be expressed in XSD) -->
403
- <!-- ============================================================ -->
404
- <!-- -->
405
- <!-- The following rules must be checked by a programmatic -->
406
- <!-- validator (e.g., AestheticRuleValidator.cs). They are -->
407
- <!-- documented here for completeness. -->
408
- <!-- -->
409
- <!-- ── RULE P1: Heading Size Hierarchy ── -->
410
- <!-- H1 sz >= H2 sz >= H3 sz >= body sz -->
411
- <!-- Exception: APA-style where all headings = body size. -->
412
- <!-- Implementation: Collect sz from Heading1/2/3 styles and -->
413
- <!-- docDefaults. Verify monotonic decrease (or equality). -->
414
- <!-- -->
415
- <!-- ── RULE P2: Maximum 3 Font Families ── -->
416
- <!-- Across docDefaults rPr + all style rPr, at most 3 distinct -->
417
- <!-- font families (by Ascii name) should be used. -->
418
- <!-- WHY: More than 3 fonts creates visual chaos. Professional -->
419
- <!-- designs typically use 1-2 families. -->
420
- <!-- Implementation: Collect all rFonts.ascii values from -->
421
- <!-- docDefaults and all styles. Count distinct. Warn if > 3. -->
422
- <!-- -->
423
- <!-- ── RULE P3: Heading Space-Before >= Space-After ── -->
424
- <!-- For heading styles, spaceBefore should be >= spaceAfter. -->
425
- <!-- WHY: Headings should be visually closer to the content they -->
426
- <!-- introduce than to the content above. This is the -->
427
- <!-- "proximity principle" of Gestalt design. -->
428
- <!-- Implementation: For each Heading style, compare pPr spacing -->
429
- <!-- before vs after values. -->
430
- <!-- -->
431
- <!-- ── RULE P4: Spacing-Size Coherence ── -->
432
- <!-- Paragraph after-spacing should be proportional to body size: -->
433
- <!-- after >= bodySize * 0.5 AND after <= bodySize * 1.5 -->
434
- <!-- WHY: Too little spacing makes paragraphs run together. -->
435
- <!-- Too much spacing disconnects them. -->
436
- <!-- Implementation: Get body sz from docDefaults, convert to DXA -->
437
- <!-- (multiply by 10), check after-spacing ratio. -->
438
- <!-- -->
439
- <!-- ── RULE P5: Color Consistency ── -->
440
- <!-- All heading styles should use the same color value. -->
441
- <!-- Body text color (if set) should be consistent across styles. -->
442
- <!-- WHY: Inconsistent colors look accidental, not designed. -->
443
- <!-- Exception: Caption and footnote styles may differ. -->
444
- <!-- Implementation: Collect color.val from heading styles. -->
445
- <!-- Verify all are identical. -->
446
- <!-- -->
447
- <!-- ── RULE P6: Indent/Spacing Mutual Exclusion ── -->
448
- <!-- If first-line indent > 0 in docDefaults, then after-spacing -->
449
- <!-- should be 0 (and vice versa). Using BOTH indent AND spacing -->
450
- <!-- is visually redundant — it signals uncertainty. -->
451
- <!-- Exception: Headings may override this. -->
452
- <!-- Implementation: Check docDefaults pPr. If firstLine > 0 AND -->
453
- <!-- after > 0, emit a warning (not error). -->
454
- <!-- -->
455
- <!-- ── RULE P7: Table Border Consistency ── -->
456
- <!-- Within a single table, border styles should be internally -->
457
- <!-- consistent (all single, or all none — not a random mix). -->
458
- <!-- Implementation: Check tblBorders for consistent val values. -->
459
- <!-- -->
460
- <!-- ── RULE P8: Line Spacing vs Font Size Harmony ── -->
461
- <!-- For fixed line spacing (lineRule="exact"): -->
462
- <!-- lineHeight >= fontSize * 1.2 -->
463
- <!-- WHY: Fixed line spacing less than 1.2x the font size causes -->
464
- <!-- ascender/descender clipping. -->
465
- <!-- Implementation: When lineRule="exact", compare line value -->
466
- <!-- against the effective font size. -->
467
- <!-- -->
468
- <!-- ============================================================ -->
469
-
470
- </xs:schema>
@@ -1,130 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!-- Business Rules Gate-Check Schema for docx -->
3
- <!-- Used in Scenario C (template application) as hard gate -->
4
- <!-- Validates business compliance beyond XML correctness -->
5
- <!-- MIT License - docx project -->
6
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
7
- xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
8
- targetNamespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
9
- elementFormDefault="qualified">
10
-
11
- <!-- ============================================================ -->
12
- <!-- Page margins: constrained to reasonable bounds -->
13
- <!-- Minimum 360 DXA (0.25 inch), maximum 4320 DXA (3 inches) -->
14
- <!-- ============================================================ -->
15
- <xs:simpleType name="ST_MarginMeasure">
16
- <xs:restriction base="xs:integer">
17
- <xs:minInclusive value="360"/>
18
- <xs:maxInclusive value="4320"/>
19
- </xs:restriction>
20
- </xs:simpleType>
21
-
22
- <!-- Signed margin (top/bottom can be negative for overlap) -->
23
- <xs:simpleType name="ST_SignedMarginMeasure">
24
- <xs:restriction base="xs:integer">
25
- <xs:minInclusive value="-4320"/>
26
- <xs:maxInclusive value="4320"/>
27
- </xs:restriction>
28
- </xs:simpleType>
29
-
30
- <!-- ============================================================ -->
31
- <!-- Font size constraints -->
32
- <!-- Body text: 16-144 half-points (8-72pt) -->
33
- <!-- Heading text: 20-192 half-points (10-96pt) -->
34
- <!-- ============================================================ -->
35
- <xs:simpleType name="ST_BodyFontSize">
36
- <xs:restriction base="xs:positiveInteger">
37
- <xs:minInclusive value="16"/>
38
- <xs:maxInclusive value="144"/>
39
- </xs:restriction>
40
- </xs:simpleType>
41
-
42
- <xs:simpleType name="ST_HeadingFontSize">
43
- <xs:restriction base="xs:positiveInteger">
44
- <xs:minInclusive value="20"/>
45
- <xs:maxInclusive value="192"/>
46
- </xs:restriction>
47
- </xs:simpleType>
48
-
49
- <!-- ============================================================ -->
50
- <!-- Valid standard page sizes (width x height in DXA) -->
51
- <!-- ============================================================ -->
52
- <!-- Letter: 12240 x 15840 -->
53
- <!-- A4: 11906 x 16838 -->
54
- <!-- Legal: 12240 x 20160 -->
55
- <!-- A3: 16838 x 23811 -->
56
- <!-- A5: 8391 x 11906 -->
57
-
58
- <xs:simpleType name="ST_PageWidth">
59
- <xs:restriction base="xs:positiveInteger">
60
- <xs:minInclusive value="5040"/>
61
- <xs:maxInclusive value="31680"/>
62
- </xs:restriction>
63
- </xs:simpleType>
64
-
65
- <xs:simpleType name="ST_PageHeight">
66
- <xs:restriction base="xs:positiveInteger">
67
- <xs:minInclusive value="5040"/>
68
- <xs:maxInclusive value="31680"/>
69
- </xs:restriction>
70
- </xs:simpleType>
71
-
72
- <!-- ============================================================ -->
73
- <!-- Constrained section properties for gate-check -->
74
- <!-- ============================================================ -->
75
- <xs:complexType name="CT_GateCheckSectPr">
76
- <xs:all>
77
- <xs:element name="pgSz" minOccurs="1">
78
- <xs:complexType>
79
- <xs:attribute name="w" type="w:ST_PageWidth" use="required"/>
80
- <xs:attribute name="h" type="w:ST_PageHeight" use="required"/>
81
- <xs:attribute name="orient" use="optional">
82
- <xs:simpleType>
83
- <xs:restriction base="xs:string">
84
- <xs:enumeration value="portrait"/>
85
- <xs:enumeration value="landscape"/>
86
- </xs:restriction>
87
- </xs:simpleType>
88
- </xs:attribute>
89
- </xs:complexType>
90
- </xs:element>
91
- <xs:element name="pgMar" minOccurs="1">
92
- <xs:complexType>
93
- <xs:attribute name="top" type="w:ST_SignedMarginMeasure" use="required"/>
94
- <xs:attribute name="bottom" type="w:ST_SignedMarginMeasure" use="required"/>
95
- <xs:attribute name="left" type="w:ST_MarginMeasure" use="required"/>
96
- <xs:attribute name="right" type="w:ST_MarginMeasure" use="required"/>
97
- <xs:attribute name="header" type="xs:nonNegativeInteger" use="optional"/>
98
- <xs:attribute name="footer" type="xs:nonNegativeInteger" use="optional"/>
99
- <xs:attribute name="gutter" type="xs:nonNegativeInteger" use="optional"/>
100
- </xs:complexType>
101
- </xs:element>
102
- </xs:all>
103
- </xs:complexType>
104
-
105
- <!-- ============================================================ -->
106
- <!-- Required styles: at minimum Normal and Heading1 must exist -->
107
- <!-- This is enforced programmatically by GateCheckValidator -->
108
- <!-- rather than via XSD, since XSD cannot validate style presence -->
109
- <!-- across separate XML parts. -->
110
- <!-- ============================================================ -->
111
-
112
- <!-- ============================================================ -->
113
- <!-- Constrained run properties for font size validation -->
114
- <!-- ============================================================ -->
115
- <xs:complexType name="CT_GateCheckRPr">
116
- <xs:all>
117
- <xs:element name="sz" minOccurs="0">
118
- <xs:complexType>
119
- <xs:attribute name="val" type="w:ST_BodyFontSize" use="required"/>
120
- </xs:complexType>
121
- </xs:element>
122
- <xs:element name="szCs" minOccurs="0">
123
- <xs:complexType>
124
- <xs:attribute name="val" type="w:ST_BodyFontSize" use="required"/>
125
- </xs:complexType>
126
- </xs:element>
127
- </xs:all>
128
- </xs:complexType>
129
-
130
- </xs:schema>