Skip to content
Data

Jupyter notebooks agents can edit

Notebook rules for agents: edit Jupytext-paired .py files instead of JSON, run top to bottom in a fresh kernel, keep outputs out of git with nbstripout, check data first.

Verified install Not agent-tested v1.0.0 MIT updated pythonjupyteruv
Equips
  • 1 1 Rules
  • 1 1 Skills
  • – 0 MCP

Agents struggle with notebooks for a simple reason: an .ipynb is JSON full of outputs and execution counts, so edits are fragile and diffs unreadable, and a notebook that ran once out of order passes for working. This loadout uses the tools data teams already rely on: Jupytext pairs each notebook with a percent-format .py file that the agent edits, nbstripout keeps outputs out of git, and done means executed from a fresh kernel. It adds reproducibility and data-care rules, and the verifier converts and runs the example notebook.

What's in it

  • Edit the paired .py (Jupytext percent format), never the .ipynb JSON
  • Done means executed top to bottom in a fresh kernel
  • nbstripout git filter keeps outputs and counts out of commits
  • Parameters cell, seeded randomness, relative paths
  • Data-check cell with asserts before any result

You'll need

  • Tools: uv
Level 1 · automated

Verification

Verified install

Checked at commit 03c1b98 · 9 passed, 0 failed, 1 not applicable

CheckResultWhat we found
Listinglisting.yaml matches the schema and declares every file in the folder. Pass
Schema valid; 5 files declared, none missing or extra
  • tested.status: untested (agent tests are separate from Level 1)
Files parseJSON parses; SKILL.md and .mdc front matter is valid YAML with the fields each agent needs; code fences are closed. Pass All 5 files parse; front matter valid
AdaptersCLAUDE.md imports @AGENTS.md, GEMINI.md imports @./AGENTS.md, and both match the generator. Pass
CLAUDE.md and GEMINI.md import AGENTS.md and are up to date
  • CLAUDE.md: matches the generator
  • GEMINI.md: matches the generator
Install pathsEvery file lands where each agent documents it, with no collisions, and the laid-out project is re-discovered correctly. Pass
Correct paths for all 6 agents; layouts re-discovered
  • Claude Code: 4 files, 1 skill in .claude/skills/
  • Codex CLI: 3 files, 1 skill in .agents/skills/
  • Cursor: 3 files, 1 skill in .agents/skills/
  • Gemini CLI: 4 files, 1 skill in .agents/skills/
  • Antigravity CLI: 3 files, 1 skill in .agents/skills/
  • GitHub Copilot: 3 files, 1 skill in .agents/skills/
MCP configmcp.json is structurally valid, converts to each agent's format, declares no literal secrets, and referenced packages exist on npm/PyPI. Not applicable No MCP servers in this loadout
Safety scanThe intake scanner finds no credentials, risky shell, hidden Unicode or prompt-injection wording, and the listing's network flag is honest. Pass
Clean: no credentials, risky shell or hidden text
  • Scanner intake-precheck/1: verdict clean; network yes (listing says yes)
ReferencesLinks and file paths between the loadout's files resolve, including for each agent's installed layout. Pass 1 reference between files resolves for every agent
Size limitsFile count and sizes are within the submission limits; SKILL.md bodies stay under 500 lines. Pass
5 files, 5.3 KB total; largest AGENTS.md 2.1 KB
  • Limits: 30 files, 32 KB per file, 128 KB total, 500 lines per skill or rule
LicenceA recognised SPDX licence, with the licence text available. Pass MIT, by Agent Loadout; text in the repository LICENSE
Starter buildA minimal fixture project with the loadout applied installs and builds or type-checks, and the loadout's own code examples compile. Pass
The notebook-change skill's percent-format example converts to a notebook with Jupytext and executes top to bottom in a fresh kernel; nbstripout removes outputs from a committed notebook
  • Applied 7 loadout files at every agent's paths
  • ✓ place the example: cp .agents/skills/notebook-change/references/analysis.py notebooks/analysis.py
  • ✓ jupytext: convert and execute from a fresh kernel: uv run --no-project --python 3.12 --with jupytext==1.19.6 --with nbconvert==7.17.2 --with ipykernel==7.4.0 jupytext --to ipynb --execute notebooks/analysis.py
  • ✓ executed notebook has the result: bash -c grep -o 'busiest week: [0-9] with [0-9]* orders' notebooks/analysis.ipynb | head -1
  • ✓ nbstripout removes outputs: bash -c uvx nbstripout@0.9.1 notebooks/with-outputs.ipynb notebooks/analysis.ipynb && python3 check_outputs.py notebooks/with-outputs.ipynb notebooks/analysis.ipynb
  • ✓ ruff on the paired .py: uvx ruff@0.17.1 check --select E,F,I,B --ignore E402 --line-length 120 notebooks/analysis.py
  • Covers: Percent-format .py as the source of truth, converted by Jupytext
  • Covers: Runs top to bottom from a fresh kernel with a parameters cell and a seeded random source
  • Covers: Data-check cell with asserts before the result
  • Covers: nbstripout leaves no outputs or execution counts

What this means: a script checked the files themselves: they parse, they install where each agent looks, any MCP config is sound, the safety scan is clean, references between files resolve, and, where a free and repeatable fixture exists, a small starter project builds with the loadout applied. No AI agent was run. Per-agent results ("tested with agent") are separate and stay untested until an agent actually runs.

Install

Choose your agent. Run the commands from your project root, or download a zip already laid out in the right folders.

Claude Code reads CLAUDE.md (imports AGENTS.md with @AGENTS.md) and skills from .claude/skills/.

Download zip
curl -fsSL --create-dirs -o AGENTS.md https://loadout.jnw-it.com/raw/jupyter-notebooks/1.0.0/AGENTS.md
curl -fsSL --create-dirs -o CLAUDE.md https://loadout.jnw-it.com/raw/jupyter-notebooks/1.0.0/CLAUDE.md
curl -fsSL --create-dirs -o .claude/skills/notebook-change/SKILL.md https://loadout.jnw-it.com/raw/jupyter-notebooks/1.0.0/skills/notebook-change/SKILL.md
curl -fsSL --create-dirs -o .claude/skills/notebook-change/references/analysis.py https://loadout.jnw-it.com/raw/jupyter-notebooks/1.0.0/skills/notebook-change/references/analysis.py
FileGoes to
AGENTS.mdAGENTS.md
CLAUDE.mdCLAUDE.md
skills/notebook-change/SKILL.md.claude/skills/notebook-change/SKILL.md
skills/notebook-change/references/analysis.py.claude/skills/notebook-change/references/analysis.py

Already have an AGENTS.md or CLAUDE.md? The commands above overwrite it — download the file instead and merge the sections you want.

Files

Rules AGENTS.md Notebook editing, execution, reproducibility and data-care rules. 34 lines
Download Raw
# AGENTS.md: Jupyter notebooks

Data and ML work in Jupyter notebooks, managed with uv. Notebooks are paired with plain Python files by Jupytext and
committed without outputs.

## Editing notebooks
- Edit the paired `.py` file (Jupytext percent format, cells start with `# %%`), not the `.ipynb` JSON. Then sync:
  `uv run jupytext --sync notebooks/<name>.py`. Never hand-edit cell JSON, outputs or execution counts.
- New notebook: write `notebooks/<name>.py` in percent format and pair it:
  `uv run jupytext --set-formats ipynb,py:percent notebooks/<name>.py`.
- Keep outputs out of git: `nbstripout` is installed as a git filter (`uv run nbstripout --install`). Do not remove it.

## Done means it runs top to bottom
- Execute from a fresh kernel before reporting: `uv run jupytext --to ipynb --execute notebooks/<name>.py`
  (or `uv run jupyter nbconvert --to notebook --execute --inplace notebooks/<name>.ipynb`).
- A notebook that only works after running cells out of order is broken. Fix the order; no hidden state.
- Report the key numbers or the figure you produced, not just "it ran".

## Reproducibility
- Dependencies in `pyproject.toml` via `uv add`; no `!pip install` cells. Dev tools: `uv add --dev jupytext nbconvert
  ipykernel nbstripout` (executing needs nbconvert and ipykernel).
- One parameters cell near the top (paths, dates, sample sizes, seeds). No magic numbers further down.
- Seed every source of randomness (`numpy.random.default_rng(seed)`, framework seeds) and say so in the notebook.
- Paths relative to the project root; raw data in `data/raw/` is read-only and gitignored. Write outputs to
  `data/processed/` or `reports/`.
- Long training or heavy queries: move the code into a module in `src/` and import it; keep the notebook for narrative,
  checks and plots.

## Data care
- Look at the data before modelling: shape, dtypes, missing values, duplicates, a few rows. Use the
  `notebook-change` skill.
- Never print or commit personal data, credentials or full raw tables. Use `.head()` on synthetic or anonymised data.
- Split train and test before any fitting or scaling. Never tune on the test set.
Adapter CLAUDE.md Imports AGENTS.md for Claude Code. 10 lines
Download Raw
# CLAUDE.md

@AGENTS.md

## Claude Code notes
- Skills from this loadout live in `.claude/skills/`: `notebook-change`. Use them when their description matches the task.
- Follow AGENTS.md above; where this file and AGENTS.md disagree, AGENTS.md wins.

<!-- From the Agent Loadout "Jupyter notebooks agents can edit" v1.0.0 — https://loadout.jnw-it.com/loadouts/jupyter-notebooks/ -->
Adapter GEMINI.md Imports AGENTS.md for Gemini CLI. 10 lines
Download Raw
# GEMINI.md

@./AGENTS.md

## Gemini CLI notes
- Skills from this loadout live in `.agents/skills/`: `notebook-change`. Use them when their description matches the task.
- Follow AGENTS.md above; where this file and AGENTS.md disagree, AGENTS.md wins.

<!-- From the Agent Loadout "Jupyter notebooks agents can edit" v1.0.0 — https://loadout.jnw-it.com/loadouts/jupyter-notebooks/ -->
Skill skills/notebook-change/SKILL.md Edit via the paired .py, run fresh, strip outputs. 19 lines
Download Raw
---
name: notebook-change
description: Change or add a Jupyter notebook through its Jupytext-paired .py file, check the data first, run it top to bottom in a fresh kernel and keep outputs out of git. Use for any notebook work.
---

# Notebook change

1. Find the paired `.py` file for the notebook (`jupytext --paired-paths notebooks/<name>.ipynb` if unsure). If the
   notebook is not paired yet, pair it first and commit that as its own change.
2. Read the parameters cell and the cells you will change. Edit the `.py` file only, keeping `# %%` cell markers and
   `# %% [markdown]` cells for narrative.
3. When data is involved, add or keep a check cell like the one in `references/analysis.py`: shape, dtypes, missing
   values and duplicates, with `assert` lines for what the rest of the notebook relies on.
4. Sync and execute from a fresh kernel: `uv run jupytext --sync notebooks/<name>.py` then
   `uv run jupytext --to ipynb --execute notebooks/<name>.py`. Fix any error and run again from the top.
5. Check git sees no outputs: `git diff --stat` shows the `.py` and a small `.ipynb` change; if outputs appear, run
   `uv run nbstripout notebooks/<name>.ipynb` and check the filter is installed.
6. Report: what changed, the key result (numbers or a figure described in words), and the run time.
Skill file skills/notebook-change/references/analysis.py Percent-format example with parameters and a data check. 42 lines
Download Raw
# ---
# jupyter:
#   jupytext:
#     formats: ipynb,py:percent
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# %% [markdown]
# # Weekly orders: example analysis
# Parameters first, a data check, then the result. Runs top to bottom from a fresh kernel.

# %% tags=["parameters"]
SEED = 42
N_ORDERS = 500
WEEKS = 8

# %%
import random
import statistics

rng = random.Random(SEED)
orders = [{"week": rng.randrange(WEEKS), "pence": rng.randint(200, 5000)} for _ in range(N_ORDERS)]

# %% [markdown]
# ## Data check
# Shape, missing values and ranges that the rest of the notebook relies on.

# %%
assert len(orders) == N_ORDERS, "unexpected row count"
assert all(o["pence"] is not None for o in orders), "missing values"
assert all(0 <= o["week"] < WEEKS for o in orders), "week out of range"
print(f"rows: {len(orders)}, weeks: {len({o['week'] for o in orders})}")

# %%
by_week = {w: [o["pence"] for o in orders if o["week"] == w] for w in range(WEEKS)}
summary = {w: (len(v), statistics.median(v)) for w, v in by_week.items()}
busiest = max(summary, key=lambda w: summary[w][0])
print(f"busiest week: {busiest} with {summary[busiest][0]} orders, median £{summary[busiest][1] / 100:.2f}")

All files: source zip · Licence MIT · By Agent Loadout · First listed

Credits

Public work that inspired this loadout. The wording here is our own; follow the links for the originals.

Installing and testing

How do I install Jupyter notebooks agents can edit in Claude Code?

From your project root, put AGENTS.md, CLAUDE.md, skills/notebook-change/SKILL.md at .claude/skills/notebook-change/SKILL.md, skills/notebook-change/references/analysis.py at .claude/skills/notebook-change/references/analysis.py. The "Claude Code" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/jupyter-notebooks/claude-code.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install Jupyter notebooks agents can edit in Codex CLI?

From your project root, put AGENTS.md, skills/notebook-change/SKILL.md at .agents/skills/notebook-change/SKILL.md, skills/notebook-change/references/analysis.py at .agents/skills/notebook-change/references/analysis.py. The "Codex CLI" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/jupyter-notebooks/codex.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install Jupyter notebooks agents can edit in Cursor?

From your project root, put AGENTS.md, skills/notebook-change/SKILL.md at .agents/skills/notebook-change/SKILL.md, skills/notebook-change/references/analysis.py at .agents/skills/notebook-change/references/analysis.py. The "Cursor" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/jupyter-notebooks/cursor.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install Jupyter notebooks agents can edit in Gemini CLI?

From your project root, put AGENTS.md, GEMINI.md, skills/notebook-change/SKILL.md at .agents/skills/notebook-change/SKILL.md, skills/notebook-change/references/analysis.py at .agents/skills/notebook-change/references/analysis.py. The "Gemini CLI" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/jupyter-notebooks/gemini-cli.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install Jupyter notebooks agents can edit in Antigravity CLI?

From your project root, put AGENTS.md, skills/notebook-change/SKILL.md at .agents/skills/notebook-change/SKILL.md, skills/notebook-change/references/analysis.py at .agents/skills/notebook-change/references/analysis.py. The "Antigravity CLI" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/jupyter-notebooks/antigravity-cli.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install Jupyter notebooks agents can edit in GitHub Copilot?

From your project root, put AGENTS.md, skills/notebook-change/SKILL.md at .agents/skills/notebook-change/SKILL.md, skills/notebook-change/references/analysis.py at .agents/skills/notebook-change/references/analysis.py. The "GitHub Copilot" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/jupyter-notebooks/copilot.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

Has Jupyter notebooks agents can edit been tested?

It passed the Level 1 automated install checks on 2026-10-17: the files parse, install to each agent's documented paths, and pass the safety scan. No AI agent has run it yet, so no agent pass or fail is claimed.

More for Claude Code, Codex, Cursor, Gemini CLI, Antigravity CLI and GitHub Copilot.