Skip to content

feat(skills): workers discover skills on demand via read_skill tool#172

Merged
jamiepine merged 1 commit intospacedriveapp:mainfrom
Marenz:feat/worker-skill-discovery
Feb 23, 2026
Merged

feat(skills): workers discover skills on demand via read_skill tool#172
jamiepine merged 1 commit intospacedriveapp:mainfrom
Marenz:feat/worker-skill-discovery

Conversation

@Marenz
Copy link
Collaborator

@Marenz Marenz commented Feb 23, 2026

Previously workers received a single skill's full content injected into their system prompt at spawn time (skill="name" on spawn_worker). Two problems with that approach:

  1. Workers were locked to one skill chosen upfront by the channel
  2. If a task turned out to need a different or additional skill, the worker had no way to get it

This replaces the skill: Option<String> parameter with suggested_skills: Vec<String> and adds a read_skill tool available to all workers. Workers now:

  • See a listing of all available skills (with suggested ones flagged) in their system prompt
  • Call read_skill("name") to fetch the full content of any skill on demand
  • Can read multiple skills if the task turns out to need them

The read_skill tool reads directly from RuntimeConfig.skills (the in-memory ArcSwap), so it works within the worker's existing security boundary without needing file access.

@Marenz Marenz marked this pull request as draft February 23, 2026 15:03
@Marenz Marenz force-pushed the feat/worker-skill-discovery branch 3 times, most recently from 0bd0a1f to e12d666 Compare February 23, 2026 15:49
@Marenz Marenz marked this pull request as ready for review February 23, 2026 15:55
@Marenz Marenz force-pushed the feat/worker-skill-discovery branch 2 times, most recently from 44a3bb4 to 0f7f6bf Compare February 23, 2026 19:34
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=[...]
@Marenz Marenz force-pushed the feat/worker-skill-discovery branch from 0f7f6bf to 6d4a68e Compare February 23, 2026 19:57
@jamiepine jamiepine merged commit 392cdff into spacedriveapp:main Feb 23, 2026
3 checks passed
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.

2 participants