@aslomon/effectum 0.3.3 → 0.4.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 (359) hide show
  1. package/bin/install.js +68 -4
  2. package/bin/lib/cli-tools.js +288 -0
  3. package/bin/lib/specializations.js +11 -1
  4. package/bin/lib/template.js +14 -0
  5. package/bin/lib/ui.js +109 -0
  6. package/package.json +1 -1
  7. package/system/agents/data-engineer.md +268 -0
  8. package/system/agents/mobile-developer.md +257 -0
  9. package/system/hooks/observe.sh +164 -0
  10. package/system/hooks/quick-diff.sh +87 -0
  11. package/system/hooks/save-results.sh +56 -0
  12. package/system/hooks/scan.sh +170 -0
  13. package/system/skills/README.md +86 -0
  14. package/system/skills/SKILL.md +117 -0
  15. package/system/skills/agents/observer.md +137 -0
  16. package/system/skills/agents/start-observer.sh +143 -0
  17. package/system/skills/algorithmic-art/LICENSE.txt +202 -0
  18. package/system/skills/algorithmic-art/SKILL.md +405 -0
  19. package/system/skills/algorithmic-art/templates/generator_template.js +223 -0
  20. package/system/skills/algorithmic-art/templates/viewer.html +599 -0
  21. package/system/skills/api-endpoint/SKILL.md +106 -0
  22. package/system/skills/canvas-design/LICENSE.txt +202 -0
  23. package/system/skills/canvas-design/SKILL.md +130 -0
  24. package/system/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
  25. package/system/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
  26. package/system/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
  27. package/system/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
  28. package/system/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
  29. package/system/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
  30. package/system/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
  31. package/system/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  32. package/system/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
  33. package/system/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  34. package/system/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
  35. package/system/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
  36. package/system/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
  37. package/system/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
  38. package/system/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
  39. package/system/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
  40. package/system/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
  41. package/system/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
  42. package/system/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
  43. package/system/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
  44. package/system/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
  45. package/system/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
  46. package/system/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
  47. package/system/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
  48. package/system/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
  49. package/system/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
  50. package/system/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
  51. package/system/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
  52. package/system/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
  53. package/system/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
  54. package/system/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  55. package/system/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  56. package/system/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  57. package/system/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
  58. package/system/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  59. package/system/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  60. package/system/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  61. package/system/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
  62. package/system/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
  63. package/system/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  64. package/system/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
  65. package/system/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  66. package/system/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
  67. package/system/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
  68. package/system/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
  69. package/system/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
  70. package/system/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
  71. package/system/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  72. package/system/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  73. package/system/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  74. package/system/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
  75. package/system/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  76. package/system/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
  77. package/system/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
  78. package/system/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
  79. package/system/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
  80. package/system/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  81. package/system/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  82. package/system/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
  83. package/system/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  84. package/system/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
  85. package/system/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
  86. package/system/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
  87. package/system/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
  88. package/system/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
  89. package/system/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
  90. package/system/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
  91. package/system/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
  92. package/system/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
  93. package/system/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
  94. package/system/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
  95. package/system/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  96. package/system/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
  97. package/system/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  98. package/system/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
  99. package/system/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
  100. package/system/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
  101. package/system/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
  102. package/system/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
  103. package/system/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
  104. package/system/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  105. package/system/skills/component/SKILL.md +103 -0
  106. package/system/skills/config.json +18 -0
  107. package/system/skills/doc-coauthoring/SKILL.md +375 -0
  108. package/system/skills/docx/LICENSE.txt +30 -0
  109. package/system/skills/docx/SKILL.md +590 -0
  110. package/system/skills/docx/scripts/__init__.py +1 -0
  111. package/system/skills/docx/scripts/accept_changes.py +135 -0
  112. package/system/skills/docx/scripts/comment.py +318 -0
  113. package/system/skills/docx/scripts/office/helpers/__init__.py +0 -0
  114. package/system/skills/docx/scripts/office/helpers/merge_runs.py +199 -0
  115. package/system/skills/docx/scripts/office/helpers/simplify_redlines.py +197 -0
  116. package/system/skills/docx/scripts/office/pack.py +159 -0
  117. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  118. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  119. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  120. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  121. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  122. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  123. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  124. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  125. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  126. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  127. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  128. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  129. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  130. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  131. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  132. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  133. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  134. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  135. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  136. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  137. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  138. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  139. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  140. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  141. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  142. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  143. package/system/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  144. package/system/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  145. package/system/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  146. package/system/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  147. package/system/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  148. package/system/skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
  149. package/system/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  150. package/system/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  151. package/system/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  152. package/system/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  153. package/system/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  154. package/system/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  155. package/system/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  156. package/system/skills/docx/scripts/office/soffice.py +183 -0
  157. package/system/skills/docx/scripts/office/unpack.py +132 -0
  158. package/system/skills/docx/scripts/office/validate.py +111 -0
  159. package/system/skills/docx/scripts/office/validators/__init__.py +15 -0
  160. package/system/skills/docx/scripts/office/validators/base.py +847 -0
  161. package/system/skills/docx/scripts/office/validators/docx.py +446 -0
  162. package/system/skills/docx/scripts/office/validators/pptx.py +275 -0
  163. package/system/skills/docx/scripts/office/validators/redlining.py +247 -0
  164. package/system/skills/docx/scripts/templates/comments.xml +3 -0
  165. package/system/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  166. package/system/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  167. package/system/skills/docx/scripts/templates/commentsIds.xml +3 -0
  168. package/system/skills/docx/scripts/templates/people.xml +3 -0
  169. package/system/skills/evaluate-session.sh +69 -0
  170. package/system/skills/feature/SKILL.md +73 -0
  171. package/system/skills/frontend-design/LICENSE.txt +177 -0
  172. package/system/skills/frontend-design/SKILL.md +52 -0
  173. package/system/skills/hooks/observe.sh +164 -0
  174. package/system/skills/mcp-builder/LICENSE.txt +202 -0
  175. package/system/skills/mcp-builder/SKILL.md +236 -0
  176. package/system/skills/mcp-builder/reference/evaluation.md +602 -0
  177. package/system/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
  178. package/system/skills/mcp-builder/reference/node_mcp_server.md +970 -0
  179. package/system/skills/mcp-builder/reference/python_mcp_server.md +719 -0
  180. package/system/skills/mcp-builder/scripts/connections.py +151 -0
  181. package/system/skills/mcp-builder/scripts/evaluation.py +373 -0
  182. package/system/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  183. package/system/skills/mcp-builder/scripts/requirements.txt +2 -0
  184. package/system/skills/pdf/LICENSE.txt +30 -0
  185. package/system/skills/pdf/SKILL.md +314 -0
  186. package/system/skills/pdf/forms.md +294 -0
  187. package/system/skills/pdf/reference.md +612 -0
  188. package/system/skills/pdf/scripts/check_bounding_boxes.py +65 -0
  189. package/system/skills/pdf/scripts/check_fillable_fields.py +11 -0
  190. package/system/skills/pdf/scripts/convert_pdf_to_images.py +33 -0
  191. package/system/skills/pdf/scripts/create_validation_image.py +37 -0
  192. package/system/skills/pdf/scripts/extract_form_field_info.py +122 -0
  193. package/system/skills/pdf/scripts/extract_form_structure.py +115 -0
  194. package/system/skills/pdf/scripts/fill_fillable_fields.py +98 -0
  195. package/system/skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
  196. package/system/skills/pptx/LICENSE.txt +30 -0
  197. package/system/skills/pptx/SKILL.md +232 -0
  198. package/system/skills/pptx/editing.md +205 -0
  199. package/system/skills/pptx/pptxgenjs.md +420 -0
  200. package/system/skills/pptx/scripts/__init__.py +0 -0
  201. package/system/skills/pptx/scripts/add_slide.py +195 -0
  202. package/system/skills/pptx/scripts/clean.py +286 -0
  203. package/system/skills/pptx/scripts/office/helpers/__init__.py +0 -0
  204. package/system/skills/pptx/scripts/office/helpers/merge_runs.py +199 -0
  205. package/system/skills/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
  206. package/system/skills/pptx/scripts/office/pack.py +159 -0
  207. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  208. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  209. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  210. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  211. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  212. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  213. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  214. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  215. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  216. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  217. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  218. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  219. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  220. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  221. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  222. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  223. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  224. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  225. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  226. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  227. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  228. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  229. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  230. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  231. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  232. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  233. package/system/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  234. package/system/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  235. package/system/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  236. package/system/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  237. package/system/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  238. package/system/skills/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
  239. package/system/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  240. package/system/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  241. package/system/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  242. package/system/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  243. package/system/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  244. package/system/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  245. package/system/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  246. package/system/skills/pptx/scripts/office/soffice.py +183 -0
  247. package/system/skills/pptx/scripts/office/unpack.py +132 -0
  248. package/system/skills/pptx/scripts/office/validate.py +111 -0
  249. package/system/skills/pptx/scripts/office/validators/__init__.py +15 -0
  250. package/system/skills/pptx/scripts/office/validators/base.py +847 -0
  251. package/system/skills/pptx/scripts/office/validators/docx.py +446 -0
  252. package/system/skills/pptx/scripts/office/validators/pptx.py +275 -0
  253. package/system/skills/pptx/scripts/office/validators/redlining.py +247 -0
  254. package/system/skills/pptx/scripts/thumbnail.py +289 -0
  255. package/system/skills/scripts/quick-diff.sh +87 -0
  256. package/system/skills/scripts/save-results.sh +56 -0
  257. package/system/skills/scripts/scan.sh +170 -0
  258. package/system/skills/security-check/SKILL.md +70 -0
  259. package/system/skills/skill-creator/LICENSE.txt +202 -0
  260. package/system/skills/skill-creator/SKILL.md +479 -0
  261. package/system/skills/skill-creator/agents/analyzer.md +274 -0
  262. package/system/skills/skill-creator/agents/comparator.md +202 -0
  263. package/system/skills/skill-creator/agents/grader.md +223 -0
  264. package/system/skills/skill-creator/assets/eval_review.html +146 -0
  265. package/system/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  266. package/system/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  267. package/system/skills/skill-creator/references/schemas.md +430 -0
  268. package/system/skills/skill-creator/scripts/__init__.py +0 -0
  269. package/system/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  270. package/system/skills/skill-creator/scripts/generate_report.py +326 -0
  271. package/system/skills/skill-creator/scripts/improve_description.py +248 -0
  272. package/system/skills/skill-creator/scripts/package_skill.py +136 -0
  273. package/system/skills/skill-creator/scripts/quick_validate.py +103 -0
  274. package/system/skills/skill-creator/scripts/run_eval.py +310 -0
  275. package/system/skills/skill-creator/scripts/run_loop.py +332 -0
  276. package/system/skills/skill-creator/scripts/utils.py +47 -0
  277. package/system/skills/suggest-compact.sh +54 -0
  278. package/system/skills/supabase-migration/SKILL.md +59 -0
  279. package/system/skills/theme-factory/LICENSE.txt +202 -0
  280. package/system/skills/theme-factory/SKILL.md +59 -0
  281. package/system/skills/theme-factory/theme-showcase.pdf +0 -0
  282. package/system/skills/theme-factory/themes/arctic-frost.md +19 -0
  283. package/system/skills/theme-factory/themes/botanical-garden.md +19 -0
  284. package/system/skills/theme-factory/themes/desert-rose.md +19 -0
  285. package/system/skills/theme-factory/themes/forest-canopy.md +19 -0
  286. package/system/skills/theme-factory/themes/golden-hour.md +19 -0
  287. package/system/skills/theme-factory/themes/midnight-galaxy.md +19 -0
  288. package/system/skills/theme-factory/themes/modern-minimalist.md +19 -0
  289. package/system/skills/theme-factory/themes/ocean-depths.md +19 -0
  290. package/system/skills/theme-factory/themes/sunset-boulevard.md +19 -0
  291. package/system/skills/theme-factory/themes/tech-innovation.md +19 -0
  292. package/system/skills/web-artifacts-builder/LICENSE.txt +202 -0
  293. package/system/skills/web-artifacts-builder/SKILL.md +74 -0
  294. package/system/skills/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
  295. package/system/skills/web-artifacts-builder/scripts/init-artifact.sh +322 -0
  296. package/system/skills/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
  297. package/system/skills/webapp-testing/LICENSE.txt +202 -0
  298. package/system/skills/webapp-testing/SKILL.md +96 -0
  299. package/system/skills/webapp-testing/examples/console_logging.py +35 -0
  300. package/system/skills/webapp-testing/examples/element_discovery.py +40 -0
  301. package/system/skills/webapp-testing/examples/static_html_automation.py +33 -0
  302. package/system/skills/webapp-testing/scripts/with_server.py +106 -0
  303. package/system/skills/xlsx/LICENSE.txt +30 -0
  304. package/system/skills/xlsx/SKILL.md +292 -0
  305. package/system/skills/xlsx/scripts/office/helpers/__init__.py +0 -0
  306. package/system/skills/xlsx/scripts/office/helpers/merge_runs.py +199 -0
  307. package/system/skills/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
  308. package/system/skills/xlsx/scripts/office/pack.py +159 -0
  309. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  310. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  311. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  312. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  313. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  314. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  315. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  316. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  317. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  318. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  319. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  320. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  321. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  322. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  323. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  324. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  325. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  326. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  327. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  328. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  329. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  330. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  331. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  332. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  333. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  334. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  335. package/system/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  336. package/system/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  337. package/system/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  338. package/system/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  339. package/system/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  340. package/system/skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
  341. package/system/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  342. package/system/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  343. package/system/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  344. package/system/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  345. package/system/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  346. package/system/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  347. package/system/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  348. package/system/skills/xlsx/scripts/office/soffice.py +183 -0
  349. package/system/skills/xlsx/scripts/office/unpack.py +132 -0
  350. package/system/skills/xlsx/scripts/office/validate.py +111 -0
  351. package/system/skills/xlsx/scripts/office/validators/__init__.py +15 -0
  352. package/system/skills/xlsx/scripts/office/validators/base.py +847 -0
  353. package/system/skills/xlsx/scripts/office/validators/docx.py +446 -0
  354. package/system/skills/xlsx/scripts/office/validators/pptx.py +275 -0
  355. package/system/skills/xlsx/scripts/office/validators/redlining.py +247 -0
  356. package/system/skills/xlsx/scripts/recalc.py +184 -0
  357. package/system/teams/profiles.md +76 -0
  358. package/system/templates/CLAUDE.md.tmpl +6 -0
  359. package/system/templates/settings.json.tmpl +11 -0
@@ -0,0 +1,20 @@
1
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:s="http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" elementFormDefault="qualified" attributeFormDefault="qualified" blockDefault="#all" xmlns="http://schemas.microsoft.com/office/word/2018/wordml/cex" targetNamespace="http://schemas.microsoft.com/office/word/2018/wordml/cex">
2
+ <xsd:import id="w16" namespace="http://schemas.microsoft.com/office/word/2018/wordml" schemaLocation="wml-2018.xsd"/>
3
+ <xsd:import id="w" namespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main" schemaLocation="../ISO-IEC29500-4_2016/wml.xsd"/>
4
+ <xsd:import id="s" namespace="http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes" schemaLocation="../ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd"/>
5
+ <xsd:complexType name="CT_CommentsExtensible">
6
+ <xsd:sequence>
7
+ <xsd:element name="commentExtensible" type="CT_CommentExtensible" minOccurs="0" maxOccurs="unbounded"/>
8
+ <xsd:element name="extLst" type="w16:CT_ExtensionList" minOccurs="0" maxOccurs="1"/>
9
+ </xsd:sequence>
10
+ </xsd:complexType>
11
+ <xsd:complexType name="CT_CommentExtensible">
12
+ <xsd:sequence>
13
+ <xsd:element name="extLst" type="w16:CT_ExtensionList" minOccurs="0" maxOccurs="1"/>
14
+ </xsd:sequence>
15
+ <xsd:attribute name="durableId" type="w:ST_LongHexNumber" use="required"/>
16
+ <xsd:attribute name="dateUtc" type="w:ST_DateTime" use="optional"/>
17
+ <xsd:attribute name="intelligentPlaceholder" type="s:ST_OnOff" use="optional"/>
18
+ </xsd:complexType>
19
+ <xsd:element name="commentsExtensible" type="CT_CommentsExtensible"/>
20
+ </xsd:schema>
@@ -0,0 +1,13 @@
1
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:w12="http://schemas.openxmlformats.org/wordprocessingml/2006/main" elementFormDefault="qualified" attributeFormDefault="qualified" blockDefault="#all" xmlns="http://schemas.microsoft.com/office/word/2016/wordml/cid" targetNamespace="http://schemas.microsoft.com/office/word/2016/wordml/cid">
2
+ <xsd:import id="w12" namespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main" schemaLocation="../ISO-IEC29500-4_2016/wml.xsd"/>
3
+ <xsd:complexType name="CT_CommentsIds">
4
+ <xsd:sequence>
5
+ <xsd:element name="commentId" type="CT_CommentId" minOccurs="0" maxOccurs="unbounded"/>
6
+ </xsd:sequence>
7
+ </xsd:complexType>
8
+ <xsd:complexType name="CT_CommentId">
9
+ <xsd:attribute name="paraId" type="w12:ST_LongHexNumber" use="required"/>
10
+ <xsd:attribute name="durableId" type="w12:ST_LongHexNumber" use="required"/>
11
+ </xsd:complexType>
12
+ <xsd:element name="commentsIds" type="CT_CommentsIds"/>
13
+ </xsd:schema>
@@ -0,0 +1,4 @@
1
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:w12="http://schemas.openxmlformats.org/wordprocessingml/2006/main" elementFormDefault="qualified" attributeFormDefault="qualified" blockDefault="#all" xmlns="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" targetNamespace="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash">
2
+ <xsd:import id="w12" namespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main" schemaLocation="../ISO-IEC29500-4_2016/wml.xsd"/>
3
+ <xsd:attribute name="storeItemChecksum" type="w12:ST_String"/>
4
+ </xsd:schema>
@@ -0,0 +1,8 @@
1
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:w12="http://schemas.openxmlformats.org/wordprocessingml/2006/main" elementFormDefault="qualified" attributeFormDefault="qualified" blockDefault="#all" xmlns="http://schemas.microsoft.com/office/word/2015/wordml/symex" targetNamespace="http://schemas.microsoft.com/office/word/2015/wordml/symex">
2
+ <xsd:import id="w12" namespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main" schemaLocation="../ISO-IEC29500-4_2016/wml.xsd"/>
3
+ <xsd:complexType name="CT_SymEx">
4
+ <xsd:attribute name="font" type="w12:ST_String"/>
5
+ <xsd:attribute name="char" type="w12:ST_LongHexNumber"/>
6
+ </xsd:complexType>
7
+ <xsd:element name="symEx" type="CT_SymEx"/>
8
+ </xsd:schema>
@@ -0,0 +1,183 @@
1
+ """
2
+ Helper for running LibreOffice (soffice) in environments where AF_UNIX
3
+ sockets may be blocked (e.g., sandboxed VMs). Detects the restriction
4
+ at runtime and applies an LD_PRELOAD shim if needed.
5
+
6
+ Usage:
7
+ from office.soffice import run_soffice, get_soffice_env
8
+
9
+ # Option 1 – run soffice directly
10
+ result = run_soffice(["--headless", "--convert-to", "pdf", "input.docx"])
11
+
12
+ # Option 2 – get env dict for your own subprocess calls
13
+ env = get_soffice_env()
14
+ subprocess.run(["soffice", ...], env=env)
15
+ """
16
+
17
+ import os
18
+ import socket
19
+ import subprocess
20
+ import tempfile
21
+ from pathlib import Path
22
+
23
+
24
+ def get_soffice_env() -> dict:
25
+ env = os.environ.copy()
26
+ env["SAL_USE_VCLPLUGIN"] = "svp"
27
+
28
+ if _needs_shim():
29
+ shim = _ensure_shim()
30
+ env["LD_PRELOAD"] = str(shim)
31
+
32
+ return env
33
+
34
+
35
+ def run_soffice(args: list[str], **kwargs) -> subprocess.CompletedProcess:
36
+ env = get_soffice_env()
37
+ return subprocess.run(["soffice"] + args, env=env, **kwargs)
38
+
39
+
40
+
41
+ _SHIM_SO = Path(tempfile.gettempdir()) / "lo_socket_shim.so"
42
+
43
+
44
+ def _needs_shim() -> bool:
45
+ try:
46
+ s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
47
+ s.close()
48
+ return False
49
+ except OSError:
50
+ return True
51
+
52
+
53
+ def _ensure_shim() -> Path:
54
+ if _SHIM_SO.exists():
55
+ return _SHIM_SO
56
+
57
+ src = Path(tempfile.gettempdir()) / "lo_socket_shim.c"
58
+ src.write_text(_SHIM_SOURCE)
59
+ subprocess.run(
60
+ ["gcc", "-shared", "-fPIC", "-o", str(_SHIM_SO), str(src), "-ldl"],
61
+ check=True,
62
+ capture_output=True,
63
+ )
64
+ src.unlink()
65
+ return _SHIM_SO
66
+
67
+
68
+
69
+ _SHIM_SOURCE = r"""
70
+ #define _GNU_SOURCE
71
+ #include <dlfcn.h>
72
+ #include <errno.h>
73
+ #include <signal.h>
74
+ #include <stdio.h>
75
+ #include <stdlib.h>
76
+ #include <sys/socket.h>
77
+ #include <unistd.h>
78
+
79
+ static int (*real_socket)(int, int, int);
80
+ static int (*real_socketpair)(int, int, int, int[2]);
81
+ static int (*real_listen)(int, int);
82
+ static int (*real_accept)(int, struct sockaddr *, socklen_t *);
83
+ static int (*real_close)(int);
84
+ static int (*real_read)(int, void *, size_t);
85
+
86
+ /* Per-FD bookkeeping (FDs >= 1024 are passed through unshimmed). */
87
+ static int is_shimmed[1024];
88
+ static int peer_of[1024];
89
+ static int wake_r[1024]; /* accept() blocks reading this */
90
+ static int wake_w[1024]; /* close() writes to this */
91
+ static int listener_fd = -1; /* FD that received listen() */
92
+
93
+ __attribute__((constructor))
94
+ static void init(void) {
95
+ real_socket = dlsym(RTLD_NEXT, "socket");
96
+ real_socketpair = dlsym(RTLD_NEXT, "socketpair");
97
+ real_listen = dlsym(RTLD_NEXT, "listen");
98
+ real_accept = dlsym(RTLD_NEXT, "accept");
99
+ real_close = dlsym(RTLD_NEXT, "close");
100
+ real_read = dlsym(RTLD_NEXT, "read");
101
+ for (int i = 0; i < 1024; i++) {
102
+ peer_of[i] = -1;
103
+ wake_r[i] = -1;
104
+ wake_w[i] = -1;
105
+ }
106
+ }
107
+
108
+ /* ---- socket ---------------------------------------------------------- */
109
+ int socket(int domain, int type, int protocol) {
110
+ if (domain == AF_UNIX) {
111
+ int fd = real_socket(domain, type, protocol);
112
+ if (fd >= 0) return fd;
113
+ /* socket(AF_UNIX) blocked – fall back to socketpair(). */
114
+ int sv[2];
115
+ if (real_socketpair(domain, type, protocol, sv) == 0) {
116
+ if (sv[0] >= 0 && sv[0] < 1024) {
117
+ is_shimmed[sv[0]] = 1;
118
+ peer_of[sv[0]] = sv[1];
119
+ int wp[2];
120
+ if (pipe(wp) == 0) {
121
+ wake_r[sv[0]] = wp[0];
122
+ wake_w[sv[0]] = wp[1];
123
+ }
124
+ }
125
+ return sv[0];
126
+ }
127
+ errno = EPERM;
128
+ return -1;
129
+ }
130
+ return real_socket(domain, type, protocol);
131
+ }
132
+
133
+ /* ---- listen ---------------------------------------------------------- */
134
+ int listen(int sockfd, int backlog) {
135
+ if (sockfd >= 0 && sockfd < 1024 && is_shimmed[sockfd]) {
136
+ listener_fd = sockfd;
137
+ return 0;
138
+ }
139
+ return real_listen(sockfd, backlog);
140
+ }
141
+
142
+ /* ---- accept ---------------------------------------------------------- */
143
+ int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
144
+ if (sockfd >= 0 && sockfd < 1024 && is_shimmed[sockfd]) {
145
+ /* Block until close() writes to the wake pipe. */
146
+ if (wake_r[sockfd] >= 0) {
147
+ char buf;
148
+ real_read(wake_r[sockfd], &buf, 1);
149
+ }
150
+ errno = ECONNABORTED;
151
+ return -1;
152
+ }
153
+ return real_accept(sockfd, addr, addrlen);
154
+ }
155
+
156
+ /* ---- close ----------------------------------------------------------- */
157
+ int close(int fd) {
158
+ if (fd >= 0 && fd < 1024 && is_shimmed[fd]) {
159
+ int was_listener = (fd == listener_fd);
160
+ is_shimmed[fd] = 0;
161
+
162
+ if (wake_w[fd] >= 0) { /* unblock accept() */
163
+ char c = 0;
164
+ write(wake_w[fd], &c, 1);
165
+ real_close(wake_w[fd]);
166
+ wake_w[fd] = -1;
167
+ }
168
+ if (wake_r[fd] >= 0) { real_close(wake_r[fd]); wake_r[fd] = -1; }
169
+ if (peer_of[fd] >= 0) { real_close(peer_of[fd]); peer_of[fd] = -1; }
170
+
171
+ if (was_listener)
172
+ _exit(0); /* conversion done – exit */
173
+ }
174
+ return real_close(fd);
175
+ }
176
+ """
177
+
178
+
179
+
180
+ if __name__ == "__main__":
181
+ import sys
182
+ result = run_soffice(sys.argv[1:])
183
+ sys.exit(result.returncode)
@@ -0,0 +1,132 @@
1
+ """Unpack Office files (DOCX, PPTX, XLSX) for editing.
2
+
3
+ Extracts the ZIP archive, pretty-prints XML files, and optionally:
4
+ - Merges adjacent runs with identical formatting (DOCX only)
5
+ - Simplifies adjacent tracked changes from same author (DOCX only)
6
+
7
+ Usage:
8
+ python unpack.py <office_file> <output_dir> [options]
9
+
10
+ Examples:
11
+ python unpack.py document.docx unpacked/
12
+ python unpack.py presentation.pptx unpacked/
13
+ python unpack.py document.docx unpacked/ --merge-runs false
14
+ """
15
+
16
+ import argparse
17
+ import sys
18
+ import zipfile
19
+ from pathlib import Path
20
+
21
+ import defusedxml.minidom
22
+
23
+ from helpers.merge_runs import merge_runs as do_merge_runs
24
+ from helpers.simplify_redlines import simplify_redlines as do_simplify_redlines
25
+
26
+ SMART_QUOTE_REPLACEMENTS = {
27
+ "\u201c": "&#x201C;",
28
+ "\u201d": "&#x201D;",
29
+ "\u2018": "&#x2018;",
30
+ "\u2019": "&#x2019;",
31
+ }
32
+
33
+
34
+ def unpack(
35
+ input_file: str,
36
+ output_directory: str,
37
+ merge_runs: bool = True,
38
+ simplify_redlines: bool = True,
39
+ ) -> tuple[None, str]:
40
+ input_path = Path(input_file)
41
+ output_path = Path(output_directory)
42
+ suffix = input_path.suffix.lower()
43
+
44
+ if not input_path.exists():
45
+ return None, f"Error: {input_file} does not exist"
46
+
47
+ if suffix not in {".docx", ".pptx", ".xlsx"}:
48
+ return None, f"Error: {input_file} must be a .docx, .pptx, or .xlsx file"
49
+
50
+ try:
51
+ output_path.mkdir(parents=True, exist_ok=True)
52
+
53
+ with zipfile.ZipFile(input_path, "r") as zf:
54
+ zf.extractall(output_path)
55
+
56
+ xml_files = list(output_path.rglob("*.xml")) + list(output_path.rglob("*.rels"))
57
+ for xml_file in xml_files:
58
+ _pretty_print_xml(xml_file)
59
+
60
+ message = f"Unpacked {input_file} ({len(xml_files)} XML files)"
61
+
62
+ if suffix == ".docx":
63
+ if simplify_redlines:
64
+ simplify_count, _ = do_simplify_redlines(str(output_path))
65
+ message += f", simplified {simplify_count} tracked changes"
66
+
67
+ if merge_runs:
68
+ merge_count, _ = do_merge_runs(str(output_path))
69
+ message += f", merged {merge_count} runs"
70
+
71
+ for xml_file in xml_files:
72
+ _escape_smart_quotes(xml_file)
73
+
74
+ return None, message
75
+
76
+ except zipfile.BadZipFile:
77
+ return None, f"Error: {input_file} is not a valid Office file"
78
+ except Exception as e:
79
+ return None, f"Error unpacking: {e}"
80
+
81
+
82
+ def _pretty_print_xml(xml_file: Path) -> None:
83
+ try:
84
+ content = xml_file.read_text(encoding="utf-8")
85
+ dom = defusedxml.minidom.parseString(content)
86
+ xml_file.write_bytes(dom.toprettyxml(indent=" ", encoding="utf-8"))
87
+ except Exception:
88
+ pass
89
+
90
+
91
+ def _escape_smart_quotes(xml_file: Path) -> None:
92
+ try:
93
+ content = xml_file.read_text(encoding="utf-8")
94
+ for char, entity in SMART_QUOTE_REPLACEMENTS.items():
95
+ content = content.replace(char, entity)
96
+ xml_file.write_text(content, encoding="utf-8")
97
+ except Exception:
98
+ pass
99
+
100
+
101
+ if __name__ == "__main__":
102
+ parser = argparse.ArgumentParser(
103
+ description="Unpack an Office file (DOCX, PPTX, XLSX) for editing"
104
+ )
105
+ parser.add_argument("input_file", help="Office file to unpack")
106
+ parser.add_argument("output_directory", help="Output directory")
107
+ parser.add_argument(
108
+ "--merge-runs",
109
+ type=lambda x: x.lower() == "true",
110
+ default=True,
111
+ metavar="true|false",
112
+ help="Merge adjacent runs with identical formatting (DOCX only, default: true)",
113
+ )
114
+ parser.add_argument(
115
+ "--simplify-redlines",
116
+ type=lambda x: x.lower() == "true",
117
+ default=True,
118
+ metavar="true|false",
119
+ help="Merge adjacent tracked changes from same author (DOCX only, default: true)",
120
+ )
121
+ args = parser.parse_args()
122
+
123
+ _, message = unpack(
124
+ args.input_file,
125
+ args.output_directory,
126
+ merge_runs=args.merge_runs,
127
+ simplify_redlines=args.simplify_redlines,
128
+ )
129
+ print(message)
130
+
131
+ if "Error" in message:
132
+ sys.exit(1)
@@ -0,0 +1,111 @@
1
+ """
2
+ Command line tool to validate Office document XML files against XSD schemas and tracked changes.
3
+
4
+ Usage:
5
+ python validate.py <path> [--original <original_file>] [--auto-repair] [--author NAME]
6
+
7
+ The first argument can be either:
8
+ - An unpacked directory containing the Office document XML files
9
+ - A packed Office file (.docx/.pptx/.xlsx) which will be unpacked to a temp directory
10
+
11
+ Auto-repair fixes:
12
+ - paraId/durableId values that exceed OOXML limits
13
+ - Missing xml:space="preserve" on w:t elements with whitespace
14
+ """
15
+
16
+ import argparse
17
+ import sys
18
+ import tempfile
19
+ import zipfile
20
+ from pathlib import Path
21
+
22
+ from validators import DOCXSchemaValidator, PPTXSchemaValidator, RedliningValidator
23
+
24
+
25
+ def main():
26
+ parser = argparse.ArgumentParser(description="Validate Office document XML files")
27
+ parser.add_argument(
28
+ "path",
29
+ help="Path to unpacked directory or packed Office file (.docx/.pptx/.xlsx)",
30
+ )
31
+ parser.add_argument(
32
+ "--original",
33
+ required=False,
34
+ default=None,
35
+ help="Path to original file (.docx/.pptx/.xlsx). If omitted, all XSD errors are reported and redlining validation is skipped.",
36
+ )
37
+ parser.add_argument(
38
+ "-v",
39
+ "--verbose",
40
+ action="store_true",
41
+ help="Enable verbose output",
42
+ )
43
+ parser.add_argument(
44
+ "--auto-repair",
45
+ action="store_true",
46
+ help="Automatically repair common issues (hex IDs, whitespace preservation)",
47
+ )
48
+ parser.add_argument(
49
+ "--author",
50
+ default="Claude",
51
+ help="Author name for redlining validation (default: Claude)",
52
+ )
53
+ args = parser.parse_args()
54
+
55
+ path = Path(args.path)
56
+ assert path.exists(), f"Error: {path} does not exist"
57
+
58
+ original_file = None
59
+ if args.original:
60
+ original_file = Path(args.original)
61
+ assert original_file.is_file(), f"Error: {original_file} is not a file"
62
+ assert original_file.suffix.lower() in [".docx", ".pptx", ".xlsx"], (
63
+ f"Error: {original_file} must be a .docx, .pptx, or .xlsx file"
64
+ )
65
+
66
+ file_extension = (original_file or path).suffix.lower()
67
+ assert file_extension in [".docx", ".pptx", ".xlsx"], (
68
+ f"Error: Cannot determine file type from {path}. Use --original or provide a .docx/.pptx/.xlsx file."
69
+ )
70
+
71
+ if path.is_file() and path.suffix.lower() in [".docx", ".pptx", ".xlsx"]:
72
+ temp_dir = tempfile.mkdtemp()
73
+ with zipfile.ZipFile(path, "r") as zf:
74
+ zf.extractall(temp_dir)
75
+ unpacked_dir = Path(temp_dir)
76
+ else:
77
+ assert path.is_dir(), f"Error: {path} is not a directory or Office file"
78
+ unpacked_dir = path
79
+
80
+ match file_extension:
81
+ case ".docx":
82
+ validators = [
83
+ DOCXSchemaValidator(unpacked_dir, original_file, verbose=args.verbose),
84
+ ]
85
+ if original_file:
86
+ validators.append(
87
+ RedliningValidator(unpacked_dir, original_file, verbose=args.verbose, author=args.author)
88
+ )
89
+ case ".pptx":
90
+ validators = [
91
+ PPTXSchemaValidator(unpacked_dir, original_file, verbose=args.verbose),
92
+ ]
93
+ case _:
94
+ print(f"Error: Validation not supported for file type {file_extension}")
95
+ sys.exit(1)
96
+
97
+ if args.auto_repair:
98
+ total_repairs = sum(v.repair() for v in validators)
99
+ if total_repairs:
100
+ print(f"Auto-repaired {total_repairs} issue(s)")
101
+
102
+ success = all(v.validate() for v in validators)
103
+
104
+ if success:
105
+ print("All validations PASSED!")
106
+
107
+ sys.exit(0 if success else 1)
108
+
109
+
110
+ if __name__ == "__main__":
111
+ main()
@@ -0,0 +1,15 @@
1
+ """
2
+ Validation modules for Word document processing.
3
+ """
4
+
5
+ from .base import BaseSchemaValidator
6
+ from .docx import DOCXSchemaValidator
7
+ from .pptx import PPTXSchemaValidator
8
+ from .redlining import RedliningValidator
9
+
10
+ __all__ = [
11
+ "BaseSchemaValidator",
12
+ "DOCXSchemaValidator",
13
+ "PPTXSchemaValidator",
14
+ "RedliningValidator",
15
+ ]