Goal
- Input: A
notebook_outline.<TAG>.mdoutline file that describes each notebook
cell (created via .claude/skills/notebook.create_outline/SKILL.md)
- Outputs:
1. .ipynb file: Fully functional Jupyter notebook with working code,
visualizations, and interactive widgets
2. .py file: Paired with the .ipynb using jupytext in py:percent format
3. *_utils.py file: Reusable helper functions for the notebook code
- Purpose: Implement the pedagogical design as an executable, interactive
notebook
- Each visualization is a triplet of pre-viz markdown, a code cell, and post-viz
markdown (see "Cell Structure in Notebook")
Core Workflow
- Understand the outline: Review each cell's Purpose, Display, and (if present)
Widgets and Guided Usage
- Implement utility functions: Write reusable widget and visualization code in
*_utils.py
- Create notebook cells: Add markdown cells (context) and code cells (widget
calls)
- Follow the separation principle: Utilities hold the implementation. The
notebook holds only function calls
Key Conventions
- Follow
.claude/skills/notebook.rules.mdfor general notebook conventions and
structure, especially:
## Visualization Cell Triplet Details: Pre-viz and post-viz markdown cells# Visualization and Interactivity: Widget patterns and comments panel
conventions
- Follow the outline cell format in
.claude/skills/notebook.create_outline/SKILL.md
- Follow
.claude/skills/coding.rules.mdfor Python in*_utils.pyand in the
.ipynb Python cells
Code Organization
- Follow the section
## Utilities vs. Notebook Responsibilitiesfrom the file
.claude/skills/notebook.rules.md for organizing utility files and notebook cells
Reference Templates
- Study these before implementing. They set the quality bar and idioms
.claude/templates/notebook.template.py- End-to-end notebook covering both static and interactive cell types
.claude/templates/notebook_utils_template.py- Paired utilities file with widget creation, state management, and
visualization functions
- In the title cell, right after the title, add:
```markdown
- Generated by
.claude/skills/notebook.implement_outline/SKILL.md
```
- Examples of notebooks:
msml610/tutorials/Lesson94_Information_Theory_utils.py- Production example with complex interactive patterns (especially
plot_joint_entropy_interactive())
Implementation Patterns
Cell Structure in Notebook
- Each visualization in the outline becomes a sequence of cells (a triplet of
stages, with more than one cell per stage):
1. Markdown cells (pre-viz): Goal, then Description split into Inputs and
Panels
2. Code cell: Visualization / interactive widget, with a comments panel
that holds only variable state
3. Markdown cells (post-viz): Guided usage (one action per control plus the
observation it produces, not general facts to learn), then Implementation,
then the print_obj_info() code cell
- Follow
## Visualization Cell Triplet Detailsin
.claude/skills/notebook.rules.md
Simple Interactive Widgets
- Follow
## Simple Interactive Widgetsin.claude/skills/notebook.rules.md
Complex Interactive Widgets
- Follow
## Complex Interactive Widgetsin.claude/skills/notebook.rules.md
Sync with Jupytext
- After all modifications, sync the paired
.pyfile with Jupytext following
# Code Architecture and Responsibility -> `## Utilities vs. Notebook
Responsibilities in .claude/skills/notebook.rules.md`
Verification
- [ ] Confirm the
.ipynb, paired.py, and*_utils.pyfiles are in sync via
Jupytext
- [ ] Run the notebook top to bottom following
## Testing Notebookin
.claude/skills/notebook.rules.md and confirm it completes without errors
- [ ] Check that every outline cell has a corresponding notebook cell and no step
from notebook_outline.<TAG>.md was skipped
- [ ] The title cell of the notebook says that it was generated by
.claude/skills/notebook.implement_outline/SKILL.md