Skip to content
Back to skills

Clean Notebook

ASecurity

Cleans a Jupyter notebook: removes dead cells, fixes run order, moves reusable code into modules and checks it runs top to bottom.

  • 3 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added November 15, 2026
ai-agents

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill clean-notebook --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clean Notebook?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Clean Notebook
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-clean-notebook-ai-agent-templates/badge)](https://www.skillsdirectory.com/skills/workspace-templates-clean-notebook-ai-agent-templates)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: clean-notebook
description: "Cleans a Jupyter notebook: removes dead cells, fixes run order, moves reusable code into modules and checks it runs top to bottom."
disable-model-invocation: true
---

Clean up the notebook: $ARGUMENTS

1. Copy it to `<name>.backup.ipynb` before touching anything.
2. Read all cells with `jupyter nbconvert --to script` or by parsing the JSON. List cells that are empty, commented-out experiments, duplicated, or never referenced by later cells.
3. Find hidden state: variables used before they are defined in file order, cells that depend on a manual run order, and hard-coded absolute paths or credentials. Move paths to variables at the top.
4. Propose the cleanup list and ask for approval before deleting any cell.
5. Move functions used by more than one cell into `<name>_lib.py` beside the notebook with docstrings, and import them. Keep exploratory plotting in the notebook.
6. Order cells: imports, config, load, transform, analyze, plot. Add a short markdown heading before each section.
7. Clear outputs, then verify with `jupyter nbconvert --to notebook --execute --inplace` on a copy.

Report cells removed, code moved, and whether the notebook runs top to bottom.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.