AgentSkillsCN

build-notebook

通过质量评分,迭代式构建或改进Jupyter笔记本。参数:[新建|改进|修复] <路径> [--主题] [--领域] [--等级] [--质量] [--最大迭代]

SKILL.md
--- frontmatter
name: build-notebook
description: Build or improve Jupyter notebooks iteratively with quality scoring. Arguments: <new|improve|fix> <path> [--topic] [--domain] [--level] [--quality] [--max-iter]

Build Notebook

Create, improve, or fix Jupyter notebooks iteratively.

Action: $ARGUMENTS

Actions

new - Create from scratch

Requires: --topic, --domain (ML, Probas, GenAI, GameTheory, SymbolicAI, Sudoku, Search), --level (intro, intermediate, advanced)

improve - Enhance existing notebook

Requires: notebook path, optional --quality (0-100, default 90), --focus (execution, pedagogy, content, structure)

fix - Correct execution errors

Requires: notebook path, optional --max-iter (default 5)

Iterative Workflow

code
while iteration < max_iterations and score < quality_target:
    1. Execute notebook (notebook-executor agent)
    2. Validate all aspects (notebook-validator agent)
    3. Plan corrective actions (prioritized by severity)
    4. Apply via appropriate sub-agent (enricher, cell-iterator, cleaner)
    5. Re-validate and measure improvement

Quality Scoring

CategoryWeightCriteria
Structure15%Valid JSON, metadata, cells
Syntax15%Valid code, markdown, LaTeX
Execution30%No errors, no timeouts
Pedagogy25%Progression, code/markdown ratio, explanations
Content15%Visualizations, formulas, conclusion

Sub-Agents Used

AgentRoleModel
notebook-designerCreate initial structureinherit
notebook-executorRun the notebooksonnet
notebook-validatorEvaluate qualitysonnet
notebook-enricherAdd pedagogical contentsonnet
notebook-cell-iteratorFix specific cellssonnet
notebook-cleanerClean structuresonnet

Model Selection Strategy

  • Use haiku for quick validation checks
  • Use sonnet for enrichment and standard fixes
  • Use inherit (or opus if available) for complex design and orchestration