@synsci/cli-darwin-x64 1.1.70 → 1.1.72

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 (339) hide show
  1. package/bin/skills/citation-management/SKILL.md +1109 -0
  2. package/bin/skills/citation-management/assets/bibtex_template.bib +264 -0
  3. package/bin/skills/citation-management/assets/citation_checklist.md +386 -0
  4. package/bin/skills/citation-management/references/bibtex_formatting.md +908 -0
  5. package/bin/skills/citation-management/references/citation_validation.md +794 -0
  6. package/bin/skills/citation-management/references/google_scholar_search.md +725 -0
  7. package/bin/skills/citation-management/references/metadata_extraction.md +870 -0
  8. package/bin/skills/citation-management/references/pubmed_search.md +839 -0
  9. package/bin/skills/citation-management/scripts/doi_to_bibtex.py +182 -0
  10. package/bin/skills/citation-management/scripts/extract_metadata.py +570 -0
  11. package/bin/skills/citation-management/scripts/format_bibtex.py +349 -0
  12. package/bin/skills/citation-management/scripts/search_google_scholar.py +251 -0
  13. package/bin/skills/citation-management/scripts/search_pubmed.py +348 -0
  14. package/bin/skills/citation-management/scripts/validate_citations.py +494 -0
  15. package/bin/skills/clinical-decision-support/README.md +129 -0
  16. package/bin/skills/clinical-decision-support/SKILL.md +506 -0
  17. package/bin/skills/clinical-decision-support/assets/biomarker_report_template.tex +380 -0
  18. package/bin/skills/clinical-decision-support/assets/clinical_pathway_template.tex +222 -0
  19. package/bin/skills/clinical-decision-support/assets/cohort_analysis_template.tex +359 -0
  20. package/bin/skills/clinical-decision-support/assets/color_schemes.tex +149 -0
  21. package/bin/skills/clinical-decision-support/assets/example_gbm_cohort.md +208 -0
  22. package/bin/skills/clinical-decision-support/assets/recommendation_strength_guide.md +328 -0
  23. package/bin/skills/clinical-decision-support/assets/treatment_recommendation_template.tex +529 -0
  24. package/bin/skills/clinical-decision-support/references/biomarker_classification.md +719 -0
  25. package/bin/skills/clinical-decision-support/references/clinical_decision_algorithms.md +604 -0
  26. package/bin/skills/clinical-decision-support/references/evidence_synthesis.md +840 -0
  27. package/bin/skills/clinical-decision-support/references/outcome_analysis.md +640 -0
  28. package/bin/skills/clinical-decision-support/references/patient_cohort_analysis.md +427 -0
  29. package/bin/skills/clinical-decision-support/references/treatment_recommendations.md +521 -0
  30. package/bin/skills/clinical-decision-support/scripts/biomarker_classifier.py +383 -0
  31. package/bin/skills/clinical-decision-support/scripts/build_decision_tree.py +417 -0
  32. package/bin/skills/clinical-decision-support/scripts/create_cohort_tables.py +509 -0
  33. package/bin/skills/clinical-decision-support/scripts/generate_survival_analysis.py +441 -0
  34. package/bin/skills/clinical-decision-support/scripts/validate_cds_document.py +326 -0
  35. package/bin/skills/clinical-reports/IMPLEMENTATION_SUMMARY.md +641 -0
  36. package/bin/skills/clinical-reports/README.md +236 -0
  37. package/bin/skills/clinical-reports/SKILL.md +1127 -0
  38. package/bin/skills/clinical-reports/assets/case_report_template.md +352 -0
  39. package/bin/skills/clinical-reports/assets/clinical_trial_csr_template.md +353 -0
  40. package/bin/skills/clinical-reports/assets/clinical_trial_sae_template.md +359 -0
  41. package/bin/skills/clinical-reports/assets/consult_note_template.md +305 -0
  42. package/bin/skills/clinical-reports/assets/discharge_summary_template.md +453 -0
  43. package/bin/skills/clinical-reports/assets/hipaa_compliance_checklist.md +395 -0
  44. package/bin/skills/clinical-reports/assets/history_physical_template.md +305 -0
  45. package/bin/skills/clinical-reports/assets/lab_report_template.md +309 -0
  46. package/bin/skills/clinical-reports/assets/pathology_report_template.md +249 -0
  47. package/bin/skills/clinical-reports/assets/quality_checklist.md +338 -0
  48. package/bin/skills/clinical-reports/assets/radiology_report_template.md +318 -0
  49. package/bin/skills/clinical-reports/assets/soap_note_template.md +253 -0
  50. package/bin/skills/clinical-reports/references/case_report_guidelines.md +570 -0
  51. package/bin/skills/clinical-reports/references/clinical_trial_reporting.md +693 -0
  52. package/bin/skills/clinical-reports/references/data_presentation.md +530 -0
  53. package/bin/skills/clinical-reports/references/diagnostic_reports_standards.md +629 -0
  54. package/bin/skills/clinical-reports/references/medical_terminology.md +588 -0
  55. package/bin/skills/clinical-reports/references/patient_documentation.md +744 -0
  56. package/bin/skills/clinical-reports/references/peer_review_standards.md +585 -0
  57. package/bin/skills/clinical-reports/references/regulatory_compliance.md +577 -0
  58. package/bin/skills/clinical-reports/scripts/check_deidentification.py +332 -0
  59. package/bin/skills/clinical-reports/scripts/compliance_checker.py +78 -0
  60. package/bin/skills/clinical-reports/scripts/extract_clinical_data.py +97 -0
  61. package/bin/skills/clinical-reports/scripts/format_adverse_events.py +97 -0
  62. package/bin/skills/clinical-reports/scripts/generate_report_template.py +149 -0
  63. package/bin/skills/clinical-reports/scripts/terminology_validator.py +126 -0
  64. package/bin/skills/clinical-reports/scripts/validate_case_report.py +323 -0
  65. package/bin/skills/clinical-reports/scripts/validate_trial_report.py +88 -0
  66. package/bin/skills/fireworks-ai/SKILL.md +665 -0
  67. package/bin/skills/generate-image/SKILL.md +178 -0
  68. package/bin/skills/generate-image/scripts/generate_image.py +254 -0
  69. package/bin/skills/groq/SKILL.md +347 -0
  70. package/bin/skills/hypothesis-generation/SKILL.md +293 -0
  71. package/bin/skills/hypothesis-generation/assets/FORMATTING_GUIDE.md +672 -0
  72. package/bin/skills/hypothesis-generation/assets/hypothesis_generation.sty +307 -0
  73. package/bin/skills/hypothesis-generation/assets/hypothesis_report_template.tex +572 -0
  74. package/bin/skills/hypothesis-generation/references/experimental_design_patterns.md +329 -0
  75. package/bin/skills/hypothesis-generation/references/hypothesis_quality_criteria.md +198 -0
  76. package/bin/skills/hypothesis-generation/references/literature_search_strategies.md +622 -0
  77. package/bin/skills/latex-posters/README.md +417 -0
  78. package/bin/skills/latex-posters/SKILL.md +1602 -0
  79. package/bin/skills/latex-posters/assets/baposter_template.tex +257 -0
  80. package/bin/skills/latex-posters/assets/beamerposter_template.tex +244 -0
  81. package/bin/skills/latex-posters/assets/poster_quality_checklist.md +358 -0
  82. package/bin/skills/latex-posters/assets/tikzposter_template.tex +251 -0
  83. package/bin/skills/latex-posters/references/latex_poster_packages.md +745 -0
  84. package/bin/skills/latex-posters/references/poster_content_guide.md +748 -0
  85. package/bin/skills/latex-posters/references/poster_design_principles.md +806 -0
  86. package/bin/skills/latex-posters/references/poster_layout_design.md +900 -0
  87. package/bin/skills/latex-posters/scripts/review_poster.sh +214 -0
  88. package/bin/skills/literature-review/SKILL.md +641 -0
  89. package/bin/skills/literature-review/assets/review_template.md +412 -0
  90. package/bin/skills/literature-review/references/citation_styles.md +166 -0
  91. package/bin/skills/literature-review/references/database_strategies.md +455 -0
  92. package/bin/skills/literature-review/scripts/generate_pdf.py +184 -0
  93. package/bin/skills/literature-review/scripts/search_databases.py +310 -0
  94. package/bin/skills/literature-review/scripts/verify_citations.py +218 -0
  95. package/bin/skills/market-research-reports/SKILL.md +904 -0
  96. package/bin/skills/market-research-reports/assets/FORMATTING_GUIDE.md +428 -0
  97. package/bin/skills/market-research-reports/assets/market_report_template.tex +1380 -0
  98. package/bin/skills/market-research-reports/assets/market_research.sty +564 -0
  99. package/bin/skills/market-research-reports/references/data_analysis_patterns.md +548 -0
  100. package/bin/skills/market-research-reports/references/report_structure_guide.md +999 -0
  101. package/bin/skills/market-research-reports/references/visual_generation_guide.md +1077 -0
  102. package/bin/skills/market-research-reports/scripts/generate_market_visuals.py +472 -0
  103. package/bin/skills/markitdown/INSTALLATION_GUIDE.md +318 -0
  104. package/bin/skills/markitdown/LICENSE.txt +22 -0
  105. package/bin/skills/markitdown/OPENROUTER_INTEGRATION.md +359 -0
  106. package/bin/skills/markitdown/QUICK_REFERENCE.md +309 -0
  107. package/bin/skills/markitdown/README.md +184 -0
  108. package/bin/skills/markitdown/SKILL.md +486 -0
  109. package/bin/skills/markitdown/SKILL_SUMMARY.md +307 -0
  110. package/bin/skills/markitdown/assets/example_usage.md +463 -0
  111. package/bin/skills/markitdown/references/api_reference.md +399 -0
  112. package/bin/skills/markitdown/references/file_formats.md +542 -0
  113. package/bin/skills/markitdown/scripts/batch_convert.py +195 -0
  114. package/bin/skills/markitdown/scripts/convert_literature.py +262 -0
  115. package/bin/skills/markitdown/scripts/convert_with_ai.py +224 -0
  116. package/bin/skills/ml-paper-writing/SKILL.md +937 -0
  117. package/bin/skills/ml-paper-writing/references/checklists.md +361 -0
  118. package/bin/skills/ml-paper-writing/references/citation-workflow.md +562 -0
  119. package/bin/skills/ml-paper-writing/references/reviewer-guidelines.md +367 -0
  120. package/bin/skills/ml-paper-writing/references/sources.md +159 -0
  121. package/bin/skills/ml-paper-writing/references/writing-guide.md +476 -0
  122. package/bin/skills/ml-paper-writing/templates/README.md +251 -0
  123. package/bin/skills/ml-paper-writing/templates/aaai2026/README.md +534 -0
  124. package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-supp.tex +144 -0
  125. package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-template.tex +952 -0
  126. package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.bib +111 -0
  127. package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.bst +1493 -0
  128. package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.sty +315 -0
  129. package/bin/skills/ml-paper-writing/templates/acl/README.md +50 -0
  130. package/bin/skills/ml-paper-writing/templates/acl/acl.sty +312 -0
  131. package/bin/skills/ml-paper-writing/templates/acl/acl_latex.tex +377 -0
  132. package/bin/skills/ml-paper-writing/templates/acl/acl_lualatex.tex +101 -0
  133. package/bin/skills/ml-paper-writing/templates/acl/acl_natbib.bst +1940 -0
  134. package/bin/skills/ml-paper-writing/templates/acl/anthology.bib.txt +26 -0
  135. package/bin/skills/ml-paper-writing/templates/acl/custom.bib +70 -0
  136. package/bin/skills/ml-paper-writing/templates/acl/formatting.md +326 -0
  137. package/bin/skills/ml-paper-writing/templates/colm2025/README.md +3 -0
  138. package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bib +11 -0
  139. package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bst +1440 -0
  140. package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.pdf +0 -0
  141. package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.sty +218 -0
  142. package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.tex +305 -0
  143. package/bin/skills/ml-paper-writing/templates/colm2025/fancyhdr.sty +485 -0
  144. package/bin/skills/ml-paper-writing/templates/colm2025/math_commands.tex +508 -0
  145. package/bin/skills/ml-paper-writing/templates/colm2025/natbib.sty +1246 -0
  146. package/bin/skills/ml-paper-writing/templates/iclr2026/fancyhdr.sty +485 -0
  147. package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bib +24 -0
  148. package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bst +1440 -0
  149. package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.pdf +0 -0
  150. package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.sty +246 -0
  151. package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.tex +414 -0
  152. package/bin/skills/ml-paper-writing/templates/iclr2026/math_commands.tex +508 -0
  153. package/bin/skills/ml-paper-writing/templates/iclr2026/natbib.sty +1246 -0
  154. package/bin/skills/ml-paper-writing/templates/icml2026/algorithm.sty +79 -0
  155. package/bin/skills/ml-paper-writing/templates/icml2026/algorithmic.sty +201 -0
  156. package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.bib +75 -0
  157. package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.pdf +0 -0
  158. package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.tex +662 -0
  159. package/bin/skills/ml-paper-writing/templates/icml2026/fancyhdr.sty +864 -0
  160. package/bin/skills/ml-paper-writing/templates/icml2026/icml2026.bst +1443 -0
  161. package/bin/skills/ml-paper-writing/templates/icml2026/icml2026.sty +767 -0
  162. package/bin/skills/ml-paper-writing/templates/icml2026/icml_numpapers.pdf +0 -0
  163. package/bin/skills/ml-paper-writing/templates/neurips2025/Makefile +36 -0
  164. package/bin/skills/ml-paper-writing/templates/neurips2025/extra_pkgs.tex +53 -0
  165. package/bin/skills/ml-paper-writing/templates/neurips2025/main.tex +38 -0
  166. package/bin/skills/ml-paper-writing/templates/neurips2025/neurips.sty +382 -0
  167. package/bin/skills/paper-2-web/SKILL.md +491 -0
  168. package/bin/skills/paper-2-web/references/installation.md +141 -0
  169. package/bin/skills/paper-2-web/references/paper2poster.md +346 -0
  170. package/bin/skills/paper-2-web/references/paper2video.md +305 -0
  171. package/bin/skills/paper-2-web/references/paper2web.md +187 -0
  172. package/bin/skills/paper-2-web/references/usage_examples.md +436 -0
  173. package/bin/skills/peer-review/SKILL.md +702 -0
  174. package/bin/skills/peer-review/references/calibration_guidelines.md +196 -0
  175. package/bin/skills/peer-review/references/common_issues.md +552 -0
  176. package/bin/skills/peer-review/references/paper_mechanics.md +269 -0
  177. package/bin/skills/peer-review/references/reporting_standards.md +290 -0
  178. package/bin/skills/peer-review/references/scoring_rubric.md +239 -0
  179. package/bin/skills/pptx-posters/SKILL.md +410 -0
  180. package/bin/skills/pptx-posters/assets/poster_html_template.html +257 -0
  181. package/bin/skills/pptx-posters/assets/poster_quality_checklist.md +358 -0
  182. package/bin/skills/pptx-posters/references/poster_content_guide.md +748 -0
  183. package/bin/skills/pptx-posters/references/poster_design_principles.md +806 -0
  184. package/bin/skills/pptx-posters/references/poster_layout_design.md +900 -0
  185. package/bin/skills/research-grants/README.md +285 -0
  186. package/bin/skills/research-grants/SKILL.md +938 -0
  187. package/bin/skills/research-grants/assets/budget_justification_template.md +453 -0
  188. package/bin/skills/research-grants/assets/nih_specific_aims_template.md +166 -0
  189. package/bin/skills/research-grants/assets/nsf_project_summary_template.md +92 -0
  190. package/bin/skills/research-grants/references/broader_impacts.md +392 -0
  191. package/bin/skills/research-grants/references/darpa_guidelines.md +636 -0
  192. package/bin/skills/research-grants/references/doe_guidelines.md +586 -0
  193. package/bin/skills/research-grants/references/nih_guidelines.md +851 -0
  194. package/bin/skills/research-grants/references/nsf_guidelines.md +570 -0
  195. package/bin/skills/research-grants/references/specific_aims_guide.md +458 -0
  196. package/bin/skills/research-lookup/README.md +156 -0
  197. package/bin/skills/research-lookup/SKILL.md +606 -0
  198. package/bin/skills/research-lookup/examples.py +174 -0
  199. package/bin/skills/research-lookup/lookup.py +187 -0
  200. package/bin/skills/research-lookup/research_lookup.py +483 -0
  201. package/bin/skills/research-lookup/scripts/research_lookup.py +483 -0
  202. package/bin/skills/scholar-evaluation/SKILL.md +289 -0
  203. package/bin/skills/scholar-evaluation/references/evaluation_framework.md +663 -0
  204. package/bin/skills/scholar-evaluation/scripts/calculate_scores.py +366 -0
  205. package/bin/skills/scientific-critical-thinking/SKILL.md +566 -0
  206. package/bin/skills/scientific-critical-thinking/references/common_biases.md +364 -0
  207. package/bin/skills/scientific-critical-thinking/references/evidence_hierarchy.md +484 -0
  208. package/bin/skills/scientific-critical-thinking/references/experimental_design.md +496 -0
  209. package/bin/skills/scientific-critical-thinking/references/logical_fallacies.md +478 -0
  210. package/bin/skills/scientific-critical-thinking/references/scientific_method.md +169 -0
  211. package/bin/skills/scientific-critical-thinking/references/statistical_pitfalls.md +506 -0
  212. package/bin/skills/scientific-schematics/QUICK_REFERENCE.md +207 -0
  213. package/bin/skills/scientific-schematics/README.md +327 -0
  214. package/bin/skills/scientific-schematics/SKILL.md +615 -0
  215. package/bin/skills/scientific-schematics/example_usage.sh +89 -0
  216. package/bin/skills/scientific-schematics/references/best_practices.md +559 -0
  217. package/bin/skills/scientific-schematics/scripts/generate_schematic.py +135 -0
  218. package/bin/skills/scientific-schematics/scripts/generate_schematic_ai.py +807 -0
  219. package/bin/skills/scientific-schematics/test_ai_generation.py +243 -0
  220. package/bin/skills/scientific-slides/SKILL.md +942 -0
  221. package/bin/skills/scientific-slides/assets/timing_guidelines.md +597 -0
  222. package/bin/skills/scientific-slides/references/data_visualization_slides.md +708 -0
  223. package/bin/skills/scientific-slides/references/presentation_structure.md +642 -0
  224. package/bin/skills/scientific-slides/references/slide_design_principles.md +849 -0
  225. package/bin/skills/scientific-slides/references/talk_types_guide.md +687 -0
  226. package/bin/skills/scientific-slides/references/visual_review_workflow.md +775 -0
  227. package/bin/skills/scientific-slides/scripts/generate_slide_image.py +143 -0
  228. package/bin/skills/scientific-slides/scripts/generate_slide_image_ai.py +748 -0
  229. package/bin/skills/scientific-slides/scripts/pdf_to_images.py +201 -0
  230. package/bin/skills/scientific-slides/scripts/slides_to_pdf.py +220 -0
  231. package/bin/skills/scientific-slides/scripts/validate_presentation.py +367 -0
  232. package/bin/skills/scientific-writing/SKILL.md +714 -0
  233. package/bin/skills/scientific-writing/assets/REPORT_FORMATTING_GUIDE.md +574 -0
  234. package/bin/skills/scientific-writing/assets/scientific_report.sty +606 -0
  235. package/bin/skills/scientific-writing/assets/scientific_report_template.tex +449 -0
  236. package/bin/skills/scientific-writing/references/citation_styles.md +720 -0
  237. package/bin/skills/scientific-writing/references/figures_tables.md +806 -0
  238. package/bin/skills/scientific-writing/references/imrad_structure.md +686 -0
  239. package/bin/skills/scientific-writing/references/professional_report_formatting.md +664 -0
  240. package/bin/skills/scientific-writing/references/reporting_guidelines.md +748 -0
  241. package/bin/skills/scientific-writing/references/writing_principles.md +824 -0
  242. package/bin/skills/tinker/SKILL.md +2 -3
  243. package/bin/skills/together-ai/SKILL.md +722 -0
  244. package/bin/skills/treatment-plans/README.md +488 -0
  245. package/bin/skills/treatment-plans/SKILL.md +1579 -0
  246. package/bin/skills/treatment-plans/assets/STYLING_QUICK_REFERENCE.md +185 -0
  247. package/bin/skills/treatment-plans/assets/chronic_disease_management_plan.tex +665 -0
  248. package/bin/skills/treatment-plans/assets/general_medical_treatment_plan.tex +547 -0
  249. package/bin/skills/treatment-plans/assets/medical_treatment_plan.sty +222 -0
  250. package/bin/skills/treatment-plans/assets/mental_health_treatment_plan.tex +774 -0
  251. package/bin/skills/treatment-plans/assets/one_page_treatment_plan.tex +193 -0
  252. package/bin/skills/treatment-plans/assets/pain_management_plan.tex +799 -0
  253. package/bin/skills/treatment-plans/assets/perioperative_care_plan.tex +753 -0
  254. package/bin/skills/treatment-plans/assets/quality_checklist.md +471 -0
  255. package/bin/skills/treatment-plans/assets/rehabilitation_treatment_plan.tex +756 -0
  256. package/bin/skills/treatment-plans/references/goal_setting_frameworks.md +411 -0
  257. package/bin/skills/treatment-plans/references/intervention_guidelines.md +507 -0
  258. package/bin/skills/treatment-plans/references/regulatory_compliance.md +476 -0
  259. package/bin/skills/treatment-plans/references/specialty_specific_guidelines.md +655 -0
  260. package/bin/skills/treatment-plans/references/treatment_plan_standards.md +485 -0
  261. package/bin/skills/treatment-plans/scripts/check_completeness.py +322 -0
  262. package/bin/skills/treatment-plans/scripts/generate_template.py +233 -0
  263. package/bin/skills/treatment-plans/scripts/timeline_generator.py +385 -0
  264. package/bin/skills/treatment-plans/scripts/validate_treatment_plan.py +369 -0
  265. package/bin/skills/unsloth/SKILL.md +565 -47
  266. package/bin/skills/unsloth/docs/advanced-rl.md +222 -0
  267. package/bin/skills/unsloth/docs/chat-templates.md +141 -0
  268. package/bin/skills/unsloth/docs/datasets.md +489 -0
  269. package/bin/skills/unsloth/docs/docker-extended.md +99 -0
  270. package/bin/skills/unsloth/docs/dynamic-ggufs-2.0.md +116 -0
  271. package/bin/skills/unsloth/docs/dynamic-ggufs-aider.md +118 -0
  272. package/bin/skills/unsloth/docs/faq.md +91 -0
  273. package/bin/skills/unsloth/docs/fp16-vs-bf16.md +61 -0
  274. package/bin/skills/unsloth/docs/fp8-rl.md +224 -0
  275. package/bin/skills/unsloth/docs/glm-4.7-flash.md +997 -0
  276. package/bin/skills/unsloth/docs/inference-deployment-overview.md +17 -0
  277. package/bin/skills/unsloth/docs/inference.md +27 -0
  278. package/bin/skills/unsloth/docs/installation-docker.md +155 -0
  279. package/bin/skills/unsloth/docs/installation-pip.md +148 -0
  280. package/bin/skills/unsloth/docs/kernels-packing.md +190 -0
  281. package/bin/skills/unsloth/docs/kimi-k2.5.md +634 -0
  282. package/bin/skills/unsloth/docs/lm-studio.md +235 -0
  283. package/bin/skills/unsloth/docs/lora-hot-swapping.md +75 -0
  284. package/bin/skills/unsloth/docs/lora-hyperparameters.md +363 -0
  285. package/bin/skills/unsloth/docs/memory-efficient-rl.md +267 -0
  286. package/bin/skills/unsloth/docs/model-selection.md +70 -0
  287. package/bin/skills/unsloth/docs/models.md +532 -0
  288. package/bin/skills/unsloth/docs/multi-gpu-ddp.md +90 -0
  289. package/bin/skills/unsloth/docs/notebooks.md +223 -0
  290. package/bin/skills/unsloth/docs/overview.md +110 -0
  291. package/bin/skills/unsloth/docs/qwen3-coder-next-extended.md +900 -0
  292. package/bin/skills/unsloth/docs/qwen3-coder-next.md +900 -0
  293. package/bin/skills/unsloth/docs/requirements.md +45 -0
  294. package/bin/skills/unsloth/docs/reward-hacking.md +25 -0
  295. package/bin/skills/unsloth/docs/saving-to-gguf.md +138 -0
  296. package/bin/skills/unsloth/docs/saving-to-ollama.md +46 -0
  297. package/bin/skills/unsloth/docs/sglang-guide.md +278 -0
  298. package/bin/skills/unsloth/docs/speculative-decoding.md +70 -0
  299. package/bin/skills/unsloth/docs/tool-calling.md +334 -0
  300. package/bin/skills/unsloth/docs/troubleshooting-faq.md +204 -0
  301. package/bin/skills/unsloth/docs/troubleshooting-inference.md +26 -0
  302. package/bin/skills/unsloth/docs/tts-fine-tuning.md +149 -0
  303. package/bin/skills/unsloth/docs/tutorial-grpo.md +273 -0
  304. package/bin/skills/unsloth/docs/tutorial-llama3-ollama.md +356 -0
  305. package/bin/skills/unsloth/docs/vision-fine-tuning.md +135 -0
  306. package/bin/skills/unsloth/docs/vision-rl.md +170 -0
  307. package/bin/skills/unsloth/docs/vllm-engine-arguments.md +43 -0
  308. package/bin/skills/unsloth/docs/vllm-guide.md +98 -0
  309. package/bin/skills/venue-templates/SKILL.md +686 -0
  310. package/bin/skills/venue-templates/assets/examples/cell_summary_example.md +247 -0
  311. package/bin/skills/venue-templates/assets/examples/medical_structured_abstract.md +313 -0
  312. package/bin/skills/venue-templates/assets/examples/nature_abstract_examples.md +213 -0
  313. package/bin/skills/venue-templates/assets/examples/neurips_introduction_example.md +245 -0
  314. package/bin/skills/venue-templates/assets/grants/nih_specific_aims.tex +235 -0
  315. package/bin/skills/venue-templates/assets/grants/nsf_proposal_template.tex +375 -0
  316. package/bin/skills/venue-templates/assets/journals/nature_article.tex +171 -0
  317. package/bin/skills/venue-templates/assets/journals/neurips_article.tex +283 -0
  318. package/bin/skills/venue-templates/assets/journals/plos_one.tex +317 -0
  319. package/bin/skills/venue-templates/assets/posters/beamerposter_academic.tex +311 -0
  320. package/bin/skills/venue-templates/references/cell_press_style.md +483 -0
  321. package/bin/skills/venue-templates/references/conferences_formatting.md +564 -0
  322. package/bin/skills/venue-templates/references/cs_conference_style.md +463 -0
  323. package/bin/skills/venue-templates/references/grants_requirements.md +787 -0
  324. package/bin/skills/venue-templates/references/journals_formatting.md +486 -0
  325. package/bin/skills/venue-templates/references/medical_journal_styles.md +535 -0
  326. package/bin/skills/venue-templates/references/ml_conference_style.md +556 -0
  327. package/bin/skills/venue-templates/references/nature_science_style.md +405 -0
  328. package/bin/skills/venue-templates/references/posters_guidelines.md +628 -0
  329. package/bin/skills/venue-templates/references/reviewer_expectations.md +417 -0
  330. package/bin/skills/venue-templates/references/venue_writing_styles.md +321 -0
  331. package/bin/skills/venue-templates/scripts/customize_template.py +195 -0
  332. package/bin/skills/venue-templates/scripts/query_template.py +266 -0
  333. package/bin/skills/venue-templates/scripts/validate_format.py +250 -0
  334. package/bin/synsc +0 -0
  335. package/package.json +1 -1
  336. package/bin/skills/unsloth/references/index.md +0 -7
  337. package/bin/skills/unsloth/references/llms-full.md +0 -16799
  338. package/bin/skills/unsloth/references/llms-txt.md +0 -12044
  339. package/bin/skills/unsloth/references/llms.md +0 -82
@@ -0,0 +1,332 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Check clinical reports for HIPAA identifiers that need removal.
4
+
5
+ Scans text for 18 HIPAA identifiers and flags potential privacy violations.
6
+
7
+ Usage:
8
+ python check_deidentification.py <input_file>
9
+ python check_deidentification.py <input_file> --output violations.json
10
+ """
11
+
12
+ import argparse
13
+ import json
14
+ import re
15
+ from pathlib import Path
16
+ from typing import Dict
17
+
18
+
19
+ # 18 HIPAA Identifiers patterns
20
+ HIPAA_IDENTIFIERS = {
21
+ "1_names": {
22
+ "description": "Names (patient, family, providers)",
23
+ "patterns": [
24
+ r"\b(Dr\.|Mr\.|Mrs\.|Ms\.)\s+[A-Z][a-z]+",
25
+ r"\b[A-Z][a-z]+,\s+[A-Z][a-z]+\b", # Last, First
26
+ ],
27
+ "severity": "HIGH",
28
+ },
29
+ "2_geographic": {
30
+ "description": "Geographic subdivisions smaller than state",
31
+ "patterns": [
32
+ r"\b\d+\s+[A-Z][a-z]+\s+(Street|St|Avenue|Ave|Road|Rd|Boulevard|Blvd|Lane|Ln|Drive|Dr)\b",
33
+ r"\b[A-Z][a-z]+,\s+[A-Z]{2}\s+\d{5}\b", # City, ST ZIP
34
+ ],
35
+ "severity": "HIGH",
36
+ },
37
+ "3_dates": {
38
+ "description": "Dates (except year)",
39
+ "patterns": [
40
+ r"\b(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])/\d{4}\b",
41
+ r"\b(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[a-z]*\s+\d{1,2},\s+\d{4}\b",
42
+ r"\b\d{1,2}\s+(January|February|March|April|May|June|July|August|September|October|November|December)\s+\d{4}\b",
43
+ ],
44
+ "severity": "HIGH",
45
+ },
46
+ "4_telephone": {
47
+ "description": "Telephone numbers",
48
+ "patterns": [
49
+ r"\b\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b",
50
+ r"\b1-\d{3}-\d{3}-\d{4}\b",
51
+ ],
52
+ "severity": "HIGH",
53
+ },
54
+ "5_fax": {
55
+ "description": "Fax numbers",
56
+ "patterns": [
57
+ r"(?i)fax[:]\s*\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}",
58
+ ],
59
+ "severity": "HIGH",
60
+ },
61
+ "6_email": {
62
+ "description": "Email addresses",
63
+ "patterns": [
64
+ r"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b",
65
+ ],
66
+ "severity": "HIGH",
67
+ },
68
+ "7_ssn": {
69
+ "description": "Social Security numbers",
70
+ "patterns": [
71
+ r"\b\d{3}-\d{2}-\d{4}\b",
72
+ r"\b\d{9}\b",
73
+ ],
74
+ "severity": "CRITICAL",
75
+ },
76
+ "8_mrn": {
77
+ "description": "Medical record numbers",
78
+ "patterns": [
79
+ r"(?i)(mrn|medical\s+record\s+(number|#))[:]\s*\d+",
80
+ r"(?i)patient\s+id[:]\s*\d+",
81
+ ],
82
+ "severity": "HIGH",
83
+ },
84
+ "9_health_plan": {
85
+ "description": "Health plan beneficiary numbers",
86
+ "patterns": [
87
+ r"(?i)(insurance|policy)\s+(number|#|id)[:]\s*[A-Z0-9]+",
88
+ ],
89
+ "severity": "HIGH",
90
+ },
91
+ "10_account": {
92
+ "description": "Account numbers",
93
+ "patterns": [
94
+ r"(?i)account\s+(number|#)[:]\s*\d+",
95
+ ],
96
+ "severity": "MEDIUM",
97
+ },
98
+ "11_license": {
99
+ "description": "Certificate/license numbers",
100
+ "patterns": [
101
+ r"(?i)(driver[']?s\s+license|DL)[:]\s*[A-Z0-9]+",
102
+ ],
103
+ "severity": "MEDIUM",
104
+ },
105
+ "12_vehicle": {
106
+ "description": "Vehicle identifiers",
107
+ "patterns": [
108
+ r"(?i)(license\s+plate|VIN)[:]\s*[A-Z0-9]+",
109
+ ],
110
+ "severity": "MEDIUM",
111
+ },
112
+ "13_device": {
113
+ "description": "Device identifiers and serial numbers",
114
+ "patterns": [
115
+ r"(?i)(serial|device)\s+(number|#)[:]\s*[A-Z0-9-]+",
116
+ ],
117
+ "severity": "MEDIUM",
118
+ },
119
+ "14_url": {
120
+ "description": "Web URLs",
121
+ "patterns": [
122
+ r"https?://[^\s]+",
123
+ r"www\.[^\s]+",
124
+ ],
125
+ "severity": "MEDIUM",
126
+ },
127
+ "15_ip": {
128
+ "description": "IP addresses",
129
+ "patterns": [
130
+ r"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b",
131
+ ],
132
+ "severity": "HIGH",
133
+ },
134
+ "16_biometric": {
135
+ "description": "Biometric identifiers",
136
+ "patterns": [
137
+ r"(?i)(fingerprint|voiceprint|retinal\s+scan)",
138
+ ],
139
+ "severity": "CRITICAL",
140
+ },
141
+ "17_photos": {
142
+ "description": "Full-face photographs",
143
+ "patterns": [
144
+ r"(?i)(photograph|photo|image).*face",
145
+ r"\.(jpg|jpeg|png|gif)\b",
146
+ ],
147
+ "severity": "HIGH",
148
+ },
149
+ "18_unique": {
150
+ "description": "Any other unique identifying characteristic",
151
+ "patterns": [
152
+ r"(?i)(tattoo|birthmark|scar).*unique",
153
+ ],
154
+ "severity": "MEDIUM",
155
+ },
156
+ }
157
+
158
+
159
+ def check_identifiers(text: str) -> Dict:
160
+ """Check text for HIPAA identifiers."""
161
+ violations = {}
162
+ total_issues = 0
163
+
164
+ for identifier_id, config in HIPAA_IDENTIFIERS.items():
165
+ matches = []
166
+ for pattern in config["patterns"]:
167
+ found = re.findall(pattern, text, re.IGNORECASE)
168
+ matches.extend(found)
169
+
170
+ if matches:
171
+ # Remove duplicates, limit to first 5 examples
172
+ unique_matches = list(set(matches))[:5]
173
+ violations[identifier_id] = {
174
+ "description": config["description"],
175
+ "severity": config["severity"],
176
+ "count": len(matches),
177
+ "examples": unique_matches,
178
+ }
179
+ total_issues += len(matches)
180
+
181
+ return {"total_violations": len(violations), "total_instances": total_issues, "violations": violations}
182
+
183
+
184
+ def check_age_compliance(text: str) -> Dict:
185
+ """Check if ages >89 are properly aggregated."""
186
+ age_pattern = r"\b(\d{2,3})\s*(?:year|yr)s?[\s-]?old\b"
187
+ ages = [int(age) for age in re.findall(age_pattern, text, re.IGNORECASE)]
188
+
189
+ violations = [age for age in ages if age > 89]
190
+
191
+ return {
192
+ "ages_over_89": len(violations),
193
+ "examples": violations[:5] if violations else [],
194
+ "compliant": len(violations) == 0,
195
+ }
196
+
197
+
198
+ def generate_report(filename: str) -> Dict:
199
+ """Generate de-identification compliance report."""
200
+ filepath = Path(filename)
201
+
202
+ if not filepath.exists():
203
+ raise FileNotFoundError(f"File not found: {filename}")
204
+
205
+ with open(filepath, 'r', encoding='utf-8') as f:
206
+ text = f.read()
207
+
208
+ identifier_check = check_identifiers(text)
209
+ age_check = check_age_compliance(text)
210
+
211
+ # Determine overall compliance
212
+ critical_violations = sum(1 for v in identifier_check["violations"].values() if v["severity"] == "CRITICAL")
213
+ high_violations = sum(1 for v in identifier_check["violations"].values() if v["severity"] == "HIGH")
214
+
215
+ if critical_violations > 0 or high_violations >= 3:
216
+ status = "NON_COMPLIANT"
217
+ elif high_violations > 0 or not age_check["compliant"]:
218
+ status = "NEEDS_REVIEW"
219
+ else:
220
+ status = "COMPLIANT"
221
+
222
+ report = {
223
+ "filename": str(filename),
224
+ "status": status,
225
+ "identifier_violations": identifier_check,
226
+ "age_compliance": age_check,
227
+ "recommendation": get_recommendation(status, identifier_check, age_check),
228
+ }
229
+
230
+ return report
231
+
232
+
233
+ def get_recommendation(status: str, identifiers: Dict, ages: Dict) -> str:
234
+ """Generate recommendation based on findings."""
235
+ if status == "COMPLIANT":
236
+ return "Document appears compliant. Perform final manual review before publication."
237
+
238
+ recommendations = []
239
+
240
+ if identifiers["total_violations"] > 0:
241
+ recommendations.append(f"Remove or redact {identifiers['total_instances']} identified HIPAA identifiers.")
242
+
243
+ if not ages["compliant"]:
244
+ recommendations.append(f"Aggregate {ages['ages_over_89']} age(s) >89 years to '90 or older' or '>89 years'.")
245
+
246
+ return " ".join(recommendations)
247
+
248
+
249
+ def print_report(report: Dict):
250
+ """Print human-readable report."""
251
+ print("=" * 70)
252
+ print("HIPAA DE-IDENTIFICATION CHECK")
253
+ print(f"File: {report['filename']}")
254
+ print("=" * 70)
255
+ print()
256
+
257
+ print(f"Overall Status: {report['status']}")
258
+ print()
259
+
260
+ if report["identifier_violations"]["total_violations"] == 0:
261
+ print("✓ No HIPAA identifiers detected")
262
+ else:
263
+ print(f"⚠ Found {report['identifier_violations']['total_violations']} types of violations")
264
+ print(f" Total instances: {report['identifier_violations']['total_instances']}")
265
+ print()
266
+
267
+ print("Violations by type:")
268
+ print("-" * 70)
269
+
270
+ for id_type, details in sorted(
271
+ report["identifier_violations"]["violations"].items(),
272
+ key=lambda x: {"CRITICAL": 0, "HIGH": 1, "MEDIUM": 2}[x[1]["severity"]],
273
+ ):
274
+ severity_symbol = (
275
+ "⚠⚠⚠" if details["severity"] == "CRITICAL" else "⚠⚠" if details["severity"] == "HIGH" else "⚠"
276
+ )
277
+ print(f"{severity_symbol} [{details['severity']:8}] {details['description']}")
278
+ print(f" Count: {details['count']}")
279
+ print(" Examples:")
280
+ for example in details["examples"]:
281
+ print(f" - {example}")
282
+ print()
283
+
284
+ age_check = report["age_compliance"]
285
+ if age_check["compliant"]:
286
+ print("✓ Age reporting compliant (no ages >89 or properly aggregated)")
287
+ else:
288
+ print(f"⚠ Age compliance issue: {age_check['ages_over_89']} age(s) >89 detected")
289
+ print(" Ages must be aggregated to '90 or older' or '>89 years'")
290
+ print(f" Ages found: {age_check['examples']}")
291
+
292
+ print()
293
+ print("Recommendation:")
294
+ print(report["recommendation"])
295
+ print("=" * 70)
296
+
297
+
298
+ def main():
299
+ """Main entry point."""
300
+ parser = argparse.ArgumentParser(description="Check clinical reports for HIPAA identifiers")
301
+ parser.add_argument("input_file", help="Path to clinical report file")
302
+ parser.add_argument("--output", "-o", help="Output JSON report to file")
303
+ parser.add_argument("--json", action="store_true", help="Output JSON to stdout")
304
+
305
+ args = parser.parse_args()
306
+
307
+ try:
308
+ report = generate_report(args.input_file)
309
+
310
+ if args.json:
311
+ print(json.dumps(report, indent=2))
312
+ else:
313
+ print_report(report)
314
+
315
+ if args.output:
316
+ with open(args.output, 'w') as f:
317
+ json.dump(report, f, indent=2)
318
+ print(f"\nJSON report saved to: {args.output}")
319
+
320
+ # Exit with non-zero if violations found
321
+ exit_code = 0 if report["status"] == "COMPLIANT" else 1
322
+ return exit_code
323
+
324
+ except Exception as e:
325
+ print(f"Error: {e}")
326
+ return 1
327
+
328
+
329
+ if __name__ == "__main__":
330
+ import sys
331
+
332
+ sys.exit(main())
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Check clinical reports for regulatory compliance (HIPAA, GCP, FDA).
4
+
5
+ Usage:
6
+ python compliance_checker.py <report_file>
7
+ """
8
+
9
+ import argparse
10
+ import json
11
+ import re
12
+
13
+
14
+ COMPLIANCE_CHECKS = {
15
+ "hipaa": {
16
+ "consent_statement": r"(?i)(informed\s+consent|written\s+consent).*obtained",
17
+ "deidentification": r"(?i)(de-identif|anonymi[sz])",
18
+ },
19
+ "gcp": {
20
+ "irb_approval": r"(?i)(IRB|IEC|ethics\s+committee).*approv",
21
+ "protocol_compliance": r"(?i)protocol",
22
+ "informed_consent": r"(?i)informed\s+consent",
23
+ },
24
+ "fda": {
25
+ "study_id": r"(?i)(IND|IDE|protocol)\s+(number|#)[:]\s*\S+",
26
+ "safety_reporting": r"(?i)(adverse\s+event|SAE)",
27
+ },
28
+ }
29
+
30
+
31
+ def check_compliance(filename: str) -> dict:
32
+ """Check regulatory compliance."""
33
+ with open(filename, 'r', encoding='utf-8') as f:
34
+ content = f.read()
35
+
36
+ results = {}
37
+ for regulation, checks in COMPLIANCE_CHECKS.items():
38
+ reg_results = {}
39
+ for check_name, pattern in checks.items():
40
+ reg_results[check_name] = bool(re.search(pattern, content))
41
+ results[regulation] = reg_results
42
+
43
+ return {"filename": filename, "compliance": results}
44
+
45
+
46
+ def main():
47
+ """Main entry point."""
48
+ parser = argparse.ArgumentParser(description="Check regulatory compliance")
49
+ parser.add_argument("input_file", help="Path to clinical report")
50
+ parser.add_argument("--json", action="store_true")
51
+
52
+ args = parser.parse_args()
53
+
54
+ try:
55
+ report = check_compliance(args.input_file)
56
+
57
+ if args.json:
58
+ print(json.dumps(report, indent=2))
59
+ else:
60
+ print("\nRegulatory Compliance Check:\n")
61
+ for reg, checks in report["compliance"].items():
62
+ print(f"{reg.upper()}:")
63
+ for check, passed in checks.items():
64
+ symbol = "✓" if passed else "✗"
65
+ print(f" {symbol} {check}")
66
+ print()
67
+
68
+ return 0
69
+
70
+ except Exception as e:
71
+ print(f"Error: {e}")
72
+ return 1
73
+
74
+
75
+ if __name__ == "__main__":
76
+ import sys
77
+
78
+ sys.exit(main())
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Extract structured clinical data from reports.
4
+
5
+ Usage:
6
+ python extract_clinical_data.py <report_file>
7
+ """
8
+
9
+ import argparse
10
+ import json
11
+ import re
12
+
13
+
14
+ def extract_vital_signs(content: str) -> dict:
15
+ """Extract vital signs."""
16
+ vitals = {}
17
+ patterns = {
18
+ "temperature": r"(?i)temp(?:erature)?[:]\s*([\d.]+)\s*°?F",
19
+ "bp": r"(?i)BP[:]\s*(\d+/\d+)",
20
+ "hr": r"(?i)HR[:]\s*(\d+)",
21
+ "rr": r"(?i)RR[:]\s*(\d+)",
22
+ "spo2": r"(?i)SpO2[:]\s*([\d.]+)%",
23
+ }
24
+
25
+ for vital, pattern in patterns.items():
26
+ match = re.search(pattern, content)
27
+ if match:
28
+ vitals[vital] = match.group(1)
29
+
30
+ return vitals
31
+
32
+
33
+ def extract_demographics(content: str) -> dict:
34
+ """Extract patient demographics."""
35
+ demographics = {}
36
+ patterns = {
37
+ "age": r"(?i)(\d+)[\s-]year[\s-]old",
38
+ "sex": r"(?i)(male|female|M|F)",
39
+ }
40
+
41
+ for demo, pattern in patterns.items():
42
+ match = re.search(pattern, content)
43
+ if match:
44
+ demographics[demo] = match.group(1)
45
+
46
+ return demographics
47
+
48
+
49
+ def extract_medications(content: str) -> list:
50
+ """Extract medication list."""
51
+ meds = []
52
+ # Simple pattern for common medication format
53
+ pattern = r"(?i)(\w+)\s+(\d+\s*mg)\s+(PO|IV|SC)\s+(daily|BID|TID|QID)"
54
+ matches = re.findall(pattern, content)
55
+
56
+ for match in matches:
57
+ meds.append({"drug": match[0], "dose": match[1], "route": match[2], "frequency": match[3]})
58
+
59
+ return meds
60
+
61
+
62
+ def main():
63
+ """Main entry point."""
64
+ parser = argparse.ArgumentParser(description="Extract clinical data")
65
+ parser.add_argument("input_file", help="Path to clinical report")
66
+ parser.add_argument("--output", "-o", help="Output JSON file")
67
+
68
+ args = parser.parse_args()
69
+
70
+ try:
71
+ with open(args.input_file, 'r', encoding='utf-8') as f:
72
+ content = f.read()
73
+
74
+ extracted_data = {
75
+ "demographics": extract_demographics(content),
76
+ "vital_signs": extract_vital_signs(content),
77
+ "medications": extract_medications(content),
78
+ }
79
+
80
+ if args.output:
81
+ with open(args.output, 'w') as f:
82
+ json.dump(extracted_data, f, indent=2)
83
+ print(f"✓ Data extracted to: {args.output}")
84
+ else:
85
+ print(json.dumps(extracted_data, indent=2))
86
+
87
+ return 0
88
+
89
+ except Exception as e:
90
+ print(f"Error: {e}")
91
+ return 1
92
+
93
+
94
+ if __name__ == "__main__":
95
+ import sys
96
+
97
+ sys.exit(main())
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Format adverse event data into tables for clinical trial reports.
4
+
5
+ Converts CSV or structured data into formatted AE summary tables.
6
+
7
+ Usage:
8
+ python format_adverse_events.py <ae_data.csv>
9
+ """
10
+
11
+ import argparse
12
+ import csv
13
+ from collections import defaultdict
14
+
15
+
16
+ def format_ae_summary_table(data: list) -> str:
17
+ """Generate AE summary table in markdown format."""
18
+ # Group by treatment arm
19
+ arm_stats = defaultdict(
20
+ lambda: {'total': 0, 'any_ae': 0, 'related_ae': 0, 'sae': 0, 'deaths': 0, 'discontinuations': 0}
21
+ )
22
+
23
+ for row in data:
24
+ arm = row.get('treatment_arm', 'Unknown')
25
+ arm_stats[arm]['total'] += 1
26
+
27
+ if row.get('any_ae', '').lower() == 'yes':
28
+ arm_stats[arm]['any_ae'] += 1
29
+ if row.get('related', '').lower() == 'yes':
30
+ arm_stats[arm]['related_ae'] += 1
31
+ if row.get('serious', '').lower() == 'yes':
32
+ arm_stats[arm]['sae'] += 1
33
+ if row.get('fatal', '').lower() == 'yes':
34
+ arm_stats[arm]['deaths'] += 1
35
+ if row.get('discontinuation', '').lower() == 'yes':
36
+ arm_stats[arm]['discontinuations'] += 1
37
+
38
+ # Generate table
39
+ table = "| Category | " + " | ".join(arm_stats.keys()) + " |\n"
40
+ table += "|----------|" + "|".join(["--------"] * len(arm_stats)) + "|\n"
41
+
42
+ categories = [
43
+ ('Total N', 'total'),
44
+ ('Any AE', 'any_ae'),
45
+ ('Treatment-related AE', 'related_ae'),
46
+ ('Serious AE', 'sae'),
47
+ ('Deaths', 'deaths'),
48
+ ('Discontinuation due to AE', 'discontinuations'),
49
+ ]
50
+
51
+ for cat_name, cat_key in categories:
52
+ row_data = [cat_name]
53
+ for arm_data in arm_stats.values():
54
+ count = arm_data[cat_key]
55
+ total = arm_data['total']
56
+ pct = (count / total * 100) if total > 0 and cat_key != 'total' else 0
57
+ value = f"{count}" if cat_key == 'total' else f"{count} ({pct:.1f}%)"
58
+ row_data.append(value)
59
+ table += "| " + " | ".join(row_data) + " |\n"
60
+
61
+ return table
62
+
63
+
64
+ def main():
65
+ """Main entry point."""
66
+ parser = argparse.ArgumentParser(description="Format AE data into tables")
67
+ parser.add_argument("input_file", help="Path to AE data CSV")
68
+ parser.add_argument("--output", "-o", help="Output markdown file")
69
+
70
+ args = parser.parse_args()
71
+
72
+ try:
73
+ with open(args.input_file, 'r') as f:
74
+ reader = csv.DictReader(f)
75
+ data = list(reader)
76
+
77
+ table = format_ae_summary_table(data)
78
+
79
+ if args.output:
80
+ with open(args.output, 'w') as f:
81
+ f.write(table)
82
+ print(f"✓ Table saved to: {args.output}")
83
+ else:
84
+ print("\nAdverse Events Summary Table:\n")
85
+ print(table)
86
+
87
+ return 0
88
+
89
+ except Exception as e:
90
+ print(f"Error: {e}")
91
+ return 1
92
+
93
+
94
+ if __name__ == "__main__":
95
+ import sys
96
+
97
+ sys.exit(main())