forgebook
AGENTS.md45 starsChanged 6 months agoMITView on GitHub
A curated Microsoft Foundry cookbook where approved Microsoft authors publish Jupyter notebook "recipes" and readers learn to build on Microsoft Foundry. Notebooks are the source of truth; all publishing metadata lives in registry.yaml.
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- .github/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- site/public/llms.txtllms.txt
- cookbook-reviewSkill
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 65
Create the subdirectory if it doesn't exist — name it after the registry slug
- Very specific: line 68
Use relative paths in notebooks: media/<slug>/image.png
- Very specific: line 72
Must exist in tags.yaml — unknown tags fail both the validator and the content loader
- Very specific: line 106
Use withBase() or import.meta.env.BASE_URL for internal links — base path changes in PR previews
- Distinctive: line 107
Prefer functional patterns.
- Distinctive: line 111
Keep notebooks clean — no site-specific metadata inside notebooks
- Very specific: line 112
Don't start notebooks with # H1 — the page header comes from the registry title
- Very specific: line 121
Patterns: Use role-based selectors (getByRole), not CSS selectors
- Very specific: line 149
Run npm run build in site/ to catch build errors
- Distinctive: line 150
Keep notebook changes separate from site changes when possible
- Very specific: line 151
Add new notebooks to registry.yaml with all required fields
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
A curated Microsoft Foundry cookbook where approved Microsoft authors publish Jupyter notebook "recipes" and readers learn to build on Microsoft Foundry. Notebooks are the source of truth; all publishing metadata lives in registry.yaml.
Project Structure
forgebook/
├── notebooks/ # Jupyter notebooks (source of truth)
│ ├── data/ # Sample datasets, organized per-recipe
│ │ └── <slug>/ # e.g. data/foundry-agent-part-1/
│ ├── media/ # Images referenced in notebooks, organized per-recipe
│ │ └── <slug>/ # e.g. media/foundry-agent-part-1/
│ └── examples/ # Example notebooks
├── registry.yaml # Publishing metadata — opt-in per notebook
├── authors.yaml # Author profiles (name + title required)
├── tags.yaml # Allowed tags — CI rejects unknown tags
├── site/ # Astro static site
│ └── src/
│ ├── components/ # .astro components
│ ├── layouts/ # Page layouts
│ ├── lib/ # Core TS: registry.ts, notebook.ts, telemetry.ts
│ ├── pages/ # Route pages (index, notebook/[slug], RSS)
│ ├── data/ # popular.json (auto-generated, do not edit)
│ └── styles/ # global.css (Tailwind v4)
│ └── tests/ # Playwright e2e tests
├── scripts/ # validate-registry.ts, fetch-popular.ts
└── .github/workflows/ # CI: deploy (also refreshes popular.json), previewSetup Commands
# Notebooks
pip install -r requirements.txt
jupyter notebook
# Site
cd site && npm install
npm run dev # Dev server at localhost:4321/forgebook
npm run build # Production build (includes astro check)Validation — Run Before Every Commit
cd scripts && npx tsx validate-registry.ts # Registry + tags + authors
cd site && npm run build # Full build with type checkingContent Pipeline
How Notebooks Become Pages
- Approved author drafts or validates the recipe through the internal authoring workflow, then adds
.ipynbtonotebooks/and an entry toregistry.yaml - Content loader (site/src/lib/registry.ts) reads
registry.yaml, resolves authors fromauthors.yaml - Notebook renderer (site/src/lib/notebook.ts) converts cells to HTML:
notebookjs+ JSDOM + DOMPurify (sanitization)- Prism.js highlighting (Python, JS, TS, bash, JSON, YAML)
- KaTeX for math (
$inline$and$$block$$) markedwith GFM + footnotes for markdown cells
- Each notebook gets two routes:
/notebook/<slug>/(rendered) and/notebook/<slug>.md(raw markdown)
Image and Data Organization
- Organize per-recipe:
notebooks/media/<slug>/andnotebooks/data/<slug>/ - Create the subdirectory if it doesn't exist — name it after the registry slug
- Example:
notebooks/media/foundry-agent-part-1/01-project-home.png - Served via symlink at
site/public/notebook/media(subdirectories work automatically) - Use relative paths in notebooks:
media/<slug>/image.png - The renderer rewrites relative paths to absolute URLs using the site base path
Tags
- Must exist in
tags.yaml— unknown tags fail both the validator and the content loader - Two groups: Core Capabilities (agents, inference, evaluation, etc.) and Integrations (langchain, mcp, etc.)
Popular Notebooks
site/src/data/popular.jsonis refreshed bydeploy.yml(on every push tomain, on the daily 06:00 UTC cron, and on manual dispatch) by querying production recipe page views via App Insights and OIDC.- The carousel ranks current registry recipes by trailing-30-day views while each badge displays production views since the 2026-06-02 launch.
- The committed copy is a fallback: if the App Insights query fails, the build logs a warning and reuses the last good
popular.jsonso the deploy never breaks on a transient telemetry outage. - Never edit popular.json manually — it gets overwritten on the next deploy.
- Homepage shows "Most Popular" section only when ≥12 recipes exist
Registry Format
- slug: my-notebook # Required: lowercase, hyphens only (^[a-z0-9]+(?:-[a-z0-9]+)*$)
path: notebooks/my.ipynb # Required: must start with notebooks/, end with .ipynb
title: "My Notebook" # Required: display title
authors: # Required: at least one
- github: username # Must exist in authors.yaml with name + title
description: "..." # Optional: max 500 chars
date: "2026-02-01" # Optional: YYYY-MM-DD
tags: # Optional: must exist in tags.yaml
- agentsAuthors (authors.yaml)
- Keyed by GitHub username.
nameandtitleare required — the build throws if missing - Avatar falls back to
github.com/<user>.png; social links optional
Code Style
TypeScript/Astro (site/)
- Strict TypeScript mode
- Tailwind CSS v4 — use
@custom-variantsyntax, not legacy config - Components use
.astroextension - Use
withBase()orimport.meta.env.BASE_URLfor internal links — base path changes in PR previews - Prefer functional patterns; avoid nested ternaries
Python (notebooks/)
- Python 3.10+
- Keep notebooks clean — no site-specific metadata inside notebooks
- Don't start notebooks with
# H1— the page header comes from the registry title - Organize images in
media/<slug>/and data indata/<slug>/— create the directory if it doesn't exist - Reference with relative paths:
media/<slug>/01-image.png,data/<slug>/sample.csv
Testing
- Framework: Playwright with 4 device profiles (mobile, android, tablet, desktop)
- Base URL:
http://localhost:4321/forgebook - Run:
cd site && npx playwright test - Patterns: Use role-based selectors (
getByRole), not CSS selectors
CI/CD
| Workflow | Trigger | Purpose |
deploy.yml | Push to main, daily cron, manual | Refresh popular.json from App Insights, build, deploy to GitHub Pages |
preview.yml | PR events | Validate, build with PR-scoped base, post preview URL |
Telemetry
- App Insights via
@microsoft/applicationinsights-web— connection string fromPUBLIC_APP_INSIGHTS_CONNECTION_STRING - No-op in dev (console warning only)
- Tracks: page views, click events, scroll depth, Core Web Vitals
window.__telemetrybridge for inline scripts
Key Principles
- Notebooks are sacred — No site-specific metadata inside notebooks
- Publishing is explicit — Authors opt-in via
registry.yaml - Credit is intentional — Authors listed explicitly, not inferred from git
- Tags are curated — Must exist in
tags.yaml; propose new tags via PR - Automation removes toil — CI handles conversion, deployment, and popularity tracking
- Publishing is curated while stabilizing — Recipe publishing is focused on approved Foundry DX / Developer Marketing and product group authors while broader contribution paths mature
PR Guidelines
- Validate registry before committing
- Run
npm run buildinsite/to catch build errors - Keep notebook changes separate from site changes when possible
- Add new notebooks to
registry.yamlwith all required fields - See CONTRIBUTING.md for the full author workflow
PR Guidelines
- Validate registry before committing
- Run
npm run buildinsite/to catch build errors - Keep notebook changes separate from site changes when possible
- Add new notebooks to
registry.yamlwith all required fields
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

