Repository navigation
Add skills: instructions the model loads when a task needs them - #42
Merged
Merged
Conversation
agent({skills}) takes a SkillSource: plain async list, load and an
optional read, each run journaled. The run lists the skills once and adds
each name and description after the instructions, so the cached prefix
stays stable. It gives the model load_skill, and read_skill_file when the
source can read files. A listed skill's optional location is journaled
with the list and passed back to load and read, so a source over
something that changes pins it per run. skills([...]) builds a source
from skills defined in code.
Lesson 19 reads a folder of SKILL.md files. Skill scripts are out of
scope.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Adds skills to the SDK: instructions for one kind of task that the model loads by name when a task needs them. The API doesn't depend on any particular store. The application supplies a
SkillSource, and lesson 19 backs one with a folder ofSKILL.mdfiles in Anthropic's Agent Skills format.Behavior
list,loadandreadis journaled, like anasyncTool. A source can do plain I/O, and a replay never calls it again.load_skill(name), andread_skill_file(name, path)when the source hasread...are rejected before the source sees them.toolResultspreviews.location, such as a folder or a URL pinned to a commit. It's journaled with the list and passed back toloadandread, so a source over something that changes pins it for the run. The model never sees it.skills([...])builds a source from skills defined in code.Lesson 19:
folderSkillsreadspackages/examples/skills/, which holds two samples:release-noteswith atemplate.md, andincident-summary. A small frontmatter parser handleskey: valuelines and YAML>and|blocks.Docs:
restate-agentsskill: its lesson table, a "find the right tool" row and a Skills section inagent-basics.mdCONTEXT.mdglossaryTests
skills.test.tscovers:read, and an empty sourcelocationreachingloadandread🤖 Generated with Claude Code