Progressive disclosure L1/L2/L3
The context budget model behind inspect and the CTX-001 rule.
An Agent Skill costs context, and the cost is not uniform: some of it is
paid every time the skill loads, and some only when the agent chooses to go
deeper. agore-skill models this with three levels.
The three levels
L1 — Metadata. The name and description in the frontmatter. This is
what an agent always sees when deciding whether the skill applies at all.
It is the only part that is always in context when skills are listed, so
it has the tightest budget: 120 tokens by default.
L2 — Body. The Markdown body of SKILL.md, after the frontmatter. Paid
whenever the skill is actually used. Default budgets: 2500 tokens, 300
lines.
L3 — Progressive disclosure. Everything attached behind SKILL.md:
files under references/, scripts/ and assets/. Not paid unless the
agent (or a script) explicitly reads them — that is the "progressive"
part. The templates encode the pattern: a short SKILL.md checklist plus a
[references/guide.md](references/guide.md) link for depth.
Why budgets are lint rules, not hard limits
CTX-001 is a warning, not an error. Context cost is a policy decision,
not a correctness question: a 130-token description is not broken, it is
expensive. Projects tune the budgets in agore.yaml and decide with
strict whether warnings block. What the tool refuses to do is stay silent
while L1 grows unbounded — that is how a skill list becomes unusable.
The token estimator
Both inspect and the budget rule use one deterministic, offline estimator:
- ASCII characters cost ¼ token each, rounded up:
(asciiBytes + 3) / 4. - Each non-ASCII rune (CJK characters in particular) costs 1.5 tokens.
- Non-empty text never estimates below 1.
No tokenizer model, no dictionary download, no network: the same text yields the same number everywhere, in microseconds. The numbers are estimates, not exact tokenizer output — that is the deliberate trade-off for determinism and zero dependencies. Treat budget numbers as stable relative measures ("this description doubled") rather than absolute model accounting.
Orphans and dead references
The same analysis that computes L3 also validates it, starting from the
paths SKILL.md mentions — markdown links plus explicit
references/, scripts/, assets/ path mentions. An optional ./
prefix is accepted (./references/guide.md) and trailing sentence
punctuation is ignored, so Read references/guide.md. still extracts the
path.
- A dead reference (
broken_refs) is a reachable path that does not exist — an error (CTX-002), because the agent would hit a wall. - An orphan (
orphan_files) is a file underreferences/orscripts/that is not reachable — a warning (CTX-003), because content that can never be progressively disclosed is content that ships without a reader.
Reachability is transitive. SKILL.md's mentions seed a breadth-first
walk through references/ Markdown files: a second hop
(SKILL.md → references/a.md → references/b.md) is not an orphan, and a
missing second hop is reported as a dead reference. Links inside a
reference file resolve against that file's own directory (and are dropped
when they would leave the skill directory); a cycle among references is
harmless. Hidden files and directories, the root dist/ directory, files
matched by .gitignore rules or skill.exclude are exempt from both
checks.
Related
- The rendering and JSON of the analysis: How to inspect context budgets
- Field meanings: JSON schemas