Skip to content

feat(tool-skills): token-budget skills catalog — every skill visible, priority tiers, tightened descriptions - #63

Merged
Brian Krabach (bkrabach) merged 6 commits into
mainfrom
skills-catalog-token-budget
Aug 30, 2026
Merged

feat(tool-skills): token-budget skills catalog — every skill visible, priority tiers, tightened descriptions#63
Brian Krabach (bkrabach) merged 6 commits into
mainfrom
skills-catalog-token-budget

Conversation

@bkrabach

Copy link
Copy Markdown
Collaborator

What

Replaces the visibility hook's sorted(...)[:max_skills_visible] alphabetical cap (which silently hid every skill past ~50 — 't' names like ten-lane-highway were never advertised) with a token-budget tier renderer: every regular skill always appears (name-index → one-line summary → full description), upgraded in (-priority, name) rank order within visibility_token_budget (default 5000); optional per-skill visibility: {priority, summary} frontmatter; legacy count mode preserved when only max_skills_visible is set; behaviors/skills.yaml + skills-tool.yaml switched to the budget key.

Additional improvements:

  • 38 skill descriptions tightened −23% (first sentence now stands alone as the summary tier)
  • tester-breaker gets priority 5
  • monitor description points to ten-lane-highway
  • Two stale pre-existing tests repaired

Coverage & Validation

  • 358-line test file covers coverage/budget/priority/fallback/legacy
  • Catalog simulation results (across ~106-skill composition at 5k budget):
    • 19 FULL + 87 summary + 0 invisible (vs 50 full + 56 invisible under old mechanism)
    • Budget lands at ~4,986/5,000 tokens
    • Six priority skills render FULL and first: context-intelligence-graph-query, context-tester, councilify, digital-twin-universe, tester-breaker, workflow-pattern-analysis
  • Digital Twin validation (5/5 checks):
    • Catalog renders every composed skill with NO truncation
    • Skill v2 loads correctly
    • Scripts clean
    • Infra-ledger round-trip verified
    • DTU width pin validated
  • tool-skills module tests: 302-304 passed (one pre-existing collection error in test_fork_skill_model_role_resolver.py — ModuleNotFoundError amplifier_foundation — reproduces identically on origin/main; suite fully green when the declared git dep resolves)

Paired With

Related to: amplifier-app-cli PR (cross-link after both exist)

…token budget

Replace the alphabetical max_skills_visible cap (which silently dropped every
skill sorting past position 50) with deterministic tier assembly under a
configurable visibility_token_budget (default 5000, estimate = len//4):

  1. Reserve a name-only index line for EVERY regular skill (full coverage).
  2. Upgrade index -> one-line summary in rank order, while budget allows.
  3. Upgrade summary -> full description in rank order, while budget allows.

Rank = (-priority, name). priority/summary come from an optional skill
'visibility:' frontmatter mapping, read by the hook (cached per path) so no
metadata field is added to discovery. Summary falls back to the description's
first sentence, truncated to 140 chars.

Back-compat: max_skills_visible without a budget keeps the legacy count cap;
budget wins when both are set. behaviors/skills*.yaml switch to
visibility_token_budget: 5000. User-invoked section unchanged.

Also: monitor SKILL.md points at the ten-lane-highway skill.
…en suite

Neither test exercises the visibility budget; both fail on base 11f97bc and
were asserting against contracts that already changed:

- test_fork_skill_model_resolver_called_with_metadata_fields registered its
  resolver mock under the old 'routing_matrix' capability with a sync resolve().
  Production _execute_fork looks up 'model_role_resolver' and awaits resolve().
  Align the mock: register under 'model_role_resolver', make resolve() async.

- test_skills_visible_in_session matched the CLI's unknown-option error as
  'No such option: --dry-run'; current CLI phrases it "No such option
  '--dry-run'.". Match the stable 'No such option' prefix instead.

Full suite from modules/tool-skills now: 304 passed.
…talog

The skills index now renders in tiers (name -> one-line summary -> full
description) under a token budget, so every wasted word in a `description:`
costs another skill its detail. This is an editorial pass over all 38
skills/*/SKILL.md descriptions.

- First sentence of every description now stands alone as a <=140-char
  one-liner, which is exactly what the catalog's summary tier renders
  (hooks._first_sentence truncates at 140).
- Load-bearing routing preserved verbatim or moved earlier: "Use when"
  triggers, quoted trigger strings, slash-command names, MUST/ALWAYS
  language, and cross-skill pointers (/council, /design-council, personafy,
  crusty-old-engineer, ten-lane-highway, /verify).
- Cut repetition, process narration, and over-long persona flavor. The
  eleven persona lenses keep one load-bearing question, one voice clause,
  and their triggers; each drops ~40-55%.
- Literal block scalars (`|`) folded to `>-` so descriptions render as a
  single line in the catalog instead of ragged multi-line list items.
- visibility.priority: 5 added to councilify and tester-breaker, plus a
  curated visibility.summary for councilify (its first sentence is a long
  compound clause that would truncate badly).
- code-review, mass-change, and session-debug left untouched: already clean,
  standalone one-liners with no flab.

Total: 17,479 -> 13,389 chars (-4,090, -23%; ~4,369 -> ~3,347 est. tokens).
No name/version/shortcut/user-invocable/disable-model-invocation/license or
below-frontmatter content changed; verified per-file against HEAD.
@bkrabach
Brian Krabach (bkrabach) deleted the skills-catalog-token-budget branch August 30, 2026 10:58
@bkrabach

Copy link
Copy Markdown
Collaborator Author

Paired with: microsoft/amplifier-app-cli#289 (ten-lane-highway v2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants