Amplifier Foundation
Token cost the source never shows
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 diagramIt 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?
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?
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.
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…
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.
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.
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.
Data as of: April 2026 · Feature status: Shipped and in use (microsoft/amplifier-foundation)
Commands run:
grep -rln 'def bundle_repo_dot' amplifier-foundation/ → amplifier_foundation/bundle_docs/bundle_to_dot.pywc -l amplifier-foundation/amplifier_foundation/bundle_docs/bundle_to_dot.py → 1027 lineswc -l tests/test_bundle_to_dot.py; grep -c 'def test' … → 422 lines, 35 testscat amplifier-foundation/skills/bundle-to-dot/SKILL.md → 7 cluster subgraphs + token cost modelgrep -n 'source_hash' amplifier-foundation/bundle.dot → source_hash + root_foundation ~11537 tok aggregategrep -n '_COLOR_EXTERNAL_COST' …/bundle_to_dot.py → external = dashed, red, not countedgrep -n 'BUNDLE_DOT_STALE|BUNDLE_DOT_MISSING' recipes/validate-bundle-repo.yamlgh pr view 149 --repo microsoft/amplifier-foundation → v3 rewrite, merged 2026-04-03, +1747/-3144Primary 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.