Team Skills
Give the team leader direct access to skills without delegating to a member agent.
Pass a Skills instance to the skills parameter on Team. The team leader gets skill tools and system prompt snippets directly.
1from kern.agent import Agent2from kern.models.openai import OpenAIResponses3from kern.skills import Skills, LocalSkills4from kern.team import Team56implementer = Agent(7 name="Implementer",8 role="Write code based on review feedback",9 model=OpenAIResponses(id="gpt-4o"),10)1112team = Team(13 name="Code Review Team",14 model=OpenAIResponses(id="gpt-4o"),15 members=[implementer],16 skills=Skills(loaders=[LocalSkills("/path/to/skills")]),17 instructions=[18 "Use your skills to review code, then delegate implementation to the Implementer.",19 ],20)2122team.print_response("Review this function and improve it", stream=True)The leader model receives:
- Skill summaries in its system prompt (via
get_system_prompt_snippet()) - Skill tools:
get_skill_instructions,get_skill_reference,get_skill_script
Team-Level vs. Member-Level Skills
| Approach | When to use |
|---|---|
Team(skills=...) | The leader needs domain expertise to coordinate (e.g., review standards, routing rules) |
Agent(skills=...) on a member | A specialist agent needs the expertise to do its own work |
| Both | The leader needs context to delegate, and members need context to execute |
How It Works
Skills on a team follow the same pattern as knowledge, memory, and tools:
skills.get_tools()adds skill tools to the leader's tool listskills.get_system_prompt_snippet()injects skill metadata into the leader's system prompt- The leader discovers, loads, and uses skills on demand during the run
Complete Example
1from pathlib import Path23from kern.agent import Agent4from kern.models.openai import OpenAIResponses5from kern.skills import Skills, LocalSkills6from kern.team import Team78skills_dir = Path(__file__).parent / "sample_skills"910implementer = Agent(11 name="Implementer",12 role="Write code based on the review feedback",13 model=OpenAIResponses(id="gpt-4o"),14 instructions=[15 "You write clean, well-tested Python code.",16 "When given review feedback, produce an improved version of the code.",17 ],18)1920review_team = Team(21 name="Code Review Team",22 model=OpenAIResponses(id="gpt-4o"),23 members=[implementer],24 skills=Skills(loaders=[LocalSkills(str(skills_dir))]),25 instructions=[26 "You are a team leader with access to code review skills.",27 "Use your skills to review code, then delegate implementation work to the Implementer.",28 ],29 markdown=True,30 show_members_responses=True,31)3233if __name__ == "__main__":34 review_team.print_response(35 "Review this Python code and suggest improvements, "36 "then have the Implementer write the improved version:\n\n"37 "```python\n"38 "def calculate_total(items):\n"39 " total = 0\n"40 " for i in range(len(items)):\n"41 " total = total + items[i]['price'] * items[i]['quantity']\n"42 " return total\n"43 "```",44 stream=True,45 )Next Steps
| Task | Guide |
|---|---|
| Create skills | Creating Skills |
| Load skills into agents | Loading Skills |
| Build teams | Building Teams |