design-a2a-agent-card
关于
This Claude skill generates A2A Agent Card manifests (`agent.json`) to make agents discoverable and interoperable within the A2A protocol ecosystem. It's used when building, migrating, or defining the public contract for an agent that needs to expose its capabilities, skills, and authentication requirements. The output enables multi-agent orchestration and integration with agent registries.
快速安装
Claude Code
推荐npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/design-a2a-agent-card在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Design A2A Agent Card
Create a standards-compliant A2A Agent Card that advertises an agent's identity, skills, authentication requirements, and capabilities for discovery by other agents.
Cuándo Usar
- Building an agent that must be discoverable by other A2A-compliant agents
- Exposing agent capabilities for multi-agent orchestration
- Migrating an existing agent to the A2A (Agent-to-Agent) protocol
- Defining the public contract for an agent before implementation
- Integrating with agent registries or directories that consume Agent Cards
Entradas
- Requerido: Agent name and description
- Requerido: List of skills the agent can perform (name, description, input/output schemas)
- Requerido: Base URL where the agent will be hosted
- Opcional: Authentication method (
none,oauth2,oidc,api-key) - Opcional: Supported content types beyond
text/plain(e.g.,image/png,application/json) - Opcional: Capability flags (streaming, push notifications, state transition history)
- Opcional: Provider organization name and URL
Procedimiento
Paso 1: Define Agent Identity and Description
1.1. Choose the agent identity fields:
{
"name": "data-analysis-agent",
"description": "Performs statistical analysis, data visualization, and report generation on tabular datasets.",
"url": "https://agent.example.com",
"provider": {
"organization": "Example Corp",
"url": "https://example.com"
},
"version": "1.0.0"
}
1.2. Write a clear, actionable description that answers:
- What domains does this agent cover?
- What kinds of tasks can it handle?
- What are its limitations?
1.3. Set the canonical URL where the Agent Card will be served at /.well-known/agent.json.
Esperado: A complete identity block with name, description, URL, provider, and version.
En caso de fallo: If the agent serves multiple domains, consider whether it should be one agent with many skills or multiple agents with focused scopes. A2A favors focused agents with clear boundaries.
Paso 2: Enumerate Skills with Input/Output Schemas
2.1. Define each skill the agent can perform:
{
"skills": [
{
"id": "analyze-dataset",
"name": "Analyze Dataset",
"description": "Run descriptive statistics, correlation analysis, or hypothesis tests on a CSV dataset.",
"tags": ["statistics", "data-analysis", "csv"],
"examples": [
"Analyze the correlation between columns A and B in my dataset",
"Run a t-test comparing group 1 and group 2"
],
"inputModes": ["text/plain", "application/json"],
"outputModes": ["text/plain", "application/json", "image/png"]
},
{
"id": "generate-chart",
"name": "Generate Chart",
"description": "Create bar, line, scatter, or histogram charts from tabular data.",
"tags": ["visualization", "charts"],
"examples": [
"Create a scatter plot of height vs weight",
"Generate a histogram of the age column"
],
"inputModes": ["text/plain", "application/json"],
"outputModes": ["image/png", "image/svg+xml"]
}
]
}
2.2. For each skill, provide:
- id: Unique identifier (kebab-case)
- name: Human-readable display name
- description: What the skill does, in one to two sentences
- tags: Searchable keywords for discovery
- examples: Natural language task examples that trigger this skill
- inputModes: MIME types the skill accepts
- outputModes: MIME types the skill can produce
2.3. Ensure skill boundaries are clear and non-overlapping. Each task should map to exactly one skill.
Esperado: A skills array where each entry has id, name, description, tags, examples, and I/O modes.
En caso de fallo: If skills overlap significantly, merge them into a single broader skill with more examples. If a skill is too broad, split it into focused sub-skills.
Paso 3: Configure Authentication
3.1. Define the authentication scheme based on deployment context:
No authentication (local/trusted network):
{
"authentication": {
"schemes": []
}
}
OAuth 2.0 (recommended for production):
{
"authentication": {
"schemes": ["oauth2"],
"credentials": {
"oauth2": {
"authorizationUrl": "https://auth.example.com/authorize",
"tokenUrl": "https://auth.example.com/token",
"scopes": {
"agent:invoke": "Invoke agent skills",
"agent:read": "Read task status"
}
}
}
}
}
API Key (simple shared-secret):
{
"authentication": {
"schemes": ["apiKey"],
"credentials": {
"apiKey": {
"headerName": "X-API-Key"
}
}
}
}
3.2. Choose the minimum viable authentication for the deployment environment:
- Local development:
none - Internal services:
apiKey - Public-facing agents:
oauth2oroidc
3.3. Document the token/key provisioning process in the Agent Card's provider section or external documentation.
Esperado: An authentication block matching the deployment security requirements.
En caso de fallo: If OAuth 2.0 infrastructure is not available, start with API key authentication and plan migration. Never deploy a public agent with none authentication.
Paso 4: Specify Capabilities
4.1. Declare what protocol features the agent supports:
{
"capabilities": {
"streaming": true,
"pushNotifications": false,
"stateTransitionHistory": true
}
}
4.2. Set each capability flag based on implementation readiness:
- streaming:
trueif the agent supports SSE streaming viatasks/sendSubscribe. Enables real-time progress updates for long-running tasks. - pushNotifications:
trueif the agent can send webhook callbacks when task state changes. Requires the agent to store and call back webhook URLs. - stateTransitionHistory:
trueif the agent maintains a full history of task state transitions (submitted, working, completed, etc.). Useful for audit trails.
4.3. Only set capabilities to true if the implementation fully supports them. Advertising unsupported capabilities breaks interoperability.
Esperado: A capabilities object with boolean flags matching actual implementation.
En caso de fallo: If unsure whether a capability will be implemented, set it to false. Capabilities can be added in future versions. Removing a capability is a breaking change.
Paso 5: Validate and Publish Agent Card
5.1. Assemble the complete Agent Card:
{
"name": "data-analysis-agent",
"description": "Performs statistical analysis and visualization on tabular datasets.",
"url": "https://agent.example.com",
"version": "1.0.0",
"provider": {
"organization": "Example Corp",
"url": "https://example.com"
},
"authentication": {
"schemes": ["oauth2"],
"credentials": { ... }
},
"capabilities": {
"streaming": true,
"pushNotifications": false,
"stateTransitionHistory": true
},
"skills": [ ... ],
"defaultInputModes": ["text/plain"],
"defaultOutputModes": ["text/plain"]
}
5.2. Validate the Agent Card:
- Parse as JSON and verify no syntax errors
- Verify all required fields are present (name, description, url, skills)
- Verify each skill has id, name, description, and at least one input/output mode
- Verify the URL is reachable and serves the card at
/.well-known/agent.json
5.3. Publish the Agent Card:
- Serve at
https://<agent-url>/.well-known/agent.json - Set
Content-Type: application/json - Enable CORS headers if cross-origin discovery is needed
- Register with any relevant agent directories or registries
5.4. Test discovery by fetching the card:
curl -s https://agent.example.com/.well-known/agent.json | python3 -m json.tool
Esperado: A valid JSON Agent Card served at the well-known URL, parseable by any A2A client.
En caso de fallo: If JSON validation fails, use a JSON linter to identify syntax errors. If the URL is not reachable, check DNS, SSL certificates, and web server configuration. If CORS is needed, add Access-Control-Allow-Origin headers.
Validación
- Agent Card is valid JSON with no syntax errors
- All required fields are present: name, description, url, skills
- Each skill has id, name, description, inputModes, and outputModes
- Authentication scheme matches deployment security requirements
- Capability flags accurately reflect implementation status
- Agent Card is served at
/.well-known/agent.jsonwith correct Content-Type - A2A clients can fetch and parse the card successfully
- Examples in skills are realistic and trigger the correct skill
Errores Comunes
- Overpromising capabilities: Setting
streaming: trueorpushNotifications: truewithout implementation causes client failures when those features are used. Be conservative. - Vague skill descriptions: Descriptions like "does data stuff" prevent accurate skill matching. Be specific about inputs, outputs, and domains.
- Missing CORS headers: Browser-based A2A clients cannot fetch the Agent Card without proper CORS configuration.
- Skill overlap: If two skills could handle the same task, client agents cannot determine which to invoke. Ensure clear boundaries.
- Forgetting default modes: If
defaultInputModesanddefaultOutputModesare omitted, clients may not know what content types to send. - Version stagnation: Update the Agent Card version when skills or capabilities change. Clients may cache old versions.
- Publishing before implementation: The Agent Card is a contract. Publishing skills that are not yet implemented leads to runtime failures.
Habilidades Relacionadas
implement-a2a-server- implement the server behind the Agent Cardtest-a2a-interop- validate Agent Card conformance and interoperabilitybuild-custom-mcp-server- MCP server as alternative/complement to A2Aconfigure-mcp-server- MCP configuration patterns applicable to A2A setup
GitHub 仓库
相关推荐技能
content-collections
元Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。
polymarket
元这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。
creating-opencode-plugins
元该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。
sglang
元SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。
