Enrich notebooks

From jsboige/CoursIA · View interactive version

Enrich notebooks is an AI agent skill from the GitHub repository jsboige/CoursIA. Enrich Jupyter notebooks with pedagogical markdown content. Arguments: [target] [--execute] [--fix-errors] [--strict] [--consecutive] [--iterate]

How to use this skill

Skill file

Enrich Notebooks

Add pedagogical markdown content to Jupyter notebooks.

Target: $ARGUMENTS

Arguments

Process

  1. Parse target - Discover notebooks to enrich
  2. For each notebook, launch a background agent:

```python

from scripts.notebook_helpers import NotebookHelper

helper = NotebookHelper(path)

gaps = helper.find_cells_needing_enrichment() # Cells missing interpretation

consecutive = helper.find_consecutive_code_cells() # Code cells without markdown between

```

  1. If --execute: Execute notebooks first to capture outputs for interpretation
  2. If --fix-errors: Analyze errors, propose corrections, re-execute
  3. If --consecutive: Prioritize fixing consecutive code cells
  4. If --iterate: Use notebook-cell-iterator agent for targeted cell fixes

Agent Delegation

Use model: sonnet for enrichment agents (good balance of speed and quality).

For complex domains (Probas, Lean), consider model: inherit for better reasoning.

Task(
    subagent_type="general-purpose",
    model="sonnet",
    prompt="Tu es un agent notebook-enricher. Lis .claude/agents/notebook-enricher.md. Enrichis: {path}",
    description=f"Enrich {name}",
    run_in_background=True
)

Enrichment Criteria

| Type | Placement | Tense |

|------|-----------|-------|

| Section intro | BEFORE code | Future: "This code will..." |

| Code explanation | BETWEEN code cells | Present: "This function..." |

| Result interpretation | AFTER code output | Past: "The results show..." |

| Transition | Between sections | "After seeing X, let's explore Y..." |

| Conclusion | End of section | Summary table |

After Enrichment

```bash

git show origin/main:<nb-path> > /tmp/base.ipynb

python scripts/notebook_tools/scan_enrich_quality.py <nb-path> --base /tmp/base.ipynb

# 0 HIGH finding before commit: anchors must resolve at HEAD (code[N] =

# N-th CODE cell, 0-based, final layout), accents must survive, hrefs must

# resolve, no phantom entities, no worked solution before a TODO exercise.

```

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.