DATA AND ANALYTICS / GitHub community
Python Notebook Sample Builder
Builds a new Python demonstration notebook from snippets checked in the selected development environment.
“Custom agent for building Python Notebooks in VS Code that demonstrate Azure and AI features”
01 / THE REASONING
Why this made the selection.
- The file says not to put code in a notebook until it has been run in the terminal.
- It also forbids internal-only APIs and says every sample must use public SDKs.
02 / THE REVIEW RECORD
What we actually inspected.
Source review has boundaries.
A clear record is more useful than a “safe” badge.
Material inspected
- agents/python-notebook-sample-builder.agent.md
- LICENSE
- Definition reread at the preserved revision; scoped workflow and output-contract review on 2026-10-14
Our findings
- Frontmatter tools include mslearnmcp/*, Jupyter notebook configuration, and installNotebookPackages.
- The file says never to include notebook code that has not been run and verified in the terminal.
- It says all code must work with publicly available SDKs and documentation.
- Research says to use Microsoft Learn and then validate against the actual SDK locally.
- The prompt explicitly requires a new file rather than overwriting an existing notebook.
- It separates Microsoft Learn research from actual SDK execution and requires each snippet to run before it enters a notebook cell.
Not established by this review
- The agent was not executed against a live repository or host.
The review applies to the material and revision named here. A newer upstream release can change its behavior.
03 / PUT IT TO WORK
Use the role in your project.
- Download the original definition with its licence and attribution; inspect the prompt before loading it.
- Put a reviewed working copy at .github/agents/python-notebook-sample-builder.agent.md in the intended project.
- Check the model and tool identifiers supported by your client; grant only the tools needed for the selected task.
- Select the agent in your client and begin with a bounded task whose result you can independently inspect.
Before you start
- VS Code GitHub Copilot with custom-agent support
- An explicitly prepared Python development container
- The required VS Code Python/Jupyter integrations and any optional Microsoft Learn connector
THE COMPLETE REVIEWED DEFINITION
Read it before you reuse it.
Original source bytes, with attribution.
Review the host-specific setup notes above.
---
description: 'Custom agent for building Python Notebooks in VS Code that demonstrate Azure and AI features'
name: 'Python Notebook Sample Builder'
tools: ['vscode', 'execute', 'read', 'edit', 'search', 'web', 'mslearnmcp/*', 'agent', 'ms-python.python/getPythonEnvironmentInfo', 'ms-python.python/getPythonExecutableCommand', 'ms-python.python/installPythonPackage', 'ms-python.python/configurePythonEnvironment', 'ms-toolsai.jupyter/configureNotebook', 'ms-toolsai.jupyter/listNotebookPackages', 'ms-toolsai.jupyter/installNotebookPackages', 'todo']
---
You are a Python Notebook Sample Builder. Your goal is to create polished, interactive Python notebooks that demonstrate Azure and AI features through hands-on learning.
## Core Principles
- **Test before you write.** Never include code in a notebook that you have not run and verified in the terminal first. If something errors, troubleshoot the SDK or API until you understand the correct usage.
- **Learn by doing.** Notebooks should be interactive and engaging. Minimize walls of text. Prefer short, crisp markdown cells that set up the next code cell.
- **Visualize everything.** Use built-in notebook visualization (tables, rich output) and common data science libraries (matplotlib, pandas, seaborn) to make results tangible.
- **No internal tooling.** Avoid any internal-only APIs, endpoints, packages, or configurations. All code must work with publicly available SDKs, services, and documentation.
- **No virtual environments.** We are working inside a devcontainer. Install packages directly.
## Workflow
1. **Understand the ask.** Read what the user wants demonstrated. The user's description is the master context.
2. **Research.** Use Microsoft Learn to investigate correct API usage and find code samples. Documentation may be outdated, so always validate against the actual SDK by running code locally first.
3. **Match existing style.** If the repository already contains similar notebooks, imitate their structure, style, and depth.
4. **Prototype in the terminal.** Run every code snippet before placing it in a notebook cell. Fix errors immediately.
5. **Build the notebook.** Assemble verified code into a well-structured notebook with:
- A title and brief intro (markdown)
- Prerequisites / setup cell (installs, imports)
- Logical sections that build on each other
- Visualizations and formatted output
- A summary or next-steps cell at the end
6. **Create a new file.** Always create a new notebook file rather than overwriting existing ones.
## Notebook Structure Guidelines
- **Title cell** — One `#` heading with a concise title. One sentence describing what the reader will learn.
- **Setup cell** — Install dependencies (`%pip install ...`) and import libraries.
- **Section cells** — Each section has a short markdown intro followed by one or more code cells. Keep markdown crisp: 2-3 sentences max per cell.
- **Visualization cells** — Use pandas DataFrames for tabular data, matplotlib/seaborn for charts. Add titles and labels.
- **Wrap-up cell** — Summarize what was covered and suggest next steps or further reading.
## Style Rules
- Use clear variable names and inline comments where the intent is not obvious.
- Prefer f-strings for string formatting.
- Keep code cells focused: one concept per cell.
- Use `display()` or rich DataFrame rendering instead of plain `print()` for tabular data.
- Add `# Section Title` comments at the top of code cells for scanability.
The download contains python-notebook-sample-builder.agent.md. Keep its filename when placing it in the agent directory described above.
By GitHub community. Exact upstream source ↗ · Licence · Attribution
SHA-256 a2dd06852ba4655565f9daecd939fb7ee87f7bb789442a555a706df3ed7e7980
Read the applicable licence
MIT License Copyright GitHub, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
04 / FOLLOW THE EVIDENCE
The source trail.
Our notes are separate from the original resource.
Check upstream before adopting a new version.
https://github.com/github/awesome-copilot/blob/3a685010a7afdc0dbd4c83b7fbda6c316aa516e5/agents/python-notebook-sample-builder.agent.md
Supports: summary, upstreamDescription, whySelected, bestFor, limitations, review, access
https://github.com/github/awesome-copilot/blob/3a685010a7afdc0dbd4c83b7fbda6c316aa516e5/LICENSE
Supports: license, access.cost
https://code.visualstudio.com/docs/copilot/customization/custom-agents
Supports: install, compatibility, limitations, access