Jupyter notebook

From microsoft/ai-agents-for-beginners · View interactive version

Jupyter notebook is an AI agent skill from the GitHub repository microsoft/ai-agents-for-beginners. Use dis one wen di user dey ask make you create, scaffold, or edit Jupyter notebooks (`.ipynb`) for experiments, explorations, or tutorials; prefer di bundled templates and run di helper script `new_notebook.py` make e generate a clean starting notebook.

How to use this skill

Skill file

Jupyter Notebook Skill

Make clean, reproducible Jupyter notebooks for two main modes:

Dey prefer di bundled templates and di helper script for consistent structure and to reduce JSON mistakes.

When to use

Decision tree

Skill path (set once)

export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
export JUPYTER_NOTEBOOK_CLI="$CODEX_HOME/skills/jupyter-notebook/scripts/new_notebook.py"

User-scoped skills dey install under $CODEX_HOME/skills (default: ~/.codex/skills).

Workflow

  1. Lock the intent.

Identify di notebook kind: experiment or tutorial.

Capture di objective, audience, and wetin "done" suppose look like.

  1. Scaffold from the template.

Use di helper script so you no go hand-author raw notebook JSON.

uv run --python 3.12 python "$JUPYTER_NOTEBOOK_CLI" \
  --kind experiment \
  --title "Compare prompt variants" \
  --out output/jupyter-notebook/compare-prompt-variants.ipynb
uv run --python 3.12 python "$JUPYTER_NOTEBOOK_CLI" \
  --kind tutorial \
  --title "Intro to embeddings" \
  --out output/jupyter-notebook/intro-to-embeddings.ipynb
  1. Fill the notebook with small, runnable steps.

Make each code cell focus on one step.

Add short markdown cells wey explain di purpose and wetin dem suppose expect.

Avoid big, noisy outputs if small summary fit do.

  1. Apply the right pattern.

For experiments, follow references/experiment-patterns.md.

For tutorials, follow references/tutorial-patterns.md.

  1. Edit safely when working with existing notebooks.

Preserve di notebook structure; no dey reorder cells unless e go improve di top-to-bottom story.

Prefer targeted edits rather than full rewrites.

If you must edit raw JSON, check references/notebook-structure.md first.

  1. Validate the result.

Run the notebook top-to-bottom when environment allow.

If execution no possible, talk am clear and explain how to validate locally.

Use di final pass checklist in references/quality-checklist.md.

Templates and helper script

Script path:

Temp and output conventions

Dependencies (install only when needed)

Prefer uv for dependency management.

Optional Python packages for local notebook execution:

uv pip install jupyterlab ipykernel

Di bundled scaffold script dey use only di Python standard library and no need extra dependencies.

Environment

No required environment variables.

Reference map


<!-- CO-OP TRANSLATOR DISCLAIMER START -->

Disclaimer:

Dis dokument don translate wit AI translation service Co-op Translator (https://github.com/Azure/co-op-translator). Even though we dey try make am correct, abeg sabi say automatic translations fit get errors or mistakes. The original dokument for im own language na the correct/official source. For important information, na professional human translator we dey recommend. We no dey responsible for any wrong understanding or misinterpretation wey fit come from using this translation.

<!-- CO-OP TRANSLATOR DISCLAIMER END -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.