Agent skill

Mne Python Guide

by NeuroAIHub in NeuroAIHub/BrainPilot

Domain-validated pipeline guidance for EEG/MEG data analysis using MNE-Python: data loading, preprocessing (filtering, ICA, re-referencing), epoching, ERP/ERF computation, time-frequency…

AGPL-3.0Auto-check passedData & Analytics

Install Mne Python Guide

skills CLI
$ npx skills add NeuroAIHub/BrainPilot --skill mne-python-guide -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install NeuroAIHub/BrainPilot mne-python-guide --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/NeuroAIHub/BrainPilot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/skills/skills/05_EEG_ERP/mne-python-guide .claude/skills/mne-python-guide && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mne-python-guide
GitHub stars
1k
Token cost
~2.3k tokens
SKILL.md length
706 words
Files
9 (incl. references)
Skills in repo
59
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Domain-validated pipeline guidance for EEG/MEG data analysis using MNE-Python: data loading, preprocessing (filtering, ICA, re-referencing), epoching, ERP/ERF computation, time-frequency…

  • Works in 5 steps: State the research question — What is… → Justify the method choice — Confirm… → Declare expected outcomes — What output… → …
  • The user works with EEG/MEG/sEEG/ECoG/NIRS/eye-tracking data in Python
  • SKILL.md covers Purpose, When to Use This Skill, Research Planning Protocol and Verification Notice, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Mne Python Guide is an agent skill from NeuroAIHub/BrainPilot. Domain-validated pipeline guidance for EEG/MEG data analysis using MNE-Python: data loading, preprocessing (filtering, ICA, re-referencing), epoching, ERP/ERF computation, time-frequency decomposition, source localization, decoding/MVPA, statistical testing, simulation, and visualization. Use this skill whenever the user works with EEG/MEG/sEEG/ECoG/NIRS/eye-tracking data in Python, mentions MNE, or needs neurophysiological analysis guidance.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including reference files (for example `references/decoding.md`, `references/io_formats.md` and `references/preprocessing.md`).

It sits in Data & Analytics, covering Internationalization and Data analysis. It works with Python. The repository describes itself as: BrainPilot: Automating Brain Discovery with Agentic Research. The licence is AGPL-3.0.

When your agent uses it

  • The user works with EEG/MEG/sEEG/ECoG/NIRS/eye-tracking data in Python
  • Needs neurophysiological analysis guidance

Example prompts

  • “/mne-python-guide”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. State the research question — What is the user investigating?
  2. Justify the method choice — Confirm MNE-Python fits their data type and goal.
  3. Declare expected outcomes — What output format? (ERP plots, TFR maps, source maps, decoding accuracy)
  4. Note assumptions and limitations — Data quality, sample size, MRI availability, montage info.
  5. Present the plan and WAIT for confirmation before writing code.

What it can do on your machine

Read from SKILL.md and the folder at commit 93f6855. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mne Python Guide loads about 2.3k tokens when it runs, and up to ~14k if it reads all its reference files. Until then it costs about 116 tokens; SKILL.md has 706 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~116
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~14k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from NeuroAIHub/BrainPilot at commit 93f6855, republished under its AGPL-3.0 licence (© NeuroAIHub). 706 words, ~2,303 tokens.

Download SKILL.mdSave it as .claude/skills/mne-python-guide/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
mne-python-guide
description
Domain-validated pipeline guidance for EEG/MEG data analysis using MNE-Python: data loading, preprocessing (filtering, ICA, re-referencing), epoching, ERP/ERF computation, time-frequency decomposition, source localization, decoding/MVPA, statistical testing, simulation, and visualization. Use this skill whenever the user works with EEG/MEG/sEEG/ECoG/NIRS/eye-tracking data in Python, mentions MNE, or needs neurophysiological analysis guidance.
domain
neuroimaging-methods
version
2.0.0
authors
Claude (AI-assisted)
papers
Gramfort et al., 2013, Gramfort et al., 2014, Luck, 2014, Jas et al., 2018, Dale et al., 2000, Pascual-Marqui, 2002, Tallon-Baudry et al., 1997, Maris &…
dependencies.required
research-literacy
review_status
ai-generated

MNE-Python Analysis Guide

Purpose

This skill encodes expert methodological knowledge for analyzing neurophysiological data (EEG, MEG, sEEG, ECoG, NIRS, eye-tracking) using MNE-Python (Gramfort et al., 2013; Gramfort et al., 2014). It covers the complete analysis pipeline with recommended parameters, code examples, and common pitfall warnings.

When to Use This Skill

Activate when the user:

  • Asks about EEG/MEG/sEEG/ECoG/NIRS data analysis in Python
  • Mentions MNE, MNE-Python, epochs, evoked, Raw, source estimate, ICA, ERP, ERF
  • Wants to load neurophysiological data files (.fif, .edf, .bdf, .set, .vhdr, .mff, .cnt, .snirf)
  • Needs preprocessing, time-frequency, source localization, decoding, or statistical testing guidance
  • Wants to create MNE objects from numpy arrays or simulate data

Research Planning Protocol

  1. State the research question — What is the user investigating?
  2. Justify the method choice — Confirm MNE-Python fits their data type and goal.
  3. Declare expected outcomes — What output format? (ERP plots, TFR maps, source maps, decoding accuracy)
  4. Note assumptions and limitations — Data quality, sample size, MRI availability, montage info.
  5. Present the plan and WAIT for confirmation before writing code.

Verification Notice

This skill was generated by AI from MNE-Python source code and academic literature. All parameters, thresholds, and citations require independent verification. If you find errors, please open an issue at https://github.com/NeuroAIHub/awesome_cognitive_and_neuroscience_skills/issues.

Reference Files (Progressive Disclosure)

This skill uses layered references. Read the relevant file when the user's question goes deeper than the overview below:

TopicReference FileWhen to Read
Data I/O (30+ formats)references/io_formats.mdUser asks about loading specific file formats, creating objects from arrays, or exporting
Preprocessingreferences/preprocessing.mdUser needs ICA details, Maxwell filtering, artifact annotation, bad channel detection, CSD, fNIRS/iEEG-specific preprocessing
Time-Frequencyreferences/time_frequency.mdUser asks about TFR methods, PSD, CSD, baseline modes, array-level functions
Source Localizationreferences/source_localization.mdUser needs forward modeling, inverse methods, beamformers, dipole fitting details
Decoding & MVPAreferences/decoding.mdUser asks about classification, temporal generalization, CSP, SPoC, receptive fields
Statisticsreferences/statistics.mdUser needs cluster permutation, TFCE, ANOVA, adjacency matrices, correction methods
Visualizationreferences/visualization.mdUser asks about plotting functions, publication figures, 3D brain rendering
Simulationreferences/simulation.mdUser wants to create synthetic data, simulate sources, add artifacts

Pipeline Overview

Raw → Mark bad channels → Filter → ICA → Re-reference → Resample
  → Epochs → Evoked (ERP/ERF)
  → Time-Frequency (TFR/PSD)
  → Source Localization (MNE/dSPM/LCMV)
  → Decoding (MVPA)
  → Statistics (cluster permutation)

Core Data Structures

ObjectDescriptionCreate from
RawContinuous datamne.io.read_raw_*() or mne.io.RawArray(data, info)
EpochsEvent-segmented datamne.Epochs(raw, events, ...) or mne.EpochsArray(data, info)
EvokedAveraged epochsepochs.average() or mne.EvokedArray(data, info)
SourceEstimateBrain-mapped activityapply_inverse(evoked, inv, ...)
SpectrumPower spectrumraw.compute_psd() or epochs.compute_psd()
AverageTFRTime-frequency mapepochs.compute_tfr(method, freqs, ...)

All objects carry an info attribute (mne.Info) with channel metadata that propagates through the pipeline.

Quick Start Pipeline

python
import mne
import numpy as np

# 1. Load
raw = mne.io.read_raw_fif('data_raw.fif', preload=True)
# or: raw = mne.io.read_raw_edf('data.edf', preload=True)

# 2. Preprocess
raw.filter(l_freq=0.1, h_freq=40.)           # bandpass
raw.notch_filter(freqs=[50, 100])              # line noise
ica = mne.preprocessing.ICA(n_components=20, random_state=97, max_iter=800)
ica.fit(raw.copy().filter(l_freq=1., h_freq=None))  # fit on 1 Hz highpass copy
eog_idx, _ = ica.find_bads_eog(raw)
ica.exclude = eog_idx
ica.apply(raw)
raw.set_eeg_reference('average')

# 3. Epoch
events, event_id = mne.events_from_annotations(raw)
epochs = mne.Epochs(raw, events, event_id, tmin=-0.2, tmax=0.5,
                    baseline=(None, 0), preload=True,
                    reject=dict(eeg=150e-6))

# 4. ERP
evoked = epochs['target'].average()
evoked.plot_joint()

# 5. Time-frequency
freqs = np.arange(4, 30, 2)
power = epochs.compute_tfr(method="morlet", freqs=freqs, n_cycles=freqs / 2.)
power.plot()

# 6. Source localization (requires anatomy)
noise_cov = mne.compute_covariance(epochs, tmax=0., method='auto')
fwd = mne.read_forward_solution('sample-fwd.fif')
inv = mne.minimum_norm.make_inverse_operator(epochs.info, fwd, noise_cov)
stc = mne.minimum_norm.apply_inverse(evoked, inv, lambda2=1./9., method='dSPM')

# 7. Decoding
from mne.decoding import SlidingEstimator, cross_val_multiscore
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
X = epochs.get_data(copy=True)
y = epochs.events[:, -1]
clf = make_pipeline(StandardScaler(), LogisticRegression(solver='liblinear'))
slider = SlidingEstimator(clf, scoring='roc_auc')
scores = cross_val_multiscore(slider, X, y, cv=5)

# 8. Statistics
from mne.stats import spatio_temporal_cluster_test
adjacency, _ = mne.channels.find_ch_adjacency(epochs.info, 'eeg')
T_obs, clusters, p_values, H0 = spatio_temporal_cluster_test(
    [X_cond1, X_cond2], adjacency=adjacency, n_permutations=1000)
Show full SKILL.md (298 more words)Show less

Common Pitfalls

  1. ICA on unfiltered data — Highpass ≥1 Hz before ICA fitting; slow drifts degrade decomposition (Jas et al., 2018)
  2. Baseline correction before ICA — Apply baseline after ICA, not before
  3. Filtering after epoching — Filter Raw, not Epochs, to avoid edge artifacts (Luck, 2014)
  4. Wrong rejection thresholds — Start with EEG 100–150 µV, adjust via epochs.plot_drop_log()
  5. Forgetting preload=True — Many operations require data in memory
  6. Re-referencing timing — Set reference after ICA but before epoching
  7. Events after resampling — Recompute events after downsampling, or resample Epochs directly
  8. Legacy API — Use epochs.compute_tfr() / raw.compute_psd() instead of deprecated tfr_morlet() / psd_welch()
  9. Decoding data leakage — Always cross-validate; never fit scaler on test data
  10. Cluster test interpretation — Clusters show where effects exist, not their spatial/temporal extent (Maris & Oostenveld, 2007)

References

  • Blankertz, B., et al. (2008). Optimizing spatial filters for robust EEG single-trial analysis. IEEE Signal Processing Magazine, 25(1), 41–56.
  • Dale, A. M., et al. (2000). Dynamic statistical parametric mapping. Neuron, 26(1), 55–67.
  • Gramfort, A., et al. (2013). MEG and EEG data analysis with MNE-Python. Frontiers in Neuroscience, 7, 267.
  • Gramfort, A., et al. (2014). MNE software for processing MEG and EEG data. NeuroImage, 86, 446–460.
  • Jas, M., et al. (2018). Autoreject: Automated artifact rejection for MEG and EEG data. NeuroImage, 159, 417–429.
  • King, J.-R., & Dehaene, S. (2014). Characterizing the dynamics of mental representations. Trends in Cognitive Sciences, 18(4), 203–210.
  • Luck, S. J. (2014). An Introduction to the Event-Related Potential Technique. MIT Press.
  • Maris, E., & Oostenveld, R. (2007). Nonparametric statistical testing of EEG- and MEG-data. Journal of Neuroscience Methods, 164(1), 177–190.
  • Pascual-Marqui, R. D. (2002). Standardized low-resolution brain electromagnetic tomography. Methods and Findings in Experimental and Clinical Pharmacology, 24(Suppl D), 5–12.
  • Tallon-Baudry, C., et al. (1997). Oscillatory gamma-band activity induced by a visual search task. Journal of Neuroscience, 17(2), 722–734.

© NeuroAIHub, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (references) in packages/skills/skills/05_EEG_ERP/mne-python-guide of NeuroAIHub/BrainPilot.

  • SKILL.md
  • references/decoding.md
  • references/io_formats.md
  • references/preprocessing.md
  • references/simulation.md
  • references/source_localization.md
  • references/statistics.md
  • references/time_frequency.md
  • references/visualization.md

Open the folder on GitHubat commit 93f6855

Compare with similar skills

Mne Python Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mne Python Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mne Python Guide this skillNeuroAIHub/BrainPilot1k—~2.3kAutomated safety check: PassAGPL-3.0
Excel and CSV Data Analysisbytedance/deer-flow83k4 repos~2.2kAutomated safety check: PassMIT
Python Executorcortega26/chile-hub1132 repos~1.5kAutomated safety check: PassMIT
MatlabzLanqing/codex-claude-academic-skills4.6k9 repos~2.3kAutomated safety check: NotesGPL-3.0
Raccoon DataanalysisSenseTime-Copilot/raccoon-dataanalysis-skill137—~1.9kAutomated safety check: PassNone
Meridian MMM Model Buildinggoogle/meridian1.6k—~2.5kAutomated safety check: PassApache-2.0

Similar skills

  • Excel and CSV Data Analysis

    bytedance/deer-flow

    Analyzes uploaded Excel and CSV files with SQL through DuckDB, producing schema inspections, statistical summaries and exports to CSV, JSON or Markdown.

    83k GitHub starsUsed in 4 repos~2.2k tokens
    Data & AnalyticsAuto-check passed
  • Python Executor

    cortega26/chile-hub

    Execute Python code in a safe sandboxed environment via [inference.sh](https://inference.sh).

    113 GitHub starsUsed in 2 repos~1.5k tokens
    Data & AnalyticsAuto-check passed
  • Matlab

    zLanqing/codex-claude-academic-skills

    MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing.

    4.6k GitHub starsUsed in 9 repos~2.3k tokens
    Data & AnalyticsAuto-check: notes
  • Raccoon Dataanalysis

    SenseTime-Copilot/raccoon-dataanalysis-skill

    Raccoon (小浣熊) Data Analysis - Remote code interpreter and data visualization service powered by SenseTime.

    137 GitHub stars~1.9k tokensUpdated 6 mo ago
    Data & AnalyticsAuto-check passed
  • Official

    Takes a user through building a Meridian marketing mix model, from loading CSV data and mapping columns to running EDA, fitting and saving the model.

    1.6k GitHub stars~2.5k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Pandas Pro

    Jeffallan/claude-skills

    Handles pandas DataFrame work: cleaning, merging, groupby aggregation, pivots, time-series resampling and memory tuning, with checks on dtypes, shapes and nulls.

    12k GitHub starsUsed in 1 repo~1.5k tokens
    Data & AnalyticsAuto-check passed

More from NeuroAIHub/BrainPilot

All 59 skills in this repo
  • Deeplabcut

    NeuroAIHub/BrainPilot

    Toolbox for markerless animal pose estimation with DeepLabCut.

    1k GitHub stars~1.7k tokensUpdated 5 days ago
    Auto-check passed
  • Fmriprep

    NeuroAIHub/BrainPilot

    Preprocess task-based or resting-state fMRI data with fMRIPrep — a robust, BIDS-App preprocessing pipeline built on FSL, ANTs, FreeSurfer, AFNI, and Nilearn.

    1k GitHub stars~4.1k tokensUpdated 5 days ago
    Auto-check passed
  • Netneurotools Guide

    NeuroAIHub/BrainPilot

    Domain-validated guidance for network neuroscience analysis using netneurotools: datasets, brain network metrics, connectivity consensus, modularity, spatial statistics, null models, and cortical…

    1k GitHub stars~2.6k tokensUpdated 5 days ago
    Auto-check passed
  • Nature Figure

    NeuroAIHub/BrainPilot

    Submission-grade Nature/high-impact journal figure workflow for Python or R.

    1k GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Pycortex Guide

    NeuroAIHub/BrainPilot

    Domain-validated guidance for cortical surface visualization and brain surface rendering of fMRI data using pycortex: data types (Volume, Vertex, Dataset), 2D cortical flatmaps, 3D WebGL brain…

    1k GitHub stars~1.6k tokensUpdated 5 days ago
    Auto-check passed
  • Markdown Report Writing

    NeuroAIHub/BrainPilot

    Guide AI agents to write beautifully formatted, well-illustrated Markdown reports with proper structure, diagrams, and compatibility across GitHub and Obsidian.

    1k GitHub stars~2.6k tokensUpdated 5 days ago
    Auto-check: warnings

Works with

Questions about Mne Python Guide

What does Mne Python Guide do?

Domain-validated pipeline guidance for EEG/MEG data analysis using MNE-Python: data loading, preprocessing (filtering, ICA, re-referencing), epoching, ERP/ERF computation, time-frequency…. Mne Python Guide is an agent skill from NeuroAIHub/BrainPilot. Domain-validated pipeline guidance for EEG/MEG data analysis using MNE-Python: data loading, preprocessing (filtering, ICA, re-referencing), epoching, ERP/ERF computation, time-frequency decomposition, source localization, decoding/MVPA, statistical testing, simulation, and visualization.

When should I use Mne Python Guide?

Mne Python Guide fits situations like: the user works with EEG/MEG/sEEG/ECoG/NIRS/eye-tracking data in Python; needs neurophysiological analysis guidance.

How do I install Mne Python Guide in Claude Code?

Run `npx skills add NeuroAIHub/BrainPilot --skill mne-python-guide -a claude-code`. Or copy the skill folder (packages/skills/skills/05_EEG_ERP/mne-python-guide in NeuroAIHub/BrainPilot) into .claude/skills/mne-python-guide in your project. Claude Code loads it when a task matches its description.

How do I install Mne Python Guide in Codex?

Run `npx skills add NeuroAIHub/BrainPilot --skill mne-python-guide -a codex`. Or copy the skill folder (packages/skills/skills/05_EEG_ERP/mne-python-guide in NeuroAIHub/BrainPilot) into .agents/skills/mne-python-guide in your project. Codex loads it when a task matches its description.

Can I use Mne Python Guide in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add NeuroAIHub/BrainPilot --skill mne-python-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mne-python-guide, .gemini/skills/mne-python-guide, .github/skills/mne-python-guide and .opencode/skills/mne-python-guide in your project.

What does Mne Python Guide need to run?

SKILL.md names no scripts, command-line tools or credentials: Mne Python Guide is instructions for the agent only. Our summary lists: Python 3.

Does Mne Python Guide access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Mne Python Guide safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Mne Python Guide use?

Mne Python Guide is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mne Python Guide use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 12k tokens, read only when the agent opens those files.

What are the alternatives to Mne Python Guide?

Skills that share tags, products or a category with Mne Python Guide: Excel and CSV Data Analysis (bytedance/deer-flow, 83k stars), Python Executor (cortega26/chile-hub, 113 stars), Matlab (zLanqing/codex-claude-academic-skills, 4.6k stars) and Raccoon Dataanalysis (SenseTime-Copilot/raccoon-dataanalysis-skill, 137 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mne Python Guide?

NeuroAIHub (a GitHub organization) maintains it in NeuroAIHub/BrainPilot, which has 1,040 GitHub stars. The repository holds 59 skills in this directory. The repository was last updated on October 2, 2026.

Source: NeuroAIHub/BrainPilot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.