Repository navigation
feat(unstable-v2): add skill command entries and skill content blocks - #2822
Merged
Merged
Conversation
Implement the Agent Skills RFD in the v2 schema behind the `unstable_agent_skills` feature. - Add `AvailableCommand::Skill`, a `skill` command entry with `name`, `description`, and an optional absolute `path` to the skill's file. - Add `ContentBlock::Skill`, a `skill` content block that names the skill a prompt invokes. - Add the `session.commands.skill` Client capability and the `session.prompt.skill` Agent capability, with its `inline` level. The Client's `session` capability group is now shared with prompt suggestions. - List `skill` as a known discriminator in both unions, so a malformed entry or block never falls through to the `Other` fallback. - Document the entry, the block, and both capabilities in the draft v2 protocol pages. - Remove `input` from the `skill` entry in the RFD. The Agent Skills specification defines no arguments for a skill.
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.
Implements the Agent Skills RFD (#2818) in the v2 schema, behind a new
unstable_agent_skillsfeature. v1 and the stable v2 schema are unchanged.What it adds
A
skillentry inavailableCommands:{ "type": "skill", "name": "pdf-processing", "description": "Extract text and tables from PDF files", "path": "/home/alice/.agents/skills/pdf-processing/SKILL.md" }A
skillcontent block that invokes it:{ "type": "skill", "name": "pdf-processing" }Two capabilities:
session.commands.skill. Agents must not sendskillentries without it.session.prompt.skillfor one block at the start of a prompt, andsession.prompt.skill.inlinefor any number of blocks at any position.Changes
AvailableCommand::Skill(Skill)withname,description,pathand_meta. An invalidpathor_metais treated as absent. An entry missingnameordescriptionis skipped in a command list and is never kept as an unknown type.ContentBlock::Skill(SkillReference)with a requiredname. It is strict, because the Agent acts on it.CommandsCapabilitiesandCommandsSkillCapabilitiesunder the Client'ssessioncapability group. That group now compiles under either this feature orunstable_prompt_suggestions.PromptSkillCapabilitiesandPromptSkillInlineCapabilitiesunderPromptCapabilities.skillis a known discriminator for both unions when the feature is on, in the deserializers and in the generated fallback schemas.Change to the RFD
The merged RFD gave
skillentries the optionalinputhint thatcommandentries have. This PR removes it. The Agent Skills specification defines no arguments for a skill, and only Claude Code adds them as its own extension. The RFD has a new FAQ entry for this and a revision history entry. It also drops three sentences that suggested_metaas a place for fields the RFD leaves out.Things to check in review
SkillfollowsCommand, andSkillReferencefollowsResourceLink. The capability types follow thePromptImageCapabilitiespattern.inlineis in the docs and doc comments. The schema can't express it, so the Agent enforces it.skillblocks. The Client'ssession.promptSuggestionscapability has noskillfield, so the existing rule excludes them. That can be a follow-up.Compatibility
A receiver built without the feature parses a
skillentry or block as the unknown-type fallback and round-trips it unchanged.tests/experimental_compatibility.rscovers both.Testing
npm run checkpasses. New tests cover the wire format of the entry and the block, lenient and strict fields, malformed entries in a command list, both capabilities at each level, and the fallback schemas with the feature on and off.I compiled these feature combinations by hand, with and without
schemars: the feature with v2, with v2 and prompt suggestions, and without v2. I did not run the fullcargo hackpowerset locally. The docs site is not rendered locally, so the new anchors are unverified.