@kolbo/kolbo-code-linux-arm64-musl 1.1.74 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) 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/ollama-vision/SKILL.md +105 -0
  75. package/skills/pdf/.skillfish.json +10 -0
  76. package/skills/pdf/FORMS.md +205 -0
  77. package/skills/pdf/REFERENCE.md +612 -0
  78. package/skills/pdf/SKILL.md +293 -0
  79. package/skills/pdf/scripts/check_bounding_boxes.py +70 -0
  80. package/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
  81. package/skills/pdf/scripts/check_fillable_fields.py +12 -0
  82. package/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
  83. package/skills/pdf/scripts/create_validation_image.py +41 -0
  84. package/skills/pdf/scripts/extract_form_field_info.py +152 -0
  85. package/skills/pdf/scripts/fill_fillable_fields.py +114 -0
  86. package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
  87. package/skills/photo-studio/SKILL.md +122 -0
  88. package/skills/pptx/.skillfish.json +10 -0
  89. package/skills/pptx/SKILL.md +483 -0
  90. package/skills/pptx/html2pptx.md +626 -0
  91. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  92. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  93. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  94. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  95. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  96. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  97. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  98. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  99. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  100. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  101. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  102. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  103. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  104. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  105. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  106. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  107. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  108. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  109. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  110. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  111. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  112. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  113. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  114. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  115. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  116. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  117. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  118. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  119. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  120. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  121. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  122. package/skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
  123. package/skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  124. package/skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  125. package/skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  126. package/skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  127. package/skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  128. package/skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  129. package/skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  130. package/skills/pptx/ooxml/scripts/pack.py +159 -0
  131. package/skills/pptx/ooxml/scripts/unpack.py +29 -0
  132. package/skills/pptx/ooxml/scripts/validate.py +69 -0
  133. package/skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
  134. package/skills/pptx/ooxml/scripts/validation/base.py +951 -0
  135. package/skills/pptx/ooxml/scripts/validation/docx.py +274 -0
  136. package/skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
  137. package/skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
  138. package/skills/pptx/ooxml.md +427 -0
  139. package/skills/pptx/scripts/html2pptx.js +995 -0
  140. package/skills/pptx/scripts/inventory.py +1020 -0
  141. package/skills/pptx/scripts/rearrange.py +231 -0
  142. package/skills/pptx/scripts/replace.py +385 -0
  143. package/skills/pptx/scripts/thumbnail.py +450 -0
  144. package/skills/receiving-code-review/SKILL.md +213 -0
  145. package/skills/requesting-code-review/SKILL.md +105 -0
  146. package/skills/requesting-code-review/code-reviewer.md +146 -0
  147. package/skills/subagent-driven-development/SKILL.md +277 -0
  148. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  149. package/skills/subagent-driven-development/implementer-prompt.md +113 -0
  150. package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  151. package/skills/supabase/.skillfish.json +10 -0
  152. package/skills/supabase/SKILL.md +106 -0
  153. package/skills/supabase/assets/feedback-issue-template.md +17 -0
  154. package/skills/supabase/references/skill-feedback.md +17 -0
  155. package/skills/supabase-postgres-best-practices/.skillfish.json +10 -0
  156. package/skills/supabase-postgres-best-practices/SKILL.md +64 -0
  157. package/skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
  158. package/skills/supabase-postgres-best-practices/references/_sections.md +39 -0
  159. package/skills/supabase-postgres-best-practices/references/_template.md +34 -0
  160. package/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
  161. package/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
  162. package/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
  163. package/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
  164. package/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
  165. package/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
  166. package/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
  167. package/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
  168. package/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
  169. package/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
  170. package/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
  171. package/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
  172. package/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
  173. package/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
  174. package/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
  175. package/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
  176. package/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
  177. package/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
  178. package/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
  179. package/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
  180. package/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
  181. package/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
  182. package/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
  183. package/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
  184. package/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
  185. package/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
  186. package/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
  187. package/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
  188. package/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
  189. package/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
  190. package/skills/supabase-postgres-best-practices/references/security-rls-performance.md +57 -0
  191. package/skills/supabase-quickstart/SKILL.md +400 -0
  192. package/skills/systematic-debugging/CREATION-LOG.md +119 -0
  193. package/skills/systematic-debugging/SKILL.md +296 -0
  194. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  195. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  196. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  197. package/skills/systematic-debugging/find-polluter.sh +63 -0
  198. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  199. package/skills/systematic-debugging/test-academic.md +14 -0
  200. package/skills/systematic-debugging/test-pressure-1.md +58 -0
  201. package/skills/systematic-debugging/test-pressure-2.md +68 -0
  202. package/skills/systematic-debugging/test-pressure-3.md +69 -0
  203. package/skills/test-driven-development/SKILL.md +371 -0
  204. package/skills/test-driven-development/testing-anti-patterns.md +299 -0
  205. package/skills/using-git-worktrees/SKILL.md +218 -0
  206. package/skills/using-superpowers/SKILL.md +115 -0
  207. package/skills/using-superpowers/references/codex-tools.md +100 -0
  208. package/skills/using-superpowers/references/gemini-tools.md +33 -0
  209. package/skills/verification-before-completion/SKILL.md +139 -0
  210. package/skills/writing-plans/SKILL.md +152 -0
  211. package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  212. package/skills/writing-skills/SKILL.md +655 -0
  213. package/skills/writing-skills/anthropic-best-practices.md +1150 -0
  214. package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  215. package/skills/writing-skills/graphviz-conventions.dot +172 -0
  216. package/skills/writing-skills/persuasion-principles.md +187 -0
  217. package/skills/writing-skills/render-graphs.js +168 -0
  218. package/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  219. package/skills/xlsx/.skillfish.json +10 -0
  220. package/skills/xlsx/SKILL.md +288 -0
  221. package/skills/xlsx/recalc.py +178 -0
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: ollama-vision
3
+ description: >
4
+ Batch image analysis using local Ollama + gemma4 (multimodal).
5
+ Use when the user needs to analyze, caption, classify, or extract text from images locally —
6
+ free, offline, no rate limits, no API key needed.
7
+ Keywords: image analysis, batch images, captions, OCR, vision, gemma4, ollama, local AI
8
+ ---
9
+
10
+ # Ollama Vision — Batch Image Analysis with gemma4
11
+
12
+ ## Setup (already done on this machine)
13
+
14
+ - Ollama installed and running (auto-starts on Windows boot)
15
+ - Model: `gemma4` (9.6 GB, multimodal)
16
+ - Python package: `ollama` v0.6.1 installed (pip, Python 3.10)
17
+ - REST API available at `http://localhost:11434`
18
+
19
+ ## Core Pattern
20
+
21
+ ```python
22
+ import ollama
23
+
24
+ response = ollama.chat(model='gemma4', messages=[{
25
+ 'role': 'user',
26
+ 'content': 'Your prompt here',
27
+ 'images': ['path/to/image.jpg'] # omit for text-only
28
+ }])
29
+ print(response['message']['content'])
30
+ ```
31
+
32
+ ## Batch Image Captioning Script
33
+
34
+ ```python
35
+ import ollama
36
+ from pathlib import Path
37
+ import csv
38
+
39
+ def caption_images(folder: str, prompt: str = "Write a short caption for this image.", output_csv: str = "captions.csv"):
40
+ images_dir = Path(folder)
41
+ extensions = {'.jpg', '.jpeg', '.png', '.webp', '.gif', '.bmp'}
42
+ image_files = [f for f in images_dir.iterdir() if f.suffix.lower() in extensions]
43
+
44
+ results = []
45
+ for i, img_path in enumerate(image_files, 1):
46
+ print(f"[{i}/{len(image_files)}] Processing {img_path.name}...")
47
+ try:
48
+ response = ollama.chat(model='gemma4', messages=[{
49
+ 'role': 'user',
50
+ 'content': prompt,
51
+ 'images': [str(img_path)]
52
+ }])
53
+ caption = response['message']['content'].strip()
54
+ results.append({'file': img_path.name, 'caption': caption})
55
+ print(f" → {caption[:80]}...")
56
+ except Exception as e:
57
+ print(f" ERROR: {e}")
58
+ results.append({'file': img_path.name, 'caption': f'ERROR: {e}'})
59
+
60
+ with open(output_csv, 'w', newline='', encoding='utf-8') as f:
61
+ writer = csv.DictWriter(f, fieldnames=['file', 'caption'])
62
+ writer.writeheader()
63
+ writer.writerows(results)
64
+
65
+ print(f"\nDone! Saved {len(results)} captions to {output_csv}")
66
+
67
+ # Usage
68
+ caption_images("./images", prompt="Describe this image in one sentence.")
69
+ ```
70
+
71
+ ## Common Prompts
72
+
73
+ | Task | Prompt |
74
+ |------|--------|
75
+ | Caption | `"Write a short, descriptive caption for this image."` |
76
+ | Alt text | `"Write alt text for this image for accessibility."` |
77
+ | Classification | `"What category does this image belong to? Reply with one word."` |
78
+ | OCR | `"Extract all text visible in this image."` |
79
+ | Product description | `"Write a product description for the item shown in this image."` |
80
+ | Social media | `"Write a catchy Instagram caption for this image."` |
81
+
82
+ ## REST API Alternative (no Python package needed)
83
+
84
+ ```python
85
+ import requests, base64
86
+
87
+ def analyze_image(image_path: str, prompt: str) -> str:
88
+ with open(image_path, "rb") as f:
89
+ img_b64 = base64.b64encode(f.read()).decode()
90
+
91
+ response = requests.post("http://localhost:11434/api/generate", json={
92
+ "model": "gemma4",
93
+ "prompt": prompt,
94
+ "images": [img_b64],
95
+ "stream": False
96
+ })
97
+ return response.json()["response"]
98
+ ```
99
+
100
+ ## Tips
101
+
102
+ - gemma4 handles JPG, PNG, WEBP, GIF, BMP
103
+ - For large batches, add `time.sleep(0.5)` between requests to avoid overloading
104
+ - Results are best when prompts are specific ("describe the main subject" vs "describe this")
105
+ - Ollama must be running — check with `ollama list` in terminal
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 2,
3
+ "name": "pdf",
4
+ "owner": "tfriedel",
5
+ "repo": "claude-office-skills",
6
+ "path": "public/pdf",
7
+ "branch": "main",
8
+ "sha": "21a390e450620cf4bcffc54d622934643e1c933f",
9
+ "source": "manual"
10
+ }
@@ -0,0 +1,205 @@
1
+ **CRITICAL: You MUST complete these steps in order. Do not skip ahead to writing code.**
2
+
3
+ If you need to fill out a PDF form, first check to see if the PDF has fillable form fields. Run this script from this file's directory:
4
+ `python scripts/check_fillable_fields <file.pdf>`, and depending on the result go to either the "Fillable fields" or "Non-fillable fields" and follow those instructions.
5
+
6
+ # Fillable fields
7
+ If the PDF has fillable form fields:
8
+ - Run this script from this file's directory: `python scripts/extract_form_field_info.py <input.pdf> <field_info.json>`. It will create a JSON file with a list of fields in this format:
9
+ ```
10
+ [
11
+ {
12
+ "field_id": (unique ID for the field),
13
+ "page": (page number, 1-based),
14
+ "rect": ([left, bottom, right, top] bounding box in PDF coordinates, y=0 is the bottom of the page),
15
+ "type": ("text", "checkbox", "radio_group", or "choice"),
16
+ },
17
+ // Checkboxes have "checked_value" and "unchecked_value" properties:
18
+ {
19
+ "field_id": (unique ID for the field),
20
+ "page": (page number, 1-based),
21
+ "type": "checkbox",
22
+ "checked_value": (Set the field to this value to check the checkbox),
23
+ "unchecked_value": (Set the field to this value to uncheck the checkbox),
24
+ },
25
+ // Radio groups have a "radio_options" list with the possible choices.
26
+ {
27
+ "field_id": (unique ID for the field),
28
+ "page": (page number, 1-based),
29
+ "type": "radio_group",
30
+ "radio_options": [
31
+ {
32
+ "value": (set the field to this value to select this radio option),
33
+ "rect": (bounding box for the radio button for this option)
34
+ },
35
+ // Other radio options
36
+ ]
37
+ },
38
+ // Multiple choice fields have a "choice_options" list with the possible choices:
39
+ {
40
+ "field_id": (unique ID for the field),
41
+ "page": (page number, 1-based),
42
+ "type": "choice",
43
+ "choice_options": [
44
+ {
45
+ "value": (set the field to this value to select this option),
46
+ "text": (display text of the option)
47
+ },
48
+ // Other choice options
49
+ ],
50
+ }
51
+ ]
52
+ ```
53
+ - Convert the PDF to PNGs (one image for each page) with this script (run from this file's directory):
54
+ `python scripts/convert_pdf_to_images.py <file.pdf> <output_directory>`
55
+ Then analyze the images to determine the purpose of each form field (make sure to convert the bounding box PDF coordinates to image coordinates).
56
+ - Create a `field_values.json` file in this format with the values to be entered for each field:
57
+ ```
58
+ [
59
+ {
60
+ "field_id": "last_name", // Must match the field_id from `extract_form_field_info.py`
61
+ "description": "The user's last name",
62
+ "page": 1, // Must match the "page" value in field_info.json
63
+ "value": "Simpson"
64
+ },
65
+ {
66
+ "field_id": "Checkbox12",
67
+ "description": "Checkbox to be checked if the user is 18 or over",
68
+ "page": 1,
69
+ "value": "/On" // If this is a checkbox, use its "checked_value" value to check it. If it's a radio button group, use one of the "value" values in "radio_options".
70
+ },
71
+ // more fields
72
+ ]
73
+ ```
74
+ - Run the `fill_fillable_fields.py` script from this file's directory to create a filled-in PDF:
75
+ `python scripts/fill_fillable_fields.py <input pdf> <field_values.json> <output pdf>`
76
+ This script will verify that the field IDs and values you provide are valid; if it prints error messages, correct the appropriate fields and try again.
77
+
78
+ # Non-fillable fields
79
+ If the PDF doesn't have fillable form fields, you'll need to visually determine where the data should be added and create text annotations. Follow the below steps *exactly*. You MUST perform all of these steps to ensure that the the form is accurately completed. Details for each step are below.
80
+ - Convert the PDF to PNG images and determine field bounding boxes.
81
+ - Create a JSON file with field information and validation images showing the bounding boxes.
82
+ - Validate the the bounding boxes.
83
+ - Use the bounding boxes to fill in the form.
84
+
85
+ ## Step 1: Visual Analysis (REQUIRED)
86
+ - Convert the PDF to PNG images. Run this script from this file's directory:
87
+ `python scripts/convert_pdf_to_images.py <file.pdf> <output_directory>`
88
+ The script will create a PNG image for each page in the PDF.
89
+ - Carefully examine each PNG image and identify all form fields and areas where the user should enter data. For each form field where the user should enter text, determine bounding boxes for both the form field label, and the area where the user should enter text. The label and entry bounding boxes MUST NOT INTERSECT; the text entry box should only include the area where data should be entered. Usually this area will be immediately to the side, above, or below its label. Entry bounding boxes must be tall and wide enough to contain their text.
90
+
91
+ These are some examples of form structures that you might see:
92
+
93
+ *Label inside box*
94
+ ```
95
+ ┌────────────────────────┐
96
+ │ Name: │
97
+ └────────────────────────┘
98
+ ```
99
+ The input area should be to the right of the "Name" label and extend to the edge of the box.
100
+
101
+ *Label before line*
102
+ ```
103
+ Email: _______________________
104
+ ```
105
+ The input area should be above the line and include its entire width.
106
+
107
+ *Label under line*
108
+ ```
109
+ _________________________
110
+ Name
111
+ ```
112
+ The input area should be above the line and include the entire width of the line. This is common for signature and date fields.
113
+
114
+ *Label above line*
115
+ ```
116
+ Please enter any special requests:
117
+ ________________________________________________
118
+ ```
119
+ The input area should extend from the bottom of the label to the line, and should include the entire width of the line.
120
+
121
+ *Checkboxes*
122
+ ```
123
+ Are you a US citizen? Yes □ No □
124
+ ```
125
+ For checkboxes:
126
+ - Look for small square boxes (□) - these are the actual checkboxes to target. They may be to the left or right of their labels.
127
+ - Distinguish between label text ("Yes", "No") and the clickable checkbox squares.
128
+ - The entry bounding box should cover ONLY the small square, not the text label.
129
+
130
+ ### Step 2: Create fields.json and validation images (REQUIRED)
131
+ - Create a file named `fields.json` with information for the form fields and bounding boxes in this format:
132
+ ```
133
+ {
134
+ "pages": [
135
+ {
136
+ "page_number": 1,
137
+ "image_width": (first page image width in pixels),
138
+ "image_height": (first page image height in pixels),
139
+ },
140
+ {
141
+ "page_number": 2,
142
+ "image_width": (second page image width in pixels),
143
+ "image_height": (second page image height in pixels),
144
+ }
145
+ // additional pages
146
+ ],
147
+ "form_fields": [
148
+ // Example for a text field.
149
+ {
150
+ "page_number": 1,
151
+ "description": "The user's last name should be entered here",
152
+ // Bounding boxes are [left, top, right, bottom]. The bounding boxes for the label and text entry should not overlap.
153
+ "field_label": "Last name",
154
+ "label_bounding_box": [30, 125, 95, 142],
155
+ "entry_bounding_box": [100, 125, 280, 142],
156
+ "entry_text": {
157
+ "text": "Johnson", // This text will be added as an annotation at the entry_bounding_box location
158
+ "font_size": 14, // optional, defaults to 14
159
+ "font_color": "000000", // optional, RRGGBB format, defaults to 000000 (black)
160
+ }
161
+ },
162
+ // Example for a checkbox. TARGET THE SQUARE for the entry bounding box, NOT THE TEXT
163
+ {
164
+ "page_number": 2,
165
+ "description": "Checkbox that should be checked if the user is over 18",
166
+ "entry_bounding_box": [140, 525, 155, 540], // Small box over checkbox square
167
+ "field_label": "Yes",
168
+ "label_bounding_box": [100, 525, 132, 540], // Box containing "Yes" text
169
+ // Use "X" to check a checkbox.
170
+ "entry_text": {
171
+ "text": "X",
172
+ }
173
+ }
174
+ // additional form field entries
175
+ ]
176
+ }
177
+ ```
178
+
179
+ Create validation images by running this script from this file's directory for each page:
180
+ `python scripts/create_validation_image.py <page_number> <path_to_fields.json> <input_image_path> <output_image_path>
181
+
182
+ The validation images will have red rectangles where text should be entered, and blue rectangles covering label text.
183
+
184
+ ### Step 3: Validate Bounding Boxes (REQUIRED)
185
+ #### Automated intersection check
186
+ - Verify that none of bounding boxes intersect and that the entry bounding boxes are tall enough by checking the fields.json file with the `check_bounding_boxes.py` script (run from this file's directory):
187
+ `python scripts/check_bounding_boxes.py <JSON file>`
188
+
189
+ If there are errors, reanalyze the relevant fields, adjust the bounding boxes, and iterate until there are no remaining errors. Remember: label (blue) bounding boxes should contain text labels, entry (red) boxes should not.
190
+
191
+ #### Manual image inspection
192
+ **CRITICAL: Do not proceed without visually inspecting validation images**
193
+ - Red rectangles must ONLY cover input areas
194
+ - Red rectangles MUST NOT contain any text
195
+ - Blue rectangles should contain label text
196
+ - For checkboxes:
197
+ - Red rectangle MUST be centered on the checkbox square
198
+ - Blue rectangle should cover the text label for the checkbox
199
+
200
+ - If any rectangles look wrong, fix fields.json, regenerate the validation images, and verify again. Repeat this process until the bounding boxes are fully accurate.
201
+
202
+
203
+ ### Step 4: Add annotations to the PDF
204
+ Run this script from this file's directory to create a filled-out PDF using the information in fields.json:
205
+ `python scripts/fill_pdf_form_with_annotations.py <input_pdf_path> <path_to_fields.json> <output_pdf_path>