Skip to content

Phase 4: Researcher authoring toolkit, template package, examples, and scaffolding #116

Closed

Description

@suraj-ranganath

Summary

Make it easy for EEG researchers to create high-quality EEGPrep extensions without needing to understand the entire EEGPrep codebase.

This phase focuses on concrete authoring assets: template packages, scaffold tooling if justified, reusable examples, and test scaffolds. The broader docs/trust-level explanation and the agent skill are split into Phase 4b so this phase can stay implementation-focused.

Key Work

  • Add a minimal extension template package that demonstrates pyproject.toml, entry point registration, ExtensionSpec, one pop_* function, one menu item, one help Markdown resource, tests, and sample data usage.
  • Add examples for common extension types: pure signal transform, file importer/exporter, GUI dialog, plot/browser integration, and plugin with optional dependency.
  • Add a developer checklist for GUI parity, console/history behavior, data semantics, package data, dependencies, tests, and version compatibility.
  • Consider a small scaffold command only if it stays simple and maintainable. If added, it should generate from templates and not become a custom package manager.
  • Explain how the template can be installed locally with uv add -e /path/to/eegprep-ext-foo, from GitHub with uv add git+https://github.com/lab/eegprep-ext-foo, or from PyPI with uv add eegprep-ext-foo.
  • Keep the template aligned with the Phase 1 SDK and Phase 2 runtime integration contract.

Edge Cases To Cover

  • Extension needs optional dependencies.
  • Extension needs packaged data or model weights.
  • Extension contributes GUI but user launches --no-plugins.
  • Extension handles a failed GUI dialog/cancel path.
  • Extension action mutates EEG and must update LASTCOM/ALLCOM.
  • Extension is private and never submitted to the curated catalog.
  • Extension is a port of an EEGLAB plugin with MATLAB-only pieces.

Acceptance Criteria

  • A researcher can use the template to create, install editable, and run a minimal extension.
  • The template's tests pass and verify menu, console, history, help, and package data behavior.
  • Examples cover local/private, GitHub, and PyPI-oriented packaging paths.
  • Template code does not depend on src/eegprep/eeglab at runtime.
  • Phase 4b owns the high-level docs/trust-level narrative and Codex skill, so this phase does not duplicate those deliverables.

/goal Prompt

/goal Build the EEGPrep extension authoring toolkit: template package, optional simple scaffold command, examples, test scaffold, and developer checklist. Make the workflow easy for EEG researchers creating private, GitHub-hosted, or PyPI-published extensions, while enforcing EEGPrep session/history/GUI/console conventions, standalone runtime behavior, package-data correctness, and maintainable tests.

Activity

  1. added
    phase
    on Jun 2, 2026
  2. claude commented on Jun 2, 2026

    @claude
    Contributor

    🤖 Plan:

    Research

    Phase 4 depends on a Phase 1 contract (#113: ExtensionSpec, registry, eegprep.extensions entry-point group, lazy loading, status model) that does not exist in develop. No src/eegprep/extensions.py, no entry-point group in pyproject.toml, and plugin_menu.py still holds a static _BUNDLED_PLUGINS tuple — there is nothing for a template package to register against. Per the epic in #112, recommended merge order is 1 -> 2 + 3 + 4 + 5 -> 6, so opening a Phase 4 PR now would either fork the API or block on a moving target. Scope is also well over the 100-line / multi-module threshold (template package + 4 docs pages + Codex skill + 5 example flavors + test scaffold).

    Relevant code

    • `src/eegprep/functions/adminfunc/plugin_menu.py#L1-L80` — current bundled-only inventory, no external discovery
    • `pyproject.toml` — no `[project.entry-points."eegprep.extensions"]` group yet
    • `.agents/skills/eegprep-feature-development/SKILL.md` — closest existing skill, 69 lines, sets style for the new authoring skill
    • `src/eegprep/plugins/{clean_rawdata,ICLabel,firfilt,dipfit,EEG_BIDS}/` — bundled plugins that should re-register through the SDK in Phase 2; templates must mirror this layout
    • `src/eegprep/resources/help/` — packaged Markdown help target for template's Help button

    Proposed Approach

    Treat Phase 4 as a follow-up to #113. When Phase 1 lands, deliver Phase 4 as three small PRs against `feature/eegprep-extension-completion` rather than one mega-PR:

    1. Template package + test scaffold. Add `examples/eegprep-extension-template/` (not under `src/eegprep/`) containing `pyproject.toml` with a `[project.entry-points."eegprep.extensions"]` line, one `pop_.py` returning `(EEG, com)` with `return_com=True`, one menu placeholder, one `resources/help/.md`, a sample-data smoke test using `tests/fixtures.py` patterns, and an editable-install README snippet. Tests assert: entry point loads, menu placeholder registers, console auto-store of bare `pop_*` works, history records, help resource resolves, GUI dialog cancel path returns no com. Reuses Phase 1 registry — does not add a parallel one.

    2. Docs. Four new pages under `docs/source/user_guide/`: `create_extension.rst`, `port_eeglab_plugin.rst`, `publish_extension.rst`, `submit_to_catalog.rst`, plus a developer checklist page. Cover the seven edge cases in the issue (optional deps, packaged data, `--no-plugins`, cancel path, `LASTCOM`/`ALLCOM` mutation, private extensions, MATLAB-only pieces). Index from `docs/source/index.rst`. No `auto_examples` changes unless we ship a Sphinx-Gallery example, which I'd defer.

    3. Codex skill. Add `.agents/skills/eegprep-extension-development/SKILL.md` modeled on `eegprep-feature-development/SKILL.md` (same length, same structure). Sections: when to use, required reads (AGENTS.md, Phase 1 API doc, template README), planning checklist, GUI parity loop reference, console/history verification steps, test bar, packaging/publish steps, catalog-submission gate. Explicitly out of scope: any runtime dependency on `src/eegprep/eeglab/`.

    Open questions for a maintainer before implementation begins:

    • Template location: `examples/` (kept out of installed package) vs. a sibling repo. I'd prefer `examples/` to keep the test scaffold in CI but not ship to PyPI.
    • Scaffold command: the issue says "consider … only if it stays simple". I recommend skipping it in Phase 4 and revisiting in Phase 6 once real authors have used the template.
    • Whether `examples/eegprep-extension-template/` should be installed in CI's editable env to exercise discovery end-to-end, or only smoke-tested via a one-shot `uv pip install -e examples/eegprep-extension-template` in a single test.

    Not opening a PR. Awaiting Phase 1 (#113) merge and maintainer feedback on the three questions above before starting implementation.

  3. changed the title [-]Phase 4: Researcher authoring toolkit, template package, examples, docs, and Codex skill[/-] [+]Phase 4: Researcher authoring toolkit, template package, examples, and scaffolding[/+] on Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

phase

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions