agentleFS
tondevreltondevrel/scientific-agent-skills/skills/mne/SKILL.md

mne

Skill23 starsChanged 10 months agoMITView on GitHub

Open-source Python package for exploring, visualizing, and analyzing human neurophysiological data including EEG, MEG, sEEG, and ECoG.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check data quality: - Use raw.plot() to visually inspect for artifacts.

    line 68
  2. Distinctive:

    Reject bad epochs: - Remove epochs with artifacts before averaging.

    line 70
  3. Distinctive:

    Don't mix sampling rates: - Ensure all channels have the same sampling rate.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MNE - Neurophysiology Analysis

MNE provides sophisticated tools for filtering brain signals, epoching data, and performing source localization (mapping signals back to brain anatomy).

When to Use

  • Processing EEG/MEG recordings from clinical or research studies.
  • Analyzing event-related potentials (ERPs).
  • Source localization (finding where in the brain signals originate).
  • Connectivity analysis between brain regions.
  • Preprocessing neurophysiological data for machine learning.

Core Principles

Raw → Epochs → Evoked

The standard pipeline: continuous raw data → segmented epochs → averaged evoked responses.

Sensor Space vs. Source Space

Sensor space: signals at electrodes. Source space: signals reconstructed at brain locations.

Frequency Analysis

Brain signals are analyzed in frequency bands (delta, theta, alpha, beta, gamma).

Quick Reference

Standard Imports

import mne
import numpy as np

Basic Patterns

# 1. Load data
raw = mne.io.read_raw_fif("sample_audvis_raw.fif")
# Or: raw = mne.io.read_raw_edf("eeg.edf")

# 2. Filter and cleaning
raw.filter(l_freq=1, h_freq=40)  # Bandpass filter
raw.notch_filter(freqs=[50, 100]) # Remove power line noise

# 3. Find events and create Epochs
events = mne.find_events(raw)
epochs = mne.Epochs(raw, events, event_id={'stimulus': 1}, tmin=-0.2, tmax=0.5)
epochs.average().plot() # Plot Evoked potential

# 4. Frequency analysis
epochs.compute_psd().plot()

Critical Rules

✅ DO

  • Filter before epoching - Apply filters to continuous data, not epochs.
  • Check data quality - Use raw.plot() to visually inspect for artifacts.
  • Set montage - Assign electrode positions for proper visualization.
  • Reject bad epochs - Remove epochs with artifacts before averaging.

❌ DON'T

  • Don't filter too aggressively - Over-filtering removes signal along with noise.
  • Don't ignore reference - EEG signals are relative. Know your reference electrode.
  • Don't mix sampling rates - Ensure all channels have the same sampling rate.

Advanced Patterns

Source Localization

# Compute forward solution and inverse
fwd = mne.make_forward_solution(raw.info, trans, src, bem)
inv = mne.minimum_norm.make_inverse_operator(raw.info, fwd, cov)
stc = mne.minimum_norm.apply_inverse(evoked, inv)
stc.plot()

Connectivity Analysis

from mne.connectivity import spectral_connectivity

# Compute connectivity between channels
con, freqs, times, n_epochs, n_tapers = spectral_connectivity(
    epochs, method='coh', mode='multitaper')

MNE is the gold standard for neurophysiological data analysis, enabling researchers to extract meaningful insights from the complex signals of the human brain.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.