EEG/ERP Preregistration Skill
Description
Analyzes EEG/ERP research projects and generates comprehensive preregistration documents following community standards. Detects EEG system details, preprocessing parameters, and analysis plan from existing files.
Objective
Generate modality-appropriate EEG/ERP preregistration by:
- Confirming EEG/ERP modality
- Extracting EEG acquisition parameters from scripts and documentation
- Detecting preprocessing pipeline decisions
- Extracting statistical analysis plan
- Creating preregistration draft using EEG template
- Guiding user through missing sections
Workflow
Step 1: Confirm Modality
Verify EEG/ERP detection:
- Display files found: .set, .vhdr, .fdt files
- Confirm with user: "I detected EEG/ERP files. Proceed?"
Step 2: Extract EEG Parameters
From EEGLAB script analysis (.m, .py):
pop_loadset() → Identify input data format
pop_chanedit() → Reference electrode, ground electrode
pop_resample() → Sampling rate changes
pop_eegfilter() → Online/offline filters (high-pass, low-pass, notch)
pop_runica() → ICA components
pop_selectdata() → Trial/epoch extraction
eeglab_topoplot, figure commands → Known electrode montage
From MNE Python (.py files):
raw.load_data() → Data organization
raw.set_eeg_reference() → Reference electrode
raw.filter() → Filter parameters
epochs = Epochs() → Epoch timing (tmin, tmax)
ica = ICA() → ICA parameters
raw.get_montage() → Electrode montage
From documentation:
- README: study design, hypothesis
- Protocol files: participant criteria, task description
- Data dictionaries: channel naming, sampling rates
Step 3: Detect Preprocessing Pipeline
Search scripts for patterns:
artifact_detection = grep(script, "reject_", "threshold", "badchans")
ica_components = grep(script, "n_components", "ica_fit", "exclude")
baseline_correction = grep(script, "baseline", "bl_range", "mode")
downsampling = grep(script, "resample", "decim")
Mark confidence for each parameter.
Step 4: Extract Analysis Plan
From statistical analysis scripts:
- Electrode selection (ROI or mass-univariate)
- Time windows (e.g., 100-300ms for P300)
- Statistical tests (ANOVA, t-test, linear mixed effects)
- Multiple comparisons correction (cluster, FDR, Bonferroni)
- Effect size reporting
Keywords to search:
erp, component, latency, amplitude
stat.f_oneway, ttest_ind, lmm, lmer
cluster, p.adjust, mne.stats
Step 5: Generate Draft
Create PREREGISTRATION_DRAFT.md with:
- Metadata (from METADATA_SCHEMA.md)
- Study Information (title, hypotheses, design)
- EEG Acquisition (filled from scripts + [VERIFY:])
- Preprocessing (filled from scripts + [TO BE COMPLETED])
- Statistical Analysis (filled from scripts + [TO BE COMPLETED])
- Ethics (from ETHICS_PRIVACY_TEMPLATE.md)
Step 6: Interactive Completion
Guide user through sections:
- Confirm detected EEG parameters
- Specify preprocessing decisions not found in scripts
- Detail statistical analysis plan
- Complete missing sections
- Review final document
Detection Patterns
File Extensions
.set - EEGLAB dataset
.vhdr - BrainVision header (Neuroscan)
.fdt - EEGLAB data file
.eeg - Generic EEG
.bdf - BioSemi format
Script Keywords (EEGLAB/MNE)
eeglab, pop_loadset, pop_eegfilter
mne, raw.filter, Epochs, ICA
fieldtrip, ft_preprocessing, ft_timelockanalysis
electrode, montage, reference, ICA, ERP, component
Documentation Keywords
electrode montage, impedance, artifact, preprocessing
sampling rate, filter, high-pass, low-pass
ICA, component, rejection criteria
Output Format
# Preregistration: [Study Title]
## Metadata
[From METADATA_SCHEMA.md - all fields required]
## Study Information
- Research question: [extracted or TO BE COMPLETED]
- Hypotheses: [extracted or TO BE COMPLETED]
- Design: [extracted]
## Participants
- N: [extracted or TO BE COMPLETED]
- Inclusion/exclusion: [TO BE COMPLETED]
- Compensation: [TO BE COMPLETED]
## EEG Acquisition
- System: [detected from scripts: EEGLAB/BrainVision/etc.]
- Electrodes: [montage if detected]
- Sampling rate: [VERIFY: detected value]
- Reference: [VERIFY: detected electrode]
- Ground: [TO BE COMPLETED]
- Online filters: [extracted from preprocessing script]
## Experimental Paradigm
- Task: [TO BE COMPLETED]
- Stimuli: [TO BE COMPLETED]
- Trial structure: [TO BE COMPLETED]
## Preprocessing Plan
- Artifact removal: [extracted from script]
- ICA: [extracted parameters if present]
- Re-referencing: [VERIFY: detected value]
- Baseline correction: [extracted or TO BE COMPLETED]
- Downsampling: [extracted if present]
## Analysis Plan
- ERP components: [TO BE COMPLETED]
- Time windows: [extracted if specified]
- Electrodes: [extracted if specified]
- Statistical tests: [extracted from analysis script]
- Multiple comparisons: [extracted if present]
## Ethics & Data Management
[From ETHICS_PRIVACY_TEMPLATE.md]
Behavior Rules
- Always scan script files before asking about parameters
- Mark confidence levels for each detection:
- ✓ High (direct in script, >2 mentions)
- ~ Medium (inferred from patterns)
- ? Low (guess, needs verification)
- Never modify project files
- Ask focused questions - one section at a time
- Provide examples for user input fields
- Save as
PREREGISTRATION_DRAFT.md in project root
Example Interaction
User: Create a preregistration
Agent:
1. ✓ Confirms: "I found .set files. Continuing with EEG/ERP..."
2. Scans scripts:
- Finds: pop_eegfilter(EEG, 0.5, 40) → 0.5-40 Hz
- Finds: pop_chanedit(EEG, 'ref', 'FCz') → Reference: FCz
- Finds: erp_times = [100 300] → Time window: 100-300ms
3. Extracts: "Sampling rate 500 Hz, EEGLAB dataset format"
4. Generates draft with:
- ✓ EEG system: EEGLAB
- ✓ Filters: 0.5-40 Hz
- ~ Reference: FCz (verify)
- ? Components detected: [TO BE COMPLETED]
5. Asks:
- "Confirm reference as FCz?"
- "What components are you analyzing?"
- "Define artifact rejection thresholds"
6. Saves: PREREGISTRATION_DRAFT.md
Configuration
Load from configs/eeg-config.json:
{
"modality": "eeg",
"template": "templates/eeg/EEG_ERP_PREREGISTRATION_GUIDE.md",
"search_patterns": {
"software": ["eeglab", "mne", "fieldtrip"],
"parameters": ["pop_eegfilter", "raw.filter", "Epochs"],
"keywords": ["electrode", "component", "ICA", "ERP"]
},
"required_sections": [
"Metadata",
"Study Information",
"Participants",
"EEG Acquisition",
"Experimental Paradigm",
"Preprocessing Plan",
"Analysis Plan",
"Ethics"
]
}
Related Resources
- Template:
templates/eeg/EEG_ERP_PREREGISTRATION_GUIDE.md
- Common metadata:
templates/biopsych/common/METADATA_SCHEMA.md
- Ethics template:
templates/biopsych/common/ETHICS_PRIVACY_TEMPLATE.md
- References: See README.md "EEG/ERP Templates" section
Key References
- Govaart et al. (2025). EEG ERP Preregistration Template. MetaArXiv. https://doi.org/10.31222/osf.io/4nvpt
- Pernet et al. (2020). Issues and recommendations from the OHBM COBIDAS MEEG committee for reproducible EEG and MEG research. Nature Neuroscience, 24, 1473-1474. https://doi.org/10.1038/s41593-020-00710-7
- Paul et al. (2021). Making ERP Research More Transparent. International Journal of Psychophysiology.
1---2name: eeg3description: EEG/ERP Preregistration Skill4---5# EEG/ERP Preregistration Skill67## Description89Analyzes EEG/ERP research projects and generates comprehensive preregistration documents following community standards. Detects EEG system details, preprocessing parameters, and analysis plan from existing files.1011## Objective1213Generate modality-appropriate EEG/ERP preregistration by:141. Confirming EEG/ERP modality152. Extracting EEG acquisition parameters from scripts and documentation163. Detecting preprocessing pipeline decisions174. Extracting statistical analysis plan185. Creating preregistration draft using EEG template196. Guiding user through missing sections2021## Workflow2223### Step 1: Confirm Modality24Verify EEG/ERP detection:25- Display files found: .set, .vhdr, .fdt files26- Confirm with user: "I detected EEG/ERP files. Proceed?"2728### Step 2: Extract EEG Parameters2930**From EEGLAB script analysis (.m, .py):**31- `pop_loadset()` → Identify input data format32- `pop_chanedit()` → Reference electrode, ground electrode33- `pop_resample()` → Sampling rate changes34- `pop_eegfilter()` → Online/offline filters (high-pass, low-pass, notch)35- `pop_runica()` → ICA components36- `pop_selectdata()` → Trial/epoch extraction37- `eeglab_topoplot`, `figure` commands → Known electrode montage3839**From MNE Python (.py files):**40- `raw.load_data()` → Data organization41- `raw.set_eeg_reference()` → Reference electrode42- `raw.filter()` → Filter parameters43- `epochs = Epochs()` → Epoch timing (tmin, tmax)44- `ica = ICA()` → ICA parameters45- `raw.get_montage()` → Electrode montage4647**From documentation:**48- README: study design, hypothesis49- Protocol files: participant criteria, task description50- Data dictionaries: channel naming, sampling rates5152### Step 3: Detect Preprocessing Pipeline5354Search scripts for patterns:55```56artifact_detection = grep(script, "reject_", "threshold", "badchans")57ica_components = grep(script, "n_components", "ica_fit", "exclude")58baseline_correction = grep(script, "baseline", "bl_range", "mode")59downsampling = grep(script, "resample", "decim")60```6162Mark confidence for each parameter.6364### Step 4: Extract Analysis Plan6566**From statistical analysis scripts:**67- Electrode selection (ROI or mass-univariate)68- Time windows (e.g., 100-300ms for P300)69- Statistical tests (ANOVA, t-test, linear mixed effects)70- Multiple comparisons correction (cluster, FDR, Bonferroni)71- Effect size reporting7273**Keywords to search:**74- `erp`, `component`, `latency`, `amplitude`75- `stat.f_oneway`, `ttest_ind`, `lmm`, `lmer`76- `cluster`, `p.adjust`, `mne.stats`7778### Step 5: Generate Draft7980Create `PREREGISTRATION_DRAFT.md` with:81- **Metadata** (from METADATA_SCHEMA.md)82- **Study Information** (title, hypotheses, design)83- **EEG Acquisition** (filled from scripts + [VERIFY:])84- **Preprocessing** (filled from scripts + [TO BE COMPLETED])85- **Statistical Analysis** (filled from scripts + [TO BE COMPLETED])86- **Ethics** (from ETHICS_PRIVACY_TEMPLATE.md)8788### Step 6: Interactive Completion8990Guide user through sections:911. Confirm detected EEG parameters922. Specify preprocessing decisions not found in scripts933. Detail statistical analysis plan944. Complete missing sections955. Review final document9697## Detection Patterns9899### File Extensions100- `.set` - EEGLAB dataset101- `.vhdr` - BrainVision header (Neuroscan)102- `.fdt` - EEGLAB data file103- `.eeg` - Generic EEG104- `.bdf` - BioSemi format105106### Script Keywords (EEGLAB/MNE)107- `eeglab`, `pop_loadset`, `pop_eegfilter`108- `mne`, `raw.filter`, `Epochs`, `ICA`109- `fieldtrip`, `ft_preprocessing`, `ft_timelockanalysis`110- `electrode`, `montage`, `reference`, `ICA`, `ERP`, `component`111112### Documentation Keywords113- `electrode montage`, `impedance`, `artifact`, `preprocessing`114- `sampling rate`, `filter`, `high-pass`, `low-pass`115- `ICA`, `component`, `rejection criteria`116117## Output Format118119```markdown120# Preregistration: [Study Title]121122## Metadata123[From METADATA_SCHEMA.md - all fields required]124125## Study Information126- Research question: [extracted or TO BE COMPLETED]127- Hypotheses: [extracted or TO BE COMPLETED]128- Design: [extracted]129130## Participants131- N: [extracted or TO BE COMPLETED]132- Inclusion/exclusion: [TO BE COMPLETED]133- Compensation: [TO BE COMPLETED]134135## EEG Acquisition136- System: [detected from scripts: EEGLAB/BrainVision/etc.]137- Electrodes: [montage if detected]138- Sampling rate: [VERIFY: detected value]139- Reference: [VERIFY: detected electrode]140- Ground: [TO BE COMPLETED]141- Online filters: [extracted from preprocessing script]142143## Experimental Paradigm144- Task: [TO BE COMPLETED]145- Stimuli: [TO BE COMPLETED]146- Trial structure: [TO BE COMPLETED]147148## Preprocessing Plan149- Artifact removal: [extracted from script]150- ICA: [extracted parameters if present]151- Re-referencing: [VERIFY: detected value]152- Baseline correction: [extracted or TO BE COMPLETED]153- Downsampling: [extracted if present]154155## Analysis Plan156- ERP components: [TO BE COMPLETED]157- Time windows: [extracted if specified]158- Electrodes: [extracted if specified]159- Statistical tests: [extracted from analysis script]160- Multiple comparisons: [extracted if present]161162## Ethics & Data Management163[From ETHICS_PRIVACY_TEMPLATE.md]164```165166## Behavior Rules1671681. **Always scan script files** before asking about parameters1692. **Mark confidence levels** for each detection:170 - ✓ High (direct in script, >2 mentions)171 - ~ Medium (inferred from patterns)172 - ? Low (guess, needs verification)1733. **Never modify** project files1744. **Ask focused questions** - one section at a time1755. **Provide examples** for user input fields1766. **Save as** `PREREGISTRATION_DRAFT.md` in project root177178## Example Interaction179180```181User: Create a preregistration182183Agent:1841. ✓ Confirms: "I found .set files. Continuing with EEG/ERP..."1852. Scans scripts:186 - Finds: pop_eegfilter(EEG, 0.5, 40) → 0.5-40 Hz187 - Finds: pop_chanedit(EEG, 'ref', 'FCz') → Reference: FCz188 - Finds: erp_times = [100 300] → Time window: 100-300ms1893. Extracts: "Sampling rate 500 Hz, EEGLAB dataset format"1904. Generates draft with:191 - ✓ EEG system: EEGLAB192 - ✓ Filters: 0.5-40 Hz193 - ~ Reference: FCz (verify)194 - ? Components detected: [TO BE COMPLETED]1955. Asks:196 - "Confirm reference as FCz?"197 - "What components are you analyzing?"198 - "Define artifact rejection thresholds"1996. Saves: PREREGISTRATION_DRAFT.md200```201202## Configuration203204Load from `configs/eeg-config.json`:205```json206{207 "modality": "eeg",208 "template": "templates/eeg/EEG_ERP_PREREGISTRATION_GUIDE.md",209 "search_patterns": {210 "software": ["eeglab", "mne", "fieldtrip"],211 "parameters": ["pop_eegfilter", "raw.filter", "Epochs"],212 "keywords": ["electrode", "component", "ICA", "ERP"]213 },214 "required_sections": [215 "Metadata",216 "Study Information",217 "Participants",218 "EEG Acquisition",219 "Experimental Paradigm",220 "Preprocessing Plan",221 "Analysis Plan",222 "Ethics"223 ]224}225```226227## Related Resources228229- Template: `templates/eeg/EEG_ERP_PREREGISTRATION_GUIDE.md`230- Common metadata: `templates/biopsych/common/METADATA_SCHEMA.md`231- Ethics template: `templates/biopsych/common/ETHICS_PRIVACY_TEMPLATE.md`232- References: See README.md "EEG/ERP Templates" section233234## Key References2352361. Govaart et al. (2025). EEG ERP Preregistration Template. MetaArXiv. https://doi.org/10.31222/osf.io/4nvpt2372. Pernet et al. (2020). Issues and recommendations from the OHBM COBIDAS MEEG committee for reproducible EEG and MEG research. Nature Neuroscience, 24, 1473-1474. https://doi.org/10.1038/s41593-020-00710-72383. Paul et al. (2021). Making ERP Research More Transparent. International Journal of Psychophysiology.