Agentic Development Skill
Load with: base.md + llm-patterns.md + [language].md
For building autonomous AI agents that perform multi-step tasks with tools.
Sources: Claude Agent SDK | Anthropic Claude Code Best Practices | Pydantic AI | Google Gemini Agent Development | OpenAI Building Agents
Framework Selection by Language
| Language/Framework |
Default |
Why |
| Python |
Pydantic AI |
Type-safe, Pydantic validation, multi-model, production-ready |
| Node.js / Next.js |
Claude Agent SDK |
Official Anthropic SDK, tools, multi-agent, native streaming |
Python: Pydantic AI (Default)
from pydantic_ai import Agent
from pydantic import BaseModel
class SearchResult(BaseModel):
title: str
url: str
summary: str
agent = Agent(
'claude-sonnet-4-20250514',
result_type=list[SearchResult],
system_prompt='You are a research assistant.',
)
result = await agent.run('Find articles about AI agents')
for item in result.data:
print(f"{item.title}: {item.url}")
Node.js / Next.js: Claude Agent SDK (Default)
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic();
const tools: Anthropic.Tool[] = [
{
name: "web_search",
description: "Search the web for information",
input_schema: {
type: "object",
properties: {
query: { type: "string", description: "Search query" },
},
required: ["query"],
},
},
];
async function runAgent(prompt: string) {
const messages: Anthropic.MessageParam[] = [
{ role: "user", content: prompt },
];
while (true) {
const response = await client.messages.create({
model: "claude-sonnet-4-20250514",
max_tokens: 4096,
tools,
messages,
});
if (response.stop_reason === "tool_use") {
const toolUse = response.content.find((b) => b.type === "tool_use");
if (toolUse) {
const result = await executeTool(toolUse.name, toolUse.input);
messages.push({ role: "assistant", content: response.content });
messages.push({
role: "user",
content: [{ type: "tool_result", tool_use_id: toolUse.id, content: result }],
});
continue;
}
}
return response.content.find((b) => b.type === "text")?.text;
}
}
Core Principle
Plan first, act incrementally, verify always.
Agents that research and plan before executing consistently outperform those that jump straight to action. Break complex tasks into verifiable steps, use tools judiciously, and maintain clear state throughout execution.
Agent Architecture
Three Components (OpenAI)
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β AGENT β
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Model (Brain) β LLM for reasoning & β
β β decision-making β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββ€
β Tools (Arms/Legs) β APIs, functions, external β
β β systems for action β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββ€
β Instructions β System prompts defining β
β (Rules) β behavior & boundaries β
βββββββββββββββββββββββ΄ββββββββββββββββββββββββββββ
Project Structure
project/
βββ src/
β βββ agents/
β β βββ orchestrator.ts # Main agent coordinator
β β βββ specialized/ # Task-specific agents
β β β βββ researcher.ts
β β β βββ coder.ts
β β β βββ reviewer.ts
β β βββ base.ts # Shared agent interface
β βββ tools/
β β βββ definitions/ # Tool schemas
β β βββ implementations/ # Tool logic
β β βββ registry.ts # Tool discovery
β βββ prompts/
β β βββ system/ # Agent instructions
β β βββ templates/ # Task templates
β βββ memory/
β βββ conversation.ts # Short-term context
β βββ persistent.ts # Long-term storage
βββ tests/
β βββ agents/ # Agent behavior tests
β βββ tools/ # Tool unit tests
β βββ evals/ # End-to-end evaluations
βββ skills/ # Agent skills (Anthropic pattern)
βββ skill-name/
β βββ instructions.md
β βββ scripts/
β βββ resources/
Workflow Pattern: Explore-Plan-Execute-Verify
1. Explore Phase
async function explore(task: Task): Promise<Context> {
const relevantFiles = await agent.searchCodebase(task.query);
const existingPatterns = await agent.analyzePatterns(relevantFiles);
const dependencies = await agent.identifyDependencies(task);
return { relevantFiles, existingPatterns, dependencies };
}
2. Plan Phase (Critical)
async function plan(task: Task, context: Context): Promise<Plan> {
const prompt = `
Task: ${task.description}
Context: ${JSON.stringify(context)}
Create a step-by-step plan. For each step:
1. What action to take
2. What tools to use
3. How to verify success
4. What could go wrong
Output JSON with steps array.
`