@amrhas82/agentic-kit 1.0.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 (335) hide show
  1. package/.claude-plugin/plugin-lite.json +38 -0
  2. package/.claude-plugin/plugin-pro.json +183 -0
  3. package/.claude-plugin/plugin-standard.json +147 -0
  4. package/.claude-plugin/plugin.json +47 -0
  5. package/LICENSE +21 -0
  6. package/QUICK-START.md +318 -0
  7. package/README.md +449 -0
  8. package/TROUBLESHOOTING.md +788 -0
  9. package/VARIANTS.md +480 -0
  10. package/agents/1-create-prd.md +56 -0
  11. package/agents/2-generate-tasks.md +73 -0
  12. package/agents/3-process-task-list.md +101 -0
  13. package/agents/business-analyst.md +76 -0
  14. package/agents/full-stack-dev.md +80 -0
  15. package/agents/holistic-architect.md +91 -0
  16. package/agents/master.md +55 -0
  17. package/agents/orchestrator.md +103 -0
  18. package/agents/product-manager.md +82 -0
  19. package/agents/product-owner.md +97 -0
  20. package/agents/qa-test-architect.md +72 -0
  21. package/agents/scrum-master.md +64 -0
  22. package/agents/ux-expert.md +74 -0
  23. package/cli.js +230 -0
  24. package/hooks/register-agents.js +123 -0
  25. package/package.json +61 -0
  26. package/resources/agent-teams.yaml +50 -0
  27. package/resources/checklists.md +1724 -0
  28. package/resources/data.md +1372 -0
  29. package/resources/task-briefs.md +4428 -0
  30. package/resources/templates.yaml +5634 -0
  31. package/resources/workflows.yaml +1253 -0
  32. package/skills/algorithmic-art/LICENSE.txt +202 -0
  33. package/skills/algorithmic-art/SKILL.md +405 -0
  34. package/skills/algorithmic-art/templates/generator_template.js +223 -0
  35. package/skills/algorithmic-art/templates/viewer.html +599 -0
  36. package/skills/artifacts-builder/LICENSE.txt +202 -0
  37. package/skills/artifacts-builder/SKILL.md +74 -0
  38. package/skills/artifacts-builder/scripts/bundle-artifact.sh +54 -0
  39. package/skills/artifacts-builder/scripts/init-artifact.sh +322 -0
  40. package/skills/artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
  41. package/skills/brainstorming/SKILL.md +54 -0
  42. package/skills/brand-guidelines/LICENSE.txt +202 -0
  43. package/skills/brand-guidelines/SKILL.md +73 -0
  44. package/skills/canvas-design/LICENSE.txt +202 -0
  45. package/skills/canvas-design/SKILL.md +130 -0
  46. package/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
  47. package/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
  48. package/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
  49. package/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
  50. package/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
  51. package/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
  52. package/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
  53. package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  54. package/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
  55. package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  56. package/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
  57. package/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
  58. package/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
  59. package/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
  60. package/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
  61. package/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
  62. package/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
  63. package/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
  64. package/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
  65. package/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
  66. package/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
  67. package/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
  68. package/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
  69. package/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
  70. package/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
  71. package/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
  72. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
  73. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
  74. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
  75. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
  76. package/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  77. package/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  78. package/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  79. package/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
  80. package/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  81. package/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  82. package/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  83. package/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
  84. package/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
  85. package/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  86. package/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
  87. package/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  88. package/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
  89. package/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
  90. package/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
  91. package/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
  92. package/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
  93. package/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  94. package/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  95. package/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  96. package/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
  97. package/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  98. package/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
  99. package/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
  100. package/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
  101. package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
  102. package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  103. package/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  104. package/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
  105. package/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  106. package/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
  107. package/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
  108. package/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
  109. package/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
  110. package/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
  111. package/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
  112. package/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
  113. package/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
  114. package/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
  115. package/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
  116. package/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
  117. package/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  118. package/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
  119. package/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  120. package/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
  121. package/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
  122. package/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
  123. package/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
  124. package/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
  125. package/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
  126. package/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  127. package/skills/code-review/SKILL.md +105 -0
  128. package/skills/code-review/code-reviewer.md +146 -0
  129. package/skills/condition-based-waiting/SKILL.md +120 -0
  130. package/skills/condition-based-waiting/example.ts +158 -0
  131. package/skills/docx/LICENSE.txt +30 -0
  132. package/skills/docx/SKILL.md +197 -0
  133. package/skills/docx/docx-js.md +350 -0
  134. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  135. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  136. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  137. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  138. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  139. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  140. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  141. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  142. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  143. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  144. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  145. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  146. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  147. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  148. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  149. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  150. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  151. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  152. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  153. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  154. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  155. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  156. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  157. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  158. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  159. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  160. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  161. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  162. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  163. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  164. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  165. package/skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
  166. package/skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  167. package/skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  168. package/skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  169. package/skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  170. package/skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  171. package/skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  172. package/skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  173. package/skills/docx/ooxml/scripts/pack.py +159 -0
  174. package/skills/docx/ooxml/scripts/unpack.py +29 -0
  175. package/skills/docx/ooxml/scripts/validate.py +69 -0
  176. package/skills/docx/ooxml/scripts/validation/__init__.py +15 -0
  177. package/skills/docx/ooxml/scripts/validation/base.py +951 -0
  178. package/skills/docx/ooxml/scripts/validation/docx.py +274 -0
  179. package/skills/docx/ooxml/scripts/validation/pptx.py +315 -0
  180. package/skills/docx/ooxml/scripts/validation/redlining.py +279 -0
  181. package/skills/docx/ooxml.md +610 -0
  182. package/skills/docx/scripts/__init__.py +1 -0
  183. package/skills/docx/scripts/document.py +1276 -0
  184. package/skills/docx/scripts/templates/comments.xml +3 -0
  185. package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  186. package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  187. package/skills/docx/scripts/templates/commentsIds.xml +3 -0
  188. package/skills/docx/scripts/templates/people.xml +3 -0
  189. package/skills/docx/scripts/utilities.py +374 -0
  190. package/skills/internal-comms/LICENSE.txt +202 -0
  191. package/skills/internal-comms/SKILL.md +32 -0
  192. package/skills/internal-comms/examples/3p-updates.md +47 -0
  193. package/skills/internal-comms/examples/company-newsletter.md +65 -0
  194. package/skills/internal-comms/examples/faq-answers.md +30 -0
  195. package/skills/internal-comms/examples/general-comms.md +16 -0
  196. package/skills/mcp-builder/LICENSE.txt +202 -0
  197. package/skills/mcp-builder/SKILL.md +328 -0
  198. package/skills/mcp-builder/reference/evaluation.md +602 -0
  199. package/skills/mcp-builder/reference/mcp_best_practices.md +915 -0
  200. package/skills/mcp-builder/reference/node_mcp_server.md +916 -0
  201. package/skills/mcp-builder/reference/python_mcp_server.md +752 -0
  202. package/skills/mcp-builder/scripts/connections.py +151 -0
  203. package/skills/mcp-builder/scripts/evaluation.py +373 -0
  204. package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  205. package/skills/mcp-builder/scripts/requirements.txt +2 -0
  206. package/skills/pdf/LICENSE.txt +30 -0
  207. package/skills/pdf/SKILL.md +294 -0
  208. package/skills/pdf/forms.md +205 -0
  209. package/skills/pdf/reference.md +612 -0
  210. package/skills/pdf/scripts/check_bounding_boxes.py +70 -0
  211. package/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
  212. package/skills/pdf/scripts/check_fillable_fields.py +12 -0
  213. package/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
  214. package/skills/pdf/scripts/create_validation_image.py +41 -0
  215. package/skills/pdf/scripts/extract_form_field_info.py +152 -0
  216. package/skills/pdf/scripts/fill_fillable_fields.py +114 -0
  217. package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
  218. package/skills/pptx/LICENSE.txt +30 -0
  219. package/skills/pptx/SKILL.md +484 -0
  220. package/skills/pptx/html2pptx.md +625 -0
  221. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  222. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  223. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  224. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  225. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  226. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  227. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  228. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  229. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  230. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  231. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  232. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  233. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  234. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  235. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  236. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  237. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  238. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  239. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  240. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  241. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  242. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  243. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  244. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  245. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  246. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  247. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  248. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  249. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  250. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  251. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  252. package/skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
  253. package/skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  254. package/skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  255. package/skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  256. package/skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  257. package/skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  258. package/skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  259. package/skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  260. package/skills/pptx/ooxml/scripts/pack.py +159 -0
  261. package/skills/pptx/ooxml/scripts/unpack.py +29 -0
  262. package/skills/pptx/ooxml/scripts/validate.py +69 -0
  263. package/skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
  264. package/skills/pptx/ooxml/scripts/validation/base.py +951 -0
  265. package/skills/pptx/ooxml/scripts/validation/docx.py +274 -0
  266. package/skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
  267. package/skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
  268. package/skills/pptx/ooxml.md +427 -0
  269. package/skills/pptx/scripts/html2pptx.js +979 -0
  270. package/skills/pptx/scripts/inventory.py +1020 -0
  271. package/skills/pptx/scripts/rearrange.py +231 -0
  272. package/skills/pptx/scripts/replace.py +385 -0
  273. package/skills/pptx/scripts/thumbnail.py +450 -0
  274. package/skills/root-cause-tracing/SKILL.md +174 -0
  275. package/skills/root-cause-tracing/find-polluter.sh +63 -0
  276. package/skills/skill-creator/LICENSE.txt +202 -0
  277. package/skills/skill-creator/SKILL.md +209 -0
  278. package/skills/skill-creator/scripts/init_skill.py +303 -0
  279. package/skills/skill-creator/scripts/package_skill.py +110 -0
  280. package/skills/skill-creator/scripts/quick_validate.py +65 -0
  281. package/skills/slack-gif-creator/LICENSE.txt +202 -0
  282. package/skills/slack-gif-creator/SKILL.md +646 -0
  283. package/skills/slack-gif-creator/core/color_palettes.py +302 -0
  284. package/skills/slack-gif-creator/core/easing.py +230 -0
  285. package/skills/slack-gif-creator/core/frame_composer.py +469 -0
  286. package/skills/slack-gif-creator/core/gif_builder.py +246 -0
  287. package/skills/slack-gif-creator/core/typography.py +357 -0
  288. package/skills/slack-gif-creator/core/validators.py +264 -0
  289. package/skills/slack-gif-creator/core/visual_effects.py +494 -0
  290. package/skills/slack-gif-creator/requirements.txt +4 -0
  291. package/skills/slack-gif-creator/templates/bounce.py +106 -0
  292. package/skills/slack-gif-creator/templates/explode.py +331 -0
  293. package/skills/slack-gif-creator/templates/fade.py +329 -0
  294. package/skills/slack-gif-creator/templates/flip.py +291 -0
  295. package/skills/slack-gif-creator/templates/kaleidoscope.py +211 -0
  296. package/skills/slack-gif-creator/templates/morph.py +329 -0
  297. package/skills/slack-gif-creator/templates/move.py +293 -0
  298. package/skills/slack-gif-creator/templates/pulse.py +268 -0
  299. package/skills/slack-gif-creator/templates/shake.py +127 -0
  300. package/skills/slack-gif-creator/templates/slide.py +291 -0
  301. package/skills/slack-gif-creator/templates/spin.py +269 -0
  302. package/skills/slack-gif-creator/templates/wiggle.py +300 -0
  303. package/skills/slack-gif-creator/templates/zoom.py +312 -0
  304. package/skills/systematic-debugging/CREATION-LOG.md +119 -0
  305. package/skills/systematic-debugging/SKILL.md +295 -0
  306. package/skills/systematic-debugging/test-academic.md +14 -0
  307. package/skills/systematic-debugging/test-pressure-1.md +58 -0
  308. package/skills/systematic-debugging/test-pressure-2.md +68 -0
  309. package/skills/systematic-debugging/test-pressure-3.md +69 -0
  310. package/skills/test-driven-development/SKILL.md +364 -0
  311. package/skills/testing-anti-patterns/SKILL.md +302 -0
  312. package/skills/theme-factory/LICENSE.txt +202 -0
  313. package/skills/theme-factory/SKILL.md +59 -0
  314. package/skills/theme-factory/theme-showcase.pdf +0 -0
  315. package/skills/theme-factory/themes/arctic-frost.md +19 -0
  316. package/skills/theme-factory/themes/botanical-garden.md +19 -0
  317. package/skills/theme-factory/themes/desert-rose.md +19 -0
  318. package/skills/theme-factory/themes/forest-canopy.md +19 -0
  319. package/skills/theme-factory/themes/golden-hour.md +19 -0
  320. package/skills/theme-factory/themes/midnight-galaxy.md +19 -0
  321. package/skills/theme-factory/themes/modern-minimalist.md +19 -0
  322. package/skills/theme-factory/themes/ocean-depths.md +19 -0
  323. package/skills/theme-factory/themes/sunset-boulevard.md +19 -0
  324. package/skills/theme-factory/themes/tech-innovation.md +19 -0
  325. package/skills/verification-before-completion/SKILL.md +139 -0
  326. package/skills/webapp-testing/LICENSE.txt +202 -0
  327. package/skills/webapp-testing/SKILL.md +96 -0
  328. package/skills/webapp-testing/examples/console_logging.py +35 -0
  329. package/skills/webapp-testing/examples/element_discovery.py +40 -0
  330. package/skills/webapp-testing/examples/static_html_automation.py +33 -0
  331. package/skills/webapp-testing/scripts/with_server.py +106 -0
  332. package/skills/xlsx/LICENSE.txt +30 -0
  333. package/skills/xlsx/SKILL.md +289 -0
  334. package/skills/xlsx/recalc.py +178 -0
  335. package/validate-references.sh +86 -0
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: condition-based-waiting
3
+ description: Use when tests have race conditions, timing dependencies, or inconsistent pass/fail behavior - replaces arbitrary timeouts with condition polling to wait for actual state changes, eliminating flaky tests from timing guesses
4
+ ---
5
+
6
+ # Condition-Based Waiting
7
+
8
+ ## Overview
9
+
10
+ Flaky tests often guess at timing with arbitrary delays. This creates race conditions where tests pass on fast machines but fail under load or in CI.
11
+
12
+ **Core principle:** Wait for the actual condition you care about, not a guess about how long it takes.
13
+
14
+ ## When to Use
15
+
16
+ ```dot
17
+ digraph when_to_use {
18
+ "Test uses setTimeout/sleep?" [shape=diamond];
19
+ "Testing timing behavior?" [shape=diamond];
20
+ "Document WHY timeout needed" [shape=box];
21
+ "Use condition-based waiting" [shape=box];
22
+
23
+ "Test uses setTimeout/sleep?" -> "Testing timing behavior?" [label="yes"];
24
+ "Testing timing behavior?" -> "Document WHY timeout needed" [label="yes"];
25
+ "Testing timing behavior?" -> "Use condition-based waiting" [label="no"];
26
+ }
27
+ ```
28
+
29
+ **Use when:**
30
+ - Tests have arbitrary delays (`setTimeout`, `sleep`, `time.sleep()`)
31
+ - Tests are flaky (pass sometimes, fail under load)
32
+ - Tests timeout when run in parallel
33
+ - Waiting for async operations to complete
34
+
35
+ **Don't use when:**
36
+ - Testing actual timing behavior (debounce, throttle intervals)
37
+ - Always document WHY if using arbitrary timeout
38
+
39
+ ## Core Pattern
40
+
41
+ ```typescript
42
+ // ❌ BEFORE: Guessing at timing
43
+ await new Promise(r => setTimeout(r, 50));
44
+ const result = getResult();
45
+ expect(result).toBeDefined();
46
+
47
+ // ✅ AFTER: Waiting for condition
48
+ await waitFor(() => getResult() !== undefined);
49
+ const result = getResult();
50
+ expect(result).toBeDefined();
51
+ ```
52
+
53
+ ## Quick Patterns
54
+
55
+ | Scenario | Pattern |
56
+ |----------|---------|
57
+ | Wait for event | `waitFor(() => events.find(e => e.type === 'DONE'))` |
58
+ | Wait for state | `waitFor(() => machine.state === 'ready')` |
59
+ | Wait for count | `waitFor(() => items.length >= 5)` |
60
+ | Wait for file | `waitFor(() => fs.existsSync(path))` |
61
+ | Complex condition | `waitFor(() => obj.ready && obj.value > 10)` |
62
+
63
+ ## Implementation
64
+
65
+ Generic polling function:
66
+ ```typescript
67
+ async function waitFor<T>(
68
+ condition: () => T | undefined | null | false,
69
+ description: string,
70
+ timeoutMs = 5000
71
+ ): Promise<T> {
72
+ const startTime = Date.now();
73
+
74
+ while (true) {
75
+ const result = condition();
76
+ if (result) return result;
77
+
78
+ if (Date.now() - startTime > timeoutMs) {
79
+ throw new Error(`Timeout waiting for ${description} after ${timeoutMs}ms`);
80
+ }
81
+
82
+ await new Promise(r => setTimeout(r, 10)); // Poll every 10ms
83
+ }
84
+ }
85
+ ```
86
+
87
+ See @example.ts for complete implementation with domain-specific helpers (`waitForEvent`, `waitForEventCount`, `waitForEventMatch`) from actual debugging session.
88
+
89
+ ## Common Mistakes
90
+
91
+ **❌ Polling too fast:** `setTimeout(check, 1)` - wastes CPU
92
+ **✅ Fix:** Poll every 10ms
93
+
94
+ **❌ No timeout:** Loop forever if condition never met
95
+ **✅ Fix:** Always include timeout with clear error
96
+
97
+ **❌ Stale data:** Cache state before loop
98
+ **✅ Fix:** Call getter inside loop for fresh data
99
+
100
+ ## When Arbitrary Timeout IS Correct
101
+
102
+ ```typescript
103
+ // Tool ticks every 100ms - need 2 ticks to verify partial output
104
+ await waitForEvent(manager, 'TOOL_STARTED'); // First: wait for condition
105
+ await new Promise(r => setTimeout(r, 200)); // Then: wait for timed behavior
106
+ // 200ms = 2 ticks at 100ms intervals - documented and justified
107
+ ```
108
+
109
+ **Requirements:**
110
+ 1. First wait for triggering condition
111
+ 2. Based on known timing (not guessing)
112
+ 3. Comment explaining WHY
113
+
114
+ ## Real-World Impact
115
+
116
+ From debugging session (2025-10-03):
117
+ - Fixed 15 flaky tests across 3 files
118
+ - Pass rate: 60% → 100%
119
+ - Execution time: 40% faster
120
+ - No more race conditions
@@ -0,0 +1,158 @@
1
+ // Complete implementation of condition-based waiting utilities
2
+ // From: Lace test infrastructure improvements (2025-10-03)
3
+ // Context: Fixed 15 flaky tests by replacing arbitrary timeouts
4
+
5
+ import type { ThreadManager } from '~/threads/thread-manager';
6
+ import type { LaceEvent, LaceEventType } from '~/threads/types';
7
+
8
+ /**
9
+ * Wait for a specific event type to appear in thread
10
+ *
11
+ * @param threadManager - The thread manager to query
12
+ * @param threadId - Thread to check for events
13
+ * @param eventType - Type of event to wait for
14
+ * @param timeoutMs - Maximum time to wait (default 5000ms)
15
+ * @returns Promise resolving to the first matching event
16
+ *
17
+ * Example:
18
+ * await waitForEvent(threadManager, agentThreadId, 'TOOL_RESULT');
19
+ */
20
+ export function waitForEvent(
21
+ threadManager: ThreadManager,
22
+ threadId: string,
23
+ eventType: LaceEventType,
24
+ timeoutMs = 5000
25
+ ): Promise<LaceEvent> {
26
+ return new Promise((resolve, reject) => {
27
+ const startTime = Date.now();
28
+
29
+ const check = () => {
30
+ const events = threadManager.getEvents(threadId);
31
+ const event = events.find((e) => e.type === eventType);
32
+
33
+ if (event) {
34
+ resolve(event);
35
+ } else if (Date.now() - startTime > timeoutMs) {
36
+ reject(new Error(`Timeout waiting for ${eventType} event after ${timeoutMs}ms`));
37
+ } else {
38
+ setTimeout(check, 10); // Poll every 10ms for efficiency
39
+ }
40
+ };
41
+
42
+ check();
43
+ });
44
+ }
45
+
46
+ /**
47
+ * Wait for a specific number of events of a given type
48
+ *
49
+ * @param threadManager - The thread manager to query
50
+ * @param threadId - Thread to check for events
51
+ * @param eventType - Type of event to wait for
52
+ * @param count - Number of events to wait for
53
+ * @param timeoutMs - Maximum time to wait (default 5000ms)
54
+ * @returns Promise resolving to all matching events once count is reached
55
+ *
56
+ * Example:
57
+ * // Wait for 2 AGENT_MESSAGE events (initial response + continuation)
58
+ * await waitForEventCount(threadManager, agentThreadId, 'AGENT_MESSAGE', 2);
59
+ */
60
+ export function waitForEventCount(
61
+ threadManager: ThreadManager,
62
+ threadId: string,
63
+ eventType: LaceEventType,
64
+ count: number,
65
+ timeoutMs = 5000
66
+ ): Promise<LaceEvent[]> {
67
+ return new Promise((resolve, reject) => {
68
+ const startTime = Date.now();
69
+
70
+ const check = () => {
71
+ const events = threadManager.getEvents(threadId);
72
+ const matchingEvents = events.filter((e) => e.type === eventType);
73
+
74
+ if (matchingEvents.length >= count) {
75
+ resolve(matchingEvents);
76
+ } else if (Date.now() - startTime > timeoutMs) {
77
+ reject(
78
+ new Error(
79
+ `Timeout waiting for ${count} ${eventType} events after ${timeoutMs}ms (got ${matchingEvents.length})`
80
+ )
81
+ );
82
+ } else {
83
+ setTimeout(check, 10);
84
+ }
85
+ };
86
+
87
+ check();
88
+ });
89
+ }
90
+
91
+ /**
92
+ * Wait for an event matching a custom predicate
93
+ * Useful when you need to check event data, not just type
94
+ *
95
+ * @param threadManager - The thread manager to query
96
+ * @param threadId - Thread to check for events
97
+ * @param predicate - Function that returns true when event matches
98
+ * @param description - Human-readable description for error messages
99
+ * @param timeoutMs - Maximum time to wait (default 5000ms)
100
+ * @returns Promise resolving to the first matching event
101
+ *
102
+ * Example:
103
+ * // Wait for TOOL_RESULT with specific ID
104
+ * await waitForEventMatch(
105
+ * threadManager,
106
+ * agentThreadId,
107
+ * (e) => e.type === 'TOOL_RESULT' && e.data.id === 'call_123',
108
+ * 'TOOL_RESULT with id=call_123'
109
+ * );
110
+ */
111
+ export function waitForEventMatch(
112
+ threadManager: ThreadManager,
113
+ threadId: string,
114
+ predicate: (event: LaceEvent) => boolean,
115
+ description: string,
116
+ timeoutMs = 5000
117
+ ): Promise<LaceEvent> {
118
+ return new Promise((resolve, reject) => {
119
+ const startTime = Date.now();
120
+
121
+ const check = () => {
122
+ const events = threadManager.getEvents(threadId);
123
+ const event = events.find(predicate);
124
+
125
+ if (event) {
126
+ resolve(event);
127
+ } else if (Date.now() - startTime > timeoutMs) {
128
+ reject(new Error(`Timeout waiting for ${description} after ${timeoutMs}ms`));
129
+ } else {
130
+ setTimeout(check, 10);
131
+ }
132
+ };
133
+
134
+ check();
135
+ });
136
+ }
137
+
138
+ // Usage example from actual debugging session:
139
+ //
140
+ // BEFORE (flaky):
141
+ // ---------------
142
+ // const messagePromise = agent.sendMessage('Execute tools');
143
+ // await new Promise(r => setTimeout(r, 300)); // Hope tools start in 300ms
144
+ // agent.abort();
145
+ // await messagePromise;
146
+ // await new Promise(r => setTimeout(r, 50)); // Hope results arrive in 50ms
147
+ // expect(toolResults.length).toBe(2); // Fails randomly
148
+ //
149
+ // AFTER (reliable):
150
+ // ----------------
151
+ // const messagePromise = agent.sendMessage('Execute tools');
152
+ // await waitForEventCount(threadManager, threadId, 'TOOL_CALL', 2); // Wait for tools to start
153
+ // agent.abort();
154
+ // await messagePromise;
155
+ // await waitForEventCount(threadManager, threadId, 'TOOL_RESULT', 2); // Wait for results
156
+ // expect(toolResults.length).toBe(2); // Always succeeds
157
+ //
158
+ // Result: 60% pass rate → 100%, 40% faster execution
@@ -0,0 +1,30 @@
1
+ © 2025 Anthropic, PBC. All rights reserved.
2
+
3
+ LICENSE: Use of these materials (including all code, prompts, assets, files,
4
+ and other components of this Skill) is governed by your agreement with
5
+ Anthropic regarding use of Anthropic's services. If no separate agreement
6
+ exists, use is governed by Anthropic's Consumer Terms of Service or
7
+ Commercial Terms of Service, as applicable:
8
+ https://www.anthropic.com/legal/consumer-terms
9
+ https://www.anthropic.com/legal/commercial-terms
10
+ Your applicable agreement is referred to as the "Agreement." "Services" are
11
+ as defined in the Agreement.
12
+
13
+ ADDITIONAL RESTRICTIONS: Notwithstanding anything in the Agreement to the
14
+ contrary, users may not:
15
+
16
+ - Extract these materials from the Services or retain copies of these
17
+ materials outside the Services
18
+ - Reproduce or copy these materials, except for temporary copies created
19
+ automatically during authorized use of the Services
20
+ - Create derivative works based on these materials
21
+ - Distribute, sublicense, or transfer these materials to any third party
22
+ - Make, offer to sell, sell, or import any inventions embodied in these
23
+ materials
24
+ - Reverse engineer, decompile, or disassemble these materials
25
+
26
+ The receipt, viewing, or possession of these materials does not convey or
27
+ imply any license or right beyond those expressly granted above.
28
+
29
+ Anthropic retains all right, title, and interest in these materials,
30
+ including all copyrights, patents, and other intellectual property rights.
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: docx
3
+ description: "Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks"
4
+ license: Proprietary. LICENSE.txt has complete terms
5
+ ---
6
+
7
+ # DOCX creation, editing, and analysis
8
+
9
+ ## Overview
10
+
11
+ A user may ask you to create, edit, or analyze the contents of a .docx file. A .docx file is essentially a ZIP archive containing XML files and other resources that you can read or edit. You have different tools and workflows available for different tasks.
12
+
13
+ ## Workflow Decision Tree
14
+
15
+ ### Reading/Analyzing Content
16
+ Use "Text extraction" or "Raw XML access" sections below
17
+
18
+ ### Creating New Document
19
+ Use "Creating a new Word document" workflow
20
+
21
+ ### Editing Existing Document
22
+ - **Your own document + simple changes**
23
+ Use "Basic OOXML editing" workflow
24
+
25
+ - **Someone else's document**
26
+ Use **"Redlining workflow"** (recommended default)
27
+
28
+ - **Legal, academic, business, or government docs**
29
+ Use **"Redlining workflow"** (required)
30
+
31
+ ## Reading and analyzing content
32
+
33
+ ### Text extraction
34
+ If you just need to read the text contents of a document, you should convert the document to markdown using pandoc. Pandoc provides excellent support for preserving document structure and can show tracked changes:
35
+
36
+ ```bash
37
+ # Convert document to markdown with tracked changes
38
+ pandoc --track-changes=all path-to-file.docx -o output.md
39
+ # Options: --track-changes=accept/reject/all
40
+ ```
41
+
42
+ ### Raw XML access
43
+ You need raw XML access for: comments, complex formatting, document structure, embedded media, and metadata. For any of these features, you'll need to unpack a document and read its raw XML contents.
44
+
45
+ #### Unpacking a file
46
+ `python ooxml/scripts/unpack.py <office_file> <output_directory>`
47
+
48
+ #### Key file structures
49
+ * `word/document.xml` - Main document contents
50
+ * `word/comments.xml` - Comments referenced in document.xml
51
+ * `word/media/` - Embedded images and media files
52
+ * Tracked changes use `<w:ins>` (insertions) and `<w:del>` (deletions) tags
53
+
54
+ ## Creating a new Word document
55
+
56
+ When creating a new Word document from scratch, use **docx-js**, which allows you to create Word documents using JavaScript/TypeScript.
57
+
58
+ ### Workflow
59
+ 1. **MANDATORY - READ ENTIRE FILE**: Read [`docx-js.md`](docx-js.md) (~500 lines) completely from start to finish. **NEVER set any range limits when reading this file.** Read the full file content for detailed syntax, critical formatting rules, and best practices before proceeding with document creation.
60
+ 2. Create a JavaScript/TypeScript file using Document, Paragraph, TextRun components (You can assume all dependencies are installed, but if not, refer to the dependencies section below)
61
+ 3. Export as .docx using Packer.toBuffer()
62
+
63
+ ## Editing an existing Word document
64
+
65
+ When editing an existing Word document, use the **Document library** (a Python library for OOXML manipulation). The library automatically handles infrastructure setup and provides methods for document manipulation. For complex scenarios, you can access the underlying DOM directly through the library.
66
+
67
+ ### Workflow
68
+ 1. **MANDATORY - READ ENTIRE FILE**: Read [`ooxml.md`](ooxml.md) (~600 lines) completely from start to finish. **NEVER set any range limits when reading this file.** Read the full file content for the Document library API and XML patterns for directly editing document files.
69
+ 2. Unpack the document: `python ooxml/scripts/unpack.py <office_file> <output_directory>`
70
+ 3. Create and run a Python script using the Document library (see "Document Library" section in ooxml.md)
71
+ 4. Pack the final document: `python ooxml/scripts/pack.py <input_directory> <office_file>`
72
+
73
+ The Document library provides both high-level methods for common operations and direct DOM access for complex scenarios.
74
+
75
+ ## Redlining workflow for document review
76
+
77
+ This workflow allows you to plan comprehensive tracked changes using markdown before implementing them in OOXML. **CRITICAL**: For complete tracked changes, you must implement ALL changes systematically.
78
+
79
+ **Batching Strategy**: Group related changes into batches of 3-10 changes. This makes debugging manageable while maintaining efficiency. Test each batch before moving to the next.
80
+
81
+ **Principle: Minimal, Precise Edits**
82
+ When implementing tracked changes, only mark text that actually changes. Repeating unchanged text makes edits harder to review and appears unprofessional. Break replacements into: [unchanged text] + [deletion] + [insertion] + [unchanged text]. Preserve the original run's RSID for unchanged text by extracting the `<w:r>` element from the original and reusing it.
83
+
84
+ Example - Changing "30 days" to "60 days" in a sentence:
85
+ ```python
86
+ # BAD - Replaces entire sentence
87
+ '<w:del><w:r><w:delText>The term is 30 days.</w:delText></w:r></w:del><w:ins><w:r><w:t>The term is 60 days.</w:t></w:r></w:ins>'
88
+
89
+ # GOOD - Only marks what changed, preserves original <w:r> for unchanged text
90
+ '<w:r w:rsidR="00AB12CD"><w:t>The term is </w:t></w:r><w:del><w:r><w:delText>30</w:delText></w:r></w:del><w:ins><w:r><w:t>60</w:t></w:r></w:ins><w:r w:rsidR="00AB12CD"><w:t> days.</w:t></w:r>'
91
+ ```
92
+
93
+ ### Tracked changes workflow
94
+
95
+ 1. **Get markdown representation**: Convert document to markdown with tracked changes preserved:
96
+ ```bash
97
+ pandoc --track-changes=all path-to-file.docx -o current.md
98
+ ```
99
+
100
+ 2. **Identify and group changes**: Review the document and identify ALL changes needed, organizing them into logical batches:
101
+
102
+ **Location methods** (for finding changes in XML):
103
+ - Section/heading numbers (e.g., "Section 3.2", "Article IV")
104
+ - Paragraph identifiers if numbered
105
+ - Grep patterns with unique surrounding text
106
+ - Document structure (e.g., "first paragraph", "signature block")
107
+ - **DO NOT use markdown line numbers** - they don't map to XML structure
108
+
109
+ **Batch organization** (group 3-10 related changes per batch):
110
+ - By section: "Batch 1: Section 2 amendments", "Batch 2: Section 5 updates"
111
+ - By type: "Batch 1: Date corrections", "Batch 2: Party name changes"
112
+ - By complexity: Start with simple text replacements, then tackle complex structural changes
113
+ - Sequential: "Batch 1: Pages 1-3", "Batch 2: Pages 4-6"
114
+
115
+ 3. **Read documentation and unpack**:
116
+ - **MANDATORY - READ ENTIRE FILE**: Read [`ooxml.md`](ooxml.md) (~600 lines) completely from start to finish. **NEVER set any range limits when reading this file.** Pay special attention to the "Document Library" and "Tracked Change Patterns" sections.
117
+ - **Unpack the document**: `python ooxml/scripts/unpack.py <file.docx> <dir>`
118
+ - **Note the suggested RSID**: The unpack script will suggest an RSID to use for your tracked changes. Copy this RSID for use in step 4b.
119
+
120
+ 4. **Implement changes in batches**: Group changes logically (by section, by type, or by proximity) and implement them together in a single script. This approach:
121
+ - Makes debugging easier (smaller batch = easier to isolate errors)
122
+ - Allows incremental progress
123
+ - Maintains efficiency (batch size of 3-10 changes works well)
124
+
125
+ **Suggested batch groupings:**
126
+ - By document section (e.g., "Section 3 changes", "Definitions", "Termination clause")
127
+ - By change type (e.g., "Date changes", "Party name updates", "Legal term replacements")
128
+ - By proximity (e.g., "Changes on pages 1-3", "Changes in first half of document")
129
+
130
+ For each batch of related changes:
131
+
132
+ **a. Map text to XML**: Grep for text in `word/document.xml` to verify how text is split across `<w:r>` elements.
133
+
134
+ **b. Create and run script**: Use `get_node` to find nodes, implement changes, then `doc.save()`. See **"Document Library"** section in ooxml.md for patterns.
135
+
136
+ **Note**: Always grep `word/document.xml` immediately before writing a script to get current line numbers and verify text content. Line numbers change after each script run.
137
+
138
+ 5. **Pack the document**: After all batches are complete, convert the unpacked directory back to .docx:
139
+ ```bash
140
+ python ooxml/scripts/pack.py unpacked reviewed-document.docx
141
+ ```
142
+
143
+ 6. **Final verification**: Do a comprehensive check of the complete document:
144
+ - Convert final document to markdown:
145
+ ```bash
146
+ pandoc --track-changes=all reviewed-document.docx -o verification.md
147
+ ```
148
+ - Verify ALL changes were applied correctly:
149
+ ```bash
150
+ grep "original phrase" verification.md # Should NOT find it
151
+ grep "replacement phrase" verification.md # Should find it
152
+ ```
153
+ - Check that no unintended changes were introduced
154
+
155
+
156
+ ## Converting Documents to Images
157
+
158
+ To visually analyze Word documents, convert them to images using a two-step process:
159
+
160
+ 1. **Convert DOCX to PDF**:
161
+ ```bash
162
+ soffice --headless --convert-to pdf document.docx
163
+ ```
164
+
165
+ 2. **Convert PDF pages to JPEG images**:
166
+ ```bash
167
+ pdftoppm -jpeg -r 150 document.pdf page
168
+ ```
169
+ This creates files like `page-1.jpg`, `page-2.jpg`, etc.
170
+
171
+ Options:
172
+ - `-r 150`: Sets resolution to 150 DPI (adjust for quality/size balance)
173
+ - `-jpeg`: Output JPEG format (use `-png` for PNG if preferred)
174
+ - `-f N`: First page to convert (e.g., `-f 2` starts from page 2)
175
+ - `-l N`: Last page to convert (e.g., `-l 5` stops at page 5)
176
+ - `page`: Prefix for output files
177
+
178
+ Example for specific range:
179
+ ```bash
180
+ pdftoppm -jpeg -r 150 -f 2 -l 5 document.pdf page # Converts only pages 2-5
181
+ ```
182
+
183
+ ## Code Style Guidelines
184
+ **IMPORTANT**: When generating code for DOCX operations:
185
+ - Write concise code
186
+ - Avoid verbose variable names and redundant operations
187
+ - Avoid unnecessary print statements
188
+
189
+ ## Dependencies
190
+
191
+ Required dependencies (install if not available):
192
+
193
+ - **pandoc**: `sudo apt-get install pandoc` (for text extraction)
194
+ - **docx**: `npm install -g docx` (for creating new documents)
195
+ - **LibreOffice**: `sudo apt-get install libreoffice` (for PDF conversion)
196
+ - **Poppler**: `sudo apt-get install poppler-utils` (for pdftoppm to convert PDF to images)
197
+ - **defusedxml**: `pip install defusedxml` (for secure XML parsing)