scientific-writer 2.1.1__py3-none-any.whl → 2.2.2__py3-none-any.whl

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.

Potentially problematic release.


This version of scientific-writer might be problematic. Click here for more details.

Files changed (311) hide show
  1. scientific_writer/.claude/settings.local.json +30 -0
  2. scientific_writer/.claude/skills/citation-management/SKILL.md +1046 -0
  3. scientific_writer/.claude/skills/citation-management/assets/bibtex_template.bib +264 -0
  4. scientific_writer/.claude/skills/citation-management/assets/citation_checklist.md +386 -0
  5. scientific_writer/.claude/skills/citation-management/references/bibtex_formatting.md +908 -0
  6. scientific_writer/.claude/skills/citation-management/references/citation_validation.md +794 -0
  7. scientific_writer/.claude/skills/citation-management/references/google_scholar_search.md +725 -0
  8. scientific_writer/.claude/skills/citation-management/references/metadata_extraction.md +870 -0
  9. scientific_writer/.claude/skills/citation-management/references/pubmed_search.md +839 -0
  10. scientific_writer/.claude/skills/citation-management/scripts/doi_to_bibtex.py +204 -0
  11. scientific_writer/.claude/skills/citation-management/scripts/extract_metadata.py +569 -0
  12. scientific_writer/.claude/skills/citation-management/scripts/format_bibtex.py +349 -0
  13. scientific_writer/.claude/skills/citation-management/scripts/search_google_scholar.py +282 -0
  14. scientific_writer/.claude/skills/citation-management/scripts/search_pubmed.py +398 -0
  15. scientific_writer/.claude/skills/citation-management/scripts/validate_citations.py +497 -0
  16. scientific_writer/.claude/skills/clinical-reports/IMPLEMENTATION_SUMMARY.md +641 -0
  17. scientific_writer/.claude/skills/clinical-reports/README.md +236 -0
  18. scientific_writer/.claude/skills/clinical-reports/SKILL.md +1088 -0
  19. scientific_writer/.claude/skills/clinical-reports/assets/case_report_template.md +352 -0
  20. scientific_writer/.claude/skills/clinical-reports/assets/clinical_trial_csr_template.md +353 -0
  21. scientific_writer/.claude/skills/clinical-reports/assets/clinical_trial_sae_template.md +359 -0
  22. scientific_writer/.claude/skills/clinical-reports/assets/consult_note_template.md +305 -0
  23. scientific_writer/.claude/skills/clinical-reports/assets/discharge_summary_template.md +453 -0
  24. scientific_writer/.claude/skills/clinical-reports/assets/hipaa_compliance_checklist.md +395 -0
  25. scientific_writer/.claude/skills/clinical-reports/assets/history_physical_template.md +305 -0
  26. scientific_writer/.claude/skills/clinical-reports/assets/lab_report_template.md +309 -0
  27. scientific_writer/.claude/skills/clinical-reports/assets/pathology_report_template.md +249 -0
  28. scientific_writer/.claude/skills/clinical-reports/assets/quality_checklist.md +338 -0
  29. scientific_writer/.claude/skills/clinical-reports/assets/radiology_report_template.md +318 -0
  30. scientific_writer/.claude/skills/clinical-reports/assets/soap_note_template.md +253 -0
  31. scientific_writer/.claude/skills/clinical-reports/references/case_report_guidelines.md +570 -0
  32. scientific_writer/.claude/skills/clinical-reports/references/clinical_trial_reporting.md +693 -0
  33. scientific_writer/.claude/skills/clinical-reports/references/data_presentation.md +530 -0
  34. scientific_writer/.claude/skills/clinical-reports/references/diagnostic_reports_standards.md +629 -0
  35. scientific_writer/.claude/skills/clinical-reports/references/medical_terminology.md +588 -0
  36. scientific_writer/.claude/skills/clinical-reports/references/patient_documentation.md +744 -0
  37. scientific_writer/.claude/skills/clinical-reports/references/peer_review_standards.md +585 -0
  38. scientific_writer/.claude/skills/clinical-reports/references/regulatory_compliance.md +577 -0
  39. scientific_writer/.claude/skills/clinical-reports/scripts/check_deidentification.py +346 -0
  40. scientific_writer/.claude/skills/clinical-reports/scripts/compliance_checker.py +78 -0
  41. scientific_writer/.claude/skills/clinical-reports/scripts/extract_clinical_data.py +102 -0
  42. scientific_writer/.claude/skills/clinical-reports/scripts/format_adverse_events.py +103 -0
  43. scientific_writer/.claude/skills/clinical-reports/scripts/generate_report_template.py +163 -0
  44. scientific_writer/.claude/skills/clinical-reports/scripts/terminology_validator.py +133 -0
  45. scientific_writer/.claude/skills/clinical-reports/scripts/validate_case_report.py +334 -0
  46. scientific_writer/.claude/skills/clinical-reports/scripts/validate_trial_report.py +89 -0
  47. scientific_writer/.claude/skills/document-skills/docx/LICENSE.txt +30 -0
  48. scientific_writer/.claude/skills/document-skills/docx/SKILL.md +197 -0
  49. scientific_writer/.claude/skills/document-skills/docx/docx-js.md +350 -0
  50. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  51. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  52. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  53. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  54. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  55. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  56. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  57. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  58. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  59. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  60. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  61. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  62. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  63. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  64. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  65. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  66. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  67. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  68. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  69. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  70. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  71. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  72. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  73. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  74. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  75. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  76. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  77. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  78. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  79. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  80. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  81. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
  82. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  83. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  84. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  85. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  86. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  87. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  88. scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  89. scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/pack.py +159 -0
  90. scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/unpack.py +29 -0
  91. scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validate.py +69 -0
  92. scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validation/__init__.py +15 -0
  93. scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validation/base.py +951 -0
  94. scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validation/docx.py +274 -0
  95. scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validation/pptx.py +315 -0
  96. scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validation/redlining.py +279 -0
  97. scientific_writer/.claude/skills/document-skills/docx/ooxml.md +610 -0
  98. scientific_writer/.claude/skills/document-skills/docx/scripts/__init__.py +1 -0
  99. scientific_writer/.claude/skills/document-skills/docx/scripts/document.py +1276 -0
  100. scientific_writer/.claude/skills/document-skills/docx/scripts/templates/comments.xml +3 -0
  101. scientific_writer/.claude/skills/document-skills/docx/scripts/templates/commentsExtended.xml +3 -0
  102. scientific_writer/.claude/skills/document-skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  103. scientific_writer/.claude/skills/document-skills/docx/scripts/templates/commentsIds.xml +3 -0
  104. scientific_writer/.claude/skills/document-skills/docx/scripts/templates/people.xml +3 -0
  105. scientific_writer/.claude/skills/document-skills/docx/scripts/utilities.py +374 -0
  106. scientific_writer/.claude/skills/document-skills/pdf/LICENSE.txt +30 -0
  107. scientific_writer/.claude/skills/document-skills/pdf/SKILL.md +294 -0
  108. scientific_writer/.claude/skills/document-skills/pdf/forms.md +205 -0
  109. scientific_writer/.claude/skills/document-skills/pdf/reference.md +612 -0
  110. scientific_writer/.claude/skills/document-skills/pdf/scripts/check_bounding_boxes.py +70 -0
  111. scientific_writer/.claude/skills/document-skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
  112. scientific_writer/.claude/skills/document-skills/pdf/scripts/check_fillable_fields.py +12 -0
  113. scientific_writer/.claude/skills/document-skills/pdf/scripts/convert_pdf_to_images.py +35 -0
  114. scientific_writer/.claude/skills/document-skills/pdf/scripts/create_validation_image.py +41 -0
  115. scientific_writer/.claude/skills/document-skills/pdf/scripts/extract_form_field_info.py +152 -0
  116. scientific_writer/.claude/skills/document-skills/pdf/scripts/fill_fillable_fields.py +114 -0
  117. scientific_writer/.claude/skills/document-skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
  118. scientific_writer/.claude/skills/document-skills/pptx/LICENSE.txt +30 -0
  119. scientific_writer/.claude/skills/document-skills/pptx/SKILL.md +484 -0
  120. scientific_writer/.claude/skills/document-skills/pptx/html2pptx.md +625 -0
  121. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  122. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  123. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  124. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  125. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  126. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  127. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  128. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  129. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  130. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  131. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  132. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  133. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  134. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  135. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  136. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  137. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  138. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  139. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  140. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  141. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  142. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  143. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  144. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  145. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  146. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  147. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  148. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  149. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  150. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  151. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  152. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
  153. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  154. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  155. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  156. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  157. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  158. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  159. scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  160. scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/pack.py +159 -0
  161. scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/unpack.py +29 -0
  162. scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validate.py +69 -0
  163. scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
  164. scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validation/base.py +951 -0
  165. scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validation/docx.py +274 -0
  166. scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
  167. scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
  168. scientific_writer/.claude/skills/document-skills/pptx/ooxml.md +427 -0
  169. scientific_writer/.claude/skills/document-skills/pptx/scripts/html2pptx.js +979 -0
  170. scientific_writer/.claude/skills/document-skills/pptx/scripts/inventory.py +1020 -0
  171. scientific_writer/.claude/skills/document-skills/pptx/scripts/rearrange.py +231 -0
  172. scientific_writer/.claude/skills/document-skills/pptx/scripts/replace.py +385 -0
  173. scientific_writer/.claude/skills/document-skills/pptx/scripts/thumbnail.py +450 -0
  174. scientific_writer/.claude/skills/document-skills/xlsx/LICENSE.txt +30 -0
  175. scientific_writer/.claude/skills/document-skills/xlsx/SKILL.md +289 -0
  176. scientific_writer/.claude/skills/document-skills/xlsx/recalc.py +178 -0
  177. scientific_writer/.claude/skills/hypothesis-generation/SKILL.md +155 -0
  178. scientific_writer/.claude/skills/hypothesis-generation/assets/hypothesis_output_template.md +302 -0
  179. scientific_writer/.claude/skills/hypothesis-generation/references/experimental_design_patterns.md +327 -0
  180. scientific_writer/.claude/skills/hypothesis-generation/references/hypothesis_quality_criteria.md +196 -0
  181. scientific_writer/.claude/skills/hypothesis-generation/references/literature_search_strategies.md +505 -0
  182. scientific_writer/.claude/skills/latex-posters/README.md +417 -0
  183. scientific_writer/.claude/skills/latex-posters/SKILL.md +919 -0
  184. scientific_writer/.claude/skills/latex-posters/assets/baposter_template.tex +257 -0
  185. scientific_writer/.claude/skills/latex-posters/assets/beamerposter_template.tex +244 -0
  186. scientific_writer/.claude/skills/latex-posters/assets/poster_quality_checklist.md +358 -0
  187. scientific_writer/.claude/skills/latex-posters/assets/tikzposter_template.tex +251 -0
  188. scientific_writer/.claude/skills/latex-posters/references/latex_poster_packages.md +745 -0
  189. scientific_writer/.claude/skills/latex-posters/references/poster_content_guide.md +748 -0
  190. scientific_writer/.claude/skills/latex-posters/references/poster_design_principles.md +806 -0
  191. scientific_writer/.claude/skills/latex-posters/references/poster_layout_design.md +900 -0
  192. scientific_writer/.claude/skills/latex-posters/scripts/review_poster.sh +214 -0
  193. scientific_writer/.claude/skills/literature-review/SKILL.md +546 -0
  194. scientific_writer/.claude/skills/literature-review/assets/review_template.md +412 -0
  195. scientific_writer/.claude/skills/literature-review/references/citation_styles.md +166 -0
  196. scientific_writer/.claude/skills/literature-review/references/database_strategies.md +381 -0
  197. scientific_writer/.claude/skills/literature-review/scripts/generate_pdf.py +176 -0
  198. scientific_writer/.claude/skills/literature-review/scripts/search_databases.py +303 -0
  199. scientific_writer/.claude/skills/literature-review/scripts/verify_citations.py +222 -0
  200. scientific_writer/.claude/skills/markitdown/INSTALLATION_GUIDE.md +318 -0
  201. scientific_writer/.claude/skills/markitdown/LICENSE.txt +22 -0
  202. scientific_writer/.claude/skills/markitdown/OPENROUTER_INTEGRATION.md +359 -0
  203. scientific_writer/.claude/skills/markitdown/QUICK_REFERENCE.md +309 -0
  204. scientific_writer/.claude/skills/markitdown/README.md +184 -0
  205. scientific_writer/.claude/skills/markitdown/SKILL.md +450 -0
  206. scientific_writer/.claude/skills/markitdown/SKILL_SUMMARY.md +307 -0
  207. scientific_writer/.claude/skills/markitdown/assets/example_usage.md +463 -0
  208. scientific_writer/.claude/skills/markitdown/references/api_reference.md +399 -0
  209. scientific_writer/.claude/skills/markitdown/references/file_formats.md +542 -0
  210. scientific_writer/.claude/skills/markitdown/scripts/batch_convert.py +228 -0
  211. scientific_writer/.claude/skills/markitdown/scripts/convert_literature.py +283 -0
  212. scientific_writer/.claude/skills/markitdown/scripts/convert_with_ai.py +243 -0
  213. scientific_writer/.claude/skills/paper-2-web/SKILL.md +455 -0
  214. scientific_writer/.claude/skills/paper-2-web/references/installation.md +141 -0
  215. scientific_writer/.claude/skills/paper-2-web/references/paper2poster.md +346 -0
  216. scientific_writer/.claude/skills/paper-2-web/references/paper2video.md +305 -0
  217. scientific_writer/.claude/skills/paper-2-web/references/paper2web.md +187 -0
  218. scientific_writer/.claude/skills/paper-2-web/references/usage_examples.md +436 -0
  219. scientific_writer/.claude/skills/peer-review/SKILL.md +375 -0
  220. scientific_writer/.claude/skills/peer-review/references/common_issues.md +552 -0
  221. scientific_writer/.claude/skills/peer-review/references/reporting_standards.md +290 -0
  222. scientific_writer/.claude/skills/research-grants/README.md +285 -0
  223. scientific_writer/.claude/skills/research-grants/SKILL.md +896 -0
  224. scientific_writer/.claude/skills/research-grants/assets/budget_justification_template.md +453 -0
  225. scientific_writer/.claude/skills/research-grants/assets/nih_specific_aims_template.md +166 -0
  226. scientific_writer/.claude/skills/research-grants/assets/nsf_project_summary_template.md +92 -0
  227. scientific_writer/.claude/skills/research-grants/references/broader_impacts.md +392 -0
  228. scientific_writer/.claude/skills/research-grants/references/darpa_guidelines.md +636 -0
  229. scientific_writer/.claude/skills/research-grants/references/doe_guidelines.md +586 -0
  230. scientific_writer/.claude/skills/research-grants/references/nih_guidelines.md +851 -0
  231. scientific_writer/.claude/skills/research-grants/references/nsf_guidelines.md +570 -0
  232. scientific_writer/.claude/skills/research-grants/references/specific_aims_guide.md +458 -0
  233. scientific_writer/.claude/skills/research-lookup/README.md +116 -0
  234. scientific_writer/.claude/skills/research-lookup/SKILL.md +443 -0
  235. scientific_writer/.claude/skills/research-lookup/examples.py +174 -0
  236. scientific_writer/.claude/skills/research-lookup/lookup.py +93 -0
  237. scientific_writer/.claude/skills/research-lookup/research_lookup.py +335 -0
  238. scientific_writer/.claude/skills/research-lookup/scripts/research_lookup.py +261 -0
  239. scientific_writer/.claude/skills/scholar-evaluation/SKILL.md +254 -0
  240. scientific_writer/.claude/skills/scholar-evaluation/references/evaluation_framework.md +663 -0
  241. scientific_writer/.claude/skills/scholar-evaluation/scripts/calculate_scores.py +378 -0
  242. scientific_writer/.claude/skills/scientific-critical-thinking/SKILL.md +530 -0
  243. scientific_writer/.claude/skills/scientific-critical-thinking/references/common_biases.md +364 -0
  244. scientific_writer/.claude/skills/scientific-critical-thinking/references/evidence_hierarchy.md +484 -0
  245. scientific_writer/.claude/skills/scientific-critical-thinking/references/experimental_design.md +496 -0
  246. scientific_writer/.claude/skills/scientific-critical-thinking/references/logical_fallacies.md +478 -0
  247. scientific_writer/.claude/skills/scientific-critical-thinking/references/scientific_method.md +169 -0
  248. scientific_writer/.claude/skills/scientific-critical-thinking/references/statistical_pitfalls.md +506 -0
  249. scientific_writer/.claude/skills/scientific-schematics/SKILL.md +2035 -0
  250. scientific_writer/.claude/skills/scientific-schematics/assets/block_diagram_template.tex +199 -0
  251. scientific_writer/.claude/skills/scientific-schematics/assets/circuit_template.tex +159 -0
  252. scientific_writer/.claude/skills/scientific-schematics/assets/flowchart_template.tex +161 -0
  253. scientific_writer/.claude/skills/scientific-schematics/assets/pathway_template.tex +162 -0
  254. scientific_writer/.claude/skills/scientific-schematics/assets/tikz_styles.tex +422 -0
  255. scientific_writer/.claude/skills/scientific-schematics/references/best_practices.md +562 -0
  256. scientific_writer/.claude/skills/scientific-schematics/references/diagram_types.md +637 -0
  257. scientific_writer/.claude/skills/scientific-schematics/references/python_libraries.md +791 -0
  258. scientific_writer/.claude/skills/scientific-schematics/references/tikz_guide.md +734 -0
  259. scientific_writer/.claude/skills/scientific-schematics/scripts/circuit_generator.py +307 -0
  260. scientific_writer/.claude/skills/scientific-schematics/scripts/compile_tikz.py +292 -0
  261. scientific_writer/.claude/skills/scientific-schematics/scripts/generate_flowchart.py +281 -0
  262. scientific_writer/.claude/skills/scientific-schematics/scripts/pathway_diagram.py +406 -0
  263. scientific_writer/.claude/skills/scientific-writing/SKILL.md +443 -0
  264. scientific_writer/.claude/skills/scientific-writing/references/citation_styles.md +720 -0
  265. scientific_writer/.claude/skills/scientific-writing/references/figures_tables.md +806 -0
  266. scientific_writer/.claude/skills/scientific-writing/references/imrad_structure.md +658 -0
  267. scientific_writer/.claude/skills/scientific-writing/references/reporting_guidelines.md +748 -0
  268. scientific_writer/.claude/skills/scientific-writing/references/writing_principles.md +824 -0
  269. scientific_writer/.claude/skills/treatment-plans/README.md +483 -0
  270. scientific_writer/.claude/skills/treatment-plans/SKILL.md +817 -0
  271. scientific_writer/.claude/skills/treatment-plans/assets/chronic_disease_management_plan.tex +636 -0
  272. scientific_writer/.claude/skills/treatment-plans/assets/general_medical_treatment_plan.tex +616 -0
  273. scientific_writer/.claude/skills/treatment-plans/assets/mental_health_treatment_plan.tex +745 -0
  274. scientific_writer/.claude/skills/treatment-plans/assets/pain_management_plan.tex +770 -0
  275. scientific_writer/.claude/skills/treatment-plans/assets/perioperative_care_plan.tex +724 -0
  276. scientific_writer/.claude/skills/treatment-plans/assets/quality_checklist.md +471 -0
  277. scientific_writer/.claude/skills/treatment-plans/assets/rehabilitation_treatment_plan.tex +727 -0
  278. scientific_writer/.claude/skills/treatment-plans/references/goal_setting_frameworks.md +411 -0
  279. scientific_writer/.claude/skills/treatment-plans/references/intervention_guidelines.md +507 -0
  280. scientific_writer/.claude/skills/treatment-plans/references/regulatory_compliance.md +476 -0
  281. scientific_writer/.claude/skills/treatment-plans/references/specialty_specific_guidelines.md +607 -0
  282. scientific_writer/.claude/skills/treatment-plans/references/treatment_plan_standards.md +456 -0
  283. scientific_writer/.claude/skills/treatment-plans/scripts/check_completeness.py +318 -0
  284. scientific_writer/.claude/skills/treatment-plans/scripts/generate_template.py +244 -0
  285. scientific_writer/.claude/skills/treatment-plans/scripts/timeline_generator.py +369 -0
  286. scientific_writer/.claude/skills/treatment-plans/scripts/validate_treatment_plan.py +367 -0
  287. scientific_writer/.claude/skills/venue-templates/SKILL.md +590 -0
  288. scientific_writer/.claude/skills/venue-templates/assets/grants/nih_specific_aims.tex +235 -0
  289. scientific_writer/.claude/skills/venue-templates/assets/grants/nsf_proposal_template.tex +375 -0
  290. scientific_writer/.claude/skills/venue-templates/assets/journals/nature_article.tex +171 -0
  291. scientific_writer/.claude/skills/venue-templates/assets/journals/neurips_article.tex +283 -0
  292. scientific_writer/.claude/skills/venue-templates/assets/journals/plos_one.tex +317 -0
  293. scientific_writer/.claude/skills/venue-templates/assets/posters/beamerposter_academic.tex +311 -0
  294. scientific_writer/.claude/skills/venue-templates/references/conferences_formatting.md +564 -0
  295. scientific_writer/.claude/skills/venue-templates/references/grants_requirements.md +787 -0
  296. scientific_writer/.claude/skills/venue-templates/references/journals_formatting.md +486 -0
  297. scientific_writer/.claude/skills/venue-templates/references/posters_guidelines.md +628 -0
  298. scientific_writer/.claude/skills/venue-templates/scripts/customize_template.py +206 -0
  299. scientific_writer/.claude/skills/venue-templates/scripts/query_template.py +260 -0
  300. scientific_writer/.claude/skills/venue-templates/scripts/validate_format.py +255 -0
  301. scientific_writer/CLAUDE.md +748 -0
  302. scientific_writer/__init__.py +2 -2
  303. scientific_writer/api.py +14 -7
  304. scientific_writer/cli.py +12 -7
  305. scientific_writer/core.py +27 -5
  306. {scientific_writer-2.1.1.dist-info → scientific_writer-2.2.2.dist-info}/METADATA +5 -1
  307. scientific_writer-2.2.2.dist-info/RECORD +312 -0
  308. scientific_writer-2.1.1.dist-info/RECORD +0 -11
  309. {scientific_writer-2.1.1.dist-info → scientific_writer-2.2.2.dist-info}/WHEEL +0 -0
  310. {scientific_writer-2.1.1.dist-info → scientific_writer-2.2.2.dist-info}/entry_points.txt +0 -0
  311. {scientific_writer-2.1.1.dist-info → scientific_writer-2.2.2.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,289 @@
1
+ ---
2
+ name: xlsx
3
+ description: "Spreadsheet toolkit (.xlsx/.csv). Create/edit with formulas/formatting, analyze data, visualization, recalculate formulas, for spreadsheet processing and analysis."
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
+ Create, edit, or analyze Excel spreadsheets with formulas, formatting, and data analysis. Apply this skill for spreadsheet processing using openpyxl and pandas. Recalculate formulas and ensure zero errors for publication-quality outputs.
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
@@ -0,0 +1,178 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Excel Formula Recalculation Script
4
+ Recalculates all formulas in an Excel file using LibreOffice
5
+ """
6
+
7
+ import json
8
+ import sys
9
+ import subprocess
10
+ import os
11
+ import platform
12
+ from pathlib import Path
13
+ from openpyxl import load_workbook
14
+
15
+
16
+ def setup_libreoffice_macro():
17
+ """Setup LibreOffice macro for recalculation if not already configured"""
18
+ if platform.system() == 'Darwin':
19
+ macro_dir = os.path.expanduser('~/Library/Application Support/LibreOffice/4/user/basic/Standard')
20
+ else:
21
+ macro_dir = os.path.expanduser('~/.config/libreoffice/4/user/basic/Standard')
22
+
23
+ macro_file = os.path.join(macro_dir, 'Module1.xba')
24
+
25
+ if os.path.exists(macro_file):
26
+ with open(macro_file, 'r') as f:
27
+ if 'RecalculateAndSave' in f.read():
28
+ return True
29
+
30
+ if not os.path.exists(macro_dir):
31
+ subprocess.run(['soffice', '--headless', '--terminate_after_init'],
32
+ capture_output=True, timeout=10)
33
+ os.makedirs(macro_dir, exist_ok=True)
34
+
35
+ macro_content = '''<?xml version="1.0" encoding="UTF-8"?>
36
+ <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
37
+ <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Module1" script:language="StarBasic">
38
+ Sub RecalculateAndSave()
39
+ ThisComponent.calculateAll()
40
+ ThisComponent.store()
41
+ ThisComponent.close(True)
42
+ End Sub
43
+ </script:module>'''
44
+
45
+ try:
46
+ with open(macro_file, 'w') as f:
47
+ f.write(macro_content)
48
+ return True
49
+ except Exception:
50
+ return False
51
+
52
+
53
+ def recalc(filename, timeout=30):
54
+ """
55
+ Recalculate formulas in Excel file and report any errors
56
+
57
+ Args:
58
+ filename: Path to Excel file
59
+ timeout: Maximum time to wait for recalculation (seconds)
60
+
61
+ Returns:
62
+ dict with error locations and counts
63
+ """
64
+ if not Path(filename).exists():
65
+ return {'error': f'File {filename} does not exist'}
66
+
67
+ abs_path = str(Path(filename).absolute())
68
+
69
+ if not setup_libreoffice_macro():
70
+ return {'error': 'Failed to setup LibreOffice macro'}
71
+
72
+ cmd = [
73
+ 'soffice', '--headless', '--norestore',
74
+ 'vnd.sun.star.script:Standard.Module1.RecalculateAndSave?language=Basic&location=application',
75
+ abs_path
76
+ ]
77
+
78
+ # Handle timeout command differences between Linux and macOS
79
+ if platform.system() != 'Windows':
80
+ timeout_cmd = 'timeout' if platform.system() == 'Linux' else None
81
+ if platform.system() == 'Darwin':
82
+ # Check if gtimeout is available on macOS
83
+ try:
84
+ subprocess.run(['gtimeout', '--version'], capture_output=True, timeout=1, check=False)
85
+ timeout_cmd = 'gtimeout'
86
+ except (FileNotFoundError, subprocess.TimeoutExpired):
87
+ pass
88
+
89
+ if timeout_cmd:
90
+ cmd = [timeout_cmd, str(timeout)] + cmd
91
+
92
+ result = subprocess.run(cmd, capture_output=True, text=True)
93
+
94
+ if result.returncode != 0 and result.returncode != 124: # 124 is timeout exit code
95
+ error_msg = result.stderr or 'Unknown error during recalculation'
96
+ if 'Module1' in error_msg or 'RecalculateAndSave' not in error_msg:
97
+ return {'error': 'LibreOffice macro not configured properly'}
98
+ else:
99
+ return {'error': error_msg}
100
+
101
+ # Check for Excel errors in the recalculated file - scan ALL cells
102
+ try:
103
+ wb = load_workbook(filename, data_only=True)
104
+
105
+ excel_errors = ['#VALUE!', '#DIV/0!', '#REF!', '#NAME?', '#NULL!', '#NUM!', '#N/A']
106
+ error_details = {err: [] for err in excel_errors}
107
+ total_errors = 0
108
+
109
+ for sheet_name in wb.sheetnames:
110
+ ws = wb[sheet_name]
111
+ # Check ALL rows and columns - no limits
112
+ for row in ws.iter_rows():
113
+ for cell in row:
114
+ if cell.value is not None and isinstance(cell.value, str):
115
+ for err in excel_errors:
116
+ if err in cell.value:
117
+ location = f"{sheet_name}!{cell.coordinate}"
118
+ error_details[err].append(location)
119
+ total_errors += 1
120
+ break
121
+
122
+ wb.close()
123
+
124
+ # Build result summary
125
+ result = {
126
+ 'status': 'success' if total_errors == 0 else 'errors_found',
127
+ 'total_errors': total_errors,
128
+ 'error_summary': {}
129
+ }
130
+
131
+ # Add non-empty error categories
132
+ for err_type, locations in error_details.items():
133
+ if locations:
134
+ result['error_summary'][err_type] = {
135
+ 'count': len(locations),
136
+ 'locations': locations[:20] # Show up to 20 locations
137
+ }
138
+
139
+ # Add formula count for context - also check ALL cells
140
+ wb_formulas = load_workbook(filename, data_only=False)
141
+ formula_count = 0
142
+ for sheet_name in wb_formulas.sheetnames:
143
+ ws = wb_formulas[sheet_name]
144
+ for row in ws.iter_rows():
145
+ for cell in row:
146
+ if cell.value and isinstance(cell.value, str) and cell.value.startswith('='):
147
+ formula_count += 1
148
+ wb_formulas.close()
149
+
150
+ result['total_formulas'] = formula_count
151
+
152
+ return result
153
+
154
+ except Exception as e:
155
+ return {'error': str(e)}
156
+
157
+
158
+ def main():
159
+ if len(sys.argv) < 2:
160
+ print("Usage: python recalc.py <excel_file> [timeout_seconds]")
161
+ print("\nRecalculates all formulas in an Excel file using LibreOffice")
162
+ print("\nReturns JSON with error details:")
163
+ print(" - status: 'success' or 'errors_found'")
164
+ print(" - total_errors: Total number of Excel errors found")
165
+ print(" - total_formulas: Number of formulas in the file")
166
+ print(" - error_summary: Breakdown by error type with locations")
167
+ print(" - #VALUE!, #DIV/0!, #REF!, #NAME?, #NULL!, #NUM!, #N/A")
168
+ sys.exit(1)
169
+
170
+ filename = sys.argv[1]
171
+ timeout = int(sys.argv[2]) if len(sys.argv) > 2 else 30
172
+
173
+ result = recalc(filename, timeout)
174
+ print(json.dumps(result, indent=2))
175
+
176
+
177
+ if __name__ == '__main__':
178
+ main()
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: hypothesis-generation
3
+ description: "Generate testable hypotheses. Formulate from observations, design experiments, explore competing explanations, develop predictions, propose mechanisms, for scientific inquiry across domains."
4
+ ---
5
+
6
+ # Scientific Hypothesis Generation
7
+
8
+ ## Overview
9
+
10
+ Hypothesis generation is a systematic process for developing testable explanations. Formulate evidence-based hypotheses from observations, design experiments, explore competing explanations, and develop predictions. Apply this skill for scientific inquiry across domains.
11
+
12
+ ## When to Use This Skill
13
+
14
+ This skill should be used when:
15
+ - Developing hypotheses from observations or preliminary data
16
+ - Designing experiments to test scientific questions
17
+ - Exploring competing explanations for phenomena
18
+ - Formulating testable predictions for research
19
+ - Conducting literature-based hypothesis generation
20
+ - Planning mechanistic studies across scientific domains
21
+
22
+ ## Workflow
23
+
24
+ Follow this systematic process to generate robust scientific hypotheses:
25
+
26
+ ### 1. Understand the Phenomenon
27
+
28
+ Start by clarifying the observation, question, or phenomenon that requires explanation:
29
+
30
+ - Identify the core observation or pattern that needs explanation
31
+ - Define the scope and boundaries of the phenomenon
32
+ - Note any constraints or specific contexts
33
+ - Clarify what is already known vs. what is uncertain
34
+ - Identify the relevant scientific domain(s)
35
+
36
+ ### 2. Conduct Comprehensive Literature Search
37
+
38
+ Search existing scientific literature to ground hypotheses in current evidence. Use both PubMed (for biomedical topics) and general web search (for broader scientific domains):
39
+
40
+ **For biomedical topics:**
41
+ - Use WebFetch with PubMed URLs to access relevant literature
42
+ - Search for recent reviews, meta-analyses, and primary research
43
+ - Look for similar phenomena, related mechanisms, or analogous systems
44
+
45
+ **For all scientific domains:**
46
+ - Use WebSearch to find recent papers, preprints, and reviews
47
+ - Search for established theories, mechanisms, or frameworks
48
+ - Identify gaps in current understanding
49
+
50
+ **Search strategy:**
51
+ - Begin with broad searches to understand the landscape
52
+ - Narrow to specific mechanisms, pathways, or theories
53
+ - Look for contradictory findings or unresolved debates
54
+ - Consult `references/literature_search_strategies.md` for detailed search techniques
55
+
56
+ ### 3. Synthesize Existing Evidence
57
+
58
+ Analyze and integrate findings from literature search:
59
+
60
+ - Summarize current understanding of the phenomenon
61
+ - Identify established mechanisms or theories that may apply
62
+ - Note conflicting evidence or alternative viewpoints
63
+ - Recognize gaps, limitations, or unanswered questions
64
+ - Identify analogies from related systems or domains
65
+
66
+ ### 4. Generate Competing Hypotheses
67
+
68
+ Develop 3-5 distinct hypotheses that could explain the phenomenon. Each hypothesis should:
69
+
70
+ - Provide a mechanistic explanation (not just description)
71
+ - Be distinguishable from other hypotheses
72
+ - Draw on evidence from the literature synthesis
73
+ - Consider different levels of explanation (molecular, cellular, systemic, population, etc.)
74
+
75
+ **Strategies for generating hypotheses:**
76
+ - Apply known mechanisms from analogous systems
77
+ - Consider multiple causative pathways
78
+ - Explore different scales of explanation
79
+ - Question assumptions in existing explanations
80
+ - Combine mechanisms in novel ways
81
+
82
+ ### 5. Evaluate Hypothesis Quality
83
+
84
+ Assess each hypothesis against established quality criteria from `references/hypothesis_quality_criteria.md`:
85
+
86
+ **Testability:** Can the hypothesis be empirically tested?
87
+ **Falsifiability:** What observations would disprove it?
88
+ **Parsimony:** Is it the simplest explanation that fits the evidence?
89
+ **Explanatory Power:** How much of the phenomenon does it explain?
90
+ **Scope:** What range of observations does it cover?
91
+ **Consistency:** Does it align with established principles?
92
+ **Novelty:** Does it offer new insights beyond existing explanations?
93
+
94
+ Explicitly note the strengths and weaknesses of each hypothesis.
95
+
96
+ ### 6. Design Experimental Tests
97
+
98
+ For each viable hypothesis, propose specific experiments or studies to test it. Consult `references/experimental_design_patterns.md` for common approaches:
99
+
100
+ **Experimental design elements:**
101
+ - What would be measured or observed?
102
+ - What comparisons or controls are needed?
103
+ - What methods or techniques would be used?
104
+ - What sample sizes or statistical approaches are appropriate?
105
+ - What are potential confounds and how to address them?
106
+
107
+ **Consider multiple approaches:**
108
+ - Laboratory experiments (in vitro, in vivo, computational)
109
+ - Observational studies (cross-sectional, longitudinal, case-control)
110
+ - Clinical trials (if applicable)
111
+ - Natural experiments or quasi-experimental designs
112
+
113
+ ### 7. Formulate Testable Predictions
114
+
115
+ For each hypothesis, generate specific, quantitative predictions:
116
+
117
+ - State what should be observed if the hypothesis is correct
118
+ - Specify expected direction and magnitude of effects when possible
119
+ - Identify conditions under which predictions should hold
120
+ - Distinguish predictions between competing hypotheses
121
+ - Note predictions that would falsify the hypothesis
122
+
123
+ ### 8. Present Structured Output
124
+
125
+ Use the template in `assets/hypothesis_output_template.md` to present hypotheses in a clear, consistent format:
126
+
127
+ **Standard structure:**
128
+ 1. **Background & Context** - Phenomenon and literature summary
129
+ 2. **Competing Hypotheses** - Enumerated hypotheses with mechanistic explanations
130
+ 3. **Quality Assessment** - Evaluation of each hypothesis
131
+ 4. **Experimental Designs** - Proposed tests for each hypothesis
132
+ 5. **Testable Predictions** - Specific, measurable predictions
133
+ 6. **Critical Comparisons** - How to distinguish between hypotheses
134
+
135
+ ## Quality Standards
136
+
137
+ Ensure all generated hypotheses meet these standards:
138
+
139
+ - **Evidence-based:** Grounded in existing literature with citations
140
+ - **Testable:** Include specific, measurable predictions
141
+ - **Mechanistic:** Explain how/why, not just what
142
+ - **Comprehensive:** Consider alternative explanations
143
+ - **Rigorous:** Include experimental designs to test predictions
144
+
145
+ ## Resources
146
+
147
+ ### references/
148
+
149
+ - `hypothesis_quality_criteria.md` - Framework for evaluating hypothesis quality (testability, falsifiability, parsimony, explanatory power, scope, consistency)
150
+ - `experimental_design_patterns.md` - Common experimental approaches across domains (RCTs, observational studies, lab experiments, computational models)
151
+ - `literature_search_strategies.md` - Effective search techniques for PubMed and general scientific sources
152
+
153
+ ### assets/
154
+
155
+ - `hypothesis_output_template.md` - Structured format for presenting hypotheses consistently with all required sections