jupyter-notebook-writing
Write Milvus application-level Jupyter notebook examples using a Markdown-first workflow with jupyter-switch for format conversion.
What this skill does
# Skill: Jupyter Notebook Writing
Write Milvus application-level Jupyter notebook examples as a DevRel workflow. Uses a Markdown-first approach — AI edits `.md` files, then converts to `.ipynb` via `jupyter-switch`.
> **Prerequisites**: Python >= 3.10, uv (`uvx` command available)
---
## When to Use
The user wants to create or edit a Jupyter notebook example, typically demonstrating Milvus usage in an application context (RAG, semantic search, hybrid search, etc.).
---
## Core Workflow: Markdown-First Editing
Jupyter `.ipynb` files contain complex JSON with metadata, outputs, and execution counts — painful for AI to edit directly. Instead:
1. **Write/Edit the `.md` file** — AI works with clean Markdown
2. **Convert to `.ipynb`** — using `jupyter-switch` for runnable notebook
3. **Keep both files in sync** — the `.md` is the source of truth for editing
### Format Convention
In the `.md` file:
- **Python code blocks** (` ```python ... ``` `) become **code cells** in the notebook
- **Everything else** becomes **markdown cells**
- Cell outputs are not preserved in `.md` (they get generated when running the notebook)
### Conversion Commands
```bash
# Markdown -> Jupyter Notebook
uvx jupyter-switch example.md
# produces example.ipynb
# Jupyter Notebook -> Markdown
uvx jupyter-switch example.ipynb
# produces example.md
```
- The original input file is never modified or deleted
- If the output file already exists, a `.bak` backup is created automatically
---
## Step-by-Step
### Creating a New Notebook
1. Create `example.md` with the content (see structure below)
2. Convert: `uvx jupyter-switch example.md`
3. Both `example.md` and `example.ipynb` now exist
### Editing an Existing Notebook
1. If only `.ipynb` exists, convert first: `uvx jupyter-switch example.ipynb`
2. Edit the `.md` file
3. Convert back: `uvx jupyter-switch example.md`
### Testing / Running
#### 1. Resolve the Jupyter execution environment
Before running any notebook, you must determine which Python environment to use. The system default `jupyter execute` may not have the required packages installed.
**Step A — Detect available environments.**
```bash
# Discover conda/mamba environments
conda env list 2>/dev/null || mamba env list 2>/dev/null
# Discover registered Jupyter kernels
jupyter kernelspec list 2>/dev/null
# Check system default Python
which python3 2>/dev/null && python3 --version 2>/dev/null
# Check for local virtual environment in the working directory
ls -d .venv/ venv/ 2>/dev/null
# Check if a uv-managed project (pyproject.toml + .venv)
test -f pyproject.toml && test -d .venv && echo "uv/pip project venv detected"
```
**Step B — Ask the user which environment to use.** Present a numbered list of choices. Include all detected environments:
1. **System default** — run `jupyter execute` as-is, no `--kernel_name`
2. **Each detected conda/mamba environment** — show name and path
3. **Each registered Jupyter kernel** — show kernel name
4. **Local venv** (if `.venv/` or `venv/` found in working directory) — the Python inside that venv
5. **Custom** — let the user type a Python path or environment name
> **Note on uv projects:** If the working directory has `pyproject.toml` + `.venv/` (a uv-managed project), the local venv option covers this case. The user can also run `uv run jupyter execute example.ipynb` directly if jupyter is a project dependency.
Example prompt:
```
Which Python environment should I use to run this notebook?
1. System default (jupyter execute as-is)
2. conda: myenv (/path/to/envs/myenv)
3. Jupyter kernel: some-kernel
4. Local venv (.venv/)
5. Custom — enter a path or environment name
```
**Step C — Apply the chosen environment:**
| Scenario | Action |
|----------|--------|
| Already a registered Jupyter kernel | Use `jupyter execute --kernel_name=<name>` |
| Conda env not yet registered as kernel | Register first: `<env-python> -m ipykernel install --user --name <name> --display-name "<label>"`, then use `--kernel_name=<name>` |
| Custom Python path | Same as above — register as kernel first, then use `--kernel_name` |
#### 2. Prepare the notebook for execution
Before running, comment out "setup-only" cells in the `.md` file — cells that are meant for first-time users but should not run in an automated test environment. Specifically:
- **`pip install` cells** — dependencies should already be installed in the chosen Jupyter environment. If any packages are missing or need upgrading, install them externally in the target environment (with `--upgrade`), not inside the notebook.
- **API key / credential placeholder cells** — e.g. `os.environ["OPENAI_API_KEY"] = "sk-***********"`. Instead, set environment variables externally before running (export in shell, or inject via code before `jupyter execute`).
- **Mock / demo-only cells** — any cells that exist purely for illustration and would fail or interfere in a real run.
To comment out a cell, wrap its content in a block comment so the cell still executes (producing empty output) but does nothing:
```python
# # pip install --upgrade langchain pymilvus
# import os
# os.environ["OPENAI_API_KEY"] = "sk-***********"
```
This keeps the notebook structure intact (cell count, ordering) while preventing conflicts with the external Jupyter environment.
**For environment variables:** either `export` them in the shell before running `jupyter execute`, or prepend them to the command:
```bash
OPENAI_API_KEY="sk-real-key" jupyter execute --kernel_name=<name> example.ipynb
```
#### 3. Convert and run
1. Convert `.md` to `.ipynb` if needed
2. Install any missing dependencies in the target environment externally: `<env-python> -m pip install --upgrade <packages>`
3. Run: `jupyter execute --kernel_name=<name> example.ipynb` (omit `--kernel_name` if using system default)
4. If errors found, fix in the `.md` file, uncomment setup cells if needed for debugging, and re-convert
---
## Notebook Structure Template
A typical Milvus example notebook follows this structure:
```markdown
# Title
Brief description of what this notebook demonstrates.
## Prerequisites
Install dependencies:
` ``python
!pip install pymilvus some-other-package
` ``
## Setup
Import and configuration:
` ``python
from pymilvus import MilvusClient
client = MilvusClient(uri="http://localhost:19530")
` ``
## Prepare Data
Load or generate example data:
` ``python
# data preparation code
` ``
## Create Collection & Insert Data
` ``python
# collection creation and data insertion
` ``
## Query / Search
` ``python
# search or query examples
` ``
## Cleanup
` ``python
client.drop_collection("example_collection")
` ``
```
---
## Reference Documents
This skill includes two reference documents under `references/`. **Read them when the task involves their topics.**
| Reference | When to Read | File |
|-----------|-------------|------|
| **Bootcamp Format** | Writing a Milvus integration tutorial (badges, document structure, section format, example layout) | `references/bootcamp-format.md` |
| **Milvus Code Style** | Writing pymilvus code (collection creation, MilvusClient connection args, schema patterns, best practices) | `references/milvus-code-style.md` |
### Bootcamp Format (`references/bootcamp-format.md`)
Read this when the user is writing a **Milvus integration tutorial** for the bootcamp repository. It covers:
- Badge format (Colab + GitHub badges at the top)
- Document structure: Header -> Prerequisites -> Main Content -> Conclusion
- Dependency install format with Google Colab restart note
- API key placeholder conventions (`"sk-***********"`)
- Each code block should have a short text introduction before it
### Milvus Code Style (`references/milvus-code-style.md`)
Read this when the notebook involves **pymilvus code**. Key rules:
- **Always use `MilvusClient` API** — never use the legacy ORM layer (`connections.connect()`, `Collection()`, `FieldSchema()`, etc.)
- Always define schema explicitly (`crRelated in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".