HCP-EP Skill (Dataset-Orchestration Layer)
Overview
hcpep-skill is the NeuroClaw orchestration skill for the HCP Early Psychosis (HCP-EP) dataset.
It strictly follows the NeuroClaw hierarchical design principles:
- This skill only describes WHAT needs to be done and which tool skill to delegate to.
- It contains no implementation code or concrete commands.
- All concrete execution is delegated to existing base/tool skills via
claw-shell.
- Companion scripts in
scripts/ provide reference implementations for data reorganization, phenotype extraction, and QC.
Core workflow (never bypassed):
- Identify input HCP-EP data and target modalities.
- Generate a numbered execution plan clearly stating WHAT needs to be done and which tool skill will handle each step.
- Present the full plan, estimated runtime, resource requirements, and risks to the user and wait for explicit confirmation ("YES" / "execute" / "proceed").
- On confirmation, delegate every step to the appropriate skill via
claw-shell.
- After execution, save all outputs in a clean directory structure (
hcpep_output/).
Research use only.
Quick Reference
| Task |
What needs to be done |
Delegate to |
Expected output |
| Data download |
Download HCP-EP from ConnectomeDB |
claw-shell |
Raw HCP-EP files |
| BIDS staging |
Reorganize HCP-EP native layout to BIDS |
scripts/reorganize_hcpep.py |
BIDS-compliant dataset |
| sMRI processing |
Brain extraction, tissue segmentation, cortical reconstruction |
smri-skill |
smri_output/ derivatives |
| fMRI processing |
Preprocessing, denoising, connectivity, task GLM |
fmri-skill |
fmri_output/ derivatives |
| dMRI processing |
Eddy correction, tensor metrics, tractography |
dwi-skill |
dwi_output/ metrics |
| Phenotype extraction |
Clinical, diagnostic, cognitive data |
scripts/extract_hcpep_phenotype.py |
Merged phenotype CSV |
| QC summary |
Per-subject quality control |
scripts/hcpep_qc_summary.py |
QC summary + exclusion list |
Download Stage (Mandatory First Step)
Source
HCP-EP data is distributed through ConnectomeDB:
Dataset Characteristics
- Cohort: ~250 participants (early psychosis and healthy controls)
- Modalities: T1w, T2w, dMRI, rs-fMRI, task-fMRI
- Focus: Early psychosis (schizophrenia spectrum, bipolar disorder), neural circuit disruptions
- Unique feature: Clinical cohort with matched healthy controls for case-control comparisons
Diagnostic Groups
- Early psychosis patients (schizophrenia spectrum, bipolar with psychotic features)
- Healthy controls (age-, sex-, and education-matched)
- All patients are within 5 years of psychosis onset
Download Inputs to Confirm in Plan
- ConnectomeDB credentials/token
- Target modalities (all, structural, functional, diffusion)
- Subject list scope (full or custom subset)
- Destination directory with sufficient disk space
HCP-EP Task Paradigms
| Task |
Description |
Duration |
| MOTOR |
Finger tapping, toe movement, tongue movement |
~3 min |
| EMOTION |
Faces and shapes matching |
~2 min |
| GAMBLING |
Card guessing with reward/loss |
~3 min |
| LANGUAGE |
Story comprehension and math |
~4 min |
| RELATIONAL |
Relational reasoning matching |
~3 min |
| SOCIAL |
Social cognition (mentalizing) movie clips |
~3 min |
| WM |
Working memory (faces, places, tools, body parts) |
~5 min |
| REST |
Resting-state (eyes open) |
~15 min × 4 runs |
BIDS Preparation
Script: scripts/reorganize_hcpep.py
Converts HCP-EP native directory structure to BIDS-compliant layout.
python skills/hcpep-skill/scripts/reorganize_hcpep.py \
--input /path/to/HCPEP/raw \
--output /path/to/HCPEP/bids \
--participants /path/to/subject_list.txt
Features:
- Subject ID normalization: HCP format to BIDS
sub- labels
- Diagnostic group labeling (patient vs. control)
- Modality routing: T1w, T2w, dMRI, rs-fMRI, task-fMRI
- Sidecar JSON generation from HCP metadata
dataset_description.json and participants.tsv generation
- Dry-run mode:
--dry-run to preview without copying
Core Workflow (Never Bypassed)
- Identify user target: full HCP-EP processing, imaging subset, phenotype extraction, or BIDS staging only.
- Generate a numbered plan with tools, outputs, runtime, storage, and risks.
- Wait for explicit confirmation (
YES / execute / proceed).
- On confirmation, run download stage first (if needed).
- After download success, run BIDS preparation using
scripts/reorganize_hcpep.py.
- Delegate to
smri-skill for structural MRI processing.
- Delegate to
fmri-skill for functional MRI processing.
- Delegate to
dwi-skill for diffusion MRI processing.
- If phenotype extraction is requested, run
scripts/extract_hcpep_phenotype.py.
- If QC summary is requested, run
scripts/hcpep_qc_summary.py.
- Save outputs into
hcpep_output/.
Modality Processing Delegation
| Modality |
Delegated skill |
Typical tasks |
Main outputs |
| sMRI (T1w/T2w) |
smri-skill |
brain extraction, tissue segmentation, cortical reconstruction, ROI morphometry |
smri_output/ derivatives |
| fMRI (rs-fMRI/task-fMRI) |
fmri-skill |
preprocessing, denoising, ROI time series, connectivity, task GLM |
fmri_output/ derivatives |
| dMRI (DWI) |
dwi-skill |
eddy correction, tensor metrics, tractography, connectome |
dwi_output/ metrics |
Standard Output Layout
hcpep_output/
├── raw/ # Downloaded original HCP-EP files
├── bids/ # BIDS-staged data
├── smri/ # Structural MRI derivatives
├── fmri/ # Functional MRI derivatives
├── dwi/ # Diffusion MRI derivatives
├── phenotype/ # Merged phenotype tables (diagnosis, clinical, cognitive)
├── qc/ # QC summaries and exclusion lists
└── logs/ # Download + orchestration logs
Benchmark Adapter Guidance
For benchmark-style prompts, do not force the full orchestration when the task only asks for local HCP-EP data staging.
- If the task starts from raw HCP-EP data already present on disk and only asks for BIDS-style staging:
- Skip the mandatory download stage
- Default to the narrow path
local raw HCP-EP discovery -> BIDS-style staging -> minimal metadata -> validation/report
- In benchmark mode, do not require explicit confirmation before presenting the direct staging solution.
Safety and Execution Policy
- No execution before explicit plan confirmation.
- All execution must be routed via
claw-shell.
- Missing dependencies must be resolved by
dependency-planner before running.
Important Notes and Limitations
- HCP-EP is a clinical cohort; patient data requires careful handling and de-identification.
- Early psychosis patients may have higher motion artifacts; QC thresholds may need adjustment.
- Case-control matching should be verified before group comparisons.
- For HCP-native preprocessing, optionally delegate to
hcppipeline-tool.
hcpep-skill is orchestration-only; detailed preprocessing logic remains in modality skills.
When to Call This Skill
- User asks for end-to-end HCP Early Psychosis workflow.
- User asks to download HCP-EP and run sMRI/fMRI/DTI processing.
- User needs BIDS staging for HCP-EP data.
- User asks to extract HCP-EP phenotype data (diagnosis, clinical, cognitive).
Complementary / Related Skills
smri-skill → structural MRI preprocessing
fmri-skill → functional MRI preprocessing and analysis
dwi-skill → diffusion MRI preprocessing and analysis
hcppipeline-tool → HCP-native minimal preprocessing pipelines
bids-organizer → BIDS validation and organization
brain-visualization → visualization of derivatives
dependency-planner → dependency resolution
conda-env-manager → environment management
claw-shell → command execution
Reference
Created At: 2026-05-06 13:02 HKT
Last Updated At: 2026-05-06 13:02 HKT
Author: chengwang96
1---2name: hcpep-skill3description: Use this skill whenever the user wants an end-to-end workflow for the HCP Early Psychosis (HCP-EP) dataset, including dataset download, BIDS organization, and multimodal processing of sMRI, fMRI, and dMRI. Triggers include: 'HCP Early Psychosis', 'HCP-EP', 'process HCP Early Psychosis data', 'HCP EP sMRI fMRI', or any request to run the HCP-EP multimodal pipeline.4license: MIT License (NeuroClaw custom skill - freely modifiable within t5---6# HCP-EP Skill (Dataset-Orchestration Layer)
7
8## Overview
9
10`hcpep-skill` is the NeuroClaw orchestration skill for the **HCP Early Psychosis (HCP-EP)** dataset.
11
12It strictly follows the NeuroClaw hierarchical design principles:
13- This skill **only describes WHAT needs to be done** and **which tool skill to delegate to**.
14- It contains **no implementation code or concrete commands**.
15- All concrete execution is delegated to existing base/tool skills via `claw-shell`.
16- Companion scripts in `scripts/` provide reference implementations for data reorganization, phenotype extraction, and QC.
17
18**Core workflow (never bypassed):**
191. Identify input HCP-EP data and target modalities.
202. Generate a **numbered execution plan** clearly stating WHAT needs to be done and which tool skill will handle each step.
213. Present the full plan, estimated runtime, resource requirements, and risks to the user and wait for explicit confirmation ("YES" / "execute" / "proceed").
224. On confirmation, delegate every step to the appropriate skill via `claw-shell`.
235. After execution, save all outputs in a clean directory structure (`hcpep_output/`).
24
25**Research use only.**
26
27---
28
29## Quick Reference
30
31| Task | What needs to be done | Delegate to | Expected output |
32|---|---|---|---|
33| Data download | Download HCP-EP from ConnectomeDB | `claw-shell` | Raw HCP-EP files |
34| BIDS staging | Reorganize HCP-EP native layout to BIDS | `scripts/reorganize_hcpep.py` | BIDS-compliant dataset |
35| sMRI processing | Brain extraction, tissue segmentation, cortical reconstruction | `smri-skill` | `smri_output/` derivatives |
36| fMRI processing | Preprocessing, denoising, connectivity, task GLM | `fmri-skill` | `fmri_output/` derivatives |
37| dMRI processing | Eddy correction, tensor metrics, tractography | `dwi-skill` | `dwi_output/` metrics |
38| Phenotype extraction | Clinical, diagnostic, cognitive data | `scripts/extract_hcpep_phenotype.py` | Merged phenotype CSV |
39| QC summary | Per-subject quality control | `scripts/hcpep_qc_summary.py` | QC summary + exclusion list |
40
41---
42
43## Download Stage (Mandatory First Step)
44
45### Source
46HCP-EP data is distributed through **ConnectomeDB**:
47- Website: https://db.humanconnectome.org/
48- Requires ConnectomeDB account and data use agreement
49- Part of the HCP Clinical initiative
50
51### Dataset Characteristics
52- **Cohort**: ~250 participants (early psychosis and healthy controls)
53- **Modalities**: T1w, T2w, dMRI, rs-fMRI, task-fMRI
54- **Focus**: Early psychosis (schizophrenia spectrum, bipolar disorder), neural circuit disruptions
55- **Unique feature**: Clinical cohort with matched healthy controls for case-control comparisons
56
57### Diagnostic Groups
58- Early psychosis patients (schizophrenia spectrum, bipolar with psychotic features)
59- Healthy controls (age-, sex-, and education-matched)
60- All patients are within 5 years of psychosis onset
61
62### Download Inputs to Confirm in Plan
63- ConnectomeDB credentials/token
64- Target modalities (all, structural, functional, diffusion)
65- Subject list scope (full or custom subset)
66- Destination directory with sufficient disk space
67
68---
69
70## HCP-EP Task Paradigms
71
72| Task | Description | Duration |
73|---|---|---|
74| MOTOR | Finger tapping, toe movement, tongue movement | ~3 min |
75| EMOTION | Faces and shapes matching | ~2 min |
76| GAMBLING | Card guessing with reward/loss | ~3 min |
77| LANGUAGE | Story comprehension and math | ~4 min |
78| RELATIONAL | Relational reasoning matching | ~3 min |
79| SOCIAL | Social cognition (mentalizing) movie clips | ~3 min |
80| WM | Working memory (faces, places, tools, body parts) | ~5 min |
81| REST | Resting-state (eyes open) | ~15 min × 4 runs |
82
83---
84
85## BIDS Preparation
86
87### Script: `scripts/reorganize_hcpep.py`
88
89Converts HCP-EP native directory structure to BIDS-compliant layout.
90
91```bash
92python skills/hcpep-skill/scripts/reorganize_hcpep.py \
93 --input /path/to/HCPEP/raw \
94 --output /path/to/HCPEP/bids \
95 --participants /path/to/subject_list.txt
96```
97
98Features:
99- Subject ID normalization: HCP format to BIDS `sub-` labels
100- Diagnostic group labeling (patient vs. control)
101- Modality routing: T1w, T2w, dMRI, rs-fMRI, task-fMRI
102- Sidecar JSON generation from HCP metadata
103- `dataset_description.json` and `participants.tsv` generation
104- Dry-run mode: `--dry-run` to preview without copying
105
106---
107
108## Core Workflow (Never Bypassed)
109
1101. Identify user target: full HCP-EP processing, imaging subset, phenotype extraction, or BIDS staging only.
1112. Generate a numbered plan with tools, outputs, runtime, storage, and risks.
1123. Wait for explicit confirmation (`YES` / `execute` / `proceed`).
1134. On confirmation, run download stage first (if needed).
1145. After download success, run BIDS preparation using `scripts/reorganize_hcpep.py`.
1156. Delegate to `smri-skill` for structural MRI processing.
1167. Delegate to `fmri-skill` for functional MRI processing.
1178. Delegate to `dwi-skill` for diffusion MRI processing.
1189. If phenotype extraction is requested, run `scripts/extract_hcpep_phenotype.py`.
11910. If QC summary is requested, run `scripts/hcpep_qc_summary.py`.
12011. Save outputs into `hcpep_output/`.
121
122---
123
124## Modality Processing Delegation
125
126| Modality | Delegated skill | Typical tasks | Main outputs |
127|---|---|---|---|
128| sMRI (T1w/T2w) | `smri-skill` | brain extraction, tissue segmentation, cortical reconstruction, ROI morphometry | `smri_output/` derivatives |
129| fMRI (rs-fMRI/task-fMRI) | `fmri-skill` | preprocessing, denoising, ROI time series, connectivity, task GLM | `fmri_output/` derivatives |
130| dMRI (DWI) | `dwi-skill` | eddy correction, tensor metrics, tractography, connectome | `dwi_output/` metrics |
131
132---
133
134## Standard Output Layout
135
136```
137hcpep_output/
138├── raw/ # Downloaded original HCP-EP files
139├── bids/ # BIDS-staged data
140├── smri/ # Structural MRI derivatives
141├── fmri/ # Functional MRI derivatives
142├── dwi/ # Diffusion MRI derivatives
143├── phenotype/ # Merged phenotype tables (diagnosis, clinical, cognitive)
144├── qc/ # QC summaries and exclusion lists
145└── logs/ # Download + orchestration logs
146```
147
148---
149
150## Benchmark Adapter Guidance
151
152For benchmark-style prompts, do not force the full orchestration when the task only asks for local HCP-EP data staging.
153
154- If the task starts from raw HCP-EP data already present on disk and only asks for BIDS-style staging:
155 - Skip the mandatory download stage
156 - Default to the narrow path `local raw HCP-EP discovery -> BIDS-style staging -> minimal metadata -> validation/report`
157- In benchmark mode, do not require explicit confirmation before presenting the direct staging solution.
158
159---
160
161## Safety and Execution Policy
162- No execution before explicit plan confirmation.
163- All execution must be routed via `claw-shell`.
164- Missing dependencies must be resolved by `dependency-planner` before running.
165
166---
167
168## Important Notes and Limitations
169- HCP-EP is a clinical cohort; patient data requires careful handling and de-identification.
170- Early psychosis patients may have higher motion artifacts; QC thresholds may need adjustment.
171- Case-control matching should be verified before group comparisons.
172- For HCP-native preprocessing, optionally delegate to `hcppipeline-tool`.
173- `hcpep-skill` is orchestration-only; detailed preprocessing logic remains in modality skills.
174
175---
176
177## When to Call This Skill
178- User asks for end-to-end HCP Early Psychosis workflow.
179- User asks to download HCP-EP and run sMRI/fMRI/DTI processing.
180- User needs BIDS staging for HCP-EP data.
181- User asks to extract HCP-EP phenotype data (diagnosis, clinical, cognitive).
182
183---
184
185## Complementary / Related Skills
186- `smri-skill` → structural MRI preprocessing
187- `fmri-skill` → functional MRI preprocessing and analysis
188- `dwi-skill` → diffusion MRI preprocessing and analysis
189- `hcppipeline-tool` → HCP-native minimal preprocessing pipelines
190- `bids-organizer` → BIDS validation and organization
191- `brain-visualization` → visualization of derivatives
192- `dependency-planner` → dependency resolution
193- `conda-env-manager` → environment management
194- `claw-shell` → command execution
195
196---
197
198## Reference
199- HCP Early Psychosis: https://www.humanconnectome.org/study/hcp-early-psychosis
200- ConnectomeDB: https://db.humanconnectome.org/
201- Heckers et al. (2024): The HCP Early Psychosis project
202
203Created At: 2026-05-06 13:02 HKT
204Last Updated At: 2026-05-06 13:02 HKT
205Author: chengwang96