@brainpilot/skills 0.0.6 → 0.0.7

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 (285) hide show
  1. package/package.json +2 -2
  2. package/skills/01_Meta-Skills/academic-research-hub/SKILL.md +108 -0
  3. package/skills/01_Meta-Skills/academic-research-hub/scripts/requirements.txt +17 -0
  4. package/skills/01_Meta-Skills/academic-research-hub/scripts/research.py +781 -0
  5. package/skills/01_Meta-Skills/beautiful-log/SKILL.md +64 -0
  6. package/skills/01_Meta-Skills/beautiful-log/scripts/beautiful_log.py +274 -0
  7. package/skills/01_Meta-Skills/ethoclaw-daily-paper/SKILL.md +130 -0
  8. package/skills/01_Meta-Skills/ethoclaw-daily-paper/assets/config.template.yaml +54 -0
  9. package/skills/01_Meta-Skills/ethoclaw-daily-paper/assets/top5_digest_template.md +5 -0
  10. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/build_top5_digest.py +300 -0
  11. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/common.py +137 -0
  12. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/merge_results.py +106 -0
  13. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/run_pipeline.py +177 -0
  14. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/search_arxiv.py +162 -0
  15. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/search_pubmed.py +202 -0
  16. package/skills/01_Meta-Skills/ethoclaw-normalize-tabular/SKILL.md +173 -0
  17. package/skills/01_Meta-Skills/ethoclaw-normalize-tabular/scripts/normalize_data.py +874 -0
  18. package/skills/01_Meta-Skills/ethoclaw-pdf-research/SKILL.md +134 -0
  19. package/skills/01_Meta-Skills/ethoclaw-pdf-research/references/confirmation-prompts.md +31 -0
  20. package/skills/01_Meta-Skills/ethoclaw-pdf-research/references/output-patterns.md +45 -0
  21. package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_markdown_deliverables.py +41 -0
  22. package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_research_log.py +84 -0
  23. package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_summary_md.py +63 -0
  24. package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/extract_pdf_bundle.py +140 -0
  25. package/skills/01_Meta-Skills/experiment-controller/SKILL.md +140 -0
  26. package/skills/01_Meta-Skills/knowledge-graph-builder/SKILL.md +366 -0
  27. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/entity_resolution.py +120 -0
  28. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/extraction_prompt_template.txt +19 -0
  29. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/graph_query.py +106 -0
  30. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/hypothesis_cli_reference.py +42 -0
  31. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/new_data_source_template.py +116 -0
  32. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/requirements.txt +15 -0
  33. package/skills/01_Meta-Skills/method-design/SKILL.md +61 -0
  34. package/skills/01_Meta-Skills/multi-search-engine/SKILL.md +119 -0
  35. package/skills/01_Meta-Skills/research-idea/SKILL.md +65 -0
  36. package/skills/05_EEG_ERP/eeg-skill/SKILL.md +197 -0
  37. package/skills/05_EEG_ERP/meg-skill/SKILL.md +188 -0
  38. package/skills/05_EEG_ERP/meg-skill/scripts/time_frequency.py +223 -0
  39. package/skills/05_EEG_ERP/mne-eeg-tool/SKILL.md +165 -0
  40. package/skills/05_EEG_ERP/mne-eeg-tool/scripts/eeg_pipeline_reference.py +231 -0
  41. package/skills/05_EEG_ERP/seed-iv-skill/SKILL.md +184 -0
  42. package/skills/05_EEG_ERP/seed-iv-skill/scripts/classify_seed_iv.py +154 -0
  43. package/skills/05_EEG_ERP/seed-iv-skill/scripts/extract_seed_iv_features.py +190 -0
  44. package/skills/05_EEG_ERP/seed-iv-skill/scripts/validate_seed_iv.py +102 -0
  45. package/skills/05_EEG_ERP/seed-vig-skill/SKILL.md +182 -0
  46. package/skills/05_EEG_ERP/seed-vig-skill/scripts/classify_seed_vig.py +165 -0
  47. package/skills/05_EEG_ERP/seed-vig-skill/scripts/extract_seed_vig_features.py +185 -0
  48. package/skills/05_EEG_ERP/seed-vig-skill/scripts/validate_seed_vig.py +88 -0
  49. package/skills/06_fMRI_Neuroimaging/abcd-skill/SKILL.md +308 -0
  50. package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/abcd_qc_summary.py +449 -0
  51. package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/extract_abcd_phenotype.py +292 -0
  52. package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/reorganize_abcd.py +387 -0
  53. package/skills/06_fMRI_Neuroimaging/abide-skill/SKILL.md +302 -0
  54. package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/abide_qc_summary.py +317 -0
  55. package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/extract_abide_phenotype.py +267 -0
  56. package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/reorganize_abide.py +387 -0
  57. package/skills/06_fMRI_Neuroimaging/adhd200-skill/SKILL.md +244 -0
  58. package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/adhd200_qc_summary.py +98 -0
  59. package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/extract_adhd200_phenotype.py +134 -0
  60. package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/reorganize_adhd200.py +206 -0
  61. package/skills/06_fMRI_Neuroimaging/adni-skill/SKILL.md +358 -0
  62. package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/generate_adni_task_files.py +1305 -0
  63. package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/generate_vqa_from_tasks.py +766 -0
  64. package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/reorganize_adni.py +491 -0
  65. package/skills/06_fMRI_Neuroimaging/aibl-skill/SKILL.md +295 -0
  66. package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/aibl_qc_summary.py +260 -0
  67. package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/extract_aibl_phenotype.py +365 -0
  68. package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/reorganize_aibl.py +394 -0
  69. package/skills/06_fMRI_Neuroimaging/aomic-skill/SKILL.md +292 -0
  70. package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/aomic_qc_summary.py +258 -0
  71. package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/extract_aomic_phenotype.py +284 -0
  72. package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/reorganize_aomic.py +322 -0
  73. package/skills/06_fMRI_Neuroimaging/asl-skill/SKILL.md +168 -0
  74. package/skills/06_fMRI_Neuroimaging/asl-skill/scripts/compute_cbf.py +224 -0
  75. package/skills/06_fMRI_Neuroimaging/bids-organizer/SKILL.md +241 -0
  76. package/skills/06_fMRI_Neuroimaging/bold5000-skill/SKILL.md +186 -0
  77. package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/bold5000_qc_summary.py +96 -0
  78. package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/extract_bold5000_stimulus.py +125 -0
  79. package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/reorganize_bold5000.py +102 -0
  80. package/skills/06_fMRI_Neuroimaging/camcan-skill/SKILL.md +213 -0
  81. package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/camcan_qc_summary.py +131 -0
  82. package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/extract_camcan_phenotype.py +145 -0
  83. package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/validate_camcan.py +141 -0
  84. package/skills/06_fMRI_Neuroimaging/cobre-skill/SKILL.md +201 -0
  85. package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/cobre_qc_summary.py +95 -0
  86. package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/extract_cobre_phenotype.py +104 -0
  87. package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/reorganize_cobre.py +140 -0
  88. package/skills/06_fMRI_Neuroimaging/conn-tool/SKILL.md +180 -0
  89. package/skills/06_fMRI_Neuroimaging/dcm2nii/SKILL.md +189 -0
  90. package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/SKILL.md +183 -0
  91. package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/dmt_har_med_qc_summary.py +96 -0
  92. package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/extract_dmt_har_med_phenotype.py +121 -0
  93. package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/reorganize_dmt_har_med.py +125 -0
  94. package/skills/06_fMRI_Neuroimaging/dwi-skill/SKILL.md +359 -0
  95. package/skills/06_fMRI_Neuroimaging/fmri-skill/SKILL.md +371 -0
  96. package/skills/06_fMRI_Neuroimaging/fmriprep-tool/SKILL.md +228 -0
  97. package/skills/06_fMRI_Neuroimaging/freesurfer-tool/SKILL.md +286 -0
  98. package/skills/06_fMRI_Neuroimaging/freesurfer-tool/scripts/freesurfer_processor.py +145 -0
  99. package/skills/06_fMRI_Neuroimaging/fsl-tool/SKILL.md +208 -0
  100. package/skills/06_fMRI_Neuroimaging/hbn-skill/SKILL.md +271 -0
  101. package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/extract_hbn_phenotype.py +107 -0
  102. package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/hbn_qc_summary.py +96 -0
  103. package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/reorganize_hbn.py +150 -0
  104. package/skills/06_fMRI_Neuroimaging/hcpa-skill/SKILL.md +210 -0
  105. package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/extract_hcpa_phenotype.py +146 -0
  106. package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/hcpa_qc_summary.py +120 -0
  107. package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/reorganize_hcpa.py +155 -0
  108. package/skills/06_fMRI_Neuroimaging/hcpd-skill/SKILL.md +210 -0
  109. package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/extract_hcpd_phenotype.py +148 -0
  110. package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/hcpd_qc_summary.py +125 -0
  111. package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/reorganize_hcpd.py +146 -0
  112. package/skills/06_fMRI_Neuroimaging/hcpep-skill/SKILL.md +215 -0
  113. package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/extract_hcpep_phenotype.py +157 -0
  114. package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/hcpep_qc_summary.py +143 -0
  115. package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/reorganize_hcpep.py +146 -0
  116. package/skills/06_fMRI_Neuroimaging/hcppipeline-tool/SKILL.md +217 -0
  117. package/skills/06_fMRI_Neuroimaging/hcpya-skill/SKILL.md +214 -0
  118. package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/extract_hcpya_phenotype.py +190 -0
  119. package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/hcpya_qc_summary.py +152 -0
  120. package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/reorganize_hcpya.py +203 -0
  121. package/skills/06_fMRI_Neuroimaging/ixi-skill/SKILL.md +198 -0
  122. package/skills/06_fMRI_Neuroimaging/ixi-skill/scripts/ixi_qc_summary.py +137 -0
  123. package/skills/06_fMRI_Neuroimaging/ixi-skill/scripts/reorganize_ixi.py +190 -0
  124. package/skills/06_fMRI_Neuroimaging/mnd-skill/SKILL.md +191 -0
  125. package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/extract_mnd_phenotype.py +143 -0
  126. package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/mnd_qc_summary.py +120 -0
  127. package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/validate_mnd.py +107 -0
  128. package/skills/06_fMRI_Neuroimaging/mschallenge-skill/SKILL.md +203 -0
  129. package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/analyze_lesions.py +119 -0
  130. package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/longitudinal_lesion.py +148 -0
  131. package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/mschallenge_qc_summary.py +132 -0
  132. package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/validate_mschallenge.py +116 -0
  133. package/skills/06_fMRI_Neuroimaging/nibabel-skill/SKILL.md +184 -0
  134. package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/atlas_coordinate_reference.py +61 -0
  135. package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/freesurfer_io_reference.py +34 -0
  136. package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/nifti_inspection_reference.py +35 -0
  137. package/skills/06_fMRI_Neuroimaging/nifd-skill/SKILL.md +205 -0
  138. package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/extract_nifd_phenotype.py +132 -0
  139. package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/nifd_qc_summary.py +111 -0
  140. package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/validate_nifd.py +111 -0
  141. package/skills/06_fMRI_Neuroimaging/nii2dcm/SKILL.md +143 -0
  142. package/skills/06_fMRI_Neuroimaging/nilearn-tool/SKILL.md +266 -0
  143. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/connectome_reference.py +65 -0
  144. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/denoise_timeseries_reference.py +58 -0
  145. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/hierarchical_parcellation_reference.py +53 -0
  146. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/kmeans_parcellation_reference.py +53 -0
  147. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/preprocess_bold_reference.py +76 -0
  148. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/rest_dictlearning_reference.py +56 -0
  149. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/rest_ica_reference.py +59 -0
  150. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/second_level_glm_reference.py +58 -0
  151. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/spacenet_classifier_reference.py +59 -0
  152. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/svm_classifier_reference.py +60 -0
  153. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/task_glm_reference.py +63 -0
  154. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/zalff_summary_reference.py +109 -0
  155. package/skills/06_fMRI_Neuroimaging/nsd-skill/SKILL.md +210 -0
  156. package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/extract_nsd_stimulus.py +171 -0
  157. package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/nsd_qc_summary.py +142 -0
  158. package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/validate_nsd.py +142 -0
  159. package/skills/06_fMRI_Neuroimaging/oasis-skill/SKILL.md +205 -0
  160. package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/extract_oasis_phenotype.py +126 -0
  161. package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/oasis_qc_summary.py +115 -0
  162. package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/validate_oasis.py +119 -0
  163. package/skills/06_fMRI_Neuroimaging/pet-skill/SKILL.md +173 -0
  164. package/skills/06_fMRI_Neuroimaging/pet-skill/scripts/compute_suvr.py +202 -0
  165. package/skills/06_fMRI_Neuroimaging/pnc-skill/SKILL.md +206 -0
  166. package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/extract_pnc_phenotype.py +136 -0
  167. package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/pnc_qc_summary.py +116 -0
  168. package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/validate_pnc.py +120 -0
  169. package/skills/06_fMRI_Neuroimaging/ppmi-skill/SKILL.md +209 -0
  170. package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/extract_ppmi_phenotype.py +138 -0
  171. package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/ppmi_qc_summary.py +111 -0
  172. package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/validate_ppmi.py +117 -0
  173. package/skills/06_fMRI_Neuroimaging/qsiprep-tool/SKILL.md +320 -0
  174. package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/SKILL.md +215 -0
  175. package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/extract_rest_mdd_phenotype.py +132 -0
  176. package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/harmonize_sites.py +152 -0
  177. package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/rest_mdd_qc_summary.py +124 -0
  178. package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/validate_rest_mdd.py +103 -0
  179. package/skills/06_fMRI_Neuroimaging/smri-skill/SKILL.md +302 -0
  180. package/skills/06_fMRI_Neuroimaging/tcp-skill/SKILL.md +204 -0
  181. package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/extract_tcp_phenotype.py +139 -0
  182. package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/tcp_qc_summary.py +111 -0
  183. package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/validate_tcp.py +99 -0
  184. package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/SKILL.md +217 -0
  185. package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/extract_ucla_cnp_phenotype.py +145 -0
  186. package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/ucla_cnp_qc_summary.py +111 -0
  187. package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/validate_ucla_cnp.py +113 -0
  188. package/skills/06_fMRI_Neuroimaging/ukb-skill/SKILL.md +310 -0
  189. package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/build_ukb_survival.py +210 -0
  190. package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/extract_ukb_cases.py +308 -0
  191. package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/extract_ukb_phenotype.py +232 -0
  192. package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/ukb_qc_summary.py +158 -0
  193. package/skills/06_fMRI_Neuroimaging/wmh-segmentation/SKILL.md +133 -0
  194. package/skills/07_Computational_Modeling/detrending/SKILL.md +118 -0
  195. package/skills/07_Computational_Modeling/dictlearning/SKILL.md +122 -0
  196. package/skills/07_Computational_Modeling/filtering/SKILL.md +121 -0
  197. package/skills/07_Computational_Modeling/glm/SKILL.md +153 -0
  198. package/skills/07_Computational_Modeling/hierarchical/SKILL.md +121 -0
  199. package/skills/07_Computational_Modeling/ica/SKILL.md +122 -0
  200. package/skills/07_Computational_Modeling/kmeans/SKILL.md +119 -0
  201. package/skills/07_Computational_Modeling/run_models/SKILL.md +427 -0
  202. package/skills/07_Computational_Modeling/spacenet/SKILL.md +122 -0
  203. package/skills/07_Computational_Modeling/svm/SKILL.md +120 -0
  204. package/skills/08_Computational_Neuroscience/brain_gnn/SKILL.md +183 -0
  205. package/skills/08_Computational_Neuroscience/dipy-tool/SKILL.md +239 -0
  206. package/skills/08_Computational_Neuroscience/dipy-tool/scripts/dti_metrics_reference.py +70 -0
  207. package/skills/08_Computational_Neuroscience/dipy-tool/scripts/load_and_mask_reference.py +76 -0
  208. package/skills/08_Computational_Neuroscience/dipy-tool/scripts/roi_stats_reference.py +59 -0
  209. package/skills/08_Computational_Neuroscience/fm_app/SKILL.md +195 -0
  210. package/skills/08_Computational_Neuroscience/neurostorm/SKILL.md +151 -0
  211. package/skills/13_Visualization/brain-visualization/SKILL.md +191 -0
  212. package/skills/13_Visualization/brain-visualization/scripts/connectome_reference.py +108 -0
  213. package/skills/13_Visualization/brain-visualization/scripts/freesurfer_ply_reference.py +54 -0
  214. package/skills/13_Visualization/brain-visualization/scripts/zalff_summary_reference.py +116 -0
  215. package/skills/13_Visualization/ethoclaw-paper-figure-layout/SKILL.md +78 -0
  216. package/skills/13_Visualization/ethoclaw-paper-figure-layout/assets/naturecomm_figures.tex +74 -0
  217. package/skills/13_Visualization/ethoclaw-paper-figure-layout/scripts/layout_results_foldered.py +579 -0
  218. package/skills/14_Writing/overleaf-skill/SKILL.md +184 -0
  219. package/skills/14_Writing/overleaf-skill/scripts/install.sh +30 -0
  220. package/skills/14_Writing/paper-writing/SKILL.md +146 -0
  221. package/skills/14_Writing/paper-writing/scripts/data_statement_templates.py +164 -0
  222. package/skills/14_Writing/paper-writing/scripts/figure_templates.py +315 -0
  223. package/skills/14_Writing/paper-writing/scripts/nature_figure_style.py +214 -0
  224. package/skills/14_Writing/paper-writing/scripts/section_phrasebank.py +246 -0
  225. package/skills/16_Animal_Behavior/deeplabcut/SKILL.md +154 -0
  226. package/skills/16_Animal_Behavior/deeplabcut/references/3d-pose.md +89 -0
  227. package/skills/16_Animal_Behavior/deeplabcut/references/maDLC.md +123 -0
  228. package/skills/16_Animal_Behavior/deeplabcut/references/modelzoo.md +98 -0
  229. package/skills/16_Animal_Behavior/deeplabcut/references/standard-pipeline.md +165 -0
  230. package/skills/16_Animal_Behavior/deeplabcut/references/utilities.md +146 -0
  231. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/SKILL.md +274 -0
  232. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/report_template_en.html +112 -0
  233. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/report_template_en.md +21 -0
  234. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/cluster-section.md +5 -0
  235. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/heatmap-section.md +5 -0
  236. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/integrated-interpretation.md +3 -0
  237. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/overview.md +3 -0
  238. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/project-summary.md +3 -0
  239. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/radar-section.md +5 -0
  240. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/raw-trajectory.md +3 -0
  241. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/sample-check.md +3 -0
  242. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/single-subject-section.md +3 -0
  243. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/stats-section.md +5 -0
  244. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/epm.md +52 -0
  245. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/fst.md +37 -0
  246. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/nor.md +39 -0
  247. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/oft.md +43 -0
  248. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/tcst.md +45 -0
  249. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/tst.md +36 -0
  250. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/input-types.md +59 -0
  251. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/interpretation-guardrails.md +45 -0
  252. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/metadata-schema.md +57 -0
  253. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/report-sections.md +86 -0
  254. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/section-selection-rules.md +169 -0
  255. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/build_report_manifest.py +27 -0
  256. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/render_report.py +34 -0
  257. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/report_utils.py +1121 -0
  258. package/skills/16_Animal_Behavior/ethoclaw-animal-grounding/SKILL.md +390 -0
  259. package/skills/16_Animal_Behavior/ethoclaw-animal-grounding/reference_code.py +98 -0
  260. package/skills/16_Animal_Behavior/ethoclaw-animal-pose-estimation/SKILL.md +336 -0
  261. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/README.md +21 -0
  262. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/SKILL.md +41 -0
  263. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/batch_kinematic_generator.py +663 -0
  264. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/config.json +19 -0
  265. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/generate_kinematic_parameter.py +401 -0
  266. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/kinematic_generator.py +265 -0
  267. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/SKILL.md +72 -0
  268. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/references/config.example.toml +56 -0
  269. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/scripts/cluster_all_params.py +232 -0
  270. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/scripts/cluster_all_params_from_config.py +236 -0
  271. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/SKILL.md +68 -0
  272. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/references/notes.md +5 -0
  273. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/scripts/plot_h5_radar.py +513 -0
  274. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/SKILL.md +52 -0
  275. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/config.toml +81 -0
  276. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/references/stats-rule.md +18 -0
  277. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_inspect.py +79 -0
  278. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_violin_batch.py +624 -0
  279. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_violin_stats.py +438 -0
  280. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/SKILL.md +280 -0
  281. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/core_scripts/heatmap_trajectory.py +790 -0
  282. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/core_scripts/heatmap_velocity.py +855 -0
  283. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_2d.csv +101 -0
  284. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_2d.h5 +0 -0
  285. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_data_readme.md +126 -0
@@ -0,0 +1,98 @@
1
+ # SuperAnimal & Model Zoo Reference
2
+
3
+ ## Table of Contents
4
+ 1. [SuperAnimal Overview](#superanimal-overview)
5
+ 2. [Zero-Shot Inference](#zero-shot-inference)
6
+ 3. [Fine-Tuning a SuperAnimal Model](#fine-tuning-a-superanimal-model)
7
+ 4. [Available Models](#available-models)
8
+
9
+ ## SuperAnimal Overview
10
+
11
+ SuperAnimal models are pretrained across diverse datasets and can perform pose estimation on new animals without any additional training data. They support:
12
+ - Top-view mice (various strains, fur colors)
13
+ - Quadrupeds (dogs, horses, sheep, pigs, cheetahs, etc.)
14
+ - Primate/human faces
15
+
16
+ ## Zero-Shot Inference
17
+
18
+ Use `video_inference_superanimal` for out-of-the-box inference without any labeled data:
19
+
20
+ ```python
21
+ import deeplabcut as dlc
22
+
23
+ # Single video inference
24
+ dlc.video_inference_superanimal(
25
+ videos=["/path/to/video.mp4"],
26
+ superanimal_name="superanimal_topviewmouse",
27
+ model_name="hrnet_w32",
28
+ detector_name="fasterrcnn_resnet50_fpn_v2",
29
+ scale_list=[200, 300, 400],
30
+ videotype=".mp4",
31
+ )
32
+ ```
33
+
34
+ **Key parameters:**
35
+
36
+ | Parameter | Description |
37
+ |-----------|-------------|
38
+ | `videos` | List of video paths |
39
+ | `superanimal_name` | Which pretrained model to use |
40
+ | `model_name` | Pose model: `hrnet_w32`, `hrnet_w48` |
41
+ | `detector_name` | Detector: `fasterrcnn_resnet50_fpn_v2` |
42
+ | `scale_list` | Scales to try for detection; `[200, 300, 400]` is a good default. Larger animals → lower values (e.g. `[100, 200]`), smaller → higher (e.g. `[400, 600]`) |
43
+
44
+ ## Fine-Tuning a SuperAnimal Model
45
+
46
+ When you have some labeled data, fine-tune for better accuracy:
47
+
48
+ ```python
49
+ # Create a project from a SuperAnimal model
50
+ config_path = dlc.create_pretrained_project(
51
+ path="my-superanimal-project",
52
+ task="my_task",
53
+ videos=["/path/to/video.mp4"],
54
+ superanimal_name="superanimal_topviewmouse",
55
+ model_name="hrnet_w32",
56
+ detector_name="fasterrcnn_resnet50_fpn_v2",
57
+ working_directory="/path/to/projects",
58
+ copy_videos=False,
59
+ )
60
+
61
+ # Now use the standard pipeline:
62
+ # 1. extract_frames -> 2. label_frames -> 3. create_training_dataset -> 4. train_network
63
+ # The pretrained weights give a huge head start; often 5K-20K iterations suffice.
64
+ ```
65
+
66
+ ## Available Models
67
+
68
+ ### Pose Models (`model_name`)
69
+
70
+ | Model | Description |
71
+ |-------|-------------|
72
+ | `hrnet_w32` | Default, good balance of speed/accuracy |
73
+ | `hrnet_w48` | Higher accuracy, more parameters |
74
+ | `resnet_50` | ResNet-50 backbone |
75
+ | `resnet_101` | ResNet-101 backbone |
76
+
77
+ ### Detectors (`detector_name`)
78
+
79
+ | Detector | Description |
80
+ |----------|-------------|
81
+ | `fasterrcnn_resnet50_fpn_v2` | Default, good for multi-animal |
82
+ | `fasterrcnn_mobilenet_v3_large_fpn` | Lighter, faster |
83
+
84
+ ### SuperAnimal Species
85
+
86
+ | `superanimal_name` | Species | Keypoints |
87
+ |---------------------|---------|-----------|
88
+ | `superanimal_topviewmouse` | Top-view mice | 21 (nose, ears, limbs, tail base) |
89
+ | `superanimal_quadruped` | Dogs, horses, sheep, pigs, etc. | 39 |
90
+ | `superanimal_face` | Primate/human faces | 54 |
91
+ | `superanimal_full` | Combined topview mouse + quadruped | Combined |
92
+
93
+ ## Tips
94
+
95
+ - **Scale is critical**: If detections are poor, tune `scale_list`. Each value represents a different box size. Start with `[200, 300, 400]` and expand the range if needed.
96
+ - **GPU required**: SuperAnimal models require a GPU for practical use.
97
+ - **`create_pretrained_project` uses symbolic links**: the model weights are linked, not copied, so don't delete the original.
98
+ - **dlclibrary**: Models are downloaded via `dlclibrary` from HuggingFace on first use.
@@ -0,0 +1,165 @@
1
+ # Standard Pipeline Reference
2
+
3
+ ## Table of Contents
4
+ 1. [Create a Project](#create-a-project)
5
+ 2. [Extract & Label Frames](#extract-label-frames)
6
+ 3. [Create Training Dataset](#create-training-dataset)
7
+ 4. [Train & Evaluate](#train-evaluate)
8
+ 5. [Analyze Videos](#analyze-videos)
9
+ 6. [Export Results](#export-results)
10
+
11
+ ## Create a Project
12
+
13
+ ```python
14
+ import deeplabcut as dlc
15
+
16
+ config_path = dlc.create_new_project(
17
+ "ProjectName", # project name
18
+ "ExperimenterName", # your name
19
+ ["/path/to/video.mp4"], # video(s) to add
20
+ working_directory="/path/to/projects",
21
+ copy_videos=False, # True = copy, False = symlink
22
+ multianimal=False, # True for maDLC
23
+ )
24
+ ```
25
+
26
+ A `config.yaml` is created. Edit it to adjust bodyparts, skeleton, etc. Key fields:
27
+
28
+ | Field | Description |
29
+ |-------|-------------|
30
+ | `bodyparts` | List of body part names to track |
31
+ | `skeleton` | Pairs of bodyparts for skeleton lines in visualization |
32
+ | `numframes2pick` | How many frames to extract for labeling (~20 recommended) |
33
+ | `TrainingFraction` | Fraction of data used for training (e.g. `[0.95]`) |
34
+ | `iteration` | Training iteration identifier |
35
+
36
+ ## Extract & Label Frames
37
+
38
+ ```python
39
+ # Extract frames for manual labeling
40
+ dlc.extract_frames(
41
+ config_path,
42
+ mode="automatic", # or "manual"
43
+ algo="kmeans", # clustering method: kmeans, uniform
44
+ crop=True, # crop around animal for better labeling
45
+ userfeedback_percentage=20,
46
+ )
47
+
48
+ # User labels frames using the GUI
49
+ # dlc.label_frames(config_path) # opens labeling GUI
50
+
51
+ # After labeling, check labels for completeness
52
+ dlc.check_labels(config_path, display_suggestions=True)
53
+ ```
54
+
55
+ **Labeling tips:**
56
+ - Label ~20-50 frames for good initial results
57
+ - Use `kmeans` algorithm for diverse frame selection
58
+ - Set `crop=True` to zoom in on animals for precise labeling
59
+
60
+ ## Create Training Dataset
61
+
62
+ ```python
63
+ dlc.create_training_dataset(
64
+ config_path,
65
+ net_type="resnet_50", # see net types below
66
+ augmenter_type="imgaug", # or "tensorpack", "default"
67
+ num_shuffles=1,
68
+ )
69
+ ```
70
+
71
+ Available architectures:
72
+
73
+ | `net_type` | Best for |
74
+ |-----------|----------|
75
+ | `resnet_50` | Default, good accuracy-speed balance |
76
+ | `resnet_101` | Higher accuracy, slower|
77
+ | `resnet_152` | Maximum accuracy |
78
+ | `mobilenet_v2_1.0` | Lightweight, faster inference |
79
+ | `efficientnet-b0` | Efficient, good for deployment |
80
+ | `dlcrnet_ms5` | Multi-scale, good for small body parts |
81
+
82
+ ## Train & Evaluate
83
+
84
+ ```python
85
+ # Train
86
+ dlc.train_network(
87
+ config_path,
88
+ maxiters=100000, # more iters = more training
89
+ saveiters=5000, # checkpoint interval
90
+ displayiters=500, # console update interval
91
+ max_snapshots_to_keep=5,
92
+ )
93
+
94
+ # Evaluate on test set
95
+ dlc.evaluate_network(
96
+ config_path,
97
+ Shuffles=[1],
98
+ plotting=True,
99
+ show_errors=True,
100
+ )
101
+
102
+ # Evaluate returns: train_error, test_error, p_cutoff
103
+ # p_cutoff: probability threshold for good predictions
104
+ ```
105
+
106
+ **Key metrics:**
107
+ - RMSE < 5 pixels is usually "good enough"
108
+ - Use `p_cutoff` from evaluation to filter predictions later
109
+ - If accuracy is low: label more frames, use deeper network, increase `maxiters`
110
+
111
+ ## Analyze Videos
112
+
113
+ ```python
114
+ # Predict poses for all frames
115
+ dlc.analyze_videos(
116
+ config_path,
117
+ ["/path/to/video.mp4"],
118
+ videotype=".mp4",
119
+ save_as_csv=True,
120
+ batchsize=8,
121
+ )
122
+
123
+ # Create labeled video with predictions overlaid
124
+ dlc.create_labeled_video(
125
+ config_path,
126
+ ["/path/to/video.mp4"],
127
+ filtered=True, # apply ARIMA filtering
128
+ trailpoints=10, # trail length for visualization
129
+ )
130
+
131
+ # Filter predictions (removes jitter)
132
+ dlc.filterpredictions(
133
+ config_path,
134
+ ["/path/to/video.mp4"],
135
+ filtertype="arima", # or "median"
136
+ ARdegree=3,
137
+ MAdegree=1,
138
+ )
139
+ ```
140
+
141
+ ## Export Results
142
+
143
+ H5 files are in the video directory. Export to CSV:
144
+
145
+ ```python
146
+ # Export to CSV
147
+ dlc.analyze_videos_converth5_to_csv(
148
+ "/path/to/videoDLC_resnet50_ProjectNameJul9",
149
+ videotype=".mp4",
150
+ )
151
+
152
+ # Convert to NWB (Neurodata Without Borders)
153
+ dlc.analyze_videos_converth5_to_nwb(
154
+ "/path/to/videoDLC_resnet50_ProjectNameJul9",
155
+ scorer="YourName",
156
+ )
157
+
158
+ # Plot trajectories
159
+ dlc.plot_trajectories(
160
+ config_path,
161
+ ["/path/to/video.mp4"],
162
+ filtered=True,
163
+ showfigure=True,
164
+ )
165
+ ```
@@ -0,0 +1,146 @@
1
+ # Video & Data Utilities Reference
2
+
3
+ ## Table of Contents
4
+ 1. [Video Preprocessing](#video-preprocessing)
5
+ 2. [Post-Processing Predictions](#post-processing-predictions)
6
+ 3. [Data Export & Conversion](#data-export-conversion)
7
+ 4. [Skeleton Analysis](#skeleton-analysis)
8
+ 5. [Outlier Detection](#outlier-detection)
9
+
10
+ ## Video Preprocessing
11
+
12
+ ```python
13
+ import deeplabcut as dlc
14
+
15
+ # Collect all videos in a directory
16
+ videos = dlc.collect_video_paths("/path/to/video_dir", videotype=[".mp4", ".avi"])
17
+
18
+ # Check video integrity
19
+ dlc.check_video_integrity(videos)
20
+
21
+ # Crop video
22
+ dlc.CropVideo("/path/to/video.mp4", start=100, end=5000, output_path="cropped.mp4")
23
+
24
+ # Downsample (reduce frame rate)
25
+ dlc.DownSampleVideo("/path/to/video.mp4", factor=2, output_path="downsampled.mp4")
26
+
27
+ # Shorten video
28
+ dlc.ShortenVideo("/path/to/video.mp4", start="00:00:05", stop="00:05:00", output_path="short.mp4")
29
+ ```
30
+
31
+ ## Post-Processing Predictions
32
+
33
+ ```python
34
+ # Filter jittery predictions
35
+ dlc.filterpredictions(
36
+ config_path,
37
+ ["/path/to/video.mp4"],
38
+ filtertype="arima", # or "median"
39
+ ARdegree=3,
40
+ MAdegree=1,
41
+ p_bound=0.5, # min probability to keep
42
+ )
43
+
44
+ # Create video with all raw detections (before filtering)
45
+ dlc.create_video_with_all_detections(
46
+ config_path,
47
+ ["/path/to/video.mp4"],
48
+ videotype=".mp4",
49
+ )
50
+ ```
51
+
52
+ **Filter tips:**
53
+ - `arima`: Better for smooth tracking, uses temporal context
54
+ - `median`: Simple, fast, good for quick cleanup
55
+ - Low `p_bound` (0.1) keeps more predictions; high (0.9) is more conservative
56
+
57
+ ## Data Export & Conversion
58
+
59
+ ```python
60
+ # Convert H5 to CSV
61
+ dlc.analyze_videos_converth5_to_csv(
62
+ "/path/to/output_folder",
63
+ videotype=".mp4",
64
+ scorer="YourName",
65
+ )
66
+
67
+ # Convert CSV to H5
68
+ dlc.convertcsv2h5("config.yaml", "user_specified")
69
+
70
+ # Convert single-animal project to maDLC format
71
+ dlc.convert2_maDLC(config_path, num_bodyparts=6)
72
+
73
+ # Export to NWB (supports NWB 2.0)
74
+ dlc.analyze_videos_converth5_to_nwb(
75
+ "/path/to/output_folder",
76
+ scorer="YourName",
77
+ videotype=".mp4",
78
+ individual_name="mouse1",
79
+ )
80
+ ```
81
+
82
+ ## Skeleton Analysis
83
+
84
+ Compute bone lengths and joint angles from predictions:
85
+
86
+ ```python
87
+ dlc.analyzeskeleton(
88
+ config_path,
89
+ ["/path/to/video.mp4"],
90
+ videotype=".mp4",
91
+ save_as_csv=True,
92
+ filtered=True,
93
+ )
94
+ ```
95
+
96
+ ## Outlier Detection
97
+
98
+ Find and relabel problematic frames:
99
+
100
+ ```python
101
+ # Find outliers in raw predictions
102
+ dlc.find_outliers_in_raw_data(
103
+ config_path,
104
+ ["/path/to/video.mp4"],
105
+ videotype=".mp4",
106
+ )
107
+
108
+ # Extract outlier frames for relabeling
109
+ dlc.extract_outlier_frames(
110
+ config_path,
111
+ ["/path/to/video.mp4"],
112
+ videotype=".mp4",
113
+ extractionalgorithm="jump", # or "uncertain", "manual"
114
+ p_bound=0.5,
115
+ )
116
+ ```
117
+
118
+ **Extraction algorithms:**
119
+ - `"jump"`: Find frames where body parts jump more than expected
120
+ - `"uncertain"`: Find frames with low prediction confidence
121
+ - `"manual"`: Use outlier data from `find_outliers_in_raw_data`
122
+
123
+ ## Merge Datasets
124
+
125
+ Combine training data from multiple projects:
126
+
127
+ ```python
128
+ # Merge two labeled datasets
129
+ dlc.merge_datasets(
130
+ config_path,
131
+ [project_config1_path, project_config2_path],
132
+ )
133
+ ```
134
+
135
+ ## Trajectory Plotting
136
+
137
+ ```python
138
+ dlc.plot_trajectories(
139
+ config_path,
140
+ ["/path/to/video.mp4"],
141
+ videotype=".mp4",
142
+ filtered=True,
143
+ displayedbodyparts=["nose", "tailbase"],
144
+ showfigure=True,
145
+ )
146
+ ```
@@ -0,0 +1,274 @@
1
+ ---
2
+ name: ethoclaw-analysis-report
3
+ description: Used to generate a structured analysis report based on existing skeleton data, behavioral data, statistical tables, and result figures under a single project path (project_path). First generates manifest.json, then the agent directly fills in the section bodies in the manifest, and finally renders a structured analysis report. Applicable to scenarios such as heatmaps, trajectory plots, radar plots, violin plots, cluster plots, and statistical result summaries. Default output is a single-file HTML report. Users may trigger this with English requests like "generate a report based on this project folder", "organize these results into an HTML report", "generate an analysis summary based on existing charts", or "help me check the groupings and produce a report".
4
+ ---
5
+
6
+ # Ethoclaw Analysis Report
7
+
8
+ Generate a structured analysis report based on existing data and figures under a single `project_path`. The main workflow is fixed as follows:
9
+
10
+ 1. Use `build_report_manifest.py` to generate `manifest.json`
11
+ 2. The agent only reads `manifest.json` and directly fills in `manifest["section_bodies"][...]["body"]`
12
+ 3. Use `render_report.py --manifest manifest.json` to render `report.md` and single-file `report.html`
13
+
14
+ Do not create `sections.json`. Do not write the main text to other intermediate files. `manifest.json` is the only intermediate product.
15
+
16
+ ## Environment Requirements
17
+
18
+ - Python `>=3.10`
19
+ - The current scripts use modern type annotation syntax like `str | None`, `list[...]`, which cannot be run directly on interpreters below 3.10
20
+ - Required dependency: `Pillow`
21
+ - `report_utils.py` directly depends on `PIL.Image`
22
+ - Used to compress and embed `.png` / `.jpg` / `.jpeg` images when rendering HTML
23
+ - File encoding: Must read/write `manifest.json`, `report.md`, `report.html` in `UTF-8`
24
+ - Shell/platform notes:
25
+ - Under Windows PowerShell, long Chinese text passed through command line arguments, pipes, here-strings, environment variables, or `python -c` / `python -` injection can easily be replaced with `?` or produce garbled text
26
+ - Therefore, text filling must directly edit the `manifest.json` file itself, not through shell text channels
27
+
28
+ ## Core Scope
29
+
30
+ Process only one project directory. The user must provide `project_path`, and only files under that path can be read.
31
+
32
+ Allowed inputs include but are not limited to:
33
+
34
+ - Skeleton or trajectory data: `.h5`, `.csv`, keypoint coordinate tables
35
+ - Behavioral or statistical data: summary tables, event tables, significance test tables, parameter tables, single-sample statistical JSON
36
+ - Image results: heatmaps, trajectory plots, radar plots, violin plots, cluster plots, atlas, time-series plots
37
+ - Project metadata: description text, same-directory notes files, experimental information supplemented by the user in conversation
38
+
39
+ Do not assume the project must have groupings, nor that all charts must be complete.
40
+
41
+ ## Script Responsibilities
42
+
43
+ - `scripts/build_report_manifest.py`
44
+ - Input: `project_path`
45
+ - Output: `manifest.json`
46
+ - Responsible for scanning the project, summarizing facts, determining report mode, and generating fillable `section_bodies`
47
+
48
+ - Agent
49
+ - Input: `manifest.json`
50
+ - Responsible for reading instructions in `facts`, `galleries`, and `section_bodies`
51
+ - Directly fills in `manifest["section_bodies"][body_key]["body"]`
52
+
53
+ - `scripts/render_report.py`
54
+ - Input: `manifest.json` with filled body text
55
+ - Output: `report.md`, single-file `report.html`
56
+ - HTML embeds images as compressed data URIs by default, not relying on external image files
57
+ - Only responsible for rendering, not for automatically filling in body text
58
+
59
+ ## Language Detection
60
+
61
+ Before starting any report generation, determine the report language based on the following priority:
62
+ default to English
63
+
64
+ ## Standard Workflow
65
+
66
+ Execute in the following order:
67
+
68
+ 0. **Detect report language**: Apply the language detection rules above to determine whether to generate report
69
+ 1. Confirm the user has provided `project_path`
70
+ 2. Run `build_report_manifest.py --project-path <project_path> --output <manifest.json>`
71
+ 3. Read `manifest.json`
72
+ 4. Check `facts.unconfirmed_items` and `facts.sample_check`
73
+ 5. If there are key metadata missing, first ask the user questions
74
+ 6. Fill in each `manifest["section_bodies"][body_key]["body"]`
75
+ 7. Save back to the same `manifest.json`
76
+ 8. Re-read the just-written `manifest.json` in UTF-8, check each filled `body` to ensure it is still normal text, not `?`, `\uFFFD`, garbled text, or truncated text
77
+ 9. Only after confirming step 8 is correct, run `render_report.py --manifest <manifest.json> --output-dir <report_output>`
78
+
79
+ Do not render an empty report first and then fill it in.
80
+ When filling in body text, directly edit the existing `manifest.json` file, not through shell inline text, command arguments, redirection, or pipes to write large text into JSON.
81
+ Also do not first assemble body text into `python -c`, `python -`, `node -e`, PowerShell here-string, `jq` filters, environment variables, or any command line string, and then have the script write it back to `manifest.json`; these are text injection, not "direct file editing".
82
+
83
+ ## Confirm project_path First
84
+
85
+ You must confirm the user has provided `project_path` before starting work.
86
+
87
+ If not provided:
88
+
89
+ - First ask the user for `project_path`
90
+ - Before getting the path, do not assume default directories, do not search across directories for materials
91
+
92
+ If the user provides a path:
93
+
94
+ - Only read files under that path
95
+ - Do not fetch images and data from sibling directories, parent directories, or other project directories
96
+ - If the path materials are insufficient, only report the insufficiency and ask questions, do not change to read other directories
97
+
98
+ ## When Questions Must Be Asked
99
+
100
+ The following information, if cannot be confirmed within the project path, must be asked to the user first before continuing to generate a complete report:
101
+
102
+ - Whether there are groupings; if file name prefixes already clearly show labels like `control`, `model`, `sham`, `vehicle`, they can be treated as candidate groupings first
103
+ - Meaning of each group label, e.g., what do opaque abbreviations like `Y`, `con`, `k` represent
104
+ - Which group is the control group, or if there is no control group at all
105
+ - Experimental paradigm, experimental scenario, or task type
106
+ - Report purpose: internal reporting, experimental records, manuscript draft, figure organization, etc.
107
+ - Whether explanatory conclusions are allowed, or only result organization
108
+ - If there are multiple result directories, which is the main result for this report
109
+
110
+ Before confirming these key items:
111
+
112
+ - Material inventory and result description based on current evidence can be completed
113
+ - Section bodies that do not depend on background explanation can be filled in
114
+ - Do not output a complete report with strong conclusions
115
+ - Do not automatically interpret unclear abbreviations as experimental group meanings; only make candidate grouping judgments for obvious labels like `control`, `model`
116
+
117
+ ## manifest.json Contract
118
+
119
+ `manifest.json` must contain at least these top-level fields:
120
+
121
+ - `project_path`
122
+ - `project_name`
123
+ - `report_title`
124
+ - `report_goal`
125
+ - `scan`
126
+ - `report_mode`
127
+ - `report_mode_reason`
128
+ - `facts`
129
+ - `galleries`
130
+ - `section_bodies`
131
+
132
+ Where `section_bodies` is the only location for body text filling. Structure:
133
+
134
+ ```json
135
+ {
136
+ "overview_body": {
137
+ "section_id": "overview",
138
+ "title": "Project Overview",
139
+ "purpose": "Provide a brief overview at the project level.",
140
+ "write_when": "Usually filled in; if even the basic project purpose cannot be confirmed, outline as result organization.",
141
+ "source_fields": ["facts.overview", "report_mode", "facts.unconfirmed_items"],
142
+ "rules": [
143
+ "Explain project name, report purpose, experimental paradigm or its absence.",
144
+ "Overview can cover core figure types or analysis scope."
145
+ ],
146
+ "body": ""
147
+ }
148
+ }
149
+ ```
150
+
151
+ The agent only needs to change `body`. Do not change the meaning of `section_id`, `title`, `purpose`, `write_when`, `source_fields`, `rules`.
152
+ If batch modifying multiple bodies is needed, also directly edit this UTF-8 `manifest.json` file itself, not assembling a shell command containing the body text to overwrite it.
153
+ After writing, must re-read this `manifest.json` from disk to confirm each filled `body` can display as normal UTF-8 text; only after confirming the body text is correct in the file can the rendering step proceed.
154
+
155
+ ## What to Write for Each Body
156
+
157
+ ### `project_summary_body`
158
+
159
+ - Purpose: Compress project path, material scope, current mode, and key gaps into a short section
160
+ - Required content: Scan scope, core materials, most suitable writing approach, most critical gaps
161
+ - Should not include: File-by-file lists, materials outside the path, long disclaimers
162
+
163
+ ### `overview_body`
164
+
165
+ - Purpose: Provide high-level overview at the project level and first point out the most obvious result characteristics
166
+ - Required content: Project name, experimental paradigm, current report purpose, what this experiment typically evaluates and basic workflow, 1-2 most notable conclusions from current data
167
+ - Should not write: Turn the entire section into method description
168
+
169
+ ### `sample_check_body`
170
+
171
+ - Purpose: Verify samples and groupings
172
+ - Required content: Sample count, sample IDs, candidate group labels, whether group names are confirmed, control group status, items to be confirmed
173
+ - Should not write: Force interpretation of unclear abbreviations
174
+ - Additional requirement: If file name prefixes already clearly show labels like `control`, `model`, `sham`, `vehicle`, they can be directly treated as candidate groupings
175
+
176
+ ### `raw_trajectory_body`
177
+
178
+ - Purpose: When only raw skeleton or trajectory data exists, provide simple result summary based on coordinate distribution and path length
179
+ - Required content: Which raw trajectory files were used, most obvious activity areas or principal axis distribution, intuitive differences in movement range or path length
180
+ - Should not write: Hard map horizontal/vertical axes to confirmed open arm/closed arm without device mapping
181
+ - Enable by default: As long as raw trajectory summary can be extracted from the project, whether single-sample or multi-sample, it should be filled in
182
+
183
+ ### `heatmap_body`
184
+
185
+ - Purpose: Summarize spatial distribution or movement patterns shown in heatmaps, trajectory plots, atlas, time-series plots
186
+ - Required content: Which figures were referenced, main phenomena observed on the figures
187
+ - Should not write: Statistical significance or mechanistic conclusions
188
+
189
+ ### `radar_body`
190
+
191
+ - Purpose: Summarize multi-parameter profiles in radar plots
192
+ - Required content: What the figure represents, profile relative highs and lows, main difference points
193
+ - Should not write: Unconfirmed indicator meanings, unconfirmed inter-group comparisons
194
+
195
+ ### `stats_body`
196
+
197
+ - Purpose: Summarize comparison results supported by statistical tables or statistical figures
198
+ - Required content: Which statistical tables/figures were referenced, and comparison results that can be supported by these materials
199
+ - Should not write: Significance conclusions when there are no statistical tables
200
+ - Additional requirement: Even if formal grouping definitions are incomplete, if group names are very obvious, raw difference directions can be summarized, but do not write mechanistic conclusions
201
+
202
+ ### `cluster_body`
203
+
204
+ - Purpose: Describe the pattern structure presented in cluster plots
205
+ - Required content: Clustering targets, relative proximity or separation trends
206
+ - Should not write: Turn visual separation into statistical significance
207
+
208
+ ### `single_subject_body`
209
+
210
+ - Purpose: Summarize core results for a single individual or single record in single-sample mode
211
+ - Required content: Total duration, effective detection duration, distance, core indicators like area residence/entry; if only raw skeleton data exists, also write main activity areas based on trajectory distribution
212
+ - Should not write: Group-level patterns
213
+
214
+ ### `integrated_interpretation_body`
215
+
216
+ - Purpose: Integrate multiple result sources across figure types
217
+ - Required content: Which figure types or statistical sources were integrated, which are facts and which are interpretations based on current experimental paradigm
218
+ - Should not write: Unapproved mechanistic or causal summaries
219
+
220
+ ## Report Modes
221
+
222
+ Prioritize selecting the most appropriate one from the following modes:
223
+
224
+ - `single-subject`
225
+ - `multi-sample-no-groups`
226
+ - `grouped-raw-summary`
227
+ - `grouped-comparison`
228
+ - `raw-trajectory-summary`
229
+ - `figure-only-summary`
230
+ - `data-inventory-only`
231
+
232
+ If multiple modes could all apply, prioritize the one that best matches the existing evidence; if there are still key ambiguities, confirm with the user.
233
+
234
+ ## Reference Navigation
235
+
236
+ Read the following files as needed based on task phase, do not load all at once:
237
+
238
+ - When needing to determine what material types are in the current directory: read `references/input-types.md`
239
+ - When needing to determine which items must be confirmed with the user: read `references/metadata-schema.md`
240
+ - When needing to determine what sections exist for this report and body responsibilities: read `references/report-sections.md`
241
+ - When needing to select report mode and sections based on materials: read `references/section-selection-rules.md`
242
+ - When needing to constrain interpretation scope and avoid out-of-bounds conclusions: read `references/interpretation-guardrails.md`
243
+ - If `facts.overview.experiment_type` or other project materials explicitly point to a specific animal behavior paradigm, read the corresponding file before writing `overview_body`, `raw_trajectory_body`, `heatmap_body`, `stats_body`, `single_subject_body`, `integrated_interpretation_body`:
244
+ - `TCST`: `references/experiment-types/tcst.md`
245
+ - `OFT`: `references/experiment-types/oft.md`
246
+ - `TST`: `references/experiment-types/tst.md`
247
+ - `EPM`: `references/experiment-types/epm.md`
248
+ - `FST`: `references/experiment-types/fst.md`
249
+ - `NOR`: `references/experiment-types/nor.md`
250
+ - When needing to view display templates: read `assets/report_template_en.md` and related `assets/section_templates/*.md`
251
+
252
+ ## Expression Requirements
253
+
254
+ - The default language of body should match the current user's conversation language; write in English if the user communicates in English; if the user explicitly specifies the report language, prioritize the user's specification.
255
+ - When terms first appear, prioritize using "English" format, especially for statistical methods, figure types, ethology metrics, and experimental paradigm names; subsequent text can keep one writing style as long as it doesn't cause ambiguity.
256
+ - File names, group labels, column names, and original metric names that come from project files can retain original English, do not forcibly translate and then rewrite the original values.
257
+ - Prioritize giving the most direct and informative summary based on current data, do not avoid obvious result characteristics just because of lacking complete background.
258
+ - If limitations need to be stated, concentrate them in `project_summary_body`, `overview_body`, or `integrated_interpretation_body` briefly once, do not repeat disclaimers in every section.
259
+ - When the experimental paradigm is already clear, concise conclusions can be made about area preference, exploration direction, activity pattern, or coping style by combining with the paradigm's readout meaning.
260
+ - First explain which files and figures are based on, then write interpretations
261
+ - Separate "observed facts" from "inferences based on context"
262
+ - When figures or tables are missing, skip the corresponding body and keep empty string
263
+ - When there are no groupings, do not write inter-group comparisons
264
+ - When there are no statistical tables, do not write significance conclusions
265
+ - When there are only figures without reliable table support, summarize the most obvious image patterns, but do not write as statistical significance or mechanistic conclusions
266
+ - Do not render prompt text, writing instructions, or reasoning rules into the final HTML
267
+
268
+ ## Quality Constraints
269
+
270
+ - Do not read materials outside `project_path`
271
+ - Do not fabricate group meanings, sample sizes, experimental backgrounds, statistical methods, or result conclusions
272
+ - Do not directly write clustering, heatmaps, or visual separations as significant differences
273
+ - Do not exaggerate single-sample phenomena into group-level patterns
274
+ - If the user doesn't provide report purpose, ask first; if the answer cannot be obtained temporarily, write as "result organization" first