Skip to main content
This example is available on GitHub: examples/01_standalone_sdk/03_activate_skill.py
Skills modify agent behavior by injecting additional context and rules. This example shows both always-active skills and keyword-triggered skills:
examples/01_standalone_sdk/03_activate_skill.py
Running the Example

Creating Skills

Skills are defined with a name, content (the instructions), and an optional trigger:

Keyword Triggers

Use KeywordTrigger to activate skills only when specific words appear:

Message Suffixes for AgentContext

Append custom instructions to the system prompt or user messages via AgentContext:
  • system_message_suffix: Appended to system prompt (always active, combined with repo skills)
  • user_message_suffix: Appended to each user message

Replacing the Entire System Prompt

For complete control, provide a custom Jinja2 template via the Agent class:
Custom template example (custom_system_prompt.j2):
Key points:
  • Use relative filenames (e.g., "system_prompt.j2") to load from the agent’s prompts directory
  • Use absolute paths (e.g., "/path/to/prompt.j2") to load from any location
  • Pass variables to the template via system_prompt_kwargs
  • The system_message_suffix from AgentContext is automatically appended after your custom prompt

Next Steps