mne-decoding — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited mne-decoding (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Multivariate decoding of neurophysiology data via the MNE MCP server. This skill is skeptical by design: the most damaging decoding mistakes — data leakage and a wrongly assumed chance level — produce a clean, plausible accuracy curve without any error, so the discipline is to grill the cross-validation before fitting and critique before believing.
Companion skills:mne-mcp-guardfor technical execution safety;mne-methodology-criticfor Phase 3. Loaded objects persist in one MNE session. Decoding needs scikit-learn.
Do not fit a classifier until these are answered. If the user can't answer one, propose a sensible default and explicitly flag the open risk — never silently choose.
What is being decoded
accuracy and breaks the nominal chance level.)
The two questions that decide validity
trial-level on pooled multi-subject data, do trials from one subject leak across train/test folds (⇒ identity decoding, inflated)? Is the split stratified by class? (This + leakage are the two fatal errors here.)
z-scoring must be fit on training data only within each CV fold (use an sklearn Pipeline). Anything fit on the full dataset before CV = leakage ⇒ optimistic, invalid.
Inference plan (pin this down NOW, not after seeing results)
the nominal 1/n_classes. Imbalance and small n move true chance off 1/n.
cluster-based permutation test of scores-vs-chance, not per-time-point thresholding.
maintenance / reactivation of a representation? That is a strong claim — state it in advance and guard it (it can also reflect a slow/sustained component, not reactivation).
mne_check_status (confirm scikit-learn present); inspect classcounts (epochs["condA"], epochs["condB"]) — balance and totals decide metric and CV.
mne_decode(cond_a, cond_b, scoring="roc_auc", cv=5)returns mean/peak AUC + a scores-vs-time plot. Read the PNG — where does AUC rise above chance?
Pipeline and slide itover time, cross-validated:
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from mne.decoding import SlidingEstimator, Scaler, Vectorizer, cross_val_multiscore
X = epochs.get_data(); y = epochs.events[:, 2] # transforms fit INSIDE folds
clf = make_pipeline(StandardScaler(), LogisticRegression(max_iter=1000))
sl = SlidingEstimator(clf, scoring="roc_auc", n_jobs=-1)
scores = cross_val_multiscore(sl, X, y, cv=5).mean(0) # (n_times,)SlidingEstimator → GeneralizingEstimator; the result is atrain-time × test-time matrix. Read the diagonal for decodability; off-diagonal only for maintenance/reactivation, and only if pre-planned.
mne.decoding.CSP inside the pipeline: from mne.decoding import CSP
clf = make_pipeline(CSP(n_components=4), LogisticRegression(max_iter=1000))y many times, re-run CV, build the nulldistribution of scores; compare the observed curve to it (sklearn.model_selection.permutation_test_score for a single window). Then cluster-test scores-vs-chance across time.
mne-analyst archiving convention).Best-practice reminders: ROC-AUC / balanced accuracy under imbalance; Vectorizer to flatten features for plain sklearn estimators; report per-class n and the CV scheme explicitly.
Hand the design + result to `mne-methodology-critic` (invoke the skill, or dispatch it as a subagent with references/methodology-checklist.md). For decoding work it will specifically check:
Report its BLOCK / REVISE / PASS verdict to the user and act on it before stating conclusions.
See references/decoding-methods.md for deeper recipes (sliding vs generalizing estimators, leakage-free pipelines, CSP, RSA, mTRF encoding, and permutation/cluster inference).
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.