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,295 +0,0 @@
1
- # Scenario B: Editing / Filling Content in Existing DOCX
2
-
3
- ## Core Principle
4
-
5
- **"First, do no harm."** When editing an existing document, minimize changes. Touch only what needs to change. Preserve all formatting, styles, relationships, and structure that are not directly involved in the edit.
6
-
7
- ---
8
-
9
- ## When to Use
10
-
11
- - Replacing placeholder text (`{{name}}`, `$DATE$`, `[PLACEHOLDER]`)
12
- - Updating specific paragraphs or table cells
13
- - Filling in form fields
14
- - Adding or removing paragraphs in a known location
15
- - Inserting tracked changes for review workflows
16
-
17
- Do NOT use when: the user wants to change the look/style of the entire document (→ Scenario C) or create from scratch (→ Scenario A).
18
-
19
- ---
20
-
21
- ## Workflow
22
-
23
- ```
24
- 1. Preview → CLI: analyze <input.docx>
25
- 2. Analyze → Understand structure: sections, styles, headings, tables
26
- 3. Identify → Locate exact edit targets (paragraph index, table index, placeholder text)
27
- 4. Edit → Apply surgical changes via CLI or direct XML
28
- 5. Validate → CLI: validate <output.docx>
29
- 6. Diff → Compare before/after to verify only intended changes were made
30
- ```
31
-
32
- ---
33
-
34
- ## When to Use API vs Direct XML
35
-
36
- ### Use CLI Edit Command When:
37
- - Replacing placeholder text (e.g., `{{fieldName}}` → actual value)
38
- - Filling table data from JSON
39
- - Updating document properties (title, author)
40
- - Simple text insertions or deletions
41
-
42
- ### Use Direct XML Manipulation When:
43
- - Text spans multiple runs with different formatting (run-boundary issues)
44
- - Adding complex structures (nested tables, multi-image layouts)
45
- - Manipulating Track Changes markup
46
- - Modifying header/footer content
47
- - Adjusting section properties
48
-
49
- ---
50
-
51
- ## Placeholder Patterns
52
-
53
- The CLI natively supports `{{fieldName}}` placeholders:
54
-
55
- ```bash
56
- # Replace all {{placeholders}} from a JSON map
57
- dotnet run ... edit input.docx --fill-placeholders data.json --output filled.docx
58
- ```
59
-
60
- Where `data.json`:
61
- ```json
62
- {
63
- "companyName": "Acme Corp",
64
- "date": "March 21, 2026",
65
- "amount": "$15,000.00",
66
- "recipientName": "Jane Smith"
67
- }
68
- ```
69
-
70
- Other placeholder formats (`$FIELD$`, `[PLACEHOLDER]`) require text replacement:
71
- ```bash
72
- dotnet run ... edit input.docx --replace "$DATE$" "March 21, 2026" --output updated.docx
73
- ```
74
-
75
- ---
76
-
77
- ## Text Replacement Strategies
78
-
79
- ### Simple Replacement
80
-
81
- When the entire search text is within a single `w:r` (run):
82
-
83
- ```xml
84
- <!-- Before -->
85
- <w:r>
86
- <w:rPr><w:b /></w:rPr>
87
- <w:t>{{companyName}}</w:t>
88
- </w:r>
89
-
90
- <!-- After — formatting preserved -->
91
- <w:r>
92
- <w:rPr><w:b /></w:rPr>
93
- <w:t>Acme Corp</w:t>
94
- </w:r>
95
- ```
96
-
97
- Direct replacement. The run's `w:rPr` is untouched.
98
-
99
- ### Complex Replacement (Split Runs)
100
-
101
- When the search text is split across multiple runs (common when Word applies spell-check or formatting mid-text):
102
-
103
- ```xml
104
- <!-- "{{companyName}}" split into 3 runs -->
105
- <w:r><w:rPr><w:b /></w:rPr><w:t>{{company</w:t></w:r>
106
- <w:r><w:rPr><w:b /><w:i /></w:rPr><w:t>Na</w:t></w:r>
107
- <w:r><w:rPr><w:b /></w:rPr><w:t>me}}</w:t></w:r>
108
- ```
109
-
110
- Strategy:
111
- 1. Concatenate text across runs to find the match
112
- 2. Place the replacement text in the **first** run (preserving its `w:rPr`)
113
- 3. Remove the text from subsequent runs (or remove the runs entirely if empty)
114
-
115
- ```xml
116
- <!-- After -->
117
- <w:r><w:rPr><w:b /></w:rPr><w:t>Acme Corp</w:t></w:r>
118
- ```
119
-
120
- **Rule**: Always preserve the formatting of the first run in the match.
121
-
122
- ---
123
-
124
- ## Table Editing
125
-
126
- ### By Index
127
-
128
- Tables are 0-indexed in document order:
129
-
130
- ```bash
131
- dotnet run ... edit input.docx --table-index 0 --table-data data.json --output updated.docx
132
- ```
133
-
134
- ### By Header Matching
135
-
136
- Find a table by its header row content:
137
-
138
- ```bash
139
- dotnet run ... edit input.docx --table-match "Name,Amount,Date" --table-data data.json
140
- ```
141
-
142
- ### Table Data JSON Format
143
-
144
- ```json
145
- {
146
- "rows": [
147
- ["Alice Johnson", "$5,000", "2026-03-15"],
148
- ["Bob Smith", "$3,200", "2026-03-18"]
149
- ],
150
- "appendRows": true
151
- }
152
- ```
153
-
154
- - `appendRows: true` — add rows after existing data
155
- - `appendRows: false` (default) — replace all data rows (keeps header row)
156
-
157
- ### Direct XML Table Editing
158
-
159
- To modify a specific cell, locate it by row/column index:
160
-
161
- ```xml
162
- <!-- Row 2 (0-indexed), Column 1 -->
163
- <w:tr> <!-- tr[2] -->
164
- <w:tc>...</w:tc>
165
- <w:tc> <!-- tc[1] — target cell -->
166
- <w:p>
167
- <w:r><w:t>Old Value</w:t></w:r>
168
- </w:p>
169
- </w:tc>
170
- </w:tr>
171
- ```
172
-
173
- Replace the `w:t` content. Do NOT modify `w:tcPr` (cell properties) or `w:tblPr` (table properties).
174
-
175
- ---
176
-
177
- ## Track Changes Guidance
178
-
179
- ### When to Add Revision Marks
180
- - User explicitly requests tracked changes
181
- - Document already has tracking enabled (`w:trackChanges` in settings)
182
- - Collaborative review workflow
183
-
184
- ### When NOT to Add Revision Marks
185
- - Form filling / placeholder replacement (these are "completing" the document, not "revising" it)
186
- - Direct edits where the user wants a clean result
187
- - Batch data filling operations
188
-
189
- ### Adding Tracked Changes
190
-
191
- See `references/track_changes_guide.md` for full XML examples.
192
-
193
- Quick reference — inserting text with tracking:
194
- ```xml
195
- <w:ins w:id="1" w:author="Editor" w:date="2026-03-21T10:00:00Z">
196
- <w:r>
197
- <w:t>New text here</w:t>
198
- </w:r>
199
- </w:ins>
200
- ```
201
-
202
- Deleting text with tracking:
203
- ```xml
204
- <w:del w:id="2" w:author="Editor" w:date="2026-03-21T10:00:00Z">
205
- <w:r>
206
- <w:delText>Removed text</w:delText> <!-- MUST use delText, not t -->
207
- </w:r>
208
- </w:del>
209
- ```
210
-
211
- ---
212
-
213
- ## Common Pitfalls
214
-
215
- ### 1. Breaking Run Boundaries
216
-
217
- **Problem**: Replacing text that spans runs by naively modifying individual runs destroys inline formatting.
218
-
219
- **Fix**: Concatenate run text, find match boundaries, consolidate into the first run, remove consumed runs.
220
-
221
- ### 2. Hyperlink Content
222
-
223
- **Problem**: Replacing text inside a `w:hyperlink` element without preserving the hyperlink wrapper removes the link.
224
-
225
- ```xml
226
- <w:hyperlink r:id="rId5">
227
- <w:r>
228
- <w:rPr><w:rStyle w:val="Hyperlink" /></w:rPr>
229
- <w:t>Click here</w:t> <!-- Only replace this text -->
230
- </w:r>
231
- </w:hyperlink>
232
- ```
233
-
234
- **Fix**: Only modify the `w:t` inside the hyperlink's run. Never remove or replace the `w:hyperlink` element itself.
235
-
236
- ### 3. Tracked Change Context
237
-
238
- **Problem**: Replacing text that is inside a `w:ins` or `w:del` element without understanding the revision context creates invalid markup.
239
-
240
- **Fix**: If the target text is inside a revision mark, either:
241
- - Replace within the revision context (preserving the `w:ins`/`w:del` wrapper)
242
- - Or delete the old revision and create a new one
243
-
244
- ### 4. Style Preservation
245
-
246
- **Problem**: Adding new paragraphs without specifying a style causes them to inherit `Normal`, which may not match the surrounding context.
247
-
248
- **Fix**: When inserting paragraphs, copy the `w:pStyle` from an adjacent paragraph of the same type.
249
-
250
- ### 5. Numbering Continuity
251
-
252
- **Problem**: Inserting a new list item breaks numbering sequence.
253
-
254
- **Fix**: Ensure the new paragraph has the same `w:numId` and `w:ilvl` as adjacent list items. If continuing a sequence, set `w:numPr` to match.
255
-
256
- ### 6. XML Special Characters
257
-
258
- **Problem**: User content contains `&`, `<`, `>`, `"`, `'` — these must be escaped in XML.
259
-
260
- **Fix**: Always XML-escape user-provided text before inserting into `w:t` elements:
261
- - `&` → `&amp;`
262
- - `<` → `&lt;`
263
- - `>` → `&gt;`
264
- - `"` → `&quot;`
265
- - `'` → `&apos;`
266
-
267
- ### 7. Whitespace Preservation
268
-
269
- **Problem**: Leading/trailing spaces in `w:t` are stripped by XML parsers.
270
-
271
- **Fix**: Add `xml:space="preserve"` attribute:
272
- ```xml
273
- <w:t xml:space="preserve"> text with leading space</w:t>
274
- ```
275
-
276
- ---
277
-
278
- ## Diff Verification
279
-
280
- After editing, always compare the before and after states:
281
-
282
- ```bash
283
- # Structural diff — shows only changed elements
284
- dotnet run ... diff original.docx modified.docx
285
-
286
- # Text-only diff — shows content changes
287
- dotnet run ... diff original.docx modified.docx --text-only
288
- ```
289
-
290
- Verify:
291
- - Only intended text changed
292
- - No styles were modified
293
- - No relationships were added/removed unexpectedly
294
- - Table structure intact (same number of rows/columns unless intentionally changed)
295
- - Images and other media unchanged