SkillsProcessor
The SkillsProcessor is an input processor that adds the available skills to the system message as an <available_skills> list, so the model knows which skills exist and can load one with the skill tool. The agent adds it automatically when its workspace or its own skills option provides skills, so you only configure it yourself to change how skills are presented.
With injectCatalog: false, it replaces the list with a short instruction to find skills with skill_search and load them with skill. Use this when the list costs too many tokens. See Turn off the skills list.
The skill, skill_search, and skill_read tools come from the agent, not from this processor, and stay available in both modes. To replace them with on-demand search_skills and load_skill tools instead, use SkillSearchProcessor. Configure one or the other, not both.
Usage exampleDirect link to Usage example
import { SkillsProcessor } from '@mastra/core/processors'
const skills = new SkillsProcessor({
workspace,
format: 'markdown',
})
Constructor parametersDirect link to Constructor parameters
options:
skills or workspace, not both. With injectCatalog: false, both are optional.workspace?:
workspace.skills.skills?:
injectCatalog?:
skill_search and load them with skill instead of listing every skill. The instruction is added whenever the agent exposes the skill_search tool, so it also covers skills configured on the agent.format?:
injectCatalog: false.formatLocation?:
location of each listed skill. Defaults to ${skill.path}/SKILL.md, a path on the server running the agent. Override it when the model works in a different filesystem, such as a sandbox. Rendered locations are registered as aliases, so the skill and skill_read tools still resolve them. Has no effect with injectCatalog: false.blockingRefresh?:
ReturnsDirect link to Returns
id:
name:
listSkills:
processInputStep:
skill_search instruction to the system message.Extended usage exampleDirect link to Extended usage example
import { Agent } from '@mastra/core/agent'
import { SkillsProcessor } from '@mastra/core/processors'
import { Workspace, LocalFilesystem } from '@mastra/core/workspace'
const workspace = new Workspace({
filesystem: new LocalFilesystem({ basePath: './project' }),
skills: ['skills'],
bm25: true,
})
const agent = new Agent({
id: 'skill-agent',
name: 'skill-agent',
instructions: 'You are a helpful assistant.',
model: 'openai/gpt-6.1-sol',
workspace,
inputProcessors: [new SkillsProcessor({ injectCatalog: false })],
})
With the list turned off, the agent finds skills by searching. skill_search works without any search setup; for larger collections, configure BM25 or vector search on the workspace to improve ranking, as in the example above. The agent workflow is:
- Agent receives a user message
- Agent calls
skill_searchwith keywords (e.g., "release notes") - Agent reviews results and calls
skillwith the skill name - Agent follows the loaded skill's instructions