Skip to main content

Use skills with agents

Attaching a SkillCatalog lets the agent discover instructions on demand and enables tools only when their required skill is active.

import asyncio
from ish import Agent, SkillRegistry

skills = SkillRegistry()
skills.add_search_path("./.agents/skills")

agent = Agent(
model="gpt-4o-mini",
instructions="Help with the user's task. Use an available skill when relevant.",
skills=skills,
max_active_skills=5,
)

async def main() -> None:
try:
result = await agent.run("Review our deployment checklist and verify prerequisites.")
print(result.content)
finally:
agent.close()

asyncio.run(main())

A skill-enabled agent receives a short catalog, then reads and activates a skill only when it is relevant. The active skill's instructions are added to the model context; its gated tools become available at that point.

What happens when an agent activates a skill​

Skill tools​

A skill-enabled agent can search the catalog, read a skill's instructions or reference files, and activate a skill. The catalog search and file reads do not make a skill active; activation adds its instructions and enables any tools gated by that skill.

ToolUse it to
search_skillsFind a relevant skill by name or description
read_skillRead instructions or a file within the skill directory
activate_skillAdd a skill's instructions and enable its tools

Limit the number of active skills​

Set max_active_skills to bound how many skills remain active at once. Activating a skill already in the active set makes it recent; when the limit is reached, the least recently used skill is removed. Deactivation takes effect before the next model request.

Gate tools by skill​

Use requires_skill for tools that should appear only while a named skill is active. The runtime hides inactive tools from the model and checks the requirement again before execution. For skill file layout and safe path rules, see Authoring Skills.