Repository navigation
Skills: a skill that starts an agent - #339
Merged
Merged
Conversation
SKILL_AGENT_KEY (agent, top level), skill_agent and skill_started_by (skill:<name>). SkillAgents is one loading agent's: check warns, as the agent is built, of a skill whose agent its first run could not start (skill_agent_not_startable, once per agent and skill); start checks the type, the policy and the loading run's depth, then starts the run through Delegations.start with the skill's name and body as its brief, counted, and adds "skill" to its envelope. Delegations.types lists every agent type, read-only.
An agent with a skill whose frontmatter names an agent type gets the framework's load_skill (SkillLoadTool, ADK's declaration, bound as ADK's was) in its toolset: such a skill starts its agent through SkillAgents and answers with the run's envelope as JSON text, as task does; any other skill loads as ADK loads it. A load_skill envelope is shown as a delegation (ENVELOPE_TOOLS). The build's warning for a skill whose agent cannot be started is logged once per agent and skill, though ADK builds an agent once more for each model choice. The contract scenarios cover both backends.
load_skill takes the call's runtime, which the tool node injects; a skill whose frontmatter names an agent type starts it through SkillAgents (start_skill_run, beside task's coroutine) and answers as task does, one Command with the envelope and the run's shared-state change. The tools' declarations are unchanged, and any other skill loads as before.
The CHANGELOG's Added bullet, the README's skills row and Sub-agent context bullet, and CLAUDE.md's skills, ADK and Deep Agents lines and the sub-agent paragraph.
…n empty skill is refused The frontmatter key counts only when "skill" is in SubAgentPolicy.spawn_sources: otherwise the skill loads as instructions, as any skill does (other tools give skills an agent key of their own), and the build warns once per agent and skill (skill_agent_ignored); ADK keeps its own load_skill. A skill with no instructions has no task and is refused, and warned of at build. Tests for the build warning after a model switch, the instance's tools and model, a type's brief_required, and a crash's open load_skill call.
SkillAgents.refusal gives 'this app does not let a skill start' for a skill whose key the app ignores, so a start that comes anyway starts and counts nothing; a load still treats such a skill as instructions before asking. Docs: the reason count, the README's policy sentence, CLAUDE.md's skills line and the rewrapped paragraphs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A skill can now start an agent. A skill's
SKILL.mdmay name one of the app's agent types at the top of its frontmatter (agent: researcher). When an agent loads it,load_skillstarts a run of that type instead of handing back the instructions, and returns the run's result. Both backends.Loading a skill that names an agent
# Task: <skill>,## Objective). Its parent is the loading agent's run, it isstarted_by: skill:<name>, and it counts towardmax_runs_per_turnas a delegation's run does.task's, with"skill"added, through the tool result cap. The events show it as a delegation on both backends.spawnable_byand the policy'sspawn_sourcesboth hold"skill", and the loading run is one that may start a type. A type that inherits the conversation is started only by the main agent's load.The skill '<skill>' starts the agent '<agent>', which <reason>., with no run started. That covers an unknown type, a type a skill may not start, a run that may start no type, and a skill with no instructions to give it as its task.Apps that do not enable it
"skill"is not inspawn_sources(the default), theagent:key is ignored: the skill loads as instructions, exactly as before, and the build warns of the key once (skill_agent_ignored). Skills written for other tools that use the same key (Claude Code'scontext: fork+agent:) keep loading.Tests: written first and seen failing. The shared contract suite runs on both backends and covers:
load_skillcall answered at the next turn;There are unit tests for the frontmatter key,
SkillAgents' checks and texts, and each backend'sload_skill. Reviewed, with two rounds of review fixes.The full offline suite passes in the worktree (10851 passed), except
TestChildImportOrigin::test_child_resolves_the_checkout, which fails the same way on develop under the worktree wrapper, andtest_runs_stop_on_signals.py::...[SIGHUP], which failed under load and passes alone (a fixed one-second wait in that test, untouched here). On CI's library versions the contract suites and every touched file pass (975).