Skip to content

Skills: a skill that starts an agent - #339

Merged
shoom1 merged 6 commits into
developfrom
feature/skill-agents
Nov 22, 2026
Merged

shoom1 merged 6 commits into
developfrom
feature/skill-agents

Conversation

@shoom1

@shoom1 shoom1 commented Nov 22, 2026

Copy link
Copy Markdown
Owner

A skill can now start an agent. A skill's SKILL.md may name one of the app's agent types at the top of its frontmatter (agent: researcher). When an agent loads it, load_skill starts 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

  • The run's task message is the skill's body under its name (# Task: <skill>, ## Objective). Its parent is the loading agent's run, it is started_by: skill:<name>, and it counts toward max_runs_per_turn as a delegation's run does.
  • The call's result is the run's envelope, as task's, with "skill" added, through the tool result cap. The events show it as a delegation on both backends.
  • It is allowed only as any start at run time is: the type's spawnable_by and the policy's spawn_sources both 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.
  • Otherwise the load is the call's error result, 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.
  • Each skill whose agent cannot be started is warned of once per agent and skill at each build, also on ADK, where a type with model choices builds a skill toolset per choice.

Apps that do not enable it

  • While "skill" is not in spawn_sources (the default), the agent: 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's context: fork + agent:) keep loading.
  • A skill without the key loads exactly as before on both backends. On ADK, an agent with no skill that a start could use keeps ADK's own skill toolset.

Tests: written first and seen failing. The shared contract suite runs on both backends and covers:

  • a skill starting its agent from the main agent and from a sub-agent;
  • two loads in one response;
  • the refusals, including at the depth limit;
  • the default policy loading as instructions;
  • a crash's open load_skill call answered at the next turn;
  • the warning logged once per build, also with a model choice.

There are unit tests for the frontmatter key, SkillAgents' checks and texts, and each backend's load_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, and test_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).

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.
@shoom1
shoom1 merged commit 2b82142 into develop Nov 22, 2026
6 checks passed
@shoom1
shoom1 deleted the feature/skill-agents branch November 22, 2026 22:10
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.

1 participant