Amplifier Foundation

The Whole Bundle,
One Diagram

Token cost the source never shows

You can read every file in a bundle and still not see what it costs

An Amplifier bundle is a scatter of YAML and markdown across behaviors, agents, context, tools, and providers. You can open each file one at a time — but composition and per-request token cost stay invisible in the text.

So what if the whole repo could show you both at once?

bundle_repo_dot() walks the whole repo and emits it as one annotated diagram

It lives in microsoft/amplifier-foundation — a pure, deterministic function with no LLM calls that renders the repo as bundle.dot. It is shipped and in use, at skill and recipe version 3.0.0.

First, what does that single diagram actually show?

3.0.0
bundle-to-dot skill & recipe version
1,027
lines in bundle_to_dot.py
35
test functions (422 lines)
0
LLM calls — pure & deterministic

The diagram organizes the entire repo into 7 clusters

Before the argument can lean on it, you need to know what you're looking at: bundle_repo_dot() sorts every component into seven cluster subgraphs so the shape of the bundle is legible at a glance.

Now — how does invisible cost become visible inside those clusters?

Behaviors
behaviors/
Standalones
bundles/
Agents
agents/
Modules
tools/modules
Providers
providers/
Experiments
experiments/
Context Files
context/

Every node carries an estimated per-request token cost, so heavier components stand out

Cost is estimated with a ~4 chars/token heuristic (len(content) // 4) and computed per component type — so the fat pieces are obvious by their labels, not buried in the source.

Some cost, though, hides outside the repo entirely.

External bundles are drawn dashed and red to flag cost that isn't counted locally

A solid border means local, counted cost. A dashed, red border (_COLOR_EXTERNAL_COST = "red") marks an external dependency whose hidden cost is deliberately NOT counted in the local total — so you can see the dependency you'd otherwise miss.

And to keep the whole picture honest over time…

Solid border — local, counted in the total
Dashed + red — external, hidden cost, not counted

An embedded source_hash lets the repo detect when the picture has gone stale

The generated bundle.dot embeds a source_hash graph attribute (a SHA-256 of the bundle body). validate-bundle-repo compares it against the current source and emits findings when it drifts — so the diagram never silently rots.

Put it together, and one view totals the whole bundle.

One view totals the composition — and waste jumps out at a glance

A root node sits at the center of the diagram and sums it all up. The foundation's own bundle.dot reads ~11,537 tokens aggregate — a single number where a fat context file or an expensive agent stands out immediately.

That's a property no file-by-file read would ever reveal.

~11,537 tok
aggregate, at the center of the diagram
foundation v2.0.0 · 4 tools · 11 agents

A deterministic, no-LLM diagram turns cost into a property you can see and commit

Because it's pure and deterministic, the diagram is an artifact you generate, commit, and track. Three repos under amplifier-foundation already carry a git-committed bundle.dot at their root.

Invisible cost becomes a visible thing you can watch drift.

Research Methodology

Data as of: April 2026  ·  Feature status: Shipped and in use (microsoft/amplifier-foundation)

Commands run:

Primary contributor: Brian Krabach (bkrabach) — author of the DOT-as-Docs / bundle.dot v1→v3 system (PRs #145, #146, #148, #149).

Source correction: the feature lives in microsoft/amplifier-foundation — NOT bkrabach/amplifier-bundle-dot-docs, which is a distinct "DOT Docs" feature for arbitrary codebases.

Gaps: bundle.png rendering and the optional LLM label enhancement (foundation:zen-architect) are verified as documented/wired in the recipe, not executed end-to-end in this environment.

More Amplifier Stories