- name
SKILL.md
ไฟล์สกิลยังคงอยู่ในรีโพซิทอรีของผู้เผยแพร่
วางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add Aperivue/medsci-skills --skill batch-cohort -a cursor -yวางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add Aperivue/medsci-skills --skill batch-cohort -a claude-code -yวางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add Aperivue/medsci-skills --skill batch-cohort -a codex -yวางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add Aperivue/medsci-skills --skill batch-cohort -a grok -yส่งข้อความที่คัดลอกไว้ในแชต Grok Bot แล้ว Bot จะดึง SKILL.md นี้จาก GitHub และเพิ่มลงในสกิลที่ Bot ทุกตัวของคุณใช้ร่วมกัน
Install this skill: https://github.com/Aperivue/medsci-skills/tree/HEAD/skills/batch-cohortจากผู้เผยแพร่
Generate one analysis script per exposure/outcome combination from a single validated methodology template; only the variables change between scripts.
nhis_cohort, cross_national, survey_weightedexposures: [depression, obesity, smoking]; outcomes: [diabetes, hypertension, CVD]exposure, outcome, (optional) subgroup_vars"all" keyword: generates all pairwise combinations from the listscode_only (just scripts) | execute (run + collect results) | full (code + results + summary)cross_national: true generates paired scripts for both countries per combination (see Cross-National Batch Mode)Example:
/batch-cohort
DB Korea: /path/to/knhanes/HN18.csv
DB US: /path/to/nhanes/
Template: cross_national
Exposures: [depression, obesity, smoking]
Outcomes: [diabetes, hypertension, metabolic_syndrome]
cross_national: true
Mode: execute
EXPOSURE_VAR (raw
variable name in the database), EXPOSURE_LABEL (label for tables/figures), EXPOSURE_CODING
(derivation of the binary/categorical exposure), and OUTCOME_VAR, OUTCOME_LABEL,
OUTCOME_CODING likewise.For each exposure and outcome in the combination spec:
${CLAUDE_SKILL_DIR}/../analyze-stats/references/analysis_guides/nhis_icd10_mapping.md; for
survey variable coding, survey_weighted.md in the same folder. If a mapping is
uncertain, write [VERIFY: variable_name] and ask the user to confirm it against the data
dictionary; never guess a variable name, column name or coding.HE_glu >= 126 → diabetes = 1);
categorical as level definitions (e.g., smoking: current/former/never). Outcome definitions
MUST include physician diagnosis, because lab-only definitions systematically overestimate
exposure→outcome associations: Diabetes = FPG≥126 OR HbA1c≥6.5 OR physician-diagnosed
(KNHANES: DE1_dg=1, NHANES: DIQ010="Yes"); Hypertension = SBP≥140 OR DBP≥90 OR
physician-diagnosed (KNHANES: DI1_dg=1, NHANES: BPQ020="Yes").combination_matrix.csv) with all variable specifications.| # | Exposure | Exposure Coding | Outcome | Outcome Coding | Covariates (adjusted) | Notes |
|---|----------|-----------------|---------|----------------|----------------------|-------|
| 1 | Depression (PHQ≥10) | BP_PHQ sum ≥10 | Diabetes | HE_glu≥126|HbA1c≥6.5|DE1_dg=1 | age,sex,edu,income,smoking,alcohol,obesity,CVD | — |
| 2 | Obesity (BMI≥25) | HE_obe ≥4 | Diabetes | same | age,sex,edu,income,smoking,alcohol,depression,CVD | obesity removed from covariates |
Never modify the core methodology across combinations — only swap exposure/outcome/covariates. For each combination in the matrix:
run_all.R or run_all.sh) that executes all N scripts
sequentially (or in parallel via future/parallel), captures errors per script without
stopping the batch, and logs execution time per analysis./analyze-stats code-quality gate
(python3 ${CLAUDE_SKILL_DIR}/../analyze-stats/scripts/check_generated_code.py --code-dir {batch_dir} --strict)
and clear every Major (MISSING_SEED, HARDCODED_DATA_LITERAL, HARDCODED_ABS_PATH,
INPLACE_SOURCE_OVERWRITE) before batch execution.execute or full mode)failed_runs.csv, and suggest fixes.Aggregate all results into a single summary. Every number comes from a combination's executed results files; never fill a cell by hand.
Main Results Matrix (summary_matrix.csv):
Subgroup Summary (subgroup_matrix.csv): Same format, stratified by subgroup variables.
Heatmap (optional): Visual matrix of effect sizes × significance, exposure on Y-axis, outcome on X-axis.
/search-lit-confirmed DOI/PMID; otherwise mark it [UNVERIFIED - NEEDS MANUAL CHECK].{working_dir}/batch_{timestamp}/
├── README.md — Batch run summary (N combinations, template used, date)
├── combination_matrix.csv — All exposure/outcome specs with coding
├── template/
│ └── base_template.R — The validated template (frozen copy)
├── scripts/
│ ├── 01_depression_diabetes.R
│ ├── 02_obesity_diabetes.R
│ ├── ...
│ └── run_all.R — Master execution script
├── results/
│ ├── 01_depression_diabetes/
│ │ ├── table1.csv
│ │ ├── main_results.csv
│ │ └── subgroup_results.csv
│ └── ...
├── summary/
│ ├── summary_matrix.csv — Main results across all combinations
│ ├── subgroup_matrix.csv — Subgroup results across all combinations
│ ├── failed_runs.csv — Combinations that failed + error messages
│ └── heatmap.png — Optional effect size × significance visual
└── logs/
└── batch_execution.log — Timing + error log
Reproducibility: freeze the template version (template/) and include a SHA256 hash of the
data file in README.
When cross_national: true:
/cross-national Phase 4, not a direction-agreement tickUse when one validated cohort analysis must be repeated across many exposure/outcome pairs. Generates one R/Python script per combination from a single methodology template, changing only the variable
---name: batch-cohortdescription: Use when one validated cohort analysis must be repeated across many exposure/outcome pairs. Generates one…---# skills/batch-cohort/SKILL.mdภาพรวม
Use when one validated cohort analysis must be repeated across many exposure/outcome pairs. Generates one R/Python script per combination from a single methodology template, changing only the variables, and aggregates the results into a summary matrix.
FAQ
ดาวน์โหลด skills/batch-cohort/SKILL.md จากผู้เผยแพร่ หรือคัดลอกพาธแล้วเปิดรีโพซิทอรี PlugMCP แสดงรายการสกิลเท่านั้น ไม่ได้โฮสต์ไฟล์
ผู้เผยแพร่เก็บไว้ที่ https://github.com/Aperivue/medsci-skills
Claude, Cursor, Codex และ Grok Build อ่าน SKILL.md ที่คุณเพิ่มจากรีโพซิทอรีของผู้เผยแพร่ได้ ส่วน Grok Bot จะติดตั้งให้เมื่อคุณส่งลิงก์โฟลเดอร์ GitHub ของสกิลในแชต