@yibeichan/claude-skills 1.0.2 → 1.1.0

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.
package/README.md CHANGED
@@ -6,11 +6,12 @@ A collection of reusable Claude skills for neuroimaging research workflows and s
6
6
 
7
7
  | Skill | Install | Description |
8
8
  |-------|---------|-------------|
9
- | [dicom2fmriprep](skills/dicom2fmriprep/SKILL.md) | `npx @yibeichen/claude-skills install dicom2fmriprep` | Full DICOM→BIDS→fMRIPrep pipeline: heudiconv heuristics, BIDS validation fixes, fMRIPrep on SLURM via BABS. |
10
- | [fmri-ssm](skills/fmri-ssm/SKILL.md) | `npx @yibeichen/claude-skills install fmri-ssm` | State-space models for fMRI: HMM, SLDS, rSLDS, SNLDS for resting-state, task, and naturalistic designs. |
11
- | [neuroimaging-qc](skills/neuroimaging-qc/SKILL.md) | `npx @yibeichen/claude-skills install neuroimaging-qc` | Evidence-based QC decisions for fMRI, EEG, fNIRS using metrics from fMRIPrep, MRIQC, FreeSurfer. |
12
- | [bidsapp-nidm-standards](skills/bidsapp-nidm-standards/SKILL.md) | `npx @yibeichen/claude-skills install bidsapp-nidm-standards` | Standards for creating NIDM-integrated BIDSapps that run through BABS. |
13
- | [scientific-writer](skills/scientific-writer/SKILL.md) | `npx @yibeichen/claude-skills install scientific-writer` | Rigorous scientific manuscripts following IMRAD, CONSORT/STROBE/PRISMA guidelines. |
9
+ | [dicom2fmriprep](skills/dicom2fmriprep/SKILL.md) | `npx @yibeichan/claude-skills install dicom2fmriprep` | Full DICOM→BIDS→fMRIPrep pipeline: heudiconv heuristics, BIDS validation fixes, fMRIPrep on SLURM via BABS. |
10
+ | [fmri-ssm](skills/fmri-ssm/SKILL.md) | `npx @yibeichan/claude-skills install fmri-ssm` | State-space models for fMRI: HMM, SLDS, rSLDS, SNLDS for resting-state, task, and naturalistic designs. |
11
+ | [bids-format](skills/bids-format/SKILL.md) | `npx @yibeichan/claude-skills install bids-format` | BIDS standard for all data types — naming conventions, dataset creation, multi-modal conversion (heudiconv, MNE-BIDS, pypet2bids), validation, derivatives, project organization, DataLad, sharing. |
12
+ | [neuroimaging-qc](skills/neuroimaging-qc/SKILL.md) | `npx @yibeichan/claude-skills install neuroimaging-qc` | Evidence-based QC decisions for fMRI, EEG, fNIRS using metrics from fMRIPrep, MRIQC, FreeSurfer. |
13
+ | [bidsapp-nidm-standards](skills/bidsapp-nidm-standards/SKILL.md) | `npx @yibeichan/claude-skills install bidsapp-nidm-standards` | Standards for creating NIDM-integrated BIDSapps that run through BABS. |
14
+ | [scientific-writer](skills/scientific-writer/SKILL.md) | `npx @yibeichan/claude-skills install scientific-writer` | Rigorous scientific manuscripts following IMRAD, CONSORT/STROBE/PRISMA guidelines. |
14
15
 
15
16
  ## Installation
16
17
 
@@ -21,19 +22,19 @@ Skills are installed to `.claude/skills/` in your current working directory by d
21
22
  Install a specific skill using npx:
22
23
 
23
24
  ```bash
24
- npx @yibeichen/claude-skills install bidsapp-nidm-standards
25
+ npx @yibeichan/claude-skills install bidsapp-nidm-standards
25
26
  ```
26
27
 
27
28
  Install all skills:
28
29
 
29
30
  ```bash
30
- npx @yibeichen/claude-skills install-all
31
+ npx @yibeichan/claude-skills install-all
31
32
  ```
32
33
 
33
34
  List available skills:
34
35
 
35
36
  ```bash
36
- npx @yibeichen/claude-skills list
37
+ npx @yibeichan/claude-skills list
37
38
  ```
38
39
 
39
40
  ### Custom Target Directory
@@ -41,7 +42,7 @@ npx @yibeichen/claude-skills list
41
42
  Install to a custom directory:
42
43
 
43
44
  ```bash
44
- npx @yibeichen/claude-skills install bidsapp-nidm-standards --target ./my-skills
45
+ npx @yibeichan/claude-skills install bidsapp-nidm-standards --target ./my-skills
45
46
  ```
46
47
 
47
48
  ### Overwrite Existing Skills
@@ -49,7 +50,7 @@ npx @yibeichen/claude-skills install bidsapp-nidm-standards --target ./my-skills
49
50
  If a skill already exists, use `--overwrite` to replace it:
50
51
 
51
52
  ```bash
52
- npx @yibeichen/claude-skills install bidsapp-nidm-standards --overwrite
53
+ npx @yibeichan/claude-skills install bidsapp-nidm-standards --overwrite
53
54
  ```
54
55
 
55
56
  ### Python Script (Alternative)
@@ -76,10 +77,10 @@ Remove installed skills:
76
77
 
77
78
  ```bash
78
79
  # Uninstall a specific skill
79
- npx @yibeichen/claude-skills uninstall neuroimaging-qc
80
+ npx @yibeichan/claude-skills uninstall neuroimaging-qc
80
81
 
81
82
  # Uninstall all skills
82
- npx @yibeichen/claude-skills uninstall-all
83
+ npx @yibeichan/claude-skills uninstall-all
83
84
  ```
84
85
 
85
86
  Or with Python:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yibeichan/claude-skills",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Claude skills for neuroimaging research workflows and scientific writing",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,349 @@
1
+ ---
2
+ name: bids-format
3
+ description: >
4
+ BIDS standard for all data types — MRI, DWI, PET, EEG, MEG, iEEG, fNIRS, behavioral,
5
+ annotations, motion capture, microscopy, physiology, and multi-modal datasets. Covers BIDS
6
+ naming conventions (entities, suffixes, extensions), dataset creation, modality-specific
7
+ conversion tools (heudiconv, dcm2bids, MNE-BIDS, pypet2bids), validation, project directory
8
+ layout (sourcedata, rawdata, derivatives, code, stimuli, phenotype), derivatives organization,
9
+ DataLad version control, multi-experiment projects, and sharing on OpenNeuro.
10
+ Trigger keywords: BIDS dataset, BIDS format, BIDS naming, BIDS entities, BIDS convert,
11
+ organize project, project structure, rawdata, derivatives, sourcedata, phenotype,
12
+ participants.tsv, dataset_description.json, multi-modal BIDS, behavioral data BIDS, EEG BIDS,
13
+ DWI BIDS, PET BIDS, annotation data, research data management, DataLad, OpenNeuro, data sharing.
14
+ ---
15
+
16
+ # BIDS Format & Project Organization
17
+
18
+ BIDS standard for any data type — naming conventions, dataset creation, validation, and project
19
+ organization for single-modality through multi-modal datasets.
20
+
21
+ ## When to Use This Skill
22
+
23
+ - Naming or renaming files to follow BIDS conventions
24
+ - Setting up a new BIDS dataset or research project from scratch
25
+ - Converting any data (imaging, behavioral, annotations, physiology) into BIDS
26
+ - Organizing derivatives and analysis outputs
27
+ - Managing multi-modal, multi-experiment, or multi-site projects
28
+ - Preparing data for sharing on OpenNeuro or other repositories
29
+
30
+ ## BIDS Naming Conventions
31
+
32
+ ### Filename Structure
33
+
34
+ Every BIDS filename follows this pattern:
35
+
36
+ ```
37
+ sub-<label>[_ses-<label>][_<entity>-<label>]*_<suffix>.<extension>
38
+ ```
39
+
40
+ Example: `sub-01_ses-pre_task-rest_run-02_bold.nii.gz`
41
+
42
+ ### Entities (Key-Value Pairs)
43
+
44
+ Entities appear in a **fixed order**. Not all entities apply to all datatypes.
45
+
46
+ | Entity | Key | Example | Used in |
47
+ |--------|-----|---------|---------|
48
+ | Subject | `sub-` | `sub-01` | All (required) |
49
+ | Session | `ses-` | `ses-baseline` | All (if multi-session) |
50
+ | Task | `task-` | `task-rest` | func, eeg, meg, ieeg, nirs, beh, pet |
51
+ | Acquisition | `acq-` | `acq-highres` | anat, func, dwi, perf, pet |
52
+ | Contrast agent | `ce-` | `ce-gadolinium` | anat |
53
+ | Reconstruction | `rec-` | `rec-magnitude` | anat, pet |
54
+ | Phase encoding dir | `dir-` | `dir-AP` | dwi, fmap, perf |
55
+ | Run | `run-` | `run-01` | All (if repeated) |
56
+ | Echo | `echo-` | `echo-1` | func, fmap (multi-echo) |
57
+ | Part | `part-` | `part-mag` | anat, func |
58
+ | Recording | `recording-` | `recording-autosampler` | pet (blood), physio |
59
+ | Tracer | `trc-` | `trc-FDG` | pet |
60
+ | Space | `space-` | `space-MNI152NLin2009cAsym` | Derivatives only |
61
+ | Description | `desc-` | `desc-preproc` | Derivatives only |
62
+
63
+ ### Suffixes by Datatype
64
+
65
+ | Datatype | Common Suffixes |
66
+ |----------|----------------|
67
+ | `anat/` | `T1w`, `T2w`, `FLAIR`, `T2starw`, `PDw`, `inplaneT1`, `inplaneT2`, `angio`, `defacemask` |
68
+ | `func/` | `bold`, `sbref`, `events`, `physio`, `stim` |
69
+ | `dwi/` | `dwi`, `sbref` (+ `.bval`, `.bvec` sidecars) |
70
+ | `fmap/` | `phasediff`, `magnitude1`, `magnitude2`, `phase1`, `phase2`, `fieldmap`, `epi` |
71
+ | `perf/` | `asl`, `m0scan`, `aslcontext` |
72
+ | `pet/` | `pet`, `blood` |
73
+ | `eeg/` | `eeg`, `channels`, `electrodes`, `coordsystem`, `events` |
74
+ | `meg/` | `meg`, `channels`, `coordsystem`, `events` |
75
+ | `ieeg/` | `ieeg`, `channels`, `electrodes`, `coordsystem`, `events` |
76
+ | `nirs/` | `nirs`, `channels`, `optodes`, `coordsystem`, `events` |
77
+ | `beh/` | `beh`, `events` |
78
+ | `motion/` | `motion`, `channels` |
79
+
80
+ ### Naming Rules
81
+
82
+ - Labels are **alphanumeric only** — no spaces, underscores, or special characters in values
83
+ - Entities are separated by underscores: `sub-01_task-rest_bold.nii.gz`
84
+ - Entity order is fixed — don't rearrange (sub → ses → task → acq → ce → rec → dir → run → echo → part → suffix)
85
+ - Every data file needs a JSON sidecar with the same name (except `.json` extension)
86
+ - TSV files also get JSON sidecars describing their columns
87
+
88
+ ## BIDS Data Types
89
+
90
+ BIDS supports **14 data types**:
91
+
92
+ | Datatype | Directory | What goes here |
93
+ |----------|-----------|---------------|
94
+ | Anatomical MRI | `anat/` | T1w, T2w, FLAIR, PD, angio |
95
+ | Functional MRI | `func/` | BOLD, events.tsv, physio |
96
+ | Diffusion MRI | `dwi/` | DWI, bval, bvec |
97
+ | Fieldmaps | `fmap/` | Phase-diff, pepolar, fieldmap |
98
+ | Perfusion (ASL) | `perf/` | ASL, M0scan |
99
+ | PET | `pet/` | PET images, blood data |
100
+ | EEG | `eeg/` | Scalp EEG recordings |
101
+ | MEG | `meg/` | MEG recordings |
102
+ | iEEG | `ieeg/` | Intracranial EEG, electrode coords |
103
+ | fNIRS | `nirs/` | Near-infrared spectroscopy |
104
+ | Motion capture | `motion/` | Motion tracking data |
105
+ | Microscopy | `micr/` | Microscopy images |
106
+ | MR Spectroscopy | `mrs/` | MRS data |
107
+ | Behavioral | `beh/` | Behavioral-only tasks (no imaging) |
108
+
109
+ **Key insight**: `beh/` is for standalone behavioral data (no concurrent imaging). Behavioral data
110
+ *during* imaging (e.g., button presses during fMRI) goes in `func/` as `_events.tsv`.
111
+
112
+ ## Project Directory Layout
113
+
114
+ ```
115
+ my-project/
116
+ ├── dataset_description.json # Required: project metadata
117
+ ├── README # Required: human-readable description
118
+ ├── CHANGES # Optional: version history
119
+ ├── LICENSE # Recommended: data license
120
+ ├── participants.tsv # Required: subject demographics
121
+ ├── participants.json # Required: column descriptions
122
+ ├── sourcedata/ # Raw unprocessed data (DICOMs, raw EEG, etc.)
123
+ │ └── sub-01/ # Not required to be BIDS-formatted
124
+ ├── sub-01/
125
+ │ ├── ses-01/ # Optional session level
126
+ │ │ ├── anat/
127
+ │ │ ├── func/
128
+ │ │ ├── dwi/
129
+ │ │ ├── eeg/
130
+ │ │ ├── beh/
131
+ │ │ └── ...
132
+ │ └── sub-01_sessions.tsv
133
+ ├── phenotype/ # Questionnaires, clinical scores, assessments
134
+ │ ├── depression_scores.tsv
135
+ │ └── depression_scores.json
136
+ ├── stimuli/ # Shared stimulus files
137
+ ├── code/ # Analysis scripts, pipelines
138
+ └── derivatives/ # Pipeline outputs (each a BIDS derivative dataset)
139
+ ├── fmriprep/
140
+ │ ├── dataset_description.json
141
+ │ └── sub-01/
142
+ ├── qsiprep/
143
+ └── custom-analysis/
144
+ ```
145
+
146
+ ### When to Use `sourcedata/` vs Project Root
147
+
148
+ | Approach | When to use |
149
+ |----------|-------------|
150
+ | Root = BIDS raw, `sourcedata/` holds originals | Most common. DICOMs/raw files in `sourcedata/`, converted BIDS at root |
151
+ | `rawdata/` + `sourcedata/` both as subdirs | Multi-experiment projects or multiple BIDS datasets |
152
+ | Root = BIDS raw, no `sourcedata/` | Small projects where originals stored elsewhere |
153
+
154
+ ## Multi-Modal Dataset Example
155
+
156
+ A single subject with MRI, EEG, behavioral, and phenotype data:
157
+
158
+ ```
159
+ my-multimodal-study/
160
+ ├── dataset_description.json
161
+ ├── participants.tsv
162
+ ├── participants.json
163
+ ├── phenotype/
164
+ │ ├── anxiety_scores.tsv # Subject-level questionnaire
165
+ │ └── anxiety_scores.json
166
+ ├── stimuli/
167
+ │ └── task-emotionreg_stimuli.csv
168
+ ├── sub-01/
169
+ │ └── ses-01/
170
+ │ ├── anat/
171
+ │ │ ├── sub-01_ses-01_T1w.nii.gz
172
+ │ │ └── sub-01_ses-01_T1w.json
173
+ │ ├── func/
174
+ │ │ ├── sub-01_ses-01_task-emotionreg_bold.nii.gz
175
+ │ │ ├── sub-01_ses-01_task-emotionreg_bold.json
176
+ │ │ └── sub-01_ses-01_task-emotionreg_events.tsv # In-scanner behavior
177
+ │ ├── dwi/
178
+ │ │ ├── sub-01_ses-01_dir-AP_dwi.nii.gz
179
+ │ │ ├── sub-01_ses-01_dir-AP_dwi.bval
180
+ │ │ └── sub-01_ses-01_dir-AP_dwi.bvec
181
+ │ ├── eeg/
182
+ │ │ ├── sub-01_ses-01_task-emotionreg_eeg.vhdr # Same task, separate session
183
+ │ │ ├── sub-01_ses-01_task-emotionreg_eeg.json
184
+ │ │ ├── sub-01_ses-01_task-emotionreg_channels.tsv
185
+ │ │ └── sub-01_ses-01_task-emotionreg_events.tsv
186
+ │ └── beh/
187
+ │ ├── sub-01_ses-01_task-stroop_events.tsv # Standalone behavioral
188
+ │ └── sub-01_ses-01_task-stroop_events.json
189
+ ```
190
+
191
+ ## Required Top-Level Files
192
+
193
+ ### dataset_description.json
194
+
195
+ ```json
196
+ {
197
+ "Name": "My Research Project",
198
+ "BIDSVersion": "1.9.0",
199
+ "DatasetType": "raw",
200
+ "License": "CC BY 4.0",
201
+ "Authors": ["Last, First M.", "Last2, First2"],
202
+ "Acknowledgements": "Funding: NIH R01-XX12345",
203
+ "GeneratedBy": [{"Name": "heudiconv", "Version": "1.1.0"}]
204
+ }
205
+ ```
206
+
207
+ For **derivatives**, use `"DatasetType": "derivative"` and add `SourceDatasets` and `GeneratedBy`.
208
+
209
+ ### participants.tsv / participants.json
210
+
211
+ ```
212
+ participant_id age sex group handedness
213
+ sub-01 28 M control right
214
+ sub-02 32 F patient left
215
+ ```
216
+
217
+ The sidecar JSON describes each column with `Description`, `Units`, and/or `Levels`.
218
+
219
+ ## Modality-Specific Conversion Tools
220
+
221
+ | Data type | Tool | Reference |
222
+ |-----------|------|-----------|
223
+ | MRI (DICOM→NIfTI) | heudiconv / dcm2bids | `dicom2fmriprep` skill, `references/modality-conversions.md` |
224
+ | EEG / MEG / iEEG / fNIRS | MNE-BIDS | `references/electrophys-bids.md` |
225
+ | PET | pypet2bids / manual | `references/pet-bids.md` |
226
+ | Behavioral | Manual / custom script | TSV + JSON sidecars (see below) |
227
+ | Phenotype / Annotations | Manual | TSV + JSON in `phenotype/` |
228
+
229
+ ## Behavioral and Annotation Data
230
+
231
+ ### Standalone Behavioral Tasks (`beh/`)
232
+
233
+ ```
234
+ sub-01/beh/
235
+ ├── sub-01_task-stroop_beh.tsv # Continuous recordings
236
+ ├── sub-01_task-stroop_beh.json
237
+ ├── sub-01_task-stroop_events.tsv # Discrete events (onset, duration, trial_type, ...)
238
+ └── sub-01_task-stroop_events.json
239
+ ```
240
+
241
+ ### Events During Imaging
242
+
243
+ Place `_events.tsv` in the same directory as the imaging file. Required columns: `onset`, `duration`.
244
+
245
+ ```
246
+ onset duration trial_type response_time accuracy
247
+ 0.0 0.5 target 0.432 1
248
+ 2.5 0.5 nontarget 0.567 1
249
+ ```
250
+
251
+ ### Where Annotations Go
252
+
253
+ | Annotation type | Where it goes | Format |
254
+ |----------------|---------------|--------|
255
+ | Trial-level behavioral coding | `_events.tsv` (extra columns) | TSV |
256
+ | Subject-level scores/ratings | `phenotype/` | TSV + JSON |
257
+ | Video/audio annotations | `_events.tsv` with timestamps | TSV |
258
+ | Clinical assessments | `phenotype/` | TSV + JSON |
259
+
260
+ ### Phenotype Directory
261
+
262
+ For questionnaires and subject-level data beyond demographics. Each TSV needs `participant_id`
263
+ as the first column:
264
+
265
+ ```
266
+ participant_id bdi_total bdi_cognitive bdi_somatic
267
+ sub-01 12 5 7
268
+ sub-02 28 14 14
269
+ ```
270
+
271
+ ## Organizing Derivatives
272
+
273
+ Every pipeline output is its own BIDS derivative dataset with a `dataset_description.json`.
274
+
275
+ ```
276
+ derivatives/
277
+ ├── fmriprep/ # fMRI preprocessing
278
+ ├── qsiprep/ # DWI preprocessing
279
+ ├── freesurfer/ # Surface reconstruction
280
+ ├── mriqc/ # Quality metrics
281
+ ├── xcpd/ # Post-processing (confound regression, parcellation)
282
+ ├── mne-preprocess/ # EEG/MEG preprocessing
283
+ ├── first-level/ # Subject-level statistical maps
284
+ └── group-analysis/ # Group-level results
285
+ ```
286
+
287
+ **Derivative naming**: `sub-XX_[entities]_space-<label>_desc-<label>_<suffix>.<ext>`
288
+
289
+ The `desc-` entity distinguishes processing variants (e.g., `desc-preproc`, `desc-filtered`).
290
+
291
+ ## DataLad for Version Control
292
+
293
+ ```bash
294
+ # Create dataset (text2git: text files in git, binaries in git-annex)
295
+ datalad create -c text2git my-project
296
+
297
+ # Save changes
298
+ datalad save -m "Add raw BIDS data for sub-01"
299
+
300
+ # Superdataset linking rawdata + derivatives
301
+ datalad create -c text2git my-project
302
+ datalad clone -d . <url-to-rawdata> inputs/rawdata
303
+ datalad clone -d . <url-to-derivatives> derivatives/fmriprep
304
+ ```
305
+
306
+ For full DataLad workflows (RIA stores, collaboration, HPC), see `references/datalad-workflows.md`.
307
+
308
+ ## BIDS Validation
309
+
310
+ ```bash
311
+ # CLI validator
312
+ pip install bids-validator # or: npm install -g bids-validator
313
+ bids-validator /path/to/dataset
314
+ ```
315
+
316
+ **Common fixes:** missing `dataset_description.json`, missing sidecar JSONs, unexpected files
317
+ (add to `.bidsignore`), wrong entity ordering in filenames.
318
+
319
+ ## Sharing and Archiving
320
+
321
+ **Before sharing checklist:**
322
+ - [ ] Deface anatomical images (`pydeface`, `mri_deface`)
323
+ - [ ] Remove `sourcedata/`, dates from sidecars, identifiable free-text
324
+ - [ ] Validate with `bids-validator`
325
+ - [ ] Add `LICENSE` and complete `dataset_description.json`
326
+
327
+ | Repository | Data types | Notes |
328
+ |-----------|------------|-------|
329
+ | OpenNeuro | All BIDS | Largest BIDS repo. Upload: `openneuro upload /path/to/dataset` |
330
+ | GIN | All BIDS | Git-annex native, good for DataLad |
331
+ | Dandi | Neurophysiology | NWB format preferred |
332
+ | OSF / Zenodo | Any | General-purpose, DOI minting |
333
+
334
+ ## Common Pitfalls
335
+
336
+ - **Wrong entity order**: entities must follow the fixed order (sub → ses → task → acq → ... → suffix)
337
+ - **Behavioral data in wrong place**: `beh/` = standalone; during-scan → `_events.tsv` in imaging dir
338
+ - **Missing JSON sidecars**: every data file and TSV needs a sidecar
339
+ - **Inconsistent subject IDs**: same `sub-XX` everywhere including `phenotype/` TSVs
340
+ - **Forgetting `phenotype/`**: questionnaires go at project level, not in subject directories
341
+ - **Not defacing before sharing**: anatomical MRIs contain identifiable facial features
342
+ - **Mixing raw and derived**: keep derivatives in `derivatives/`, never modify raw data
343
+
344
+ ## References
345
+
346
+ - `references/modality-conversions.md` — Detailed conversion guides for each modality (MRI, EEG, MEG, PET, behavioral, physio)
347
+ - `references/electrophys-bids.md` — EEG/MEG/iEEG/fNIRS with MNE-BIDS: formats, code, batch conversion
348
+ - `references/pet-bids.md` — PET-specific BIDS: required metadata, blood data, tracers
349
+ - `references/datalad-workflows.md` — DataLad: RIA stores, superdatasets, HPC workflows, reproducibility