jupyter
Jupyter Notebook Skill
Execute, inspect, and manage Jupyter notebooks directly from Claude Code. Eliminates the context-switching loop between CLI and browser.
Workflow
1. INSPECT → Understand notebook structure (`uv run --script <skill-dir>/scripts/cli.py inspect`)
2. EDIT → Modify cells with NotebookEdit tool
3. EXECUTE → Run cells and capture outputs (`uv run --script <skill-dir>/scripts/cli.py execute -i`)
4. VERIFY → Read outputs, check for errors (`uv run --script <skill-dir>/scripts/cli.py show --output-only`)
5. ITERATE → Repeat until complete
Entry point
Cross-platform:
uv run --script <skill-dir>/scripts/cli.py ...
Set <skill-dir> to this skill directory. Do not rely on shell sourcing, executable bits, or shebang dispatch.
Setup (One-Time)
# Install a Jupyter kernel (needed for execution)
uv run --with ipykernel python -m ipykernel install --user --name uv-py
Scripts
Public dispatcher: scripts/cli.py.
| Command | Purpose | Internal |
|---|---|---|
inspect, show, execute, convert, clear, grep |
Full notebook CLI | nb.py |
validate |
Quick syntax check | validate.py |
cli.py carries inline dependencies (PEP 723); uv handles everything automatically.
CLI Reference
# Inspect structure
uv run --script <skill-dir>/scripts/cli.py inspect notebook.ipynb
# Show cell contents
uv run --script <skill-dir>/scripts/cli.py show notebook.ipynb
uv run --script <skill-dir>/scripts/cli.py show notebook.ipynb -c 0,2-4 # specific cells
uv run --script <skill-dir>/scripts/cli.py show notebook.ipynb -o # include outputs
uv run --script <skill-dir>/scripts/cli.py show notebook.ipynb --output-only # outputs only
uv run --script <skill-dir>/scripts/cli.py show notebook.ipynb -o --save-images ./images/ # save images to dir
# Execute cells
uv run --script <skill-dir>/scripts/cli.py execute notebook.ipynb # all cells, show output
uv run --script <skill-dir>/scripts/cli.py execute notebook.ipynb -i # save outputs back to file
uv run --script <skill-dir>/scripts/cli.py execute notebook.ipynb -c 0,2-4 # specific cells
uv run --script <skill-dir>/scripts/cli.py execute notebook.ipynb --save-images ./outputs/ # save images
# Search cells
uv run --script <skill-dir>/scripts/cli.py grep "import pandas" notebook.ipynb # find cells with pattern
uv run --script <skill-dir>/scripts/cli.py grep -i "def.*function" notebook.ipynb # case-insensitive regex
uv run --script <skill-dir>/scripts/cli.py grep -C "pattern" notebook.ipynb # show full cell context
uv run --script <skill-dir>/scripts/cli.py grep --cells-only "pattern" notebook.ipynb # just cell indices
# Validate (lightweight)
uv run --script <skill-dir>/scripts/cli.py validate notebook.ipynb
# Convert
uv run --script <skill-dir>/scripts/cli.py convert notebook.ipynb --to py
uv run --script <skill-dir>/scripts/cli.py convert notebook.ipynb --to html -o output.html
# Clear outputs
uv run --script <skill-dir>/scripts/cli.py clear notebook.ipynb
Quick Patterns
Execute and Read Outputs (No Browser Needed)
# Execute all cells, save outputs back to file
uv run --script <skill-dir>/scripts/cli.py execute notebook.ipynb -i
# Then show just the outputs
uv run --script <skill-dir>/scripts/cli.py show notebook.ipynb --output-only
Debug a Failing Cell
# Execute up to the failing cell
uv run --script <skill-dir>/scripts/cli.py execute notebook.ipynb -c 0-5 --allow-errors
# Inspect the error output
uv run --script <skill-dir>/scripts/cli.py show notebook.ipynb -c 5 -o
Edit Cell (Built-in Tool)
Use Claude's NotebookEdit tool to modify cells:
cell_id: The cell ID or indexnew_source: New cell contentedit_mode: "replace", "insert", or "delete"cell_type: "code" or "markdown"
Validate Before Commit
# Quick syntax check
uv run --script <skill-dir>/scripts/cli.py validate notebook.ipynb
# Clear outputs for clean commits
uv run --script <skill-dir>/scripts/cli.py clear notebook.ipynb
Tool Integration
| Task | Tool |
|---|---|
| Read notebook structure | uv run --script <skill-dir>/scripts/cli.py inspect |
| Read cell contents | uv run --script <skill-dir>/scripts/cli.py show or read tool |
| Edit cells | NotebookEdit tool |
| Execute cells | uv run --script <skill-dir>/scripts/cli.py execute |
| View outputs | uv run --script <skill-dir>/scripts/cli.py show -o or --output-only |
| Search cells | uv run --script <skill-dir>/scripts/cli.py grep |
| Extract images | uv run --script <skill-dir>/scripts/cli.py show -o --save-images DIR |
| Validate syntax | uv run --script <skill-dir>/scripts/cli.py validate |
| Convert formats | uv run --script <skill-dir>/scripts/cli.py convert |
References
- reference.md - Notebook structure, execution model, best practices
- cookbook/workflows.md - Common workflow recipes
- cookbook/troubleshooting.md - Error handling and debugging
More from anntnzrb/agents
golang
Develop Go (Golang) applications using modern patterns, popular libraries, and idiomatic design. Activate when working with .go files, go.mod, go.sum, or user mentions Go, Golang, goroutines, channels, or Go libraries like gin, cobra, gorm.
17gleam
Develop with Gleam using idiomatic patterns, TDD, and type-driven design. Activate when working with .gleam files, gleam.toml, or user mentions Gleam, BEAM, or Erlang.
16agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.
15ast-grep
Read-only structural code search with ast-grep/sg. Grep/rg/sed alternative for AST-aware CLI exploration, pattern search, and fast code discovery. Activates on ast-grep/sg, structural search, AST search, find usages, tree-sitter.
14summarize
Operate `@steipete/summarize` end-to-end via `bun x @steipete/summarize` for URL/file/media summarization, extract-only output, YouTube transcript and slide workflows, model/language/length tuning, CLI-backend routing (`--cli`), cache/config management, and `refresh-free` model maintenance. Use when users ask to summarize or extract content, transcribe audio/video, run slide extraction, tune summarize config/env keys, or troubleshoot summarize command failures.
14python
Develop Python applications using modern patterns, uv, functional-first design, and production-first practices. Use this whenever working with .py files, pyproject.toml, uv commands, pip/pip3, poetry, virtualenv/venv, inline script metadata, or Python tooling like pytest, mypy, ruff, asyncio, itertools, functools, or dataclasses. If the task involves running Python, managing Python dependencies, creating environments, or building Python packages, load this skill and prefer uv-oriented workflows.
13