Repository navigation
Description
Summary
Build a long-term EEGPrep external extension system that lets researchers create, install, discover, manage, and use EEGPrep extensions without relying on EEGPrep-hosted zip uploads or manual maintainer-added GitHub issue entries.
The core principle is: EEGPrep extensions should feel familiar to EEGLAB plugin users, but distribution and loading should use modern Python packaging. External extension packages should be installed with standard package tooling, discovered through Python entry points, and registered through a stable EEGPrep extension SDK.
Why This Epic Exists
EEGLAB supports community plugins through eegplugin_*.m files and an extension manager. Historically, plugin submissions involved custom zip upload infrastructure and manual maintainer workflows. That does not scale well and creates avoidable security and maintenance risk.
EEGPrep should instead support:
- normal Python package distribution through PyPI, GitHub, private package indexes, and editable local installs;
- discovery via
importlib.metadataentry points; - a stable declarative extension API for menus,
pop_*functions, help resources, console aliases, and package data; - an Extension Manager that lists installed/curated extensions and gives users safe install/update guidance without EEGPrep downloading arbitrary zips;
- authoring docs, a template package, and a Codex skill so researchers can build extensions quickly and correctly.
Branch Model
- Epic branch:
feature/eegprep-extension-completion - Start point: branch from the latest integrated EEGPrep feature line after the current standalone/STUDY and EEGBrowser stacked epics land, or from
feature/eegbrowser-completionif this epic is started before those PRs merge. - Phase PR targets:
feature/eegprep-extension-completion - Final epic PR target:
origin/develop
Scope
In scope:
- EEGPrep extension SDK and runtime registry.
- Entry-point discovery group, likely
eegprep.extensions. - Menu/action/help/console/session integration for external extensions.
- Refactoring bundled plugins to use the same extension registration path where practical.
- Extension Manager UX for installed, bundled, curated, disabled, incompatible, and failed extensions.
- Curated extension catalog metadata model and validation, without hosting code artifacts.
- Extension authoring docs, template package, examples, and an
eegprep-extension-developmentCodex skill. - Cross-platform tests, import-time safety, lazy loading, and compatibility versioning.
Out of scope:
- Hosting arbitrary extension zip files inside EEGPrep infrastructure.
- Automatically installing untrusted code without explicit user action.
- Running MATLAB EEGLAB plugins directly inside EEGPrep. Extensions should be Python packages; MATLAB bridges can be separate third-party extensions if their authors choose that dependency.
Phases
- Phase 1: Extension SDK, registry, discovery, and compatibility contract.
- Phase 2: Runtime integration for menus, actions, help, console, history, and bundled plugin migration.
- Phase 3: Extension Manager, installed-extension UX, curated catalog metadata, and safe install guidance.
- Phase 4: Researcher authoring toolkit, template package, examples, and scaffolding.
- Phase 4b: Extension docs, trust levels, and agent skill.
- Phase 5: Governance, security, catalog validation, compatibility policy, and extension test harness.
- Phase 6: Cross-platform hardening, performance, integration QA, and epic closeout.
Parallelization
- Phase 1 must merge first because it defines the extension API and registry contract.
- After Phase 1, Phases 2, 3, 4, 4b, and 5 can run mostly in parallel.
- Phase 2 and Phase 3 must coordinate on the registry status model, but they can be separate PRs.
- Phase 4 can start once the Phase 1 API is stable and owns templates/scaffolding/examples.
- Phase 4b can start once the Phase 1 API names are stable and owns docs, trust-level explanation, and the
eegprep-extension-developmentskill. - Phase 5 can start after Phase 1 and should feed governance/security constraints into Phases 3, 4, and 4b.
- Phase 6 runs last after Phases 2, 3, 4, 4b, and 5 merge.
Recommended merge order: 1 -> 2 + 3 + 4 + 4b + 5 -> 6 -> final epic PR.
Epic-Level Acceptance Criteria
- External EEGPrep extensions can be installed as Python packages and discovered through entry points.
- A researcher can create a minimal extension package with a
pop_*function, GUI menu item, help resource, and console alias using documented tooling. - Installed extensions can contribute menus and actions without breaking startup, GUI refresh, or
eegprep-consoleworkspace synchronization. - Extension failures are isolated, visible, logged, and do not crash EEGPrep.
- Bundled plugins and external plugins share one coherent status/registry model.
- Extension Manager clearly distinguishes bundled, installed, curated, disabled, incompatible, missing dependency, and failed extensions.
- EEGPrep does not host or unzip arbitrary extension code as part of normal runtime.
- Tests cover discovery, validation, duplicate actions, lazy loading, failed imports, menu integration, console/history behavior, package data/help resources, and cross-platform behavior.
- Documentation explains how researchers install, build, test, publish, and submit extensions to the curated catalog.
uv run --no-sync ruff check .,uv run --no-sync ruff format --check .,uv run --no-sync ty check, and relevant pytest suites pass on the final epic branch.
Project Guidance
Follow:
- AGENTS.md
.agents/skills/eegprep-feature-development/SKILL.md.agents/skills/eeglab-gui-visual-parity/SKILL.mdfor Extension Manager GUI work.agents/skills/gui-agent-flow-qa/SKILL.mdfor mixed GUI plus console QA.agents/skills/github-pr-review/SKILL.mdfor phase review cycles
Activity
claude commentedon Jun 2, 2026
🤖 Plan:
Research
This is a 6-phase epic, far over the >100 LOC threshold and explicitly out of scope for a single bug-fix PR. The repo already has placeholder
plugin_menu.pythat hardcodes the bundled inventory and a staticeeglab_menu.pythat imports each bundled plugin's menu factory by name; there is no SDK, no entry-point discovery, no failure isolation, and no version contract. Phase issues #113-#118 already decompose the work and exist open with thephaselabel, so this epic ticket needs design pointers, not a parallel implementation PR.Relevant code
src/eegprep/functions/adminfunc/plugin_menu.py#L14-L80- hardcoded_BUNDLED_PLUGINStuple; replace with a registry view.src/eegprep/functions/guifunc/eeglab_menu.py#L6-L14- static plugin menu imports; needs registry-driven injection point.src/eegprep/functions/guifunc/menu_spec.py#L12-L29-MenuItemSpec.originalready supports non-core origins; reuse for extension provenance.src/eegprep/functions/guifunc/session.py#L92-EEGPrepSession.PLUGINLISTexists as a sync target for the manager UI.src/eegprep/plugins/firfilt/menu.py(and siblings underplugins/*/menu.py) - current per-plugin menu factories; migrate to registry-published specs in Phase 2.Proposed Approach (design pointers, not a PR)
Do not open a PR against this epic. Implementation lives in the phase issues. Recommended ordering per the epic body: #113 → (#114, #115, #116, #117 in parallel) → #118 → final epic PR to
develop.Phase 1 (#113) is the gating contract and should land first. Concrete shape that fits this repo:
eegprep.extensionsresolved viaimportlib.metadata.entry_points(group=...). Each entry point returns a small declarative descriptor (dataclass) withname,version,api_version,menu_items: tuple[MenuItemSpec, ...],pop_functions: dict[str, Callable],help_resources: dict[str, Path],console_aliases: dict[str, str]. Reuse the existingMenuItemSpec(originalready accepts extension names).src/eegprep/functions/adminfunc/extensions.py(parallel toplugin_menu.py) that loads, validates, and caches descriptors with per-extension status (ok,incompatible,failed_import,missing_dep,disabled). Failures must be captured per extension; one bad entry point cannot crash startup. Replace_BUNDLED_PLUGINSwith descriptors registered the same way (bundled plugins declare their own entry points inpyproject.toml[project.entry-points.\"eegprep.extensions\"]).EEGPREP_EXTENSION_API_VERSIONand amin_eegprepfield on descriptors. Skip-and-report on mismatch instead of importing.pop_*callables and resolves on first action invocation, so import-time cost of installed-but-unused extensions stays near zero.Phase 2 (#114) wires the registry into
eeglab_menu.py(replacing the static imports) and intoplugin_menu.pyso the manager dialog lists installed + bundled + failed. Phase 3 (#115) extends that dialog with curated-catalog metadata (read-only JSON shipped insrc/eegprep/resources/; no zip hosting). Phase 4 (#116) ships the template package +eegprep-extension-developmentskill. Phase 5 (#117) adds the catalog schema validator and test harness. Phase 6 (#118) does cross-platform + perf QA.Open questions for the human owner before Phase 1 starts:
clean_rawdata,ICLabel,firfilt,dipfit,EEG_BIDS) expected to migrate to entry-point registration in Phase 1, Phase 2, or kept dual-registered through Phase 6? The epic body says "where practical" - needs a concrete cut-off.resources/curated_extensions.json) or as a separately fetched signed manifest? The "no zip hosting" rule does not by itself answer this.No implementation in this ticket; per-phase PRs will branch from
feature/eegprep-extension-completionper the epic body.