Basic Skills on a Team
Attach Skills to a Team leader so it gets domain expertise (instructions, references, scripts) directly.
"""
Basic Skills on a Team
=============================
Shows how to attach Skills to a Team leader so it gets domain expertise
(instructions, references, scripts) directly — without needing to delegate
to a member agent.
"""
from pathlib import Path
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.skills import LocalSkills, Skills
from agno.team.team import Team
# ---------------------------------------------------------------------------
# Skills — loaded from the same sample directory used by basic_skills.py
# ---------------------------------------------------------------------------
skills_dir = Path(__file__).parent / "sample_skills"
# ---------------------------------------------------------------------------
# Member Agents
# ---------------------------------------------------------------------------
implementer = Agent(
name="Implementer",
role="Write code based on the review feedback",
model=OpenAIResponses(id="gpt-5.2"),
instructions=[
"You write clean, well-tested Python code.",
"When given review feedback, produce an improved version of the code.",
],
)
# ---------------------------------------------------------------------------
# Team with Skills on the leader
# ---------------------------------------------------------------------------
review_team = Team(
name="Code Review Team",
model=OpenAIResponses(id="gpt-5.2"),
members=[implementer],
skills=Skills(loaders=[LocalSkills(str(skills_dir))]),
instructions=[
"You are a team leader with access to code review skills.",
"Use your skills to review code, then delegate implementation work to the Implementer.",
],
markdown=True,
show_members_responses=True,
)
# ---------------------------------------------------------------------------
# Run Team
# ---------------------------------------------------------------------------
if __name__ == "__main__":
review_team.print_response(
"Review this Python code and suggest improvements, "
"then have the Implementer write the improved version:\n\n"
"```python\n"
"def calculate_total(items):\n"
" total = 0\n"
" for i in range(len(items)):\n"
" total = total + items[i]['price'] * items[i]['quantity']\n"
" return total\n"
"```",
stream=True,
)Keep the sample skills beside the script
The checkout below includes sample_skills/code-review and sample_skills/git-workflow. If you copy the Python file elsewhere, copy that directory beside it too. LocalSkills loads the directory at construction; an absent directory leaves this Skills collection empty.
The leader receives skill metadata and tools to load instructions, references, and scripts on demand. The Implementer does not inherit the leader's skills. Its proposed code is returned as text; no tool on that member writes the revised program to your repository. Skill scripts run only when the leader requests get_skill_script(..., execute=True).
Run the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno openaiExport your OpenAI API key
export OPENAI_API_KEY="your_openai_api_key_here"Clone Agno
Clone the pinned Agno source and run the remaining commands from its root:
git clone https://github.com/agno-agi/agno.git
cd agno
git checkout d703c34f3abf3c41275d3fb2da6e0518a8881f24Run the example
Run the example from the repository root:
python cookbook/02_agents/16_skills/basic_skills_team.pyFull source: cookbook/02_agents/16_skills/basic_skills_team.py