Bundle instructions, tools, and dependencies into reusable agent capabilities.
Skills are a higher-level abstraction that combines instructions (domain expertise), tools (capabilities), and dependencies (shared config) into a single reusable unit. They’re the recommended way to compose agent behavior.
from definable.agent import Agentfrom definable.model import OpenAIChatfrom definable.skill import Calculator, DateTimeagent = Agent( model=OpenAIChat(id="gpt-4o"), skills=[Calculator(), DateTime()],)output = agent.run("What is 2^10? And what day of the week is it?")print(output.content)
Skills inject their instructions into the system prompt and register their tools automatically.
Subclass Skill for configurable, reusable skills with lifecycle hooks:
from definable.skill import Skillfrom definable.tool.decorator import toolclass CustomerSupport(Skill): name = "customer_support" instructions = "You are a support specialist. Look up orders before answering." def __init__(self, db_url: str): super().__init__(dependencies={"db_url": db_url}) def setup(self): """Called once when the agent initializes.""" self._db = connect(self.dependencies["db_url"]) def teardown(self): """Called when the agent shuts down.""" self._db.close() @tool def lookup_order(self, order_id: str) -> str: """Look up an order by ID.""" return self._db.query(order_id)agent = Agent(model=model, skills=[CustomerSupport(db_url="sqlite:///orders.db")])
Methods decorated with @tool are auto-discovered — no need to pass them explicitly.