@iasiv5/dsh-skills 1.0.6 → 1.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 (192) hide show
  1. package/NOTICE.md +7 -10
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/skills/answer-me-with-html/SKILL.md +3 -1
  5. package/skills/answer-me-with-html/references/settings.md +1 -1
  6. package/skills/answer-me-with-html/references/video.md +1 -0
  7. package/skills/answer-me-with-html/scripts/am.mjs +2567 -2064
  8. package/skills/docx/LICENSE.txt +202 -0
  9. package/skills/docx/SKILL.md +91 -0
  10. package/skills/docx/scripts/__init__.py +1 -0
  11. package/skills/docx/scripts/accept_changes.py +135 -0
  12. package/skills/docx/scripts/comment.py +368 -0
  13. package/skills/docx/scripts/merge_runs.py +310 -0
  14. package/skills/docx/scripts/office/helpers/__init__.py +111 -0
  15. package/skills/docx/scripts/office/helpers/pptx_chart.py +170 -0
  16. package/skills/docx/scripts/office/helpers/pptx_slide.py +60 -0
  17. package/skills/docx/scripts/office/helpers/pptx_theme.py +114 -0
  18. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  19. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  20. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  21. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  22. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  23. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  24. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  25. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  26. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  27. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  28. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  29. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  30. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  31. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  32. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  33. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  34. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  35. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  36. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  37. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  38. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  39. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  40. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  41. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  42. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  43. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  44. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  45. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  46. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  47. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  48. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  49. package/skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
  50. package/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  51. package/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  52. package/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  53. package/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  54. package/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  55. package/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  56. package/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  57. package/skills/docx/scripts/office/soffice.py +192 -0
  58. package/skills/docx/scripts/office/validate.py +173 -0
  59. package/skills/docx/scripts/office/validators/__init__.py +15 -0
  60. package/skills/docx/scripts/office/validators/base.py +875 -0
  61. package/skills/docx/scripts/office/validators/docx.py +466 -0
  62. package/skills/docx/scripts/office/validators/pptx.py +441 -0
  63. package/skills/docx/scripts/office/validators/redlining.py +299 -0
  64. package/skills/docx/scripts/templates/comments.xml +3 -0
  65. package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  66. package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  67. package/skills/docx/scripts/templates/commentsIds.xml +3 -0
  68. package/skills/docx/scripts/templates/people.xml +3 -0
  69. package/skills/impeccable/SKILL.md +87 -0
  70. package/skills/impeccable/reference/adapt.md +318 -0
  71. package/skills/impeccable/reference/adapt.native.md +58 -0
  72. package/skills/impeccable/reference/android.md +46 -0
  73. package/skills/impeccable/reference/animate.md +89 -0
  74. package/skills/impeccable/reference/audit.md +150 -0
  75. package/skills/impeccable/reference/audit.native.md +143 -0
  76. package/skills/impeccable/reference/bolder.md +33 -0
  77. package/skills/impeccable/reference/clarify.md +94 -0
  78. package/skills/impeccable/reference/colorize.md +86 -0
  79. package/skills/impeccable/reference/component-review.md +63 -0
  80. package/skills/impeccable/reference/craft-floor.md +44 -0
  81. package/skills/impeccable/reference/craft.md +5 -0
  82. package/skills/impeccable/reference/critique.md +819 -0
  83. package/skills/impeccable/reference/degraded/asset-producer.md +42 -0
  84. package/skills/impeccable/reference/degraded/documenter.md +24 -0
  85. package/skills/impeccable/reference/degraded/finish-reviewer.md +38 -0
  86. package/skills/impeccable/reference/degraded/manual-edit-applier.md +93 -0
  87. package/skills/impeccable/reference/delight.md +70 -0
  88. package/skills/impeccable/reference/distill.md +111 -0
  89. package/skills/impeccable/reference/doctor.md +54 -0
  90. package/skills/impeccable/reference/document.md +416 -0
  91. package/skills/impeccable/reference/extract.md +69 -0
  92. package/skills/impeccable/reference/generate.md +101 -0
  93. package/skills/impeccable/reference/harden.md +362 -0
  94. package/skills/impeccable/reference/hooks.md +120 -0
  95. package/skills/impeccable/reference/init.md +133 -0
  96. package/skills/impeccable/reference/ios.md +51 -0
  97. package/skills/impeccable/reference/layout.md +84 -0
  98. package/skills/impeccable/reference/live-setup.md +104 -0
  99. package/skills/impeccable/reference/live.md +327 -0
  100. package/skills/impeccable/reference/mode-operate.md +21 -0
  101. package/skills/impeccable/reference/mode-persuade.md +19 -0
  102. package/skills/impeccable/reference/mode-read.md +21 -0
  103. package/skills/impeccable/reference/new-work.md +152 -0
  104. package/skills/impeccable/reference/onboard.md +235 -0
  105. package/skills/impeccable/reference/operate.md +61 -0
  106. package/skills/impeccable/reference/optimize.md +257 -0
  107. package/skills/impeccable/reference/overdrive.md +127 -0
  108. package/skills/impeccable/reference/polish.md +105 -0
  109. package/skills/impeccable/reference/quieter.md +99 -0
  110. package/skills/impeccable/reference/region-map.md +26 -0
  111. package/skills/impeccable/reference/routing.md +24 -0
  112. package/skills/impeccable/reference/shape.md +59 -0
  113. package/skills/impeccable/reference/typeset.md +90 -0
  114. package/skills/impeccable/reference/visualize.md +47 -0
  115. package/skills/impeccable/scripts/VERSION +1 -0
  116. package/skills/impeccable/scripts/command-metadata.json +98 -0
  117. package/skills/impeccable/scripts/data/font-index-failures.json +121 -0
  118. package/skills/impeccable/scripts/data/font-index.json +1 -0
  119. package/skills/impeccable/scripts/engine-checksums.txt +9 -0
  120. package/skills/impeccable/scripts/impeccable +291 -0
  121. package/skills/impeccable/scripts/impeccable.cmd +337 -0
  122. package/skills/impeccable/scripts/live-browser-dom.js +320 -0
  123. package/skills/impeccable/scripts/live-browser-ignores.js +246 -0
  124. package/skills/impeccable/scripts/live-browser-session.js +183 -0
  125. package/skills/impeccable/scripts/live-browser.js +13872 -0
  126. package/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
  127. package/skills/pdf/LICENSE.txt +202 -0
  128. package/skills/pdf/SKILL.md +314 -0
  129. package/skills/pdf/forms.md +294 -0
  130. package/skills/pdf/reference.md +612 -0
  131. package/skills/pdf/scripts/check_bounding_boxes.py +65 -0
  132. package/skills/pdf/scripts/check_fillable_fields.py +11 -0
  133. package/skills/pdf/scripts/convert_pdf_to_images.py +33 -0
  134. package/skills/pdf/scripts/create_validation_image.py +37 -0
  135. package/skills/pdf/scripts/extract_form_field_info.py +122 -0
  136. package/skills/pdf/scripts/extract_form_structure.py +115 -0
  137. package/skills/pdf/scripts/fill_fillable_fields.py +98 -0
  138. package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
  139. package/skills/xlsx/LICENSE.txt +202 -0
  140. package/skills/xlsx/SKILL.md +99 -0
  141. package/skills/xlsx/scripts/office/helpers/__init__.py +111 -0
  142. package/skills/xlsx/scripts/office/helpers/pptx_chart.py +170 -0
  143. package/skills/xlsx/scripts/office/helpers/pptx_slide.py +60 -0
  144. package/skills/xlsx/scripts/office/helpers/pptx_theme.py +114 -0
  145. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  146. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  147. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  148. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  149. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  150. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  151. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  152. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  153. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  154. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  155. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  156. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  157. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  158. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  159. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  160. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  161. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  162. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  163. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  164. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  165. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  166. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  167. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  168. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  169. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  170. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  171. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  172. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  173. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  174. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  175. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  176. package/skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
  177. package/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  178. package/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  179. package/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  180. package/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  181. package/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  182. package/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  183. package/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  184. package/skills/xlsx/scripts/office/soffice.py +192 -0
  185. package/skills/xlsx/scripts/office/validate.py +173 -0
  186. package/skills/xlsx/scripts/office/validators/__init__.py +15 -0
  187. package/skills/xlsx/scripts/office/validators/base.py +875 -0
  188. package/skills/xlsx/scripts/office/validators/docx.py +466 -0
  189. package/skills/xlsx/scripts/office/validators/pptx.py +441 -0
  190. package/skills/xlsx/scripts/office/validators/redlining.py +299 -0
  191. package/skills/xlsx/scripts/recalc.py +308 -0
  192. package/skills-manifest.json +36 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: docx
3
+ description: "Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation."
4
+ license: Complete terms in LICENSE.txt
5
+ ---
6
+
7
+ # DOCX creation, editing, and analysis
8
+
9
+ A `.docx` is a ZIP archive of XML files. Choose your approach by task:
10
+
11
+ | Task | Approach |
12
+ |---|---|
13
+ | **Create** a new document | Write a `docx` (npm) script — see gotchas below |
14
+ | **Edit** an existing document | `unzip` → edit `word/document.xml` → `zip` (docx-js cannot open existing files) |
15
+ | **Read** content | `pandoc -t markdown file.docx` |
16
+
17
+ > Script paths below are relative to this skill's directory.
18
+
19
+ ## Creating with docx-js — gotchas
20
+
21
+ `docx` is preinstalled — do not run `npm install` first; write the script and `require('docx')` directly. Only if that require fails: `npm install docx`. The model knows the API; these are the footguns:
22
+
23
+ - **Page size defaults to A4.** For US Letter set `page: { size: { width: 12240, height: 15840 } }` (DXA; 1440 = 1″).
24
+ - **Landscape:** pass portrait dimensions and `orientation: PageOrientation.LANDSCAPE` — docx-js swaps width/height internally.
25
+ - **Tables need dual widths:** set `columnWidths` on the table AND `width` on every cell, both in `WidthType.DXA` (PERCENTAGE breaks in Google Docs). Column widths must sum to the table width.
26
+ - **Table shading:** use `ShadingType.CLEAR`, never `SOLID` (renders black).
27
+ - **Lists:** never insert `•` literally; use a `numbering` config with `LevelFormat.BULLET`.
28
+ - **`ImageRun` requires `type:`** (`"png"`, `"jpg"`, …).
29
+ - **`PageBreak` must be inside a `Paragraph`.**
30
+ - **Never use `\n`** — use separate `Paragraph` elements.
31
+ - **TOC:** headings must use built-in `HeadingLevel.*`; custom heading styles need `outlineLevel` set or they won't appear.
32
+ - **Don't use a table as a horizontal rule** — use a paragraph bottom border instead.
33
+ - **Dot-leader / right-aligned-on-same-line:** use `PositionalTab` (`alignment: PositionalTabAlignment.RIGHT`, `leader: PositionalTabLeader.DOT`) inside a `TextRun`, not literal `.` or space padding.
34
+
35
+ ## Verify the output
36
+
37
+ After writing a `.docx`, render it and look at it:
38
+
39
+ ```bash
40
+ python scripts/office/soffice.py --headless --convert-to pdf output.docx
41
+ pdftoppm -jpeg -r 100 output.pdf page
42
+ ls page-*.jpg # then Read the images
43
+ ```
44
+
45
+ `pdftoppm` zero-pads page numbers to the width of the page count (`page-01.jpg`…`page-12.jpg`).
46
+
47
+ ## Editing existing documents
48
+
49
+ Legacy `.doc` files must be converted first: `python scripts/office/soffice.py --headless --convert-to docx file.doc`.
50
+
51
+ ```bash
52
+ unzip -q doc.docx -d unpacked/
53
+ find unpacked -type l -delete # strip symlink entries — docx from external parties is untrusted
54
+ python scripts/merge_runs.py unpacked/ # coalesce fragmented runs so text is findable
55
+ # edit unpacked/word/document.xml in place — do NOT reformat or pretty-print
56
+ (cd unpacked && rm -f ../out.docx && zip -Xr ../out.docx .)
57
+ python scripts/office/validate.py out.docx --original doc.docx # XSD checks; --auto-repair fixes common issues
58
+ # redlining? add --author "<the name you redlined under>" to check every edit is tracked
59
+ ```
60
+
61
+ Word splits text across many `<w:r>` runs (revision ids, spell-check markers), so a phrase you can see in the document often doesn't exist as a contiguous string in the XML. `merge_runs.py` merges adjacent identically-formatted runs in `word/document.xml` without changing content or rendering; it also accepts a `.docx` directly (`python scripts/merge_runs.py doc.docx -o merged.docx`).
62
+
63
+ **Tracked changes:** when redlining, validate with `--author "<the name you redlined under>"` (needs `--original`) — it reports any text you changed without a `<w:ins>`/`<w:del>` around it, which is easy to do by accident and invisible in the accepted view. Wrap runs in `<w:ins>`/`<w:del>` with `w:id`, `w:author`, `w:date` attributes. Inside `<w:del>`, the text element is `<w:delText>`, not `<w:t>`. A deleted paragraph mark (`<w:pPr><w:rPr><w:del w:id=".." w:author=".." w:date=".."/></w:rPr></w:pPr>`) means "merge this paragraph into the next" — so deleting a paragraph outright is that plus a `<w:del>` around every run. The `<w:del/>` must come before the rPr's other children; their order is schema-enforced.
64
+
65
+ To produce a clean copy with all tracked changes accepted: `python scripts/accept_changes.py in.docx out.docx`.
66
+
67
+ Accepting a deleted paragraph mark should join that paragraph to the one below it, so a paragraph whose runs are *all* deleted vanishes. Word does this; `accept_changes.py` and `pandoc --track-changes=accept` don't always. Both fail the same way — they strip the deleted text but leave the emptied paragraph behind, which reads as a stray empty bullet when it was auto-numbered:
68
+
69
+ - `pandoc --track-changes=accept` never joins the paragraphs.
70
+ - `accept_changes.py` (LibreOffice) joins them correctly, except when the deleted paragraph is followed by an empty spacer paragraph.
71
+
72
+ An empty bullet in either view is an artifact of that view, not a defect in the document. Check paragraph deletions in the XML.
73
+
74
+ ## Comments
75
+
76
+ Comments require six cross-linked files. Use the helper — directory mode when you'll also be editing `document.xml` (saves an unzip/rezip cycle), `.docx`-direct mode otherwise:
77
+
78
+ ```bash
79
+ # Against an already-unpacked directory (preferred when also placing markers)
80
+ python scripts/comment.py unpacked/ "Fees & expenses cap is too low"
81
+ python scripts/comment.py unpacked/ "Agreed" --parent 0
82
+
83
+ # Against a .docx directly
84
+ python scripts/comment.py contract.docx "This cap is too low" -o annotated.docx
85
+ ```
86
+
87
+ The script writes `comments.xml`, `commentsExtended.xml`, `commentsIds.xml`, `commentsExtensible.xml`, the relationships, and the content-type overrides. Comment IDs are auto-assigned. It then prints the `<w:commentRangeStart>`/`<w:commentRangeEnd>`/`<w:commentReference>` snippet to add to `word/document.xml` so the comment anchors to specific text — until you place those markers, the comment exists but is not visible.
88
+
89
+ ## Dependencies
90
+
91
+ `docx` (npm, preinstalled — install only if `require('docx')` fails) · `pandoc` · LibreOffice (`soffice`) · `pdftoppm` (Poppler)
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,135 @@
1
+ """Accept all tracked changes in a DOCX file using LibreOffice.
2
+
3
+ Requires LibreOffice (soffice) to be installed.
4
+ """
5
+
6
+ import argparse
7
+ import logging
8
+ import shutil
9
+ import subprocess
10
+ from pathlib import Path
11
+
12
+ from office.soffice import get_soffice_env
13
+
14
+ logger = logging.getLogger(__name__)
15
+
16
+ LIBREOFFICE_PROFILE = "/tmp/libreoffice_docx_profile"
17
+ MACRO_DIR = f"{LIBREOFFICE_PROFILE}/user/basic/Standard"
18
+
19
+ ACCEPT_CHANGES_MACRO = """<?xml version="1.0" encoding="UTF-8"?>
20
+ <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
21
+ <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Module1" script:language="StarBasic">
22
+ Sub AcceptAllTrackedChanges()
23
+ Dim document As Object
24
+ Dim dispatcher As Object
25
+
26
+ document = ThisComponent.CurrentController.Frame
27
+ dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
28
+
29
+ dispatcher.executeDispatch(document, ".uno:AcceptAllTrackedChanges", "", 0, Array())
30
+ ThisComponent.store()
31
+ ThisComponent.close(True)
32
+ End Sub
33
+ </script:module>"""
34
+
35
+
36
+ def accept_changes(
37
+ input_file: str,
38
+ output_file: str,
39
+ ) -> tuple[None, str]:
40
+ input_path = Path(input_file)
41
+ output_path = Path(output_file)
42
+
43
+ if not input_path.exists():
44
+ return None, f"Error: Input file not found: {input_file}"
45
+
46
+ if not input_path.suffix.lower() == ".docx":
47
+ return None, f"Error: Input file is not a DOCX file: {input_file}"
48
+
49
+ try:
50
+ output_path.parent.mkdir(parents=True, exist_ok=True)
51
+ shutil.copy2(input_path, output_path)
52
+ except Exception as e:
53
+ return None, f"Error: Failed to copy input file to output location: {e}"
54
+
55
+ if not _setup_libreoffice_macro():
56
+ return None, "Error: Failed to setup LibreOffice macro"
57
+
58
+ cmd = [
59
+ "soffice",
60
+ "--headless",
61
+ f"-env:UserInstallation=file://{LIBREOFFICE_PROFILE}",
62
+ "--norestore",
63
+ "vnd.sun.star.script:Standard.Module1.AcceptAllTrackedChanges?language=Basic&location=application",
64
+ str(output_path.absolute()),
65
+ ]
66
+
67
+ try:
68
+ result = subprocess.run(
69
+ cmd,
70
+ capture_output=True,
71
+ text=True,
72
+ timeout=30,
73
+ check=False,
74
+ env=get_soffice_env(),
75
+ )
76
+ except subprocess.TimeoutExpired:
77
+ return (
78
+ None,
79
+ f"Successfully accepted all tracked changes: {input_file} -> {output_file}",
80
+ )
81
+
82
+ if result.returncode != 0:
83
+ return None, f"Error: LibreOffice failed: {result.stderr}"
84
+
85
+ return (
86
+ None,
87
+ f"Successfully accepted all tracked changes: {input_file} -> {output_file}",
88
+ )
89
+
90
+
91
+ def _setup_libreoffice_macro() -> bool:
92
+ macro_dir = Path(MACRO_DIR)
93
+ macro_file = macro_dir / "Module1.xba"
94
+
95
+ if macro_file.exists() and "AcceptAllTrackedChanges" in macro_file.read_text():
96
+ return True
97
+
98
+ if not macro_dir.exists():
99
+ subprocess.run(
100
+ [
101
+ "soffice",
102
+ "--headless",
103
+ f"-env:UserInstallation=file://{LIBREOFFICE_PROFILE}",
104
+ "--terminate_after_init",
105
+ ],
106
+ capture_output=True,
107
+ timeout=10,
108
+ check=False,
109
+ env=get_soffice_env(),
110
+ )
111
+ macro_dir.mkdir(parents=True, exist_ok=True)
112
+
113
+ try:
114
+ macro_file.write_text(ACCEPT_CHANGES_MACRO)
115
+ return True
116
+ except Exception as e:
117
+ logger.warning(f"Failed to setup LibreOffice macro: {e}")
118
+ return False
119
+
120
+
121
+ if __name__ == "__main__":
122
+ parser = argparse.ArgumentParser(
123
+ description="Accept all tracked changes in a DOCX file"
124
+ )
125
+ parser.add_argument("input_file", help="Input DOCX file with tracked changes")
126
+ parser.add_argument(
127
+ "output_file", help="Output DOCX file (clean, no tracked changes)"
128
+ )
129
+ args = parser.parse_args()
130
+
131
+ _, message = accept_changes(args.input_file, args.output_file)
132
+ print(message)
133
+
134
+ if "Error" in message:
135
+ raise SystemExit(1)