skills only.Expand description
Agent Skills in the tool loop, without running their scripts (ADR 0035;
feature skills).
Agent Skills is a format for reusable
procedures: a directory with a SKILL.md (YAML frontmatter with a name
and a description, then Markdown instructions) and optionally
scripts/, references/ and assets/. A client tells the model each
skill’s name and description, and loads a skill’s instructions, then its
files, only when the task calls for them. It is not A2A’s AgentSkill,
which an agent card advertises to other agents; the two meet in
SkillCatalog::agent_skills.
skills directory ──discover──→ SkillCatalog ──┬─ prompt() ─→ system prompt (names, descriptions)
(SKILL.md files) + diagnostics ├─ activate_skill ─→ the instructions
└─ read_skill_file ─→ references/, assets/ (confined)
scripts/ are listed as present, never run§Use
use a2a_protocol_server::skills::{SkillCatalog, SkillSource, SkillsConfig};
use a2a_protocol_server::tool_loop::{OpenAiChatModel, ToolLoop, ToolLoopExecutor, ToolSet};
let catalog = SkillCatalog::discover(
&SkillsConfig::new().with_source(SkillSource::operator("/etc/my-agent/skills")),
);
for problem in catalog.diagnostics() {
eprintln!("{problem}");
}
let model = OpenAiChatModel::new("http://127.0.0.1:8080/v1", "qwen3:1.7b")?;
let executor = ToolLoopExecutor::new(ToolLoop::new(model, ToolSet::new()))
.with_skills(&catalog)?;§What it does and does not do
- Discovery never fails.
SkillCatalog::discoverreturns a catalog and a list ofSkillDiagnostics. ASKILL.mdthat is malformed, or whose name is not its directory’s, is reported and, where it can be used safely, still used; one that cannot is skipped, with the reason. Nothing panics and start-up is not refused. - Bounded. At most
DEFAULT_MAX_SKILLSskills, a description of at mostDEFAULT_MAX_DESCRIPTION_CHARScharacters in the prompt, a body of at mostDEFAULT_MAX_BODY_BYTESand a file of at mostDEFAULT_MAX_RESOURCE_BYTESreturned; each is set onSkillsConfig. The frontmatter’s size is checked before it is read as YAML. - No script is run.
scripts/is listed to the model as present andread_skill_filedoes not return it. Running them needs a sandbox this SDK does not have, and a skills directory is an injection channel (docs/injection-containment.md). - No skill widens the tool set.
allowed-toolsis recorded and never acted on. - Trust by scope. An operator directory (
SkillSource::operator) is the operator’s own text. A project directory (SkillSource::project) is not read until the operator marks it trusted, and its skills never take the name of an operator’s. - A snapshot. Skills are read at
discoverand not again: the prompt and the tools’ schemas stay what the model was told. Discover again, and build a new executor, to pick up a change.
§The specification
Agent Skills has no versioned releases, so this module follows the
specification text as read on SPEC_SNAPSHOT, and names that date in
the diagnostics about fields it does not know. The YAML frontmatter is read
by a reader of the subset the specification’s reference parser accepts
(all scalars are strings; no anchors, aliases, tags or flow collections),
in this crate, because that is a small job and adds no dependency (ADR
0035, decision 9).
Structs§
- Activate
Skill Tool activate_skill: returns a skill’s instructions and lists its files.- Read
Skill File Tool read_skill_file: returns the text of a file under a skill’sreferences/orassets/, through the confined reader.- Skill
- One skill: a directory with a
SKILL.md, read at discovery. - Skill
Catalog - The skills found in the configured directories, and what was noticed on the way.
- Skill
Diagnostic - One thing discovery noticed. See
SkillCatalog::diagnostics. - Skill
Source - One directory whose subdirectories are skills.
- Skills
Config - What
SkillCatalog::discoverscans and the bounds it keeps to.
Enums§
- Diagnostic
Kind - What a diagnostic is about, stable enough to match on. The message says the particulars.
- Severity
- How much a diagnostic matters.
- Skill
Scope - Where a skills directory comes from, which decides how far it is trusted.
Constants§
- ACTIVATE_
SKILL_ TOOL - The name of the tool that loads a skill’s instructions.
- AGENT_
SKILL_ TAG - The tag on the
AgentSkilla skill is advertised as. - DEFAULT_
MAX_ BODY_ BYTES - The largest
SKILL.mdbody kept when no other bound is set: 64 KiB. - DEFAULT_
MAX_ DESCRIPTION_ CHARS - The most characters of a description the prompt’s catalog shows when no other bound is set.
- DEFAULT_
MAX_ RESOURCE_ BYTES - The largest file
read_skill_filereturns when no other bound is set: 64 KiB. A larger file is refused, not truncated. - DEFAULT_
MAX_ SKILLS - The most skills a catalog holds when no other bound is set.
- READ_
SKILL_ FILE_ TOOL - The name of the tool that reads a file a skill bundles.
- SPEC_
SNAPSHOT - The date the specification text this module follows was read, as
YYYY-MM-DD. Named in the diagnostics about fields this module does not understand, because the specification may have changed since.