@kolbo/kolbo-code-linux-arm64-musl 1.1.73 → 2.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 (239) hide show
  1. package/bin/kolbo +0 -0
  2. package/package.json +1 -1
  3. package/skills/brainstorming/SKILL.md +164 -0
  4. package/skills/brainstorming/scripts/frame-template.html +214 -0
  5. package/skills/brainstorming/scripts/helper.js +88 -0
  6. package/skills/brainstorming/scripts/server.cjs +354 -0
  7. package/skills/brainstorming/scripts/start-server.sh +148 -0
  8. package/skills/brainstorming/scripts/stop-server.sh +56 -0
  9. package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  10. package/skills/brainstorming/visual-companion.md +287 -0
  11. package/skills/dispatching-parallel-agents/SKILL.md +182 -0
  12. package/skills/docx/.skillfish.json +10 -0
  13. package/skills/docx/SKILL.md +196 -0
  14. package/skills/docx/docx-js.md +350 -0
  15. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  16. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  17. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  18. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  19. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  20. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  21. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  22. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  23. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  24. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  25. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  26. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  27. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  28. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  29. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  30. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  31. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  32. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  33. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  34. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  35. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  36. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  37. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  38. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  39. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  40. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  41. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  42. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  43. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  44. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  45. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  46. package/skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
  47. package/skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  48. package/skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  49. package/skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  50. package/skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  51. package/skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  52. package/skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  53. package/skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  54. package/skills/docx/ooxml/scripts/pack.py +159 -0
  55. package/skills/docx/ooxml/scripts/unpack.py +29 -0
  56. package/skills/docx/ooxml/scripts/validate.py +69 -0
  57. package/skills/docx/ooxml/scripts/validation/__init__.py +15 -0
  58. package/skills/docx/ooxml/scripts/validation/base.py +951 -0
  59. package/skills/docx/ooxml/scripts/validation/docx.py +274 -0
  60. package/skills/docx/ooxml/scripts/validation/pptx.py +315 -0
  61. package/skills/docx/ooxml/scripts/validation/redlining.py +279 -0
  62. package/skills/docx/ooxml.md +599 -0
  63. package/skills/docx/scripts/__init__.py +1 -0
  64. package/skills/docx/scripts/document.py +1272 -0
  65. package/skills/docx/scripts/templates/comments.xml +3 -0
  66. package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  67. package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  68. package/skills/docx/scripts/templates/commentsIds.xml +3 -0
  69. package/skills/docx/scripts/templates/people.xml +3 -0
  70. package/skills/docx/scripts/utilities.py +374 -0
  71. package/skills/executing-plans/SKILL.md +70 -0
  72. package/skills/finishing-a-development-branch/SKILL.md +200 -0
  73. package/skills/fullstack-app/SKILL.md +621 -0
  74. package/skills/kolbo/SKILL.md +19 -263
  75. package/skills/ollama-vision/SKILL.md +105 -0
  76. package/skills/pdf/.skillfish.json +10 -0
  77. package/skills/pdf/FORMS.md +205 -0
  78. package/skills/pdf/REFERENCE.md +612 -0
  79. package/skills/pdf/SKILL.md +293 -0
  80. package/skills/pdf/scripts/check_bounding_boxes.py +70 -0
  81. package/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
  82. package/skills/pdf/scripts/check_fillable_fields.py +12 -0
  83. package/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
  84. package/skills/pdf/scripts/create_validation_image.py +41 -0
  85. package/skills/pdf/scripts/extract_form_field_info.py +152 -0
  86. package/skills/pdf/scripts/fill_fillable_fields.py +114 -0
  87. package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
  88. package/skills/photo-studio/SKILL.md +122 -0
  89. package/skills/pptx/.skillfish.json +10 -0
  90. package/skills/pptx/SKILL.md +483 -0
  91. package/skills/pptx/html2pptx.md +626 -0
  92. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  93. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  94. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  95. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  96. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  97. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  98. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  99. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  100. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  101. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  102. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  103. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  104. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  105. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  106. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  107. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  108. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  109. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  110. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  111. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  112. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  113. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  114. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  115. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  116. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  117. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  118. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  119. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  120. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  121. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  122. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  123. package/skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
  124. package/skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  125. package/skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  126. package/skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  127. package/skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  128. package/skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  129. package/skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  130. package/skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  131. package/skills/pptx/ooxml/scripts/pack.py +159 -0
  132. package/skills/pptx/ooxml/scripts/unpack.py +29 -0
  133. package/skills/pptx/ooxml/scripts/validate.py +69 -0
  134. package/skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
  135. package/skills/pptx/ooxml/scripts/validation/base.py +951 -0
  136. package/skills/pptx/ooxml/scripts/validation/docx.py +274 -0
  137. package/skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
  138. package/skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
  139. package/skills/pptx/ooxml.md +427 -0
  140. package/skills/pptx/scripts/html2pptx.js +995 -0
  141. package/skills/pptx/scripts/inventory.py +1020 -0
  142. package/skills/pptx/scripts/rearrange.py +231 -0
  143. package/skills/pptx/scripts/replace.py +385 -0
  144. package/skills/pptx/scripts/thumbnail.py +450 -0
  145. package/skills/receiving-code-review/SKILL.md +213 -0
  146. package/skills/requesting-code-review/SKILL.md +105 -0
  147. package/skills/requesting-code-review/code-reviewer.md +146 -0
  148. package/skills/subagent-driven-development/SKILL.md +277 -0
  149. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  150. package/skills/subagent-driven-development/implementer-prompt.md +113 -0
  151. package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  152. package/skills/supabase/.skillfish.json +10 -0
  153. package/skills/supabase/SKILL.md +106 -0
  154. package/skills/supabase/assets/feedback-issue-template.md +17 -0
  155. package/skills/supabase/references/skill-feedback.md +17 -0
  156. package/skills/supabase-postgres-best-practices/.skillfish.json +10 -0
  157. package/skills/supabase-postgres-best-practices/SKILL.md +64 -0
  158. package/skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
  159. package/skills/supabase-postgres-best-practices/references/_sections.md +39 -0
  160. package/skills/supabase-postgres-best-practices/references/_template.md +34 -0
  161. package/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
  162. package/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
  163. package/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
  164. package/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
  165. package/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
  166. package/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
  167. package/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
  168. package/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
  169. package/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
  170. package/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
  171. package/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
  172. package/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
  173. package/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
  174. package/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
  175. package/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
  176. package/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
  177. package/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
  178. package/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
  179. package/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
  180. package/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
  181. package/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
  182. package/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
  183. package/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
  184. package/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
  185. package/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
  186. package/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
  187. package/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
  188. package/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
  189. package/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
  190. package/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
  191. package/skills/supabase-postgres-best-practices/references/security-rls-performance.md +57 -0
  192. package/skills/supabase-quickstart/SKILL.md +400 -0
  193. package/skills/systematic-debugging/CREATION-LOG.md +119 -0
  194. package/skills/systematic-debugging/SKILL.md +296 -0
  195. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  196. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  197. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  198. package/skills/systematic-debugging/find-polluter.sh +63 -0
  199. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  200. package/skills/systematic-debugging/test-academic.md +14 -0
  201. package/skills/systematic-debugging/test-pressure-1.md +58 -0
  202. package/skills/systematic-debugging/test-pressure-2.md +68 -0
  203. package/skills/systematic-debugging/test-pressure-3.md +69 -0
  204. package/skills/test-driven-development/SKILL.md +371 -0
  205. package/skills/test-driven-development/testing-anti-patterns.md +299 -0
  206. package/skills/using-git-worktrees/SKILL.md +218 -0
  207. package/skills/using-superpowers/SKILL.md +115 -0
  208. package/skills/using-superpowers/references/codex-tools.md +100 -0
  209. package/skills/using-superpowers/references/gemini-tools.md +33 -0
  210. package/skills/verification-before-completion/SKILL.md +139 -0
  211. package/skills/video-production/SKILL.md +8 -7
  212. package/skills/writing-plans/SKILL.md +152 -0
  213. package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  214. package/skills/writing-skills/SKILL.md +655 -0
  215. package/skills/writing-skills/anthropic-best-practices.md +1150 -0
  216. package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  217. package/skills/writing-skills/graphviz-conventions.dot +172 -0
  218. package/skills/writing-skills/persuasion-principles.md +187 -0
  219. package/skills/writing-skills/render-graphs.js +168 -0
  220. package/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  221. package/skills/xlsx/.skillfish.json +10 -0
  222. package/skills/xlsx/SKILL.md +288 -0
  223. package/skills/xlsx/recalc.py +178 -0
  224. package/skills/color-grading/SKILL.md +0 -152
  225. package/skills/ffmpeg-patterns/SKILL.md +0 -240
  226. package/skills/image-prompting-guide/SKILL.md +0 -143
  227. package/skills/music-prompting/SKILL.md +0 -146
  228. package/skills/production-review/SKILL.md +0 -152
  229. package/skills/short-form-video/SKILL.md +0 -168
  230. package/skills/sound-design/SKILL.md +0 -154
  231. package/skills/storytelling/SKILL.md +0 -139
  232. package/skills/subtitle-production/SKILL.md +0 -244
  233. package/skills/subtitle-production/reference/burn_to_video.py +0 -222
  234. package/skills/subtitle-production/reference/export_srts.py +0 -127
  235. package/skills/subtitle-production/reference/gen_srt.py +0 -42
  236. package/skills/typography-video/SKILL.md +0 -182
  237. package/skills/typography-video/reference/KineticTitleScene.tsx +0 -345
  238. package/skills/video-editing/SKILL.md +0 -128
  239. package/skills/video-prompting-guide/SKILL.md +0 -268
@@ -0,0 +1,450 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Create thumbnail grids from PowerPoint presentation slides.
4
+
5
+ Creates a grid layout of slide thumbnails with configurable columns (max 6).
6
+ Each grid contains up to cols×(cols+1) images. For presentations with more
7
+ slides, multiple numbered grid files are created automatically.
8
+
9
+ The program outputs the names of all files created.
10
+
11
+ Output:
12
+ - Single grid: {prefix}.jpg (if slides fit in one grid)
13
+ - Multiple grids: {prefix}-1.jpg, {prefix}-2.jpg, etc.
14
+
15
+ Grid limits by column count:
16
+ - 3 cols: max 12 slides per grid (3×4)
17
+ - 4 cols: max 20 slides per grid (4×5)
18
+ - 5 cols: max 30 slides per grid (5×6) [default]
19
+ - 6 cols: max 42 slides per grid (6×7)
20
+
21
+ Usage:
22
+ python thumbnail.py input.pptx [output_prefix] [--cols N] [--outline-placeholders]
23
+
24
+ Examples:
25
+ python thumbnail.py presentation.pptx
26
+ # Creates: thumbnails.jpg (using default prefix)
27
+ # Outputs:
28
+ # Created 1 grid(s):
29
+ # - thumbnails.jpg
30
+
31
+ python thumbnail.py large-deck.pptx grid --cols 4
32
+ # Creates: grid-1.jpg, grid-2.jpg, grid-3.jpg
33
+ # Outputs:
34
+ # Created 3 grid(s):
35
+ # - grid-1.jpg
36
+ # - grid-2.jpg
37
+ # - grid-3.jpg
38
+
39
+ python thumbnail.py template.pptx analysis --outline-placeholders
40
+ # Creates thumbnail grids with red outlines around text placeholders
41
+ """
42
+
43
+ import argparse
44
+ import subprocess
45
+ import sys
46
+ import tempfile
47
+ from pathlib import Path
48
+
49
+ from inventory import extract_text_inventory
50
+ from PIL import Image, ImageDraw, ImageFont
51
+ from pptx import Presentation
52
+
53
+ # Constants
54
+ THUMBNAIL_WIDTH = 300 # Fixed thumbnail width in pixels
55
+ CONVERSION_DPI = 100 # DPI for PDF to image conversion
56
+ MAX_COLS = 6 # Maximum number of columns
57
+ DEFAULT_COLS = 5 # Default number of columns
58
+ JPEG_QUALITY = 95 # JPEG compression quality
59
+
60
+ # Grid layout constants
61
+ GRID_PADDING = 20 # Padding between thumbnails
62
+ BORDER_WIDTH = 2 # Border width around thumbnails
63
+ FONT_SIZE_RATIO = 0.12 # Font size as fraction of thumbnail width
64
+ LABEL_PADDING_RATIO = 0.4 # Label padding as fraction of font size
65
+
66
+
67
+ def main():
68
+ parser = argparse.ArgumentParser(
69
+ description="Create thumbnail grids from PowerPoint slides."
70
+ )
71
+ parser.add_argument("input", help="Input PowerPoint file (.pptx)")
72
+ parser.add_argument(
73
+ "output_prefix",
74
+ nargs="?",
75
+ default="thumbnails",
76
+ help="Output prefix for image files (default: thumbnails, will create prefix.jpg or prefix-N.jpg)",
77
+ )
78
+ parser.add_argument(
79
+ "--cols",
80
+ type=int,
81
+ default=DEFAULT_COLS,
82
+ help=f"Number of columns (default: {DEFAULT_COLS}, max: {MAX_COLS})",
83
+ )
84
+ parser.add_argument(
85
+ "--outline-placeholders",
86
+ action="store_true",
87
+ help="Outline text placeholders with a colored border",
88
+ )
89
+
90
+ args = parser.parse_args()
91
+
92
+ # Validate columns
93
+ cols = min(args.cols, MAX_COLS)
94
+ if args.cols > MAX_COLS:
95
+ print(f"Warning: Columns limited to {MAX_COLS} (requested {args.cols})")
96
+
97
+ # Validate input
98
+ input_path = Path(args.input)
99
+ if not input_path.exists() or input_path.suffix.lower() != ".pptx":
100
+ print(f"Error: Invalid PowerPoint file: {args.input}")
101
+ sys.exit(1)
102
+
103
+ # Construct output path (always JPG)
104
+ output_path = Path(f"{args.output_prefix}.jpg")
105
+
106
+ print(f"Processing: {args.input}")
107
+
108
+ try:
109
+ with tempfile.TemporaryDirectory() as temp_dir:
110
+ # Get placeholder regions if outlining is enabled
111
+ placeholder_regions = None
112
+ slide_dimensions = None
113
+ if args.outline_placeholders:
114
+ print("Extracting placeholder regions...")
115
+ placeholder_regions, slide_dimensions = get_placeholder_regions(
116
+ input_path
117
+ )
118
+ if placeholder_regions:
119
+ print(f"Found placeholders on {len(placeholder_regions)} slides")
120
+
121
+ # Convert slides to images
122
+ slide_images = convert_to_images(input_path, Path(temp_dir), CONVERSION_DPI)
123
+ if not slide_images:
124
+ print("Error: No slides found")
125
+ sys.exit(1)
126
+
127
+ print(f"Found {len(slide_images)} slides")
128
+
129
+ # Create grids (max cols×(cols+1) images per grid)
130
+ grid_files = create_grids(
131
+ slide_images,
132
+ cols,
133
+ THUMBNAIL_WIDTH,
134
+ output_path,
135
+ placeholder_regions,
136
+ slide_dimensions,
137
+ )
138
+
139
+ # Print saved files
140
+ print(f"Created {len(grid_files)} grid(s):")
141
+ for grid_file in grid_files:
142
+ print(f" - {grid_file}")
143
+
144
+ except Exception as e:
145
+ print(f"Error: {e}")
146
+ sys.exit(1)
147
+
148
+
149
+ def create_hidden_slide_placeholder(size):
150
+ """Create placeholder image for hidden slides."""
151
+ img = Image.new("RGB", size, color="#F0F0F0")
152
+ draw = ImageDraw.Draw(img)
153
+ line_width = max(5, min(size) // 100)
154
+ draw.line([(0, 0), size], fill="#CCCCCC", width=line_width)
155
+ draw.line([(size[0], 0), (0, size[1])], fill="#CCCCCC", width=line_width)
156
+ return img
157
+
158
+
159
+ def get_placeholder_regions(pptx_path):
160
+ """Extract ALL text regions from the presentation.
161
+
162
+ Returns a tuple of (placeholder_regions, slide_dimensions).
163
+ text_regions is a dict mapping slide indices to lists of text regions.
164
+ Each region is a dict with 'left', 'top', 'width', 'height' in inches.
165
+ slide_dimensions is a tuple of (width_inches, height_inches).
166
+ """
167
+ prs = Presentation(str(pptx_path))
168
+ inventory = extract_text_inventory(pptx_path, prs)
169
+ placeholder_regions = {}
170
+
171
+ # Get actual slide dimensions in inches (EMU to inches conversion)
172
+ slide_width_inches = (prs.slide_width or 9144000) / 914400.0
173
+ slide_height_inches = (prs.slide_height or 5143500) / 914400.0
174
+
175
+ for slide_key, shapes in inventory.items():
176
+ # Extract slide index from "slide-N" format
177
+ slide_idx = int(slide_key.split("-")[1])
178
+ regions = []
179
+
180
+ for shape_key, shape_data in shapes.items():
181
+ # The inventory only contains shapes with text, so all shapes should be highlighted
182
+ regions.append(
183
+ {
184
+ "left": shape_data.left,
185
+ "top": shape_data.top,
186
+ "width": shape_data.width,
187
+ "height": shape_data.height,
188
+ }
189
+ )
190
+
191
+ if regions:
192
+ placeholder_regions[slide_idx] = regions
193
+
194
+ return placeholder_regions, (slide_width_inches, slide_height_inches)
195
+
196
+
197
+ def convert_to_images(pptx_path, temp_dir, dpi):
198
+ """Convert PowerPoint to images via PDF, handling hidden slides."""
199
+ # Detect hidden slides
200
+ print("Analyzing presentation...")
201
+ prs = Presentation(str(pptx_path))
202
+ total_slides = len(prs.slides)
203
+
204
+ # Find hidden slides (1-based indexing for display)
205
+ hidden_slides = {
206
+ idx + 1
207
+ for idx, slide in enumerate(prs.slides)
208
+ if slide.element.get("show") == "0"
209
+ }
210
+
211
+ print(f"Total slides: {total_slides}")
212
+ if hidden_slides:
213
+ print(f"Hidden slides: {sorted(hidden_slides)}")
214
+
215
+ pdf_path = temp_dir / f"{pptx_path.stem}.pdf"
216
+
217
+ # Convert to PDF
218
+ print("Converting to PDF...")
219
+ result = subprocess.run(
220
+ [
221
+ "soffice",
222
+ "--headless",
223
+ "--convert-to",
224
+ "pdf",
225
+ "--outdir",
226
+ str(temp_dir),
227
+ str(pptx_path),
228
+ ],
229
+ capture_output=True,
230
+ text=True,
231
+ )
232
+ if result.returncode != 0 or not pdf_path.exists():
233
+ raise RuntimeError("PDF conversion failed")
234
+
235
+ # Convert PDF to images
236
+ print(f"Converting to images at {dpi} DPI...")
237
+ result = subprocess.run(
238
+ ["pdftoppm", "-jpeg", "-r", str(dpi), str(pdf_path), str(temp_dir / "slide")],
239
+ capture_output=True,
240
+ text=True,
241
+ )
242
+ if result.returncode != 0:
243
+ raise RuntimeError("Image conversion failed")
244
+
245
+ visible_images = sorted(temp_dir.glob("slide-*.jpg"))
246
+
247
+ # Create full list with placeholders for hidden slides
248
+ all_images = []
249
+ visible_idx = 0
250
+
251
+ # Get placeholder dimensions from first visible slide
252
+ if visible_images:
253
+ with Image.open(visible_images[0]) as img:
254
+ placeholder_size = img.size
255
+ else:
256
+ placeholder_size = (1920, 1080)
257
+
258
+ for slide_num in range(1, total_slides + 1):
259
+ if slide_num in hidden_slides:
260
+ # Create placeholder image for hidden slide
261
+ placeholder_path = temp_dir / f"hidden-{slide_num:03d}.jpg"
262
+ placeholder_img = create_hidden_slide_placeholder(placeholder_size)
263
+ placeholder_img.save(placeholder_path, "JPEG")
264
+ all_images.append(placeholder_path)
265
+ else:
266
+ # Use the actual visible slide image
267
+ if visible_idx < len(visible_images):
268
+ all_images.append(visible_images[visible_idx])
269
+ visible_idx += 1
270
+
271
+ return all_images
272
+
273
+
274
+ def create_grids(
275
+ image_paths,
276
+ cols,
277
+ width,
278
+ output_path,
279
+ placeholder_regions=None,
280
+ slide_dimensions=None,
281
+ ):
282
+ """Create multiple thumbnail grids from slide images, max cols×(cols+1) images per grid."""
283
+ # Maximum images per grid is cols × (cols + 1) for better proportions
284
+ max_images_per_grid = cols * (cols + 1)
285
+ grid_files = []
286
+
287
+ print(
288
+ f"Creating grids with {cols} columns (max {max_images_per_grid} images per grid)"
289
+ )
290
+
291
+ # Split images into chunks
292
+ for chunk_idx, start_idx in enumerate(
293
+ range(0, len(image_paths), max_images_per_grid)
294
+ ):
295
+ end_idx = min(start_idx + max_images_per_grid, len(image_paths))
296
+ chunk_images = image_paths[start_idx:end_idx]
297
+
298
+ # Create grid for this chunk
299
+ grid = create_grid(
300
+ chunk_images, cols, width, start_idx, placeholder_regions, slide_dimensions
301
+ )
302
+
303
+ # Generate output filename
304
+ if len(image_paths) <= max_images_per_grid:
305
+ # Single grid - use base filename without suffix
306
+ grid_filename = output_path
307
+ else:
308
+ # Multiple grids - insert index before extension with dash
309
+ stem = output_path.stem
310
+ suffix = output_path.suffix
311
+ grid_filename = output_path.parent / f"{stem}-{chunk_idx + 1}{suffix}"
312
+
313
+ # Save grid
314
+ grid_filename.parent.mkdir(parents=True, exist_ok=True)
315
+ grid.save(str(grid_filename), quality=JPEG_QUALITY)
316
+ grid_files.append(str(grid_filename))
317
+
318
+ return grid_files
319
+
320
+
321
+ def create_grid(
322
+ image_paths,
323
+ cols,
324
+ width,
325
+ start_slide_num=0,
326
+ placeholder_regions=None,
327
+ slide_dimensions=None,
328
+ ):
329
+ """Create thumbnail grid from slide images with optional placeholder outlining."""
330
+ font_size = int(width * FONT_SIZE_RATIO)
331
+ label_padding = int(font_size * LABEL_PADDING_RATIO)
332
+
333
+ # Get dimensions
334
+ with Image.open(image_paths[0]) as img:
335
+ aspect = img.height / img.width
336
+ height = int(width * aspect)
337
+
338
+ # Calculate grid size
339
+ rows = (len(image_paths) + cols - 1) // cols
340
+ grid_w = cols * width + (cols + 1) * GRID_PADDING
341
+ grid_h = rows * (height + font_size + label_padding * 2) + (rows + 1) * GRID_PADDING
342
+
343
+ # Create grid
344
+ grid = Image.new("RGB", (grid_w, grid_h), "white")
345
+ draw = ImageDraw.Draw(grid)
346
+
347
+ # Load font with size based on thumbnail width
348
+ try:
349
+ # Use Pillow's default font with size
350
+ font = ImageFont.load_default(size=font_size)
351
+ except Exception:
352
+ # Fall back to basic default font if size parameter not supported
353
+ font = ImageFont.load_default()
354
+
355
+ # Place thumbnails
356
+ for i, img_path in enumerate(image_paths):
357
+ row, col = i // cols, i % cols
358
+ x = col * width + (col + 1) * GRID_PADDING
359
+ y_base = (
360
+ row * (height + font_size + label_padding * 2) + (row + 1) * GRID_PADDING
361
+ )
362
+
363
+ # Add label with actual slide number
364
+ label = f"{start_slide_num + i}"
365
+ bbox = draw.textbbox((0, 0), label, font=font)
366
+ text_w = bbox[2] - bbox[0]
367
+ draw.text(
368
+ (x + (width - text_w) // 2, y_base + label_padding),
369
+ label,
370
+ fill="black",
371
+ font=font,
372
+ )
373
+
374
+ # Add thumbnail below label with proportional spacing
375
+ y_thumbnail = y_base + label_padding + font_size + label_padding
376
+
377
+ with Image.open(img_path) as img:
378
+ # Get original dimensions before thumbnail
379
+ orig_w, orig_h = img.size
380
+
381
+ # Apply placeholder outlines if enabled
382
+ if placeholder_regions and (start_slide_num + i) in placeholder_regions:
383
+ # Convert to RGBA for transparency support
384
+ if img.mode != "RGBA":
385
+ img = img.convert("RGBA")
386
+
387
+ # Get the regions for this slide
388
+ regions = placeholder_regions[start_slide_num + i]
389
+
390
+ # Calculate scale factors using actual slide dimensions
391
+ if slide_dimensions:
392
+ slide_width_inches, slide_height_inches = slide_dimensions
393
+ else:
394
+ # Fallback: estimate from image size at CONVERSION_DPI
395
+ slide_width_inches = orig_w / CONVERSION_DPI
396
+ slide_height_inches = orig_h / CONVERSION_DPI
397
+
398
+ x_scale = orig_w / slide_width_inches
399
+ y_scale = orig_h / slide_height_inches
400
+
401
+ # Create a highlight overlay
402
+ overlay = Image.new("RGBA", img.size, (255, 255, 255, 0))
403
+ overlay_draw = ImageDraw.Draw(overlay)
404
+
405
+ # Highlight each placeholder region
406
+ for region in regions:
407
+ # Convert from inches to pixels in the original image
408
+ px_left = int(region["left"] * x_scale)
409
+ px_top = int(region["top"] * y_scale)
410
+ px_width = int(region["width"] * x_scale)
411
+ px_height = int(region["height"] * y_scale)
412
+
413
+ # Draw highlight outline with red color and thick stroke
414
+ # Using a bright red outline instead of fill
415
+ stroke_width = max(
416
+ 5, min(orig_w, orig_h) // 150
417
+ ) # Thicker proportional stroke width
418
+ overlay_draw.rectangle(
419
+ [(px_left, px_top), (px_left + px_width, px_top + px_height)],
420
+ outline=(255, 0, 0, 255), # Bright red, fully opaque
421
+ width=stroke_width,
422
+ )
423
+
424
+ # Composite the overlay onto the image using alpha blending
425
+ img = Image.alpha_composite(img, overlay)
426
+ # Convert back to RGB for JPEG saving
427
+ img = img.convert("RGB")
428
+
429
+ img.thumbnail((width, height), Image.Resampling.LANCZOS)
430
+ w, h = img.size
431
+ tx = x + (width - w) // 2
432
+ ty = y_thumbnail + (height - h) // 2
433
+ grid.paste(img, (tx, ty))
434
+
435
+ # Add border
436
+ if BORDER_WIDTH > 0:
437
+ draw.rectangle(
438
+ [
439
+ (tx - BORDER_WIDTH, ty - BORDER_WIDTH),
440
+ (tx + w + BORDER_WIDTH - 1, ty + h + BORDER_WIDTH - 1),
441
+ ],
442
+ outline="gray",
443
+ width=BORDER_WIDTH,
444
+ )
445
+
446
+ return grid
447
+
448
+
449
+ if __name__ == "__main__":
450
+ main()
@@ -0,0 +1,213 @@
1
+ ---
2
+ name: receiving-code-review
3
+ description: Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
4
+ ---
5
+
6
+ # Code Review Reception
7
+
8
+ ## Overview
9
+
10
+ Code review requires technical evaluation, not emotional performance.
11
+
12
+ **Core principle:** Verify before implementing. Ask before assuming. Technical correctness over social comfort.
13
+
14
+ ## The Response Pattern
15
+
16
+ ```
17
+ WHEN receiving code review feedback:
18
+
19
+ 1. READ: Complete feedback without reacting
20
+ 2. UNDERSTAND: Restate requirement in own words (or ask)
21
+ 3. VERIFY: Check against codebase reality
22
+ 4. EVALUATE: Technically sound for THIS codebase?
23
+ 5. RESPOND: Technical acknowledgment or reasoned pushback
24
+ 6. IMPLEMENT: One item at a time, test each
25
+ ```
26
+
27
+ ## Forbidden Responses
28
+
29
+ **NEVER:**
30
+ - "You're absolutely right!" (explicit CLAUDE.md violation)
31
+ - "Great point!" / "Excellent feedback!" (performative)
32
+ - "Let me implement that now" (before verification)
33
+
34
+ **INSTEAD:**
35
+ - Restate the technical requirement
36
+ - Ask clarifying questions
37
+ - Push back with technical reasoning if wrong
38
+ - Just start working (actions > words)
39
+
40
+ ## Handling Unclear Feedback
41
+
42
+ ```
43
+ IF any item is unclear:
44
+ STOP - do not implement anything yet
45
+ ASK for clarification on unclear items
46
+
47
+ WHY: Items may be related. Partial understanding = wrong implementation.
48
+ ```
49
+
50
+ **Example:**
51
+ ```
52
+ your human partner: "Fix 1-6"
53
+ You understand 1,2,3,6. Unclear on 4,5.
54
+
55
+ ❌ WRONG: Implement 1,2,3,6 now, ask about 4,5 later
56
+ ✅ RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."
57
+ ```
58
+
59
+ ## Source-Specific Handling
60
+
61
+ ### From your human partner
62
+ - **Trusted** - implement after understanding
63
+ - **Still ask** if scope unclear
64
+ - **No performative agreement**
65
+ - **Skip to action** or technical acknowledgment
66
+
67
+ ### From External Reviewers
68
+ ```
69
+ BEFORE implementing:
70
+ 1. Check: Technically correct for THIS codebase?
71
+ 2. Check: Breaks existing functionality?
72
+ 3. Check: Reason for current implementation?
73
+ 4. Check: Works on all platforms/versions?
74
+ 5. Check: Does reviewer understand full context?
75
+
76
+ IF suggestion seems wrong:
77
+ Push back with technical reasoning
78
+
79
+ IF can't easily verify:
80
+ Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"
81
+
82
+ IF conflicts with your human partner's prior decisions:
83
+ Stop and discuss with your human partner first
84
+ ```
85
+
86
+ **your human partner's rule:** "External feedback - be skeptical, but check carefully"
87
+
88
+ ## YAGNI Check for "Professional" Features
89
+
90
+ ```
91
+ IF reviewer suggests "implementing properly":
92
+ grep codebase for actual usage
93
+
94
+ IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
95
+ IF used: Then implement properly
96
+ ```
97
+
98
+ **your human partner's rule:** "You and reviewer both report to me. If we don't need this feature, don't add it."
99
+
100
+ ## Implementation Order
101
+
102
+ ```
103
+ FOR multi-item feedback:
104
+ 1. Clarify anything unclear FIRST
105
+ 2. Then implement in this order:
106
+ - Blocking issues (breaks, security)
107
+ - Simple fixes (typos, imports)
108
+ - Complex fixes (refactoring, logic)
109
+ 3. Test each fix individually
110
+ 4. Verify no regressions
111
+ ```
112
+
113
+ ## When To Push Back
114
+
115
+ Push back when:
116
+ - Suggestion breaks existing functionality
117
+ - Reviewer lacks full context
118
+ - Violates YAGNI (unused feature)
119
+ - Technically incorrect for this stack
120
+ - Legacy/compatibility reasons exist
121
+ - Conflicts with your human partner's architectural decisions
122
+
123
+ **How to push back:**
124
+ - Use technical reasoning, not defensiveness
125
+ - Ask specific questions
126
+ - Reference working tests/code
127
+ - Involve your human partner if architectural
128
+
129
+ **Signal if uncomfortable pushing back out loud:** "Strange things are afoot at the Circle K"
130
+
131
+ ## Acknowledging Correct Feedback
132
+
133
+ When feedback IS correct:
134
+ ```
135
+ ✅ "Fixed. [Brief description of what changed]"
136
+ ✅ "Good catch - [specific issue]. Fixed in [location]."
137
+ ✅ [Just fix it and show in the code]
138
+
139
+ ❌ "You're absolutely right!"
140
+ ❌ "Great point!"
141
+ ❌ "Thanks for catching that!"
142
+ ❌ "Thanks for [anything]"
143
+ ❌ ANY gratitude expression
144
+ ```
145
+
146
+ **Why no thanks:** Actions speak. Just fix it. The code itself shows you heard the feedback.
147
+
148
+ **If you catch yourself about to write "Thanks":** DELETE IT. State the fix instead.
149
+
150
+ ## Gracefully Correcting Your Pushback
151
+
152
+ If you pushed back and were wrong:
153
+ ```
154
+ ✅ "You were right - I checked [X] and it does [Y]. Implementing now."
155
+ ✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
156
+
157
+ ❌ Long apology
158
+ ❌ Defending why you pushed back
159
+ ❌ Over-explaining
160
+ ```
161
+
162
+ State the correction factually and move on.
163
+
164
+ ## Common Mistakes
165
+
166
+ | Mistake | Fix |
167
+ |---------|-----|
168
+ | Performative agreement | State requirement or just act |
169
+ | Blind implementation | Verify against codebase first |
170
+ | Batch without testing | One at a time, test each |
171
+ | Assuming reviewer is right | Check if breaks things |
172
+ | Avoiding pushback | Technical correctness > comfort |
173
+ | Partial implementation | Clarify all items first |
174
+ | Can't verify, proceed anyway | State limitation, ask for direction |
175
+
176
+ ## Real Examples
177
+
178
+ **Performative Agreement (Bad):**
179
+ ```
180
+ Reviewer: "Remove legacy code"
181
+ ❌ "You're absolutely right! Let me remove that..."
182
+ ```
183
+
184
+ **Technical Verification (Good):**
185
+ ```
186
+ Reviewer: "Remove legacy code"
187
+ ✅ "Checking... build target is 10.15+, this API needs 13+. Need legacy for backward compat. Current impl has wrong bundle ID - fix it or drop pre-13 support?"
188
+ ```
189
+
190
+ **YAGNI (Good):**
191
+ ```
192
+ Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
193
+ ✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"
194
+ ```
195
+
196
+ **Unclear Item (Good):**
197
+ ```
198
+ your human partner: "Fix items 1-6"
199
+ You understand 1,2,3,6. Unclear on 4,5.
200
+ ✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."
201
+ ```
202
+
203
+ ## GitHub Thread Replies
204
+
205
+ When replying to inline review comments on GitHub, reply in the comment thread (`gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies`), not as a top-level PR comment.
206
+
207
+ ## The Bottom Line
208
+
209
+ **External feedback = suggestions to evaluate, not orders to follow.**
210
+
211
+ Verify. Question. Then implement.
212
+
213
+ No performative agreement. Technical rigor always.