Notebook.create api intro

From causify-ai/helpers · View interactive version

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

How to use this skill

Skill file

Goal

<PACKAGE_NAME> by progressively introducing its core primitives, mental model,

and API surface

large real-world problem

Teaching Philosophy

1. Start from the smallest possible working example

2. Introduce one new concept at a time

3. Use the minimum amount of code necessary to demonstrate each concept

4. Prefer toy examples with 2-5 objects instead of 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

it is generated as:

```

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

```

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

Use Standard Template Structure

notebook initialization

## 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

.claude/skills/notebook.rules.md:

pandas dataframes for tables

LaTeX notation

visualizations or interactive widgets

Follow the Template

Library Overview

Primitive-by-Primitive Exploration

```

# Minimal example in Python

```

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

Mental Model as Markdown Table

relationships clearly

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

not a string

GitHub link to the object's source, pointing at the exact file and line,

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

readers can jump straight 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

explanation of what it will do and then a comment on its outcome

```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"

```

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.