Notebook.create api intro

From gpsaggese/helpers · View interactive version

Notebook.create api intro is an AI agent skill from the GitHub repository gpsaggese/helpers. Create a notebook to present the API of a package

How to use this skill

Skill file

Goal

<PACKAGE_NAME>: its core primitives, mental model, and API surface

problem

Teaching Philosophy

1. Start from the smallest possible working example

2. Introduce one new concept at a time

3. Use the minimum code needed to demonstrate each concept

4. Prefer toy examples with 2-5 objects over realistic datasets

5. Every code cell should answer exactly one question

6. Avoid helper functions, abstractions, and boilerplate unless they are

part of the library's API

7. Focus on understanding:

Notebook Structure

Name of the Notebook

```

tutorials/<PACKAGE_NAME>/<PACKAGE_NAME>.<ID>.API.<DESCRIPTION>.ipynb

```

tutorials/pgmpy/pgmpy.01.API.probabilistic_inference.ipynb

Use Standard Template Structure

## Use Standard Template Structure: title cell with scope and

pedagogical arc, optional pip cell, autoreload and third-party imports

cell, and a last setup cell that calls utils.init_loggers(_LOG)

Follow General Notebook Conventions

tables

LaTeX

Follow the Template

```markdown

```

Library Overview

important classes, and a conceptual diagram of how the pieces fit together

Primitive-by-Primitive Exploration

```

# Minimal example in Python

```

hintros.get_public_methods_as_str(obj) from helpers/hintrospection.py

Mental Model as Markdown Table

LimeTabularExplainer | Configured explainer | Wraps model + training data

Explanation.values | SHAP contributions | (n_samples, n_features) array

bullet-point overview

```markdown

| Object | Description | Additional Info |

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

| Explainer(...) | Main class | Wraps data/model |

| explainer.method(x) | Instance method | Returns result object |

| Result.values | Data array | shape (n, m) |

```

Composition Examples

API Patterns

Interactive Exploration

Link to Source Code

class, function, or method is introduced

a string

file and line, e.g.,

https://github.com/<ORG>/<REPO>/blob/<BRANCH>/<PATH>#L<LINE>

can jump to the implementation, e.g.,

```python

import helpers.hintrospection as hintros

# Link to the class definition on GitHub, and list its public surface.

hintros.print_obj_info(sim.MultiArmedBandit)

```

Comment Each Function

```python

# Call GET /openapi.json to fetch the schema FastAPI generated automatically.

response = demo_client.get("/openapi.json")

schema = response.json()

_LOG.info("OpenAPI title: %s", schema["info"]["title"])

_LOG.info("Registered paths: %s", sorted(schema["paths"].keys()))

# Outcome: 200 OK; the schema lists every route registered on demo_app above.

```

Special Instructions

design

Verification

```

> jupytext.py --action pair --files <FILE>.ipynb

```

```

> cd tutorial/<PACKAGE_NAME>

> docker_cmd.sh "python /git_root/tutorials/<PACKAGE_NAME>/<FILE>.py"

```

.claude/skills/notebook.create_api_intro/SKILL.md

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.