## Does agent_skills support automatic skill selection based on task context?
#993
Replies: 1 comment
|
No, that's not the current behavior. The frontmatter description works as a filter before a skill gets loaded, not after. Native skill selection happens in two stages: only the skill listing (name + description) is preloaded, and the full SKILL.md body is loaded once the model decides it's relevant and invokes it. From the skills docs:
The relevance judgment you're describing happens at that listing stage.
So with both skills in agent_skills, both full bodies end up in every executor's context. The model can still lean towards the relevant one, but that's just model discretion. There's no documented mechanism that uses the description of an already injected skill as an applicability gate, and you pay the context cost of both skills either way. Some options to get the behavior you want:
Since the injection strategy is GSD's design choice and not something Claude Code imposes, I'd say this is a valid feature request on GSD's side. The first option is the more deterministic fix. |
Uh oh!
There was an error while loading. Please reload this page.
I have multiple mutually exclusive skills configured for
gsd-executor— e.g. afrontend-react-coderskill and abackend-spring-boot-coderskill. Both are assigned inagent_skillsand would be injected into every executor prompt regardless of what the task actually involves.My assumption is that since GSD injects skills as
@path/to/SKILL.mdreferences, the subagent reads the full file including the frontmatter description — and should therefore be able to apply the same relevance judgment that Claude Code natively does when selecting skills (i.e. pick the most relevant skill based on task context, and ignore the rest).Is this already the intended and expected behavior? If so, is it documented anywhere?
If not — i.e. if subagents are expected to apply all injected skills unconditionally — then I'd argue this is a gap worth addressing, since the frontmatter description mechanism already exists precisely to express skill applicability.
Happy to run some tests and report back, or open a formal feature request if this isn't already handled.
All reactions