Defining a skill
description field is what the LLM reads to decide when to call this skill. Write it as if you’re explaining the skill to the model: when to use it, what it does, and what it returns.
Input parameters
Skill parameters become the JSON schema that the LLM uses to construct the call. GitAgent infers the schema from Python type hints.str, int, float, bool, list, dict, list[str], dict[str, str], and None for optional fields.
Explicit schema
Override the auto-generated schema with explicit OpenAPI-compatible JSON Schema:Output types
Skills can return any JSON-serializable value. Common patterns:SkillError is reported to the LLM as a tool error — the LLM can then decide how to handle it (retry, explain to user, try a different approach).
Skill organization
Skills can be a single.py file or a Python package:
__init__.py for a package skill must export the decorated function:
Async skills
Skill metadata
Additional metadata for documentation and tooling:Testing skills
Test skills as regular Python functions:Best practices
Name skills precisely. The name is used in traces and logs.search_internal_knowledge_base is better than search.
One action per skill. send_email and read_email should be separate skills. The LLM handles composition.
Return structured data when possible. Return {"result": value, "metadata": {...}} rather than plain strings — it gives downstream skills and hooks richer data to work with.
Write descriptions from the LLM’s perspective. Describe when to call the skill, not just what it does. Include the types of questions or tasks it handles.
Handle errors gracefully. Raise SkillError with a clear message rather than letting exceptions bubble up as opaque failures.