返回技能列表

design-a2a-agent-card

pjt222
更新于 2 days ago
6 次查看
17
2
17
在 GitHub 上查看
design

关于

This skill generates a standards-compliant A2A Agent Card manifest (`agent.json`) to make your agent discoverable and interoperable within multi-agent systems. It defines the agent's capabilities, skills, authentication, and supported content types as a public contract. Use it when building, migrating, or integrating an agent that must work with other A2A-compliant agents and registries.

快速安装

Claude Code

推荐
主要方式
npx skills add pjt222/agent-almanac -a claude-code
插件命令备选方式
/plugin add https://github.com/pjt222/agent-almanac
Git 克隆备选方式
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/design-a2a-agent-card

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

Design A2A Agent Card

Standards-compliant A2A Agent Card → advertises identity, skills, auth, caps for discovery.

Use When

  • Discoverable by other A2A agents
  • Expose caps → multi-agent orchestration
  • Migrate agent → A2A protocol
  • Public contract before impl
  • Integrate → registries

In

  • Required: Agent name + desc
  • Required: Skills list (name, desc, I/O schemas)
  • Required: Base URL host
  • Optional: Auth (none, oauth2, oidc, api-key)
  • Optional: Content types beyond text/plain
  • Optional: Cap flags (streaming, push, state history)
  • Optional: Provider org + URL

Do

Step 1: Identity + desc

1.1. 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. Desc answers:

  • Domains?
  • Tasks?
  • Limitations?

1.3. Canonical URL → /.well-known/agent.json.

→ Complete identity: name, desc, URL, provider, ver.

If err: Multi-domain → one agent w/ many skills vs many focused agents. A2A favors focused w/ clear bounds.

Step 2: Skills + I/O schemas

2.1. Define each:

{
  "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. Each skill:

  • id: Unique (kebab-case)
  • name: Display
  • description: 1-2 sentences
  • tags: Searchable
  • examples: NL task examples
  • inputModes: MIME accepts
  • outputModes: MIME produces

2.3. Bounds clear + non-overlap. Each task → one skill.

→ Skills array w/ id, name, desc, tags, examples, I/O.

If err: Skills overlap → merge broader w/ more examples. Too broad → split focused.

Step 3: Auth

3.1. Scheme by deploy:

No auth (local/trusted):

{
  "authentication": {
    "schemes": []
  }
}

OAuth 2.0 (rec prod):

{
  "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 (shared-secret):

{
  "authentication": {
    "schemes": ["apiKey"],
    "credentials": {
      "apiKey": {
        "headerName": "X-API-Key"
      }
    }
  }
}

3.2. Min viable:

  • Local dev → none
  • Internal svc → apiKey
  • Public → oauth2 / oidc

3.3. Doc token/key provisioning → provider section or external docs.

→ Auth block matches deploy sec reqs.

If err: No OAuth infra → start apiKey + plan migration. NEVER public w/ none.

Step 4: Caps

4.1. Protocol features:

{
  "capabilities": {
    "streaming": true,
    "pushNotifications": false,
    "stateTransitionHistory": true
  }
}

4.2. Flags by impl:

  • streaming: true if SSE via tasks/sendSubscribe. Real-time progress.
  • pushNotifications: true if webhook callbacks on state. Requires store + call webhooks.
  • stateTransitionHistory: true if full history (submitted, working, completed). Audit.

4.3. Only true if fully supported. Advertising unsupported → breaks interop.

→ Caps obj w/ flags matching impl.

If err: Unsure → false. Add in future. Removing = breaking change.

Step 5: Validate + publish

5.1. Assemble:

{
  "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:

  • Parse JSON, no syntax errs
  • Required fields (name, desc, url, skills)
  • Each skill: id, name, desc, ≥1 I/O mode
  • URL reachable, card at /.well-known/agent.json

5.3. Publish:

  • Serve → https://<agent-url>/.well-known/agent.json
  • Content-Type: application/json
  • CORS if cross-origin
  • Register → agent directories

5.4. Test discovery:

curl -s https://agent.example.com/.well-known/agent.json | python3 -m json.tool

→ Valid JSON served at well-known URL, parseable by A2A client.

If err: JSON fail → lint. URL unreachable → DNS, SSL, web server. CORS → Access-Control-Allow-Origin.

Check

  • Valid JSON, no syntax errs
  • Required: name, desc, url, skills
  • Each skill: id, name, desc, inputModes, outputModes
  • Auth matches deploy sec
  • Caps reflect impl
  • Served at /.well-known/agent.json + Content-Type
  • A2A clients fetch + parse OK
  • Examples realistic + trigger correct skill

Traps

  • Overpromising caps: streaming: true / pushNotifications: true w/o impl → client fails. Conservative.
  • Vague skill desc: "does data stuff" → no match. Specific I/O + domains.
  • Missing CORS: Browser A2A clients can't fetch w/o CORS.
  • Skill overlap: 2 skills same task → clients can't pick. Clear bounds.
  • Forget default modes: Missing defaultInputModes/defaultOutputModes → clients no MIME.
  • Ver stagnation: Update ver when skills/caps change. Clients cache.
  • Publish before impl: Card = contract. Publishing un-impl'd → runtime fails.

  • implement-a2a-server — server behind card
  • test-a2a-interop — validate conformance + interop
  • build-custom-mcp-server — MCP alt/complement
  • configure-mcp-server — MCP patterns applicable

GitHub 仓库

pjt222/agent-almanac
路径: i18n/caveman-ultra/skills/design-a2a-agent-card
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

相关推荐技能

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是理想选择。

查看技能