@waoooo/claude-skills 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 (264) hide show
  1. package/README.md +48 -0
  2. package/package.json +28 -0
  3. package/registry.json +431 -0
  4. package/skills/acceptance-review/SKILL.md +537 -0
  5. package/skills/all-plan/SKILL.md +19 -0
  6. package/skills/all-plan/references/flow.md +750 -0
  7. package/skills/api-docs-generate/SKILL.md +204 -0
  8. package/skills/api-docs-generate/assets/templates/api.mdx +140 -0
  9. package/skills/api-docs-generate/scripts/generate-api-docs.ts +308 -0
  10. package/skills/ask/SKILL.md +42 -0
  11. package/skills/autonew/SKILL.md +34 -0
  12. package/skills/capability-analyze/SKILL.md +300 -0
  13. package/skills/capability-analyze/scripts/analyze-capabilities.ts +531 -0
  14. package/skills/capability-docs-generate/SKILL.md +155 -0
  15. package/skills/capability-docs-generate/assets/templates/capability.mdx +271 -0
  16. package/skills/capability-docs-generate/scripts/generate-capability-docs.ts +358 -0
  17. package/skills/capability-tree-query/SKILL.md +112 -0
  18. package/skills/capability-tree-query/scripts/build-capability-tree.ts +402 -0
  19. package/skills/changelog-generator/SKILL.md +104 -0
  20. package/skills/continue/SKILL.md +39 -0
  21. package/skills/continue/agents/openai.yaml +3 -0
  22. package/skills/creating-skills/SKILL.md +158 -0
  23. package/skills/creating-skills/references/official_best_practices.md +128 -0
  24. package/skills/creating-skills/references/skill_examples.md +199 -0
  25. package/skills/docx/LICENSE.txt +30 -0
  26. package/skills/docx/SKILL.md +197 -0
  27. package/skills/docx/docx-js.md +350 -0
  28. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  29. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  30. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  31. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  32. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  33. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  34. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  35. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  36. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  37. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  38. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  39. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  40. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  41. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  42. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  43. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  44. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  45. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  46. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  47. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  48. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  49. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  50. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  51. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  52. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  53. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  54. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  55. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  56. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  57. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  58. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  59. package/skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
  60. package/skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  61. package/skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  62. package/skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  63. package/skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  64. package/skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  65. package/skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  66. package/skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  67. package/skills/docx/ooxml/scripts/pack.py +159 -0
  68. package/skills/docx/ooxml/scripts/unpack.py +29 -0
  69. package/skills/docx/ooxml/scripts/validate.py +69 -0
  70. package/skills/docx/ooxml/scripts/validation/__init__.py +15 -0
  71. package/skills/docx/ooxml/scripts/validation/base.py +951 -0
  72. package/skills/docx/ooxml/scripts/validation/docx.py +274 -0
  73. package/skills/docx/ooxml/scripts/validation/pptx.py +315 -0
  74. package/skills/docx/ooxml/scripts/validation/redlining.py +279 -0
  75. package/skills/docx/ooxml.md +610 -0
  76. package/skills/docx/scripts/__init__.py +1 -0
  77. package/skills/docx/scripts/document.py +1276 -0
  78. package/skills/docx/scripts/templates/comments.xml +3 -0
  79. package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  80. package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  81. package/skills/docx/scripts/templates/commentsIds.xml +3 -0
  82. package/skills/docx/scripts/templates/people.xml +3 -0
  83. package/skills/docx/scripts/utilities.py +374 -0
  84. package/skills/git-branch-create/SKILL.md +170 -0
  85. package/skills/git-branch-merge/SKILL.md +176 -0
  86. package/skills/git-commit/SKILL.md +56 -0
  87. package/skills/git-commit/references/commit_examples.md +311 -0
  88. package/skills/github-actions-trigger/SKILL.md +367 -0
  89. package/skills/github-issue-create/SKILL.md +294 -0
  90. package/skills/github-pr-creation/SKILL.md +137 -0
  91. package/skills/github-pr-creation/references/pr_templates.md +187 -0
  92. package/skills/github-pr-merge/SKILL.md +112 -0
  93. package/skills/github-pr-review/SKILL.md +110 -0
  94. package/skills/github-pr-review/references/severity_guide.md +168 -0
  95. package/skills/job-create/SKILL.md +294 -0
  96. package/skills/job-create/scripts/create-job.ts +105 -0
  97. package/skills/job-workflow/SKILL.md +212 -0
  98. package/skills/keyword-extract/SKILL.md +229 -0
  99. package/skills/mcp-builder/LICENSE.txt +202 -0
  100. package/skills/mcp-builder/SKILL.md +236 -0
  101. package/skills/mcp-builder/reference/evaluation.md +602 -0
  102. package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
  103. package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
  104. package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
  105. package/skills/mcp-builder/scripts/connections.py +151 -0
  106. package/skills/mcp-builder/scripts/evaluation.py +373 -0
  107. package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  108. package/skills/mcp-builder/scripts/requirements.txt +2 -0
  109. package/skills/mdx-to-openspec/SKILL.md +827 -0
  110. package/skills/mdx-to-openspec/scripts/mdx-to-openspec.ts +320 -0
  111. package/skills/mounted/SKILL.md +20 -0
  112. package/skills/multi-model-review/SKILL.md +459 -0
  113. package/skills/notion-automation/SKILL.md +215 -0
  114. package/skills/openspec-review/SKILL.md +513 -0
  115. package/skills/pdf/LICENSE.txt +30 -0
  116. package/skills/pdf/SKILL.md +294 -0
  117. package/skills/pdf/forms.md +205 -0
  118. package/skills/pdf/reference.md +612 -0
  119. package/skills/pdf/scripts/check_bounding_boxes.py +70 -0
  120. package/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
  121. package/skills/pdf/scripts/check_fillable_fields.py +12 -0
  122. package/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
  123. package/skills/pdf/scripts/create_validation_image.py +41 -0
  124. package/skills/pdf/scripts/extract_form_field_info.py +152 -0
  125. package/skills/pdf/scripts/fill_fillable_fields.py +114 -0
  126. package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
  127. package/skills/pend/SKILL.md +33 -0
  128. package/skills/ping/SKILL.md +39 -0
  129. package/skills/pptx/LICENSE.txt +30 -0
  130. package/skills/pptx/SKILL.md +484 -0
  131. package/skills/pptx/html2pptx.md +625 -0
  132. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  133. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  134. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  135. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  136. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  137. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  138. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  139. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  140. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  141. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  142. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  143. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  144. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  145. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  146. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  147. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  148. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  149. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  150. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  151. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  152. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  153. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  154. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  155. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  156. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  157. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  158. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  159. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  160. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  161. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  162. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  163. package/skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
  164. package/skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  165. package/skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  166. package/skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  167. package/skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  168. package/skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  169. package/skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  170. package/skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  171. package/skills/pptx/ooxml/scripts/pack.py +159 -0
  172. package/skills/pptx/ooxml/scripts/unpack.py +29 -0
  173. package/skills/pptx/ooxml/scripts/validate.py +69 -0
  174. package/skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
  175. package/skills/pptx/ooxml/scripts/validation/base.py +951 -0
  176. package/skills/pptx/ooxml/scripts/validation/docx.py +274 -0
  177. package/skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
  178. package/skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
  179. package/skills/pptx/ooxml.md +427 -0
  180. package/skills/pptx/scripts/html2pptx.js +979 -0
  181. package/skills/pptx/scripts/inventory.py +1020 -0
  182. package/skills/pptx/scripts/rearrange.py +231 -0
  183. package/skills/pptx/scripts/replace.py +385 -0
  184. package/skills/pptx/scripts/thumbnail.py +450 -0
  185. package/skills/progress-update/SKILL.md +394 -0
  186. package/skills/progress-update/scripts/update-progress.ts +221 -0
  187. package/skills/release-automation/SKILL.md +306 -0
  188. package/skills/requirement-parse/SKILL.md +212 -0
  189. package/skills/requirement-parse/scripts/infer-builder-config.ts +346 -0
  190. package/skills/requirement-parse/scripts/merge-requirements.ts +228 -0
  191. package/skills/requirement-parse/scripts/parse-docs.ts +206 -0
  192. package/skills/requirement-parse/scripts/parse-openspec.ts +168 -0
  193. package/skills/roadmap-docs-generate/SKILL.md +483 -0
  194. package/skills/roadmap-docs-generate/assets/templates/ROADMAP.mdx +75 -0
  195. package/skills/roadmap-docs-generate/assets/templates/ROADMAP.mdx.template +330 -0
  196. package/skills/roadmap-docs-generate/assets/templates/TODO.mdx +56 -0
  197. package/skills/roadmap-docs-generate/assets/templates/TODO.mdx.template +363 -0
  198. package/skills/roadmap-docs-generate/scripts/json-to-mdx.ts +445 -0
  199. package/skills/roadmap-docs-generate/scripts/json-to-mdx.ts.backup +411 -0
  200. package/skills/roadmap-generate/SKILL.md +396 -0
  201. package/skills/roadmap-generate/scripts/generate-roadmap.ts +496 -0
  202. package/skills/skill-creator/LICENSE.txt +202 -0
  203. package/skills/skill-creator/SKILL.md +356 -0
  204. package/skills/skill-creator/references/output-patterns.md +82 -0
  205. package/skills/skill-creator/references/workflows.md +28 -0
  206. package/skills/skill-creator/scripts/init_skill.py +303 -0
  207. package/skills/skill-creator/scripts/package_skill.py +110 -0
  208. package/skills/skill-creator/scripts/quick_validate.py +95 -0
  209. package/skills/spec-generate/SKILL.md +408 -0
  210. package/skills/spec-generate/scripts/generate-specs.ts +538 -0
  211. package/skills/spec-generate/scripts/generate-tasks.ts +174 -0
  212. package/skills/specs-review/SKILL.md +370 -0
  213. package/skills/task-execute/SKILL.md +399 -0
  214. package/skills/task-update-status/SKILL.md +349 -0
  215. package/skills/task-update-status/scripts/update-task-status.ts +192 -0
  216. package/skills/task-verify/SKILL.md +407 -0
  217. package/skills/ui-ux-pro-max/SKILL.md +386 -0
  218. package/skills/ui-ux-pro-max/data/charts.csv +26 -0
  219. package/skills/ui-ux-pro-max/data/colors.csv +97 -0
  220. package/skills/ui-ux-pro-max/data/icons.csv +101 -0
  221. package/skills/ui-ux-pro-max/data/landing.csv +31 -0
  222. package/skills/ui-ux-pro-max/data/products.csv +97 -0
  223. package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  224. package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  225. package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  226. package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  227. package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  228. package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  229. package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  230. package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  231. package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  232. package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  233. package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  234. package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  235. package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  236. package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  237. package/skills/ui-ux-pro-max/data/styles.csv +68 -0
  238. package/skills/ui-ux-pro-max/data/typography.csv +58 -0
  239. package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  240. package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  241. package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  242. package/skills/ui-ux-pro-max/scripts/core.py +253 -0
  243. package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  244. package/skills/ui-ux-pro-max/scripts/search.py +114 -0
  245. package/skills/vercel-automation/SKILL.md +226 -0
  246. package/skills/webapp-testing/LICENSE.txt +202 -0
  247. package/skills/webapp-testing/SKILL.md +96 -0
  248. package/skills/webapp-testing/examples/console_logging.py +35 -0
  249. package/skills/webapp-testing/examples/element_discovery.py +40 -0
  250. package/skills/webapp-testing/examples/static_html_automation.py +33 -0
  251. package/skills/webapp-testing/scripts/with_server.py +106 -0
  252. package/skills/worktree-manager/SKILL.md +725 -0
  253. package/skills/worktree-manager/config.json +15 -0
  254. package/skills/worktree-manager/scripts/allocate-ports.sh +100 -0
  255. package/skills/worktree-manager/scripts/cleanup.sh +185 -0
  256. package/skills/worktree-manager/scripts/launch-agent.sh +155 -0
  257. package/skills/worktree-manager/scripts/register.sh +125 -0
  258. package/skills/worktree-manager/scripts/release-ports.sh +48 -0
  259. package/skills/worktree-manager/scripts/status.sh +169 -0
  260. package/skills/worktree-manager/scripts/sync.sh +168 -0
  261. package/skills/worktree-manager/templates/worktree.json +23 -0
  262. package/skills/xlsx/LICENSE.txt +30 -0
  263. package/skills/xlsx/SKILL.md +289 -0
  264. package/skills/xlsx/recalc.py +178 -0
@@ -0,0 +1,169 @@
1
+ #!/bin/bash
2
+ # status.sh - Show status of all managed worktrees globally
3
+ #
4
+ # Usage: ./status.sh [--project <name>]
5
+ #
6
+ # Options:
7
+ # --project <name> Filter to show only worktrees for specific project
8
+ #
9
+ # Examples:
10
+ # ./status.sh # All worktrees
11
+ # ./status.sh --project obsidian-ai-agent # Only this project
12
+
13
+ set -e
14
+
15
+ PROJECT_FILTER=""
16
+
17
+ # Parse arguments
18
+ while [[ $# -gt 0 ]]; do
19
+ case $1 in
20
+ --project)
21
+ PROJECT_FILTER="$2"
22
+ shift 2
23
+ ;;
24
+ *)
25
+ echo "Unknown option: $1" >&2
26
+ echo "Usage: $0 [--project <name>]" >&2
27
+ exit 1
28
+ ;;
29
+ esac
30
+ done
31
+
32
+ REGISTRY="${HOME}/.claude/worktree-registry.json"
33
+
34
+ # Check if registry exists
35
+ if [ ! -f "$REGISTRY" ]; then
36
+ echo "No worktree registry found at: $REGISTRY"
37
+ echo ""
38
+ echo "No worktrees are being tracked yet."
39
+ exit 0
40
+ fi
41
+
42
+ # Check if jq is available
43
+ if ! command -v jq &> /dev/null; then
44
+ echo "Error: jq is required but not installed"
45
+ echo "Install with: brew install jq"
46
+ exit 1
47
+ fi
48
+
49
+ echo "═══════════════════════════════════════════════════════════════════════════════"
50
+ echo " GLOBAL WORKTREE STATUS"
51
+ if [ -n "$PROJECT_FILTER" ]; then
52
+ echo " (filtered: $PROJECT_FILTER)"
53
+ fi
54
+ echo "═══════════════════════════════════════════════════════════════════════════════"
55
+ echo ""
56
+
57
+ # Get worktrees, optionally filtered
58
+ if [ -n "$PROJECT_FILTER" ]; then
59
+ WORKTREES=$(jq -c ".worktrees[] | select(.project == \"$PROJECT_FILTER\")" "$REGISTRY" 2>/dev/null || echo "")
60
+ else
61
+ WORKTREES=$(jq -c '.worktrees[]' "$REGISTRY" 2>/dev/null || echo "")
62
+ fi
63
+
64
+ if [ -z "$WORKTREES" ]; then
65
+ if [ -n "$PROJECT_FILTER" ]; then
66
+ echo "No worktrees found for project: $PROJECT_FILTER"
67
+ else
68
+ echo "No worktrees registered."
69
+ fi
70
+ echo ""
71
+
72
+ # Show port pool status
73
+ echo "Port Pool:"
74
+ ALLOCATED=$(jq -r '.portPool.allocated | length' "$REGISTRY" 2>/dev/null || echo "0")
75
+ START=$(jq -r '.portPool.start // 8100' "$REGISTRY")
76
+ END=$(jq -r '.portPool.end // 8199' "$REGISTRY")
77
+ TOTAL=$((END - START + 1))
78
+ echo " Allocated: $ALLOCATED / $TOTAL"
79
+ exit 0
80
+ fi
81
+
82
+ # Print header
83
+ printf "%-25s %-20s %-12s %-8s %-10s %s\n" "PROJECT" "BRANCH" "PORTS" "PR" "STATUS" "TASK"
84
+ printf "%-25s %-20s %-12s %-8s %-10s %s\n" "─────────────────────────" "────────────────────" "────────────" "────────" "──────────" "──────────────────────"
85
+
86
+ # Process each worktree
87
+ echo "$WORKTREES" | while read -r wt; do
88
+ PROJECT=$(echo "$wt" | jq -r '.project')
89
+ BRANCH=$(echo "$wt" | jq -r '.branch')
90
+ PORTS=$(echo "$wt" | jq -r '.ports | join(",")')
91
+ TASK=$(echo "$wt" | jq -r 'if .task == null then "-" else .task end')
92
+ PR=$(echo "$wt" | jq -r 'if .prNumber == null then "-" else .prNumber end')
93
+ STATUS=$(echo "$wt" | jq -r '.status // "active"')
94
+ WORKTREE_PATH=$(echo "$wt" | jq -r '.worktreePath')
95
+ REPO_PATH=$(echo "$wt" | jq -r '.repoPath')
96
+
97
+ # Truncate task if too long
98
+ if [ ${#TASK} -gt 25 ]; then
99
+ TASK="${TASK:0:22}..."
100
+ fi
101
+
102
+ # Truncate branch if too long
103
+ if [ ${#BRANCH} -gt 18 ]; then
104
+ BRANCH="${BRANCH:0:15}..."
105
+ fi
106
+
107
+ # Check if worktree directory exists
108
+ if [ ! -d "$WORKTREE_PATH" ]; then
109
+ STATUS="missing"
110
+ fi
111
+
112
+ # Check if original repo exists
113
+ if [ ! -d "$REPO_PATH" ]; then
114
+ STATUS="orphaned"
115
+ fi
116
+
117
+ # Check PR status if not set
118
+ if [ "$PR" = "-" ] && command -v gh &> /dev/null; then
119
+ PR_INFO=$(cd "$REPO_PATH" 2>/dev/null && gh pr list --head "$BRANCH" --json number,state --jq 'if length > 0 then .[0] | "\(.number):\(.state)" else "" end' 2>/dev/null || echo "")
120
+ if [ -n "$PR_INFO" ]; then
121
+ PR_NUM=$(echo "$PR_INFO" | cut -d':' -f1)
122
+ PR_STATE=$(echo "$PR_INFO" | cut -d':' -f2)
123
+ case "$PR_STATE" in
124
+ "OPEN") PR="#$PR_NUM" ;;
125
+ "MERGED") PR="#$PR_NUM ✓" ; STATUS="merged" ;;
126
+ "CLOSED") PR="#$PR_NUM ✗" ;;
127
+ *) PR="#$PR_NUM" ;;
128
+ esac
129
+ fi
130
+ else
131
+ PR="#$PR"
132
+ fi
133
+
134
+ # Check if any port is in use (indicates server running)
135
+ FIRST_PORT=$(echo "$PORTS" | cut -d',' -f1)
136
+ if lsof -i :"$FIRST_PORT" &>/dev/null; then
137
+ PORTS="${PORTS}*"
138
+ fi
139
+
140
+ printf "%-25s %-20s %-12s %-8s %-10s %s\n" "$PROJECT" "$BRANCH" "$PORTS" "$PR" "$STATUS" "$TASK"
141
+ done
142
+
143
+ echo ""
144
+ echo "Legend: * = port in use, ✓ = PR merged, ✗ = PR closed"
145
+ echo ""
146
+
147
+ # Show port pool status
148
+ echo "───────────────────────────────────────────────────────────────────────────────"
149
+ echo "Port Pool:"
150
+ ALLOCATED=$(jq -r '.portPool.allocated | length' "$REGISTRY")
151
+ ALLOCATED_LIST=$(jq -r '.portPool.allocated | join(", ")' "$REGISTRY")
152
+ START=$(jq -r '.portPool.start // 8100' "$REGISTRY")
153
+ END=$(jq -r '.portPool.end // 8199' "$REGISTRY")
154
+ TOTAL=$((END - START + 1))
155
+ echo " Range: $START-$END ($TOTAL total)"
156
+ echo " Allocated: $ALLOCATED ports"
157
+ if [ "$ALLOCATED" -gt 0 ]; then
158
+ echo " In use: $ALLOCATED_LIST"
159
+ fi
160
+ echo ""
161
+
162
+ # Show worktree paths
163
+ echo "───────────────────────────────────────────────────────────────────────────────"
164
+ echo "Worktree Paths:"
165
+ if [ -n "$PROJECT_FILTER" ]; then
166
+ jq -r ".worktrees[] | select(.project == \"$PROJECT_FILTER\") | \" \\(.project)/\\(.branchSlug): \\(.worktreePath)\"" "$REGISTRY" 2>/dev/null
167
+ else
168
+ jq -r '.worktrees[] | " \(.project)/\(.branchSlug): \(.worktreePath)"' "$REGISTRY" 2>/dev/null
169
+ fi
@@ -0,0 +1,168 @@
1
+ #!/bin/bash
2
+ # sync.sh - Reconcile registry with actual worktrees and PR status
3
+ #
4
+ # Usage: ./sync.sh [--quiet] [--fix]
5
+ #
6
+ # Options:
7
+ # --quiet Only show issues, not OK entries
8
+ # --fix Automatically fix issues (remove missing, update PR numbers)
9
+ #
10
+ # This script:
11
+ # 1. Compares registry entries with actual git worktrees
12
+ # 2. Checks PR status for each worktree branch
13
+ # 3. Reports discrepancies
14
+ # 4. Optionally fixes issues (with --fix)
15
+
16
+ set -e
17
+
18
+ REGISTRY="${HOME}/.claude/worktree-registry.json"
19
+ QUIET=false
20
+ FIX=false
21
+
22
+ # Parse arguments
23
+ for arg in "$@"; do
24
+ case $arg in
25
+ --quiet) QUIET=true ;;
26
+ --fix) FIX=true ;;
27
+ esac
28
+ done
29
+
30
+ # Check dependencies
31
+ if ! command -v jq &> /dev/null; then
32
+ echo "Error: jq is required. Install with: brew install jq"
33
+ exit 1
34
+ fi
35
+
36
+ if ! command -v gh &> /dev/null; then
37
+ echo "Warning: gh (GitHub CLI) not found. PR status checks will be skipped."
38
+ HAS_GH=false
39
+ else
40
+ HAS_GH=true
41
+ fi
42
+
43
+ # Check if registry exists
44
+ if [ ! -f "$REGISTRY" ]; then
45
+ echo "Error: No registry found at: $REGISTRY"
46
+ exit 1
47
+ fi
48
+
49
+ echo "Syncing worktree registry..."
50
+ echo "─────────────────────────────────────────────────────────"
51
+
52
+ # Counters
53
+ TOTAL=0
54
+ MISSING=0
55
+ MERGED=0
56
+ ORPHANED=0
57
+ UPDATED=0
58
+
59
+ # Process each registry entry
60
+ while IFS= read -r entry; do
61
+ [ -z "$entry" ] && continue
62
+
63
+ TOTAL=$((TOTAL + 1))
64
+ PROJECT=$(echo "$entry" | jq -r '.project')
65
+ BRANCH=$(echo "$entry" | jq -r '.branch')
66
+ WPATH=$(echo "$entry" | jq -r '.worktreePath')
67
+ CURRENT_PR=$(echo "$entry" | jq -r '.prNumber // "null"')
68
+ CURRENT_STATUS=$(echo "$entry" | jq -r '.status')
69
+
70
+ # Check if directory exists
71
+ if [ ! -d "$WPATH" ]; then
72
+ echo "❌ MISSING: $PROJECT / $BRANCH"
73
+ echo " Path: $WPATH"
74
+ MISSING=$((MISSING + 1))
75
+
76
+ if [ "$FIX" = true ]; then
77
+ echo " → Removing from registry..."
78
+ TMP=$(mktemp)
79
+ jq "del(.worktrees[] | select(.project == \"$PROJECT\" and .branch == \"$BRANCH\"))" "$REGISTRY" > "$TMP"
80
+ mv "$TMP" "$REGISTRY"
81
+ UPDATED=$((UPDATED + 1))
82
+ fi
83
+ continue
84
+ fi
85
+
86
+ # Check if it's a valid git worktree
87
+ if [ ! -f "$WPATH/.git" ] && [ ! -d "$WPATH/.git" ]; then
88
+ echo "⚠️ ORPHANED: $PROJECT / $BRANCH"
89
+ echo " Path exists but not a git worktree"
90
+ ORPHANED=$((ORPHANED + 1))
91
+ continue
92
+ fi
93
+
94
+ # Check PR status
95
+ PR_NUM="null"
96
+ PR_STATE="NONE"
97
+
98
+ if [ "$HAS_GH" = true ]; then
99
+ PR_INFO=$(gh pr list --head "$BRANCH" --state all --json number,state --limit 1 2>/dev/null || echo "[]")
100
+ if [ "$PR_INFO" != "[]" ] && [ -n "$PR_INFO" ]; then
101
+ PR_NUM=$(echo "$PR_INFO" | jq -r '.[0].number // "null"')
102
+ PR_STATE=$(echo "$PR_INFO" | jq -r '.[0].state // "NONE"')
103
+ fi
104
+ fi
105
+
106
+ # Determine new status
107
+ NEW_STATUS="$CURRENT_STATUS"
108
+ if [ "$PR_STATE" = "MERGED" ]; then
109
+ NEW_STATUS="merged"
110
+ echo "✅ MERGED: $PROJECT / $BRANCH (PR #$PR_NUM)"
111
+ MERGED=$((MERGED + 1))
112
+ elif [ "$PR_STATE" = "OPEN" ]; then
113
+ NEW_STATUS="active"
114
+ if [ "$QUIET" = false ]; then
115
+ echo "🟢 ACTIVE: $PROJECT / $BRANCH (PR #$PR_NUM open)"
116
+ fi
117
+ elif [ "$PR_STATE" = "CLOSED" ]; then
118
+ NEW_STATUS="closed"
119
+ echo "🟡 CLOSED: $PROJECT / $BRANCH (PR #$PR_NUM closed without merge)"
120
+ else
121
+ if [ "$QUIET" = false ]; then
122
+ echo "🔵 NO PR: $PROJECT / $BRANCH"
123
+ fi
124
+ fi
125
+
126
+ # Update registry if needed
127
+ if [ "$FIX" = true ]; then
128
+ NEEDS_UPDATE=false
129
+
130
+ # Update prNumber if changed
131
+ if [ "$PR_NUM" != "null" ] && [ "$PR_NUM" != "$CURRENT_PR" ]; then
132
+ NEEDS_UPDATE=true
133
+ fi
134
+
135
+ # Update status if changed
136
+ if [ "$NEW_STATUS" != "$CURRENT_STATUS" ]; then
137
+ NEEDS_UPDATE=true
138
+ fi
139
+
140
+ if [ "$NEEDS_UPDATE" = true ]; then
141
+ TMP=$(mktemp)
142
+ if [ "$PR_NUM" != "null" ]; then
143
+ jq "(.worktrees[] | select(.project == \"$PROJECT\" and .branch == \"$BRANCH\")) |= . + {prNumber: $PR_NUM, status: \"$NEW_STATUS\"}" "$REGISTRY" > "$TMP"
144
+ else
145
+ jq "(.worktrees[] | select(.project == \"$PROJECT\" and .branch == \"$BRANCH\")).status = \"$NEW_STATUS\"" "$REGISTRY" > "$TMP"
146
+ fi
147
+ mv "$TMP" "$REGISTRY"
148
+ UPDATED=$((UPDATED + 1))
149
+ echo " → Updated registry (PR: $PR_NUM, status: $NEW_STATUS)"
150
+ fi
151
+ fi
152
+
153
+ done < <(jq -c '.worktrees[]' "$REGISTRY" 2>/dev/null)
154
+
155
+ echo "─────────────────────────────────────────────────────────"
156
+ echo "Summary:"
157
+ echo " Total entries: $TOTAL"
158
+ echo " Missing: $MISSING"
159
+ echo " Merged PRs: $MERGED"
160
+ echo " Orphaned: $ORPHANED"
161
+ if [ "$FIX" = true ]; then
162
+ echo " Updated: $UPDATED"
163
+ fi
164
+
165
+ if [ $MERGED -gt 0 ]; then
166
+ echo ""
167
+ echo "💡 Tip: Run 'cleanup.sh --merged' to remove merged worktrees"
168
+ fi
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$comment": "Optional project-specific configuration for worktree-manager. Place at .claude/worktree.json in your project root.",
4
+
5
+ "ports": {
6
+ "count": 2,
7
+ "services": ["api", "frontend"]
8
+ },
9
+
10
+ "install": "uv sync",
11
+
12
+ "validate": {
13
+ "start": "PORT={{PORT}} docker-compose up -d",
14
+ "healthCheck": "curl -sf http://localhost:{{PORT}}/health",
15
+ "healthCheckTimeout": 30,
16
+ "stop": "docker-compose down"
17
+ },
18
+
19
+ "copyDirs": [".agents", ".env.example"],
20
+
21
+ "preBranch": null,
22
+ "postCreate": null
23
+ }
@@ -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,289 @@
1
+ ---
2
+ name: xlsx
3
+ description: "Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas"
4
+ license: Proprietary. LICENSE.txt has complete terms
5
+ ---
6
+
7
+ # Requirements for Outputs
8
+
9
+ ## All Excel files
10
+
11
+ ### Zero Formula Errors
12
+ - Every Excel model MUST be delivered with ZERO formula errors (#REF!, #DIV/0!, #VALUE!, #N/A, #NAME?)
13
+
14
+ ### Preserve Existing Templates (when updating templates)
15
+ - Study and EXACTLY match existing format, style, and conventions when modifying files
16
+ - Never impose standardized formatting on files with established patterns
17
+ - Existing template conventions ALWAYS override these guidelines
18
+
19
+ ## Financial models
20
+
21
+ ### Color Coding Standards
22
+ Unless otherwise stated by the user or existing template
23
+
24
+ #### Industry-Standard Color Conventions
25
+ - **Blue text (RGB: 0,0,255)**: Hardcoded inputs, and numbers users will change for scenarios
26
+ - **Black text (RGB: 0,0,0)**: ALL formulas and calculations
27
+ - **Green text (RGB: 0,128,0)**: Links pulling from other worksheets within same workbook
28
+ - **Red text (RGB: 255,0,0)**: External links to other files
29
+ - **Yellow background (RGB: 255,255,0)**: Key assumptions needing attention or cells that need to be updated
30
+
31
+ ### Number Formatting Standards
32
+
33
+ #### Required Format Rules
34
+ - **Years**: Format as text strings (e.g., "2024" not "2,024")
35
+ - **Currency**: Use $#,##0 format; ALWAYS specify units in headers ("Revenue ($mm)")
36
+ - **Zeros**: Use number formatting to make all zeros "-", including percentages (e.g., "$#,##0;($#,##0);-")
37
+ - **Percentages**: Default to 0.0% format (one decimal)
38
+ - **Multiples**: Format as 0.0x for valuation multiples (EV/EBITDA, P/E)
39
+ - **Negative numbers**: Use parentheses (123) not minus -123
40
+
41
+ ### Formula Construction Rules
42
+
43
+ #### Assumptions Placement
44
+ - Place ALL assumptions (growth rates, margins, multiples, etc.) in separate assumption cells
45
+ - Use cell references instead of hardcoded values in formulas
46
+ - Example: Use =B5*(1+$B$6) instead of =B5*1.05
47
+
48
+ #### Formula Error Prevention
49
+ - Verify all cell references are correct
50
+ - Check for off-by-one errors in ranges
51
+ - Ensure consistent formulas across all projection periods
52
+ - Test with edge cases (zero values, negative numbers)
53
+ - Verify no unintended circular references
54
+
55
+ #### Documentation Requirements for Hardcodes
56
+ - Comment or in cells beside (if end of table). Format: "Source: [System/Document], [Date], [Specific Reference], [URL if applicable]"
57
+ - Examples:
58
+ - "Source: Company 10-K, FY2024, Page 45, Revenue Note, [SEC EDGAR URL]"
59
+ - "Source: Company 10-Q, Q2 2025, Exhibit 99.1, [SEC EDGAR URL]"
60
+ - "Source: Bloomberg Terminal, 8/15/2025, AAPL US Equity"
61
+ - "Source: FactSet, 8/20/2025, Consensus Estimates Screen"
62
+
63
+ # XLSX creation, editing, and analysis
64
+
65
+ ## Overview
66
+
67
+ A user may ask you to create, edit, or analyze the contents of an .xlsx file. You have different tools and workflows available for different tasks.
68
+
69
+ ## Important Requirements
70
+
71
+ **LibreOffice Required for Formula Recalculation**: You can assume LibreOffice is installed for recalculating formula values using the `recalc.py` script. The script automatically configures LibreOffice on first run
72
+
73
+ ## Reading and analyzing data
74
+
75
+ ### Data analysis with pandas
76
+ For data analysis, visualization, and basic operations, use **pandas** which provides powerful data manipulation capabilities:
77
+
78
+ ```python
79
+ import pandas as pd
80
+
81
+ # Read Excel
82
+ df = pd.read_excel('file.xlsx') # Default: first sheet
83
+ all_sheets = pd.read_excel('file.xlsx', sheet_name=None) # All sheets as dict
84
+
85
+ # Analyze
86
+ df.head() # Preview data
87
+ df.info() # Column info
88
+ df.describe() # Statistics
89
+
90
+ # Write Excel
91
+ df.to_excel('output.xlsx', index=False)
92
+ ```
93
+
94
+ ## Excel File Workflows
95
+
96
+ ## CRITICAL: Use Formulas, Not Hardcoded Values
97
+
98
+ **Always use Excel formulas instead of calculating values in Python and hardcoding them.** This ensures the spreadsheet remains dynamic and updateable.
99
+
100
+ ### ❌ WRONG - Hardcoding Calculated Values
101
+ ```python
102
+ # Bad: Calculating in Python and hardcoding result
103
+ total = df['Sales'].sum()
104
+ sheet['B10'] = total # Hardcodes 5000
105
+
106
+ # Bad: Computing growth rate in Python
107
+ growth = (df.iloc[-1]['Revenue'] - df.iloc[0]['Revenue']) / df.iloc[0]['Revenue']
108
+ sheet['C5'] = growth # Hardcodes 0.15
109
+
110
+ # Bad: Python calculation for average
111
+ avg = sum(values) / len(values)
112
+ sheet['D20'] = avg # Hardcodes 42.5
113
+ ```
114
+
115
+ ### ✅ CORRECT - Using Excel Formulas
116
+ ```python
117
+ # Good: Let Excel calculate the sum
118
+ sheet['B10'] = '=SUM(B2:B9)'
119
+
120
+ # Good: Growth rate as Excel formula
121
+ sheet['C5'] = '=(C4-C2)/C2'
122
+
123
+ # Good: Average using Excel function
124
+ sheet['D20'] = '=AVERAGE(D2:D19)'
125
+ ```
126
+
127
+ This applies to ALL calculations - totals, percentages, ratios, differences, etc. The spreadsheet should be able to recalculate when source data changes.
128
+
129
+ ## Common Workflow
130
+ 1. **Choose tool**: pandas for data, openpyxl for formulas/formatting
131
+ 2. **Create/Load**: Create new workbook or load existing file
132
+ 3. **Modify**: Add/edit data, formulas, and formatting
133
+ 4. **Save**: Write to file
134
+ 5. **Recalculate formulas (MANDATORY IF USING FORMULAS)**: Use the recalc.py script
135
+ ```bash
136
+ python recalc.py output.xlsx
137
+ ```
138
+ 6. **Verify and fix any errors**:
139
+ - The script returns JSON with error details
140
+ - If `status` is `errors_found`, check `error_summary` for specific error types and locations
141
+ - Fix the identified errors and recalculate again
142
+ - Common errors to fix:
143
+ - `#REF!`: Invalid cell references
144
+ - `#DIV/0!`: Division by zero
145
+ - `#VALUE!`: Wrong data type in formula
146
+ - `#NAME?`: Unrecognized formula name
147
+
148
+ ### Creating new Excel files
149
+
150
+ ```python
151
+ # Using openpyxl for formulas and formatting
152
+ from openpyxl import Workbook
153
+ from openpyxl.styles import Font, PatternFill, Alignment
154
+
155
+ wb = Workbook()
156
+ sheet = wb.active
157
+
158
+ # Add data
159
+ sheet['A1'] = 'Hello'
160
+ sheet['B1'] = 'World'
161
+ sheet.append(['Row', 'of', 'data'])
162
+
163
+ # Add formula
164
+ sheet['B2'] = '=SUM(A1:A10)'
165
+
166
+ # Formatting
167
+ sheet['A1'].font = Font(bold=True, color='FF0000')
168
+ sheet['A1'].fill = PatternFill('solid', start_color='FFFF00')
169
+ sheet['A1'].alignment = Alignment(horizontal='center')
170
+
171
+ # Column width
172
+ sheet.column_dimensions['A'].width = 20
173
+
174
+ wb.save('output.xlsx')
175
+ ```
176
+
177
+ ### Editing existing Excel files
178
+
179
+ ```python
180
+ # Using openpyxl to preserve formulas and formatting
181
+ from openpyxl import load_workbook
182
+
183
+ # Load existing file
184
+ wb = load_workbook('existing.xlsx')
185
+ sheet = wb.active # or wb['SheetName'] for specific sheet
186
+
187
+ # Working with multiple sheets
188
+ for sheet_name in wb.sheetnames:
189
+ sheet = wb[sheet_name]
190
+ print(f"Sheet: {sheet_name}")
191
+
192
+ # Modify cells
193
+ sheet['A1'] = 'New Value'
194
+ sheet.insert_rows(2) # Insert row at position 2
195
+ sheet.delete_cols(3) # Delete column 3
196
+
197
+ # Add new sheet
198
+ new_sheet = wb.create_sheet('NewSheet')
199
+ new_sheet['A1'] = 'Data'
200
+
201
+ wb.save('modified.xlsx')
202
+ ```
203
+
204
+ ## Recalculating formulas
205
+
206
+ Excel files created or modified by openpyxl contain formulas as strings but not calculated values. Use the provided `recalc.py` script to recalculate formulas:
207
+
208
+ ```bash
209
+ python recalc.py <excel_file> [timeout_seconds]
210
+ ```
211
+
212
+ Example:
213
+ ```bash
214
+ python recalc.py output.xlsx 30
215
+ ```
216
+
217
+ The script:
218
+ - Automatically sets up LibreOffice macro on first run
219
+ - Recalculates all formulas in all sheets
220
+ - Scans ALL cells for Excel errors (#REF!, #DIV/0!, etc.)
221
+ - Returns JSON with detailed error locations and counts
222
+ - Works on both Linux and macOS
223
+
224
+ ## Formula Verification Checklist
225
+
226
+ Quick checks to ensure formulas work correctly:
227
+
228
+ ### Essential Verification
229
+ - [ ] **Test 2-3 sample references**: Verify they pull correct values before building full model
230
+ - [ ] **Column mapping**: Confirm Excel columns match (e.g., column 64 = BL, not BK)
231
+ - [ ] **Row offset**: Remember Excel rows are 1-indexed (DataFrame row 5 = Excel row 6)
232
+
233
+ ### Common Pitfalls
234
+ - [ ] **NaN handling**: Check for null values with `pd.notna()`
235
+ - [ ] **Far-right columns**: FY data often in columns 50+
236
+ - [ ] **Multiple matches**: Search all occurrences, not just first
237
+ - [ ] **Division by zero**: Check denominators before using `/` in formulas (#DIV/0!)
238
+ - [ ] **Wrong references**: Verify all cell references point to intended cells (#REF!)
239
+ - [ ] **Cross-sheet references**: Use correct format (Sheet1!A1) for linking sheets
240
+
241
+ ### Formula Testing Strategy
242
+ - [ ] **Start small**: Test formulas on 2-3 cells before applying broadly
243
+ - [ ] **Verify dependencies**: Check all cells referenced in formulas exist
244
+ - [ ] **Test edge cases**: Include zero, negative, and very large values
245
+
246
+ ### Interpreting recalc.py Output
247
+ The script returns JSON with error details:
248
+ ```json
249
+ {
250
+ "status": "success", // or "errors_found"
251
+ "total_errors": 0, // Total error count
252
+ "total_formulas": 42, // Number of formulas in file
253
+ "error_summary": { // Only present if errors found
254
+ "#REF!": {
255
+ "count": 2,
256
+ "locations": ["Sheet1!B5", "Sheet1!C10"]
257
+ }
258
+ }
259
+ }
260
+ ```
261
+
262
+ ## Best Practices
263
+
264
+ ### Library Selection
265
+ - **pandas**: Best for data analysis, bulk operations, and simple data export
266
+ - **openpyxl**: Best for complex formatting, formulas, and Excel-specific features
267
+
268
+ ### Working with openpyxl
269
+ - Cell indices are 1-based (row=1, column=1 refers to cell A1)
270
+ - Use `data_only=True` to read calculated values: `load_workbook('file.xlsx', data_only=True)`
271
+ - **Warning**: If opened with `data_only=True` and saved, formulas are replaced with values and permanently lost
272
+ - For large files: Use `read_only=True` for reading or `write_only=True` for writing
273
+ - Formulas are preserved but not evaluated - use recalc.py to update values
274
+
275
+ ### Working with pandas
276
+ - Specify data types to avoid inference issues: `pd.read_excel('file.xlsx', dtype={'id': str})`
277
+ - For large files, read specific columns: `pd.read_excel('file.xlsx', usecols=['A', 'C', 'E'])`
278
+ - Handle dates properly: `pd.read_excel('file.xlsx', parse_dates=['date_column'])`
279
+
280
+ ## Code Style Guidelines
281
+ **IMPORTANT**: When generating Python code for Excel operations:
282
+ - Write minimal, concise Python code without unnecessary comments
283
+ - Avoid verbose variable names and redundant operations
284
+ - Avoid unnecessary print statements
285
+
286
+ **For Excel files themselves**:
287
+ - Add comments to cells with complex formulas or important assumptions
288
+ - Document data sources for hardcoded values
289
+ - Include notes for key calculations and model sections