Skip to content

feat(skills): say what each shortlisted skill does, not just its name - #3763

Closed
kovtcharov wants to merge 1 commit into
amd:mainfrom
kovtcharov:claude/skill-shortlist-descriptions
Closed

kovtcharov wants to merge 1 commit into
amd:mainfrom
kovtcharov:claude/skill-shortlist-descriptions

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

When a request matched a skill but not strongly enough to load it automatically, the model was offered a shortlist of skill names and asked to load one if it fit. It was never told what those skills do, so models passed over the one they needed.

On five GitHub tasks against a private repository, discovery shortlisted github-triage for 4 of 5 prompts — top-ranked on three — yet 4 of 6 models never loaded it. They fetched github.com, hit a 404, and gave up or reported the repository unreachable. The one model that loaded it passed all five. The skill's description opens with the missing fact, "Triage GitHub work with the gh CLI"; the shortlist note now carries that first clause for each shortlisted skill, after its existing instruction.

  • Kept inside the per-turn budget, on purpose. Full descriptions took a three-skill note from 63 to 196 tokens, over the 120-token ceiling test_per_turn_notes_stay_short exists to hold. Each description is cut to its first clause, capped at 60 characters, so the same note renders at ~105. Describing only the top-ranked skill was rejected: on one task github-triage ranked third.
  • Closes a gap in that guard. The existing budget test builds its shortlist without descriptions, so it could not see this growth. A new test holds a realistically described three-skill note to the same ceiling.

Closes #3762

Test plan

  • pytest tests/unit/test_skill_shortlist_descriptions.py tests/unit/test_skill_discovery.py tests/unit/test_skill_retriever.py — 52 pass, including first-clause extraction, the unchanged note when no descriptions are present, run() filling descriptions in shortlist order, and the budget test above.
  • gaia eval agent — required by CLAUDE.md: this changes what the model is shown.
  • Benchmark A/B on the five GitHub tasks once the current fix-verification run finishes: whether github-triage gets loaded, and the GitHub pass rate, before vs after.

🤖 Generated with Claude Code

When a request matched a skill but not strongly enough to auto-load it,
the model was offered a list of skill names and asked to load one if it
fit. On GitHub tasks against a private repository, github-triage was
shortlisted for 4 of 5 prompts and top-ranked on three, yet 4 of 6
models never loaded it: they fetched github.com, hit a 404, and gave up.
The one model that loaded it passed all five tasks.

The skill's description opens with the missing fact ("Triage GitHub work
with the gh CLI"). The shortlist note now carries the first clause of
each shortlisted skill's description, capped at 60 characters, after
its existing instruction.

Only the first clause is kept because full descriptions took a
three-skill note from 63 to 196 tokens, over the 120-token per-turn
budget test_per_turn_notes_stay_short enforces. With the cap it renders
at ~105. A new test holds a realistically described three-skill note to
that same budget, since the existing guard builds its shortlist without
descriptions and would not have caught the growth.

Co-Authored-By: Claude Opus 5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Request changes

The shortlist note now tells the model what each shortlisted skill actually does, and the fix is well-aimed: the diagnosis (models skipped github-triage because a bare name never said "this is how you get the gh CLI") matches the change, and the per-turn token budget is respected on purpose rather than by accident. Two things stand between this and merge, neither in the logic.

The behaviour claim isn't measured yet. The whole justification is a benchmark result, and both verification boxes in the test plan — the agent eval and the before/after A/B on the five GitHub tasks — are still unchecked. This is exactly the class of change GAIA requires an eval for: it changes what the model is shown on every shortlist turn. Unit tests prove the note renders; they say nothing about whether models now load the skill. Please land the eval comparison against the committed baseline, plus the A/B pass rate, before merge.

The documented behaviour is now out of date. The skills spec still describes a shortlist as offering names only, and its guidance on writing a skill description doesn't mention that the opening clause is now the part the model sees. That second point is newly load-bearing for every skill author — a description that buries its capability past the first clause loses it.

Also worth a look: for a description that opens with an abbreviation, the first-clause split can cut mid-abbreviation and hand the model a meaningless fragment. None of the 15 shipped skills hit it, so it's minor, but user-written and third-party skills will.

Real-world evidence

N/A — no evidence bundle was produced for this run, and the change touches no CLI, HTTP, MCP, or Agent UI surface directly; its surface is model behaviour, which is what the pending eval and A/B are for. My verdict therefore rests on static review plus one check I ran myself: I executed the new first-clause helper's logic standalone against the real frontmatter description of all 15 skills in hub/skills/ (pytest isn't installed in this review container, so I could not run the PR's test files). All 15 produce a sensible clause — e.g. github-triage → Triage GitHub work with the gh CLI, data-explore → Load messy tabular data into SQL scratchpad tables and answ…. The weakest is coding → Work on a codebase, which is thin but not wrong.

🔍 Technical details

🟡 Important

1. Eval + A/B not run — required for a prompt-fragment change

DiscoveryResult.prompt_fragment() is a per-turn prompt fragment, which CLAUDE.md lists explicitly under "changes that REQUIRE an eval run before merge". The test plan's two unchecked items are the ones that matter:

gaia eval agent --category <relevant> --agent-type <type>
gaia eval agent --compare tests/fixtures/eval_baselines/<model>/scorecard_<cat>.json <run-dir>/scorecard.json

The A/B on the five GitHub tasks is the stronger signal here — the PR's claim is "4 of 6 models never loaded it"; the review needs the after-number. Not asking for new work, just for the boxes the PR already opened.

2. docs/spec/agent-skills.mdx still describes the old note

The Shortlist row at docs/spec/agent-skills.mdx:359 says only the names are offered:

| **Shortlist** | several plausible, none dominant | each candidate's name and what it does are offered to the model, which calls `load_skill` if one fits |

The description-authoring Note at docs/spec/agent-skills.mdx:368 is the more important one: since only the first clause (capped at 60 chars) reaches the model on a shortlist turn, front-loading the capability is now a requirement, not a style preference. Worth one sentence there — coding's description reduces to Work on a codebase, which illustrates the failure mode.

🟢 Minor

3. First-clause split cuts mid-abbreviation (skill_discovery.py:64)

". " is treated as a clause end unconditionally, so "Use the gh CLI (e.g. gh issue list) to triage a repository's backlog — and more" reduces to "Use the gh CLI (e.g" — a dangling paren and no capability. Guarding on "the word before the period contains a period" fixes it and leaves every current expectation (including "Research a topic on the open web. Use when asked.") unchanged; I verified both against the shipped skill set:

    for sep in (" — ", " – ", ". ", "; "):
        head = flat.split(sep, 1)[0]
        # "(e.g. " ends a word, not a clause — don't cut mid-abbreviation.
        if head != flat and "." not in head.rsplit(" ", 1)[-1]:
            flat = head

4. test_run_fills_descriptions_in_shortlist_order bypasses the real object (tests/unit/test_skill_shortlist_descriptions.py:147)

SkillDiscovery.__new__ plus five monkeypatched attributes stubs out the one thing worth integrating here — that decision.shortlist names really are keys in candidates(). tests/unit/test_skill_discovery.py already has _Manager / _skill and a real-retriever shortlist test (test_an_ambiguous_turn_is_shortlisted_never_guessed, line 141) whose fake skills carry real descriptions; asserting result.shortlist_descriptions there covers the wiring end to end for one line, with no stubbing. (They do line up today — the retriever indexes the same dict keys candidates() returns — which is why this is a 🟢, not a bug.)

5. PR body carries a Claude attribution footer

The description ends with 🤖 Generated with [Claude Code](…), which CLAUDE.md prohibits in PR descriptions. One-line delete.

Strengths

  • The budget regression is fixed at its root, not papered over. Noticing that test_per_turn_notes_stay_short builds its shortlist without descriptions — so it structurally could not see this growth — and adding a realistically-described three-skill case is the more valuable half of this PR.
  • The rejected alternative is recorded where it helps. "Describing only the top-ranked skill was rejected: on one task github-triage ranked third" is the kind of detail that stops the next person re-litigating it.
  • Backward-compatible by construction. shortlist_descriptions defaults to (), empty descriptions are filtered out, and a bare DiscoveryResult(shortlist=…) renders byte-identically to before — with a test pinning exactly that.

@kovtcharov

Copy link
Copy Markdown
Contributor Author

Superseded by #3765. Rather than describing the shortlist better, it removes the per-turn matcher and lists every installed skill in the prompt. On the benchmark the matcher loaded a skill on 0 of 24 tasks, so the shortlist was the only path, and most models ignored it.

@kovtcharov kovtcharov closed this Sep 14, 2026
kovtcharov added a commit to kovtcharov/gaia that referenced this pull request Sep 24, 2026
…g one (amd#3765)

GAIA almost never used its skills on real work. Before each turn it
scored the user's words against skill descriptions, and on a 24-task
benchmark that loaded a skill **zero** times. Precise requests score
lowest, because repo names, issue numbers and output formats count
against the match. Without `github-triage` loaded, `gh` is refused too,
so most models never tried it.

The flagship now lists every installed skill, one line each, in its
system prompt, and the model calls `load_skill` when the work fits — at
the start of a task or partway through. The list only changes when a
skill is installed, so it stays cached. It costs **1,062 tokens** for
the starter pack. This deletes the retriever and discovery machinery
(−2,339 / +334 lines).

- **Refusals name the skill.** A refused `gh` or `pytest` now says which
skill to load, instead of "a skill that declares it".
- **Latent prompt bug fixed.** ChatAgent dropped any prompt section
containing the words "Stable Diffusion". The catalogue mentions it (the
`image-gen` skill), so the whole catalogue vanished with no warning. The
filter now matches the method that produced the section.

Closes amd#3764. Supersedes amd#3763.

## Test plan

- [x] `pytest tests/unit/test_skill_catalog.py
tests/unit/test_skill_binary_grants.py`: every installed skill listed
with its description; stable across renders; `.claude/skills` imports
not listed; the granting skill found for `gh` and `pytest`; refusals
name it, or point at the hub when none is installed.
- [x] `pytest
hub/agents/gaia/python/tests/test_full_tool_bundles.py::test_skill_catalogue_renders_for_the_flagship`:
the catalogue reaches the real flagship prompt. It failed before the
Stable Diffusion filter fix.
- [x] Targeted suites (skills, prompt composition, verification scope,
flagship tests): 947 pass. `pytest tests/unit -k "skill or prompt or
shell"`: 1,961 pass. The 6 failures also fail on untouched `main`:
`search_documentation` is absent from this environment, and the profile
goldens drift on audio wording.
- [x] Flagship system prompt measured: 3,130 → 4,192 tokens, sourcing
rule still present.
- [x] Benchmark A/B, the same 144-run battery before and after (six
Fireworks models), all batches complete: **101 vs 100 passes overall**.
GitHub tasks 10/30 → **17/30**; runs that loaded a GitHub skill 4 → 16,
runs that used `gh` 4 → 14. Adversarial tasks 19/30 → 15/30, all 4
points lost by minimax-m3; deepseek-v4p1-flash went 21 → 24/24 and
kimi-k2p7-code 19 → 22. Visible skills also exposed amd#3790: `coding` was
refused over pytest in 28 runs, which amd#3791 fixes.
- [ ] `gaia eval agent`: required by CLAUDE.md for prompt changes. It
can't run on this machine (no `claude` CLI for the judge).

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: Ovtcharov <[email protected]>
Co-authored-by: f <f@f>
Co-authored-by: kovtcharov-amd <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skill shortlist names skills without saying what they do, so models skip the one they need

1 participant