API Agent Development
БесплатноБез исполняемых скриптовНе проверенCreate API agents that wrap external HTTP services (n8n, LangGraph, CrewAI, OpenAI endpoints). Configure request/response transforms, webhook status tracking…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
API Agent Development Skill
CRITICAL: API agents wrap external HTTP services. They use request/response transforms to adapt between Orchestrator AI's format and the external service's format. Status webhook URLs MUST read from environment variables.
When to Use This Skill
Use this skill when:
- Wrapping n8n workflows as API agents
- Wrapping LangGraph/CrewAI/OpenAI endpoints as API agents
- Creating agents that call external HTTP services
- Configuring request/response transformations
- Setting up webhook status tracking
- Ensuring A2A protocol compliance
API Agent Structure
API agents wrap external HTTP endpoints and transform requests/responses. They follow this structure:
Minimal API Agent Configuration
From demo-agents/productivity/jokes_agent/agent.yaml:
api_configuration:
endpoint: "http://localhost:5678/webhook/f7387dc8-c6e4-460d-9a0c-685c86d76d1f"
method: "POST"
timeout: 30000
headers:
Content-Type: "application/json"
authentication: null
request_transform:
format: "custom"
template: '{"sessionId": "{{sessionId}}", "prompt": "{{userMessage}}"}'
response_transform:
format: "field_extraction"
field: "output"
Full API Agent Configuration
Complete example with all options:
metadata:
name: "marketing-swarm-n8n"
displayName: "Marketing Swarm N8N"
description: "API agent that calls n8n webhook for marketing campaign swarm processing"
version: "0.1.0"
type: "api"
api_configuration:
endpoint: "http://localhost:5678/webhook/marketing-swarm-flexible"
method: "POST"
timeout: 120000
headers:
Content-Type: "application/json"
authentication:
type: "none"
request_transform:
format: "custom"
template: |
{
"taskId": "{{taskId}}",
"conversationId": "{{conversationId}}",
"userId": "{{userId}}",
"announcement": "{{userMessage}}",
"statusWebhook": "{{env.API_BASE_URL}}/webhooks/status",
"provider": "{{payload.provider}}",
"model": "{{payload.model}}"
}
response_transform:
format: "field_extraction"
field: "payload.content"
configuration:
execution_capabilities:
supports_converse: false
supports_plan: false
supports_build: true
deliverable:
format: "markdown"
type: "marketing-campaign"
Request Transform: Building API Requests
Template Variables Available
From apps/api/src/agent-platform/services/agent-runtime-dispatch.service.ts:
private buildApiRequestBody(
api: NonNullable<AgentRuntimeDefinition['transport']>['api'],
options: AgentRuntimeDispatchOptions,
): unknown {
const t = api?.requestTransform;
const sessionId =
options.request.sessionId ?? options.request.conversationId ?? null;
const userMessage = options.prompt.userMessage ?? '';
const conversationId = options.request.conversationId ?? null;
const agentSlug = options.definition.slug;
const organizationSlug = options.definition.organizationSlug ?? null;
if (t && t.format === 'custom' && typeof t.template === 'string') {
try {
const rendered = t.template.replace(
/\{\{\s*(\w+)\s*\}\}/g,
(_m, key) => {
switch (String(key)) {
case 'userMessage':
case 'prompt':
return userMessage;
case 'sessionId':
return String(sessionId ?? '');
case 'conversationId':
return String(conversationId ?? '');
case 'agentSlug':
return String(agentSlug ?? '');
case 'organizationSlug':
case 'org':
return String(organizationSlug ?? '');
default:
return '';
}
},
);
// If the template is JSON-like, parse it; otherwise send as string
const maybeJson = rendered.trim();
if (
(maybeJson.startsWith('{') && maybeJson.endsWith('}')) ||
(maybeJson.startsWith('[') && maybeJson.endsWith(']'))
) {
return JSON.parse(maybeJson);
}
return rendered;
} catch {
// Fall through to minimal body
}
}
// Minimal default body expected by n8n: send only prompt
return { prompt: userMessage };
}
Available Template Variables:
| Variable | Description | Example |
|---|---|---|
{{userMessage}} |
User's message/prompt | "Write a blog post about AI" |
{{prompt}} |
Alias for userMessage |
Same as above |
{{sessionId}} |
Session identifier | "session-123" |
{{conversationId}} |
Conversation identifier | "conv-456" |
{{taskId}} |
Task identifier | "task-789" |
{{agentSlug}} |
Agent slug | "marketing-swarm-n8n" |
{{organizationSlug}} |
Organization sl |
Установить API Agent Development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGrepGlobВложенные файлы
FAQ
Что делает скилл API Agent Development?
Create API agents that wrap external HTTP services (n8n, LangGraph, CrewAI, OpenAI endpoints). Configure request/response transforms, webhook status tracking, A2A protocol compliance. CRITICAL: Request transforms use template variables ({{userMessage}}, {{conversationId}}, etc.). Response transforms use field extraction. Status webhook URL must read from environment variables.
Как установить скилл API Agent Development?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл API Agent Development запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic