/probabl-skills:export-ml-notebookfrom probabl-skills
Converts jupytext percent-format Python files to .ipynb notebooks with empty outputs. Handles data analysis, experiment, and audit notebooks with optional HTML viewer generation.
Ships in probabl-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Source of truth stays the # %% .py. This skill only writes
derived .ipynb (and optional .nb.html). Do not rewrite the
.py from the notebook. cells run is not a substitute.
Details: setup-workspace references/human_facing_prose.md.
Tell the user the written .ipynb (and HTML viewer) paths. Do
not quote notebook convert, --html, or site build as
something they should run.
While policy.notebooks is true, explore-ml-data fills the
analysis file it wrote. model-ml-pipeline and
evaluate-ml-pipeline fill the experiment script and, when it
exists, audit/<stem>.py, with empty outputs.
audit-ml-pipeline fills audit/<stem>.py only on a direct
close. This skill owns on-demand fills, other sources, and
turning the flag on when it is null or false. A data-analysis,
experiment, or audit source uses notebook fill, not
notebook convert.
Stage owners read policy before executing a human # %% source.
Only policy.notebooks true enables automatic notebook
materialization; null and false keep the stage's non-notebook
execution and do not change policy.
When true, exploratory analysis uses materialize.py as its
one run, then notebook fill writes the .ipynb with empty
outputs. Add --html only when policy.site is also true. An
experiment or audit file is the same: notebook fill writes the
.ipynb with empty outputs, and materialize.py is the run that
writes the digest and the HTML viewers. Do not notebook convert
those files and do not cells run them. Kernel notebook convert
stays only for a source that is itself the execution (the unfitted
experiment snapshot). A generated notebook records its source
fingerprint; loop notebooks fills or converts again only when
the source or required HTML changed.
Run status and read policy.notebooks. Take the first row that
matches. Fill leaves code-cell outputs empty. Do not stop after
reading the table.
policy.notebooks | Request | Then |
|---|---|---|
null | any | step 2, then match this table again. Do not take the convert row only because it is listed first. |
false | any | step 3. Do not fill until the policy is true. |
true | the user asked for HTML, a site viewer, or the notebook on the site | step 4 notebook fill --html, then step 5. data_analysis/, experiments/<stem>.py, and audit/<stem>.py stay notebook fill, not notebook convert. |
true | the source is itself the execution (unfitted experiment snapshot, before skore.evaluate) and the user did not ask for HTML or a site viewer | kernel notebook convert, not notebook fill |
true | notebook, ipynb, or convert, with no HTML and no site viewer | step 4 notebook fill only. No --html. No site build. |
python -m skore_skills status. Read policy.notebooks and
skills.
If policy.notebooks is null: persist
python -m skore_skills policy set notebooks true. Do not
AskUserQuestion. Then load add-python-package for jupytext
and nbformat (agent) and continue.
If policy.notebooks is false: say notebooks are off; offer
to turn them on. Do not fill until the policy is true.
Fill the requested percent file (default data_analysis/data_analysis.py when
the user did not name one):
python -m skore_skills notebook fill data_analysis/data_analysis.py
Fill does not execute the file and leaves code-cell outputs
empty. It needs jupytext and nbformat, not nbclient,
ipywidgets, or IPython. Do not start EDA, an evaluation, or
an audit from this skill to produce those outputs.
experiments/<stem>.py and audit/<stem>.py are filled the
same way. Missing jupytext / nbformat / nbconvert stays
a one-line skip.
If the user wants the notebook on the site, load
add-python-package for nbconvert (agent) and pass --html
(writes a self-contained <stem>.nb.html next to the .py).
The site links that file from the associated exploratory data
analysis or design report. It opens as a page of its own.
Optional --out path.ipynb. Keep *.ipynb gitignored unless
the user asks setup-git to track them.
Fill-only requests (notebook / ipynb / convert, no HTML or
site viewer): run only that notebook fill line, with no
--html. Tell the user the written .ipynb path. Do not
mention --html or site build as an optional aside.
Kernel notebook convert is only for a source that is itself
the execution: the unfitted experiment snapshot, before
skore.evaluate exists. Convert injects %matplotlib inline
for that kernel run so seaborn / matplotlib last expressions
emit image/png, then strips that setup cell from the written
notebook. Do not put %matplotlib inline in the .py
(style / ruff would reject it). If that convert fails
because ipywidgets is missing, load add-python-package
for it (agent) and convert again.
After --html, if policy.site is true, export-ml-site
is installed, run python -m skore_skills site build --if-stale so the
viewer is packaged. Run --html and site build only
when the user asked for HTML or a site viewer. Fill
without --html does not rebuild the site. Skip in one line
otherwise. If site build errors with mkdocs-material is required, load add-python-package for mkdocs-material
(agent) and build once more. Do not pixi add / uv add.
If that skill is missing, or the retry still fails, name the
error in one line. Name a build error; do not fail the
fill, and do not claim the website was updated. When the
build ran, say the website has been updated and paste the
file:// line from that output verbatim. Do not name the
markdown file
or the HTML viewer path. Do not quote the CLI.
git commit or git end-turn.cells run as a substitute for fill.pixi add / uv add; load add-python-package.--html or python -m skore_skills site build
unless the user asked for HTML or a site viewer. Tell the user
paths, not the CLI.What SKILL.md sets; muted values are Claude Code's defaults
26 skills in this plugin
/add-python-packageAdd a dependency through the project env manager, or ask the user when the environment is user-managed. Trigger when a workflow needs a missing import, after choose-python-library picks a library, or for editable install of src/<pkg>/.
SKIP choosing between competing libraries (choose-python-library owns that). SKIP bootstrapping a missing manager directly (setup-python-env). When env.managed is null, load setup-ml-project if it is installed.
HOW TO USE: read status.policy.env.managed, env detect, and env route. Classify this turn first (editable | add-skore | named package). If managed is null, load setup-ml-project and stop. If managed, env add --execute (or --editable). If unmanaged, ask; default is the user handles it — do not wait. When setup-ml-project already chose user-managed this turn, name the package and the manager, then return. Do not ask and do not wait. Never --execute while managed is false.
/audit-ml-pipelineAudit a persisted skore report read-only and produce a reusable digest. Do not execute it. Run `materialize.py` once. Never call `skore.evaluate` or `project.put`.
TRIGGER when a completed run needs an audit, the user asks to audit, show, or re-audit an experiment, a re-run overwrote the same `put()` key, or they want a narrative of a past experiment without `journal/ideas/` files.
STOP when `status.setup.pending` is non-empty (load `setup-ml-project`), or when there is no approved design, no report, or no agent feature: explain and send the user to setup, `evaluate-ml-pipeline`, or `model-ml-pipeline`. Also stop for raw-data exploration or sourcing a future experiment.
HOW TO USE: confirm journal, experiment, smoke, and report; place the file from `templates/audit.py`; copy `templates/materialize.py` to scratch; execute once; derive G-AUDIT-FINDING; then the continue-or-close gate. Resolve skore symbols with `api get`.
/build-ml-pipelineDeclare a skrub DataOps graph from the data source to the predictor after framing is locked. Stateless steps use `.skb.apply_func`. Stateful steps use `.skb.apply`. After the graph exists, attach the locked splitter and any non-default score. No fit, tune, persistence, or `skore.evaluate`.
TRIGGER when writing or editing any link from data source to predictor (loaders, preprocessing, features, composition, the final estimator), including a pure-Python function on that path, a step added or reordered, a bare `sklearn.Pipeline` as the top-level, or a request to build a pipeline, classifier, or regressor.
HOW TO USE: before the first declarative line and on every structural edit. Read the stops and emit Pre-flight before code. Confirm new names with `python -m skore_skills api get`.
/choose-python-libraryResolve a library choice and add the selected dependency. Trigger for competing-library questions or an optional package not already fixed by the project stack — at first use (tabular exploration, pipeline, or eval extras), never during workspace setup.
/evaluate-ml-pipelineEvaluate one sklearn-compatible learner with the locked validation scheme and persist structured skore reports. The splitter and any non-default score are already on the DataOp from `build-ml-pipeline`. This skill writes the call without `splitter=`, persists the report, and records the locator. When the locked split is the training table and test table that shipped with the data, fit on the training table, then pass `splitter="prefit"` with only the test table. When `model-ml-pipeline` dispatched this turn, return the locator. A standalone turn owns the evaluate-stage close.
TRIGGER when code calls `cross_val_score`, `cross_validate`, `classification_report`, `.skb.cross_validate`, or a handwritten metric print, or the user asks to score, evaluate, or run CV on one learner. Narrative reads of a persisted report belong to `audit-ml-pipeline`.
HOW TO USE: before any evaluation call. Resolve G-SKORE-MODE, read the stops, and emit Pre-flight before code. Confirm symbols with `python -m skore_skills api get`.
/explore-ml-dataExplore the dataset before designing any model. Place `data_analysis/data_analysis.py` and do not execute it. Run `materialize.py` once, write `data_analysis.md` and JOURNAL § Data understanding. Never design the model, edit `src/<pkg>/`, or modify raw data files.
TRIGGER when the user asks to explore, profile, or understand the data; triage sent them here (`status.data_analysis` missing); a data source changed; they want to refresh a recorded EDA; or leakage or research arises on a recorded EDA.
STOP when `status.setup.pending` is non-empty (load `setup-ml-project`), when there is no data (send to triage), the request is not raw-data exploration, or EDA is recorded with no refresh and no methodology concern. Do not invent a package root or a root `JOURNAL.md` while setup is pending.
HOW TO USE: G-TABULAR via `add-python-package`, infer or ask the targets, load `plot-ml-figure` if installed, then ask the five-option continuation board, including Close.
npx claudepluginhub probabl-ai/skore-skills --plugin probabl-skillsOther plugins' skills for the same job