yaalalabs/agent-kernel/ak-build
Claude Code and agent skill by yaalalabs/agent-kernel
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Add tools, agents, and handoffs to an existing Agent Kernel project. This skill guides you through reading the current project, understanding its framework and structure, then making context-aware additions — new tools, new agents, agent-to-agent handoffs, and Module wiring. The workhorse skill for iterative agent development.
Install
npx vskill@latest install yaalalabs/agent-kernel/ak-buildSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Build: Add Tools & Agents
Use this skill to add new tools, agents, or handoffs to an existing Agent Kernel project.
Instructions for the Agent
Step 1: Read the Existing Project
Before generating any code, inspect the project to determine:
- Framework — Open the main agent file (e.g.,
app.py,demo.py,server.py,lambda.py) and look for:
from agentkernel.openai import OpenAIModule→ OpenAI Agents SDKfrom agentkernel.langgraph import LangGraphModule→ LangGraphfrom agentkernel.crewai import CrewAIModule→ CrewAIfrom agentkernel.adk import GoogleADKModule→ Google ADKfrom agentkernel.smolagents import SmolagentsModule→ Smolagentsfrom agentkernel.pydanticai import PydanticAIModule→ Pydantic AIfrom agentkernel.maf import MAFModule→ Microsoft Agent Framework
- Existing agents — List every agent already defined (names, roles, instructions).
- Existing tools — List every tool function and which agent uses it.
- Entry point — Is it CLI (
demo.py), API (RESTAPI.run()), Lambda (Lambda.handler), or Azure Function?
- Config — Read
config.yamlfor session type, guardrails, tracing, integrations already enabled.
- Dependencies — Read
pyproject.tomlfor the extras already installed (e.g.,[openai,api,redis]).
Report back what you found before proceeding. Example:
Project summary:- Framework: OpenAI Agents SDK- Entry point:app.py(API mode viaRESTAPI.run())- Agents:triage(routes to sub-agents),math(handles math),general(handles everything else)- Tools:calculator(bound tomath),web_search(bound togeneral)- Session: Redis- Extras:[openai,api,redis]
Step 2: Ask What to Add
Ask the user what they want to add:
- A new tool — A Python function that an agent can call
- A new agent — A new specialist agent
- A handoff — Wire an existing agent to delegate to another
- All of the above — Add a new agent with its own tools and wire it into the existing handoff graph
Step 3: Add a Tool
3a. Write the Tool Function
Create the tool function in the project's tool file (usually tool.py, or wherever existing tools live).
Rules:
- Tool functions are plain Python functions (sync or async) with type annotations and a docstring.
- Use
ToolContext.get()inside the function body to access session and runtime. Never pass context as a parameter. - Use
__(double underscore) as the nested delimiter in environment variable names (e.g.,AK_REDIS__URL).
3b. Bind the Tool to an Agent
The binding syntax depends on the framework. Match what the project already uses:
OpenAI Agents SDK:
LangGraph:
CrewAI:
Google ADK:
Smolagents:
Pydantic AI:
Microsoft Agent Framework:
Gotcha: Always add the new tool to the existingbind()call for that agent. Don't create a secondbind().
Step 4: Add an Agent
4a. Define the Agent
Match the framework already in use:
OpenAI Agents SDK:
LangGraph:
Gotcha (LangGraph): Always passname=tocreate_react_agent(). Without it the agent is unnamed and the supervisor cannot route to it.
CrewAI:
Gotcha (CrewAI): Userole=as the agent identifier — Agent Kernel mapsagent.roleto the agent name. Settingverbose=Falsekeeps output clean.
Google ADK:
Gotcha (Google ADK): UseLiteLlm(model="openai/gpt-4o-mini")— never pass a bare model string like"gpt-4o-mini".
Smolagents:
Pydantic AI:
Gotcha (Pydantic AI): Always passname=(AK registers by name eagerly; Pydantic AI otherwise infers it lazily at first run) anddescription=(Pydantic AI's description is optional but is what AK reports as the agent description / A2A summary). The provider key for the model string (e.g.OPENAI_API_KEY) must be set at import time — Pydantic AI resolves the provider at construction.
Microsoft Agent Framework:
Gotcha (Microsoft Agent Framework): Always passname=—MAFModuleraisesValueErrorfor an unnamed agent because AK registers agents by name immediately.
4b. Register with the Module
Add the new agent to the existing Module constructor call. Do not create a second Module.
This applies to all frameworks — LangGraphModule, CrewAIModule, GoogleADKModule, SmolagentsModule, PydanticAIModule, MAFModule work the same way.
4c. Structured Output (Optional)
To make an agent return a typed dict instead of plain text, define a Pydantic model and configure it on the agent (or, for CrewAI, on the module). The runner returns an AgentReplyAny whose content is the result as a dict; str(reply) is the JSON serialization, so text-based consumers (CLI, chat integrations) work unchanged. Applies to non-streaming execution only.
| Framework | How to configure | |
|---|---|---|
| OpenAI Agents SDK | Agent(..., output_type=OrderStatus) | |
| LangGraph | create_react_agent(..., response_format=OrderStatus) | |
| CrewAI | CrewAIModule([agent], output_pydantic={"support": OrderStatus}) — or output_json={...}; keyed by agent role | |
| Google ADK | LlmAgent(..., output_schema=OrderStatus) | |
| Smolagents | No schema parameter — have the agent pass a dict or Pydantic instance to final_answer |
Gotcha (CrewAI): CrewAI puts the output schema on theTask, not theAgent— and Agent Kernel builds the task internally per run, so the schema is passed to theCrewAIModuleconstructor keyed by agent role.
Step 5: Add Handoffs
Wire the new agent into the existing routing so the triage/supervisor agent can delegate to it.
OpenAI Agents SDK:
Add the new agent to the triage agent's handoffs list:
Update the triage instructions to mention the new agent:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingak-py/src/agentkernel/skills/ak-build/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/yaalalabs/agent-kernel/ak-build)