You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(skills): workers discover skills on demand via read_skill tool
Previously workers received a single skill's full content injected into
their system prompt at spawn time. This had two problems:
- Workers were locked into one skill chosen by the channel upfront
- Workers couldn't access skills they turned out to need mid-task
New approach (aligned with the design docs):
- Workers see the full skills listing (name + description) in their
system prompt, same as the channel
- Channel suggests relevant skills via suggested_skills=[...] on
spawn_worker — these are flagged in the listing but not mandatory
- Workers call the new read_skill tool to fetch the full content of
any skill they decide is relevant — including ones not suggested
- read_skill reads from the in-memory SkillSet (not the file tool),
so the workspace boundary is never involved
Changes:
- src/tools/read_skill.rs: new ReadSkillTool, scoped to SkillSet
- src/tools.rs: register ReadSkillTool in create_worker_tool_server
- src/skills.rs: replace render_worker_prompt with render_worker_skills,
takes suggested names and builds listing with suggested flag
- src/prompts/engine.rs: render_skills_worker now takes Vec<SkillInfo>
with suggested field; SkillInfo gains suggested: bool
- src/agent/channel.rs: spawn_worker_from_state takes suggested_skills
&[&str] instead of skill_name Option<&str>
- src/tools/spawn_worker.rs: skill: Option<String> ->
suggested_skills: Vec<String>
- prompts/en/fragments/skills_worker.md.j2: rewritten — listing with
suggestions flagged, instruction to call read_skill before starting
- prompts/en/fragments/skills_channel.md.j2: updated example to use
suggested_skills=[...]
You have access to the following skills. Skills contain specialized instructions for specific tasks. When a user's request matches a skill, spawn a worker to handle it and include the skill name in the task description so the worker knows which skill to follow.
3
+
You have access to the following skills. When a user's request matches one or more skills, spawn a worker and pass the relevant skill names as `suggested_skills`. The worker will read the skills it needs automatically.
4
4
5
-
To use a skill, spawn a worker with a task like: "Use the [skill-name] skill to [task]. Read the skill instructions at [path] first."
5
+
**Do not include implementation details, tool invocations, or protocol instructions in the task description.** Describe *what* to do, not *how*. The worker reads the skill for the how.
6
+
7
+
Example: `spawn_worker(task="Generate a 30-second downtempo track with these lyrics: ...", suggested_skills=["generate_music"])`
8
+
9
+
You may suggest multiple skills if the task spans more than one: `suggested_skills=["github", "coding-agent"]`
You are executing the **{{ skill_name }}** skill. Follow these instructions:
3
+
You have access to the following skills. Before starting your task, scan the list and call `read_skill` for any skill that is relevant — you may read more than one.
4
4
5
-
{{ skill_content }}
5
+
Skills marked as **suggested** were recommended by the channel for this specific task. Read those first, then decide if any others apply.
Copy file name to clipboardExpand all lines: src/tools/spawn_worker.rs
+13-7Lines changed: 13 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -35,10 +35,11 @@ pub struct SpawnWorkerArgs {
35
35
/// Whether this is an interactive worker (accepts follow-up messages).
36
36
#[serde(default)]
37
37
pubinteractive:bool,
38
-
/// Optional skill name to load into the worker's context. The worker will
39
-
/// receive the full skill instructions in its system prompt.
38
+
/// Optional list of skill names to suggest to the worker. The worker sees
39
+
/// all available skills and can read any of them via read_skill, but
40
+
/// suggested skills are flagged as recommended for this task.
40
41
#[serde(default)]
41
-
pubskill:Option<String>,
42
+
pubsuggested_skills:Vec<String>,
42
43
/// Worker type: "builtin" (default) runs a Rig agent loop with shell/file/exec
43
44
/// tools. "opencode" spawns an OpenCode subprocess with full coding agent
44
45
/// capabilities. Use "opencode" for complex coding tasks that benefit from
@@ -106,9 +107,10 @@ impl Tool for SpawnWorkerTool {
106
107
"default":false,
107
108
"description":"If true, the worker stays alive and accepts follow-up messages via route_to_worker. If false (default), the worker runs once and returns."
108
109
},
109
-
"skill":{
110
-
"type":"string",
111
-
"description":"Name of a skill to load into the worker. The worker receives the full skill instructions in its system prompt. Only use skill names from <available_skills>."
110
+
"suggested_skills":{
111
+
"type":"array",
112
+
"items":{"type":"string"},
113
+
"description":"Skill names from <available_skills> that are likely relevant to this task. The worker sees all skills and decides what to read, but suggested skills are flagged as recommended."
112
114
}
113
115
});
114
116
@@ -158,7 +160,11 @@ impl Tool for SpawnWorkerTool {
0 commit comments