Skip to main content

Skill Tools

Category: skills · 4 tools

LLM-callable tools for managing the skill library at runtime — create, read, update, and list .skill.md files from within an agent session.

Setup

Import

import { createSkillTools } from 'toolpack-sdk';

Wire up with Toolpack

Pair createSkillTools with createSkillInterceptor so that skills created at runtime are immediately picked up by the interceptor:

import { Toolpack, createSkillInterceptor, createSkillTools } from 'toolpack-sdk';

const toolpack = await Toolpack.init({
provider: 'anthropic',
interceptors: [
createSkillInterceptor({ dir: '.toolpack/skills' }),
],
customTools: [
createSkillTools({ dir: '.toolpack/skills' }),
],
});

Both functions must point to the same dir.

Tools

ToolRequired ParametersOptional ParametersDescription
skill.createname, title, description, triggers, instructionstags, versionWrite a new .skill.md file to the skills directory
skill.readnamesectionRead a skill by name, optionally a specific section
skill.updatenametitle, description, triggers, instructions, addExamples, addTagsUpdate fields of an existing skill
skill.listtag, verboseList all skills, optionally filtered by tag

Tool Reference

skill.create

Write a new .skill.md file to the skills directory. The file name is derived from name (e.g., code-reviewcode-review.skill.md). Validation runs before writing — the call fails if any field violates the character limits or format rules.

ParameterTypeRequiredDescription
namestringYesUnique skill identifier in kebab-case (^[a-z][a-z0-9-]*$), max 50 chars
titlestringYesHuman-readable display name, max 100 chars
descriptionstringYesShort description used for BM25 indexing (not injected into context), max 300 chars
triggersstring[]Yes1–10 example phrases that should activate this skill, each max 100 chars
instructionsstringYesBehavioral instructions injected into the agent's context when the skill matches, max 2000 chars
tagsstring[]NoOptional tags for filtering. Max 10 tags, each max 30 chars
versionstringNoSemver version string (default: 1.0.0)

skill.read

Read a skill file by name. When section is omitted the full file content is returned. Use this to inspect a skill before updating it, or to load the examples section (which is never auto-injected by the interceptor).

ParameterTypeRequiredDescription
namestringYesSkill identifier (kebab-case, without the .skill.md suffix)
sectionstringNoWhich section to return: all (default), metadata, description, triggers, instructions, or examples

skill.update

Update one or more fields of an existing skill. Only the fields provided are changed — all others remain as they are. The updated timestamp in the frontmatter is refreshed automatically on every write.

ParameterTypeRequiredDescription
namestringYesIdentifier of the skill to update
titlestringNoNew display name, max 100 chars
descriptionstringNoNew description for BM25 indexing, max 300 chars
triggersstring[]NoReplacement trigger list (1–10 items, each max 100 chars). Replaces the existing list entirely
instructionsstringNoReplacement instructions text, max 2000 chars. Replaces the existing instructions entirely
addExamplesstringNoContent to append to the ## Examples section (creates the section if it does not exist)
addTagsstring[]NoTags to add to the existing tag list. Duplicates are ignored

skill.list

List all .skill.md files found in the skills directory, including subdirectories. In default mode returns name, title, category, and tags. In verbose mode also includes description and triggers.

ParameterTypeRequiredDescription
tagstringNoFilter results to skills that include this tag
verbosebooleanNoWhen true, include description and triggers in the output for each skill

Examples

Creating a Skill

const stream = toolpack.stream({
messages: [{
role: 'user',
content: 'Create a skill for writing concise commit messages',
}],
model: 'claude-sonnet-4-20250514',
});
// AI uses skill.create with name "commit-messages", appropriate triggers, and instructions

Reading a Skill's Examples

const stream = toolpack.stream({
messages: [{
role: 'user',
content: 'Show me the examples section of the code-review skill',
}],
model: 'claude-sonnet-4-20250514',
});
// AI uses skill.read with name "code-review" and section "examples"

Refining Instructions

const stream = toolpack.stream({
messages: [{
role: 'user',
content: 'Update the code-review skill to also require a summary comment at the top of each review',
}],
model: 'claude-sonnet-4-20250514',
});
// AI uses skill.read to get current instructions, then skill.update with revised instructions

Listing Skills by Tag

const stream = toolpack.stream({
messages: [{
role: 'user',
content: 'What coding skills do we have available?',
}],
model: 'claude-sonnet-4-20250514',
});
// AI uses skill.list with tag "coding" and verbose true
  • Skills Guide — Full guide covering the .skill.md format, interceptor setup, BM25 details, and best practices