notebook-ci-pipeline-author
Use when Jupyter notebooks must run in CI as tests, their outputs must stay stable, or a PR adding notebooks needs review. Wires papermill parameterized runs…
от testland★ 18 звёзд на GitHub
Установить notebook-ci-pipeline-author в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
notebook-ci-pipeline-author
Composes the three notebook testing tools into one GitHub Actions pipeline: papermill executes parameterized notebooks, nbval validates output regression, testbook runs function-level unit tests, and nbstripout gates committed output. Per-tool depth lives in references/papermill.md (parameterized execution) and references/nbval.md (output regression); this SKILL.md covers the wiring and integration decisions, plus the PR review checklist for notebook changes.
When to use
Teams using all three tools but assembling the pipeline by hand:
no consistent artifact naming, no shared caching, duplicate install
steps, no HTML report on failure. Also: any PR that adds or modifies
.ipynb files and needs the review checklist below.
Hard-reject conditions
Do not proceed if any of the following apply:
- The repository has no
parameters-tagged notebook cell. Papermill injection silently uses notebook defaults when the tag is absent per the [Papermill execute docs]; the pipeline will report green against stale values. - nbval ground-truth outputs are absent from the committed
.ipynbfiles. Re-running cells with no stored outputs produces no diff, so regressions are invisible. - testbook tests use
execute=Trueper-function without ascope="module"fixture. Each test re-executes the kernel; CI timeouts follow per the [testbook docs].
State the blocker to the user and stop.
Step 1 - Install nbstripout as a pre-commit filter
Install once per clone so committed notebooks carry no output noise per the [nbstripout README]:
pip install nbstripout
nbstripout --install # writes .git/config filter entry
nbstripout --install --attributes .gitattributes # repo-wide via .gitattributes
Add to .gitattributes:
*.ipynb filter=nbstripout
For pull-request verification without modifying files, use the [kynan/nbstripout action]:
- name: Verify notebooks are stripped
uses: kynan/nbstripout@main
with:
paths: '**/*.ipynb'
The action runs a dry-run check and fails if any notebook carries uncommitted output.
Step 2 - Install dependencies with pip caching
Per [GitHub Actions: Building and Testing Python], the setup-python
action accepts cache: 'pip' and locates requirements.txt
automatically:
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install papermill nbval pytest testbook nbconvert
Keep papermill nbval pytest testbook nbconvert pinned in
requirements.txt so the cache key (hashFiles('**/requirements.txt'))
reflects version changes.
Step 3 - Stage 1: papermill parameterized execution
Papermill executes the notebook with injected parameters and writes a fully-rendered output notebook:
- name: Execute notebook (papermill)
run: |
papermill notebooks/analysis.ipynb \
artifacts/analysis-executed.ipynb \
-p seed 42 \
-p n_samples 1000
Use -p for numeric/boolean parameters and -r for string parameters
to prevent type-coercion surprises per the [Papermill execute docs].
Full papermill depth - parameter flags, Python API, matrix sweeps,
regression-test wiring - is in
references/papermill.md.
Store the output path (artifacts/analysis-executed.ipynb) in an env
var shared across stages:
env:
EXECUTED_NB: artifacts/analysis-executed.ipynb
Step 4 - Stage 2: nbval output regression
Run nbval in lax mode on the executed notebook. Strict mode fails on
every non-deterministic output; lax mode fails only on errors unless
cells carry #NBVAL_CHECK_OUTPUT per the [nbval docs]:
- name: Output regression (nbval-lax)
run: |
pytest --nbval-lax $EXECUTED_NB \
--sanitize-with sanitize.cfg \
-v
sanitize.cfg example for timestamps and memory addresses:
[regex1]
regex: \d{1,2}/\d{1,2}/\d{2,4}
replace: DATE-STAMP
[regex2]
regex: 0x[0-9a-fA-F]+
replace: MEMORY-ADDR
Pin per-cell markers on cells that emit timestamps or large floats:
# NBVAL_IGNORE_OUTPUT. Use # NBVAL_RAISES_EXCEPTION to validate
expected error paths. Full nbval depth - strict vs lax mode, all
per-cell controls, sanitize patterns, discovery - is in
references/nbval.md.
Step 5 - Stage 3: testbook function unit tests
Run testbook tests against the source notebook (not the executed
artifact) using a module-scoped fixture so the kernel executes once per
pytest session per the [testbook docs]:
- name: Unit tests (testbook)
run: pytest tests/test_notebook_functions.py -v
The scope="module" fixture is the load-bearing wiring decision - it stops
each test re-executing the kernel:
@pytest.fixture(scope="module")
def tb():
with testbook("note
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- .tessl-plugin/plugin.json
- references/nbval.md
- references/notebook-ci-pipeline.md
- references/papermill.md
FAQ
Что делает скилл notebook-ci-pipeline-author?
Use when Jupyter notebooks must run in CI as tests, their outputs must stay stable, or a PR adding notebooks needs review. Wires papermill parameterized runs, nbval output checks, testbook unit tests, nbstripout and artifacts into GitHub Actions, plus a review checklist with a BLOCK or PASS verdict.
Как установить скилл notebook-ci-pipeline-author?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл notebook-ci-pipeline-author запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
AnthropicThe scan that the plugin's GitHub Action runs.
azure-static-web-apps
GitHubHelps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
ai-ready
GitHubMake any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
aws-cdk-python-setup
GitHubSetup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…