rseng-notebooks
/rseng-notebooks
Covers engineering discipline for computational notebooks: execution-order and hidden-state pitfalls, restart-and-run-all hygiene, keeping notebooks in version control with jupytext, testing notebooks with nbval-style execution checks, parameterizing and batch-running them with papermill, refactoring mature notebook code into importable modules, and deciding what belongs in a notebook versus a package. Use PROACTIVELY when a project contains .ipynb files, when the user works in Jupyter or similar notebooks, mentions notebook reproducibility, testing, version control or parameterization, when a
- Author
- fdiblen ↗
- Repository
- rseng-agent-skills ↗
- Licence
- MIT
- Last repository change
- 23.09.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 2
- URLs in SKILL.md
- 5
No signals detected. Repository changed on 23.09.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- SKILL.md zawiera komentarze HTML (2). Nie widać ich w podglądzie Markdown, a model je czyta.
What it does and when to use it
Covers engineering discipline for computational notebooks: execution-order and hidden-state pitfalls, restart-and-run-all hygiene, keeping notebooks in version control with jupytext, testing notebooks with nbval-style execution checks, parameterizing and batch-running them with papermill, refactoring mature notebook code into importable modules, and deciding what belongs in a notebook versus a package. Use PROACTIVELY when a project contains .ipynb files, when the user works in Jupyter or similar notebooks, mentions notebook reproducibility, testing, version control or parameterization, when a
Original author description
Covers engineering discipline for computational notebooks: execution-order and hidden-state pitfalls, restart-and-run-all hygiene, keeping notebooks in version control with jupytext, testing notebooks with nbval-style execution checks, parameterizing and batch-running them with papermill, refactoring mature notebook code into importable modules, and deciding what belongs in a notebook versus a package. Use PROACTIVELY when a project contains .ipynb files, when the user works in Jupyter or similar notebooks, mentions notebook reproducibility, testing, version control or parameterization, when a
How it works
- Hidden state: the core hazard
- Version control that works
- Testing and automation
- The graduation path
- Working with this skill
- Related skills
SKILL.md preview
---
name: rseng-notebooks
description: >-
Covers engineering discipline for computational notebooks: execution-order
and hidden-state pitfalls, restart-and-run-all hygiene, keeping notebooks in
version control with jupytext, testing notebooks with nbval-style execution
checks, parameterizing and batch-running them with papermill, refactoring
mature notebook code into importable modules, and deciding what belongs in a
notebook versus a package. Use PROACTIVELY when a project contains .ipynb
files, when the user works in Jupyter or similar notebooks, mentions
notebook reproducibility, testing, version control or parameterization, when
a notebook has grown into the de-facto pipeline, or when notebook results
must become citable, reviewable artifacts.
license: CC-BY-4.0
metadata:
version: 0.1.0
---
# Notebook engineering
Notebooks are where most research computing happens - and their
superpower (interactive, stateful, out-of-order execution) is
exactly their reproducibility hazard. The discipline is not "stop
using notebooks"; it is knowing what notebooks are FOR
(exploration, narrative, teaching) and applying engineering at the
point where a notebook turns into infrastructure without anyone
deciding it should. The
CodeRefinery Jupyter lesson teaches the same split.
## Hidden state: the core hazard
A notebook's on-screen code and its kernel's actual state can
disagree: cells run out of order, deleted cells leave live
variables, and a figure can come from code that no longer exists.
Working rules:
- Restart-and-run-all IS the test: before trusting, committing or
sharing any notebook, restart the kernel and run top to bottom.
A notebook that only works in one execution order is broken -
fix the order now, while you still remember it.
- Keep cells re-runnable: no cell should break when run twice
(guard appends, recreations, cumulative mutations); avoid
mutating a variable across distant cells - derive new names
instead.
- Definitions up top: imports, parameters and configuration in the
first cells; a parameters cell makes intent explicit and enables
parameterization later.
- Watch execution counts: out-of-sequence numbers in a "final"
notebook are the tell (rseng-version-control-review reviewers can
see them too).
## Version control that works
Raw .ipynb diffs are JSON noise with embedded outputs:
- Pair notebooks with a script/markdown twin via jupytext: the
text twin is the reviewable, diffable, mergeable source; the
.ipynb carries outputs locally.
- Decide the output policy explicitly: strip outputs before
commit (clean diffs, smaller repos - a pre-commit hook
automates it) OR commit executed notebooks deliberately as
result records (rseng-reproducibility's compendium may want
exactly that); mixing the two policies in one repo confuses
everyone.
- Large embedded outputs (images, tables) are the notebook form
of committed data - the same instincts apply
(rseng-data-management).
## Testing and automation
- Execution tests: run notebooks in CI and fail on errors
(nbval-style pytest integration checks stored outputs too;
plain execution via papermill or nbconvert catches rot). A
notebook that no longer runs is the most common form of
repository decay (rseng-ci-cd; budget-conscious: run on reduced
data - rseng-green-computing).
- Parameterize with papermill: a tagged parameters cell turns a
notebook into a callable with arguments - the honest bridge
from "notebook" to "batch job" (sweeps via rseng-hpc-computing
job arrays or rseng-workflows without abandoning the notebook
form).
- Environments: a notebook without a pinned environment is a
screenshot; keep the kernel's environment in the repository's
lockfile (rseng-reproducible-environments) and Binder-ready when
sharing is the goal (rseng-reproducibility).
- Seeds and data paths follow the same rules as any code
(rseng-defensive-coding) - notebooks get no exemption from
provenance.
## The graduation path
Notebooks accumulate load-bearing code; the move is extraction,
not rewrite:
- When a function is used twice, or another notebook copies it,
extract it to a module in the repository and import it - the
notebook keeps the narrative, the module gets tests
(rseng-testing) and design (rseng-software-design). Autoreload
during development keeps the loop tight.
- When a notebook IS the pipeline (runs nightly, feeds a paper),
graduate the computation to scripts/workflow stages
(rseng-workflows) and keep a thin notebook as the exploratory
window onto results.
- The notebook that remains is the good kind: narrative analysis,
figures with their reasoning, teaching material
(rseng-trainer) - prose and code interleaved doing what neither
does alone (rseng-science-communication for the storytelling
layer).
## Working with this skill
This skill is source-independent: its authority is the Jupyter
ecosystem tooling and the CodeRefinery lesson linked below.
Learn more (verified):
- https://jupyter.org - Project Jupyter
- https://jupytext.readthedocs.io - jupytext notebook/text
pairing
- https://github.com/computationalmodelling/nbval - nbval
notebook validation
- https://papermill.readthedocs.io - papermill parameterization
- https://coderefinery.github.io/jupyter/ - CodeRefinery
Jupyter lesson
<!-- related-skills:begin -->
## Related skills
Check whether any of these applies before moving on:
- rseng-hpc-computing - papermill batch sweeps on clusters
- rseng-reproducibility - executed notebooks as deliberate result records
- rseng-science-communication - narrative layer of analysis notebooks
- rseng-scientific-visualization - figure-producing notebook cells
- rseng-trainer - notebooks as teaching material
- rseng-version-control-review - jupytext twins make diffs reviewable
<!-- related-skills:end -->
Files in this package (2)
- SKILL.md 6 KB
- references.md 1 KB
Versions
The database has no other skills named rseng-notebooks.
Database snapshot: 13.11.2026 · package version b75eb9de43e8 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Similar skills
- 100notebook-ci-pipeline-author
The single home for Jupyter notebook testing: wires parameterized execution (papermill), output regression (nbval), function-level unit tests (testbook), output stripping (nbstripout), and artifact upload into one working GitHub Actions CI pipeline, with per-tool depth for… - 100jupyter
Assists with interactive data analysis, visualization, and reproducible research using Jupyter notebooks. Use when building notebooks that combine code with rich output, managing kernels, converting to reports, or parameterizing notebooks for batch execution. Trigger words:… - 100export-ml-notebook
Write a jupytext percent file out as a notebook with empty outputs. `data_analysis/`, `experiments/`, and `audit/` are filled with empty outputs. Pass `--html` when that notebook should also become a viewer on the site. Kernel `notebook convert` stays for a source that is itself… - 93jupyter-reproducible-research
Establish production-grade reproducible research workflows in Jupyter notebooks, kernel environment lockfiles, notebook linting, nbconvert automated execution, parameterization with Papermill, and modularized code extraction. Trigger when creating Jupyter notebooks, setting up… - 85jupyter-notebook
Work with Jupyter notebooks (.ipynb) — create, read, edit and run cells on a live Python kernel, with figures and tables returned to the chat. Notebooks can live in the workspace or on a running Jupyter Server / JupyterLab. Use when the user asks for a notebook, wants to analyse… - 90jupyter-notebook
Use when the user asks to create, scaffold, or edit Jupyter notebooks (`.ipynb`) for experiments, explorations, or tutorials.