返回技能列表

design-a2a-agent-card

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

关于

This skill generates an A2A Agent Card manifest (agent.json) that defines an agent's capabilities, authentication, and supported content types for interoperability. Use it when building discoverable agents for multi-agent orchestration or migrating existing agents to the A2A protocol. It helps establish the public contract for agent integration and registry consumption.

快速安装

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 中复制并粘贴此命令以安装该技能

技能文档

設計 A2A 代理卡

建合標 A2A 代理卡,宣告代理身份、技能、認證、能力,為他代理所發現。

  • 構代理須為他 A2A 代理所發現
  • 露代理能力於多代理編排
  • 遷現代理至 A2A 協議
  • 實作前定代理公契約
  • 接代理註冊處或目錄

  • :代理名+述
  • :技能列(名、述、入/出 schema)
  • :代理托管基 URL
  • :認證法(noneoauth2oidcapi-key
  • :超 text/plain 之內容型(如 image/pngapplication/json
  • :能力標(流、推通知、狀態轉換歷史)
  • :供應方組織名+URL

一:定代理身份+述

1.1. 擇身份字段:

{
  "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. 書清晰可行之述答:

  • 覆何域?
  • 可理何任務?
  • 有何限?

1.3. 設代理卡服務之規範 URL 於 /.well-known/agent.json

得: 完整身份塊含名、述、URL、供應方、版本。

敗: 代理覆多域→思當為一含多技能代理抑多聚焦代理。A2A 偏聚焦代理含清界。

二:列技能含入/出 schema

2.1. 定每技能:

{
  "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. 每技能供:

  • id:獨識(kebab-case)
  • name:人可讀名
  • description:一二句述
  • tags:發現關鍵字
  • examples:觸此技能之自然語例
  • inputModes:接 MIME 型
  • outputModes:生 MIME 型

2.3. 確技能界清不重疊。每任務當精映一技能。

得: 技能數組,每項有 id、name、description、tags、examples、I/O 模式。

敗: 技能重疊甚→合為一較廣技能含多例。技能過廣→拆為聚焦子技能。

三:配認證

3.1. 按部署上下文定認證:

無認證(本地/信任網):

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

OAuth 2.0(生產宜):

{
  "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(簡共享密):

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

3.2. 擇最小可行認證匹部署環境:

  • 本地開發:none
  • 內部服務:apiKey
  • 公面代理:oauth2oidc

3.3. 錄令牌/鑰配給流於代理卡供應方段或外文檔。

得: 認證塊匹部署安全要求。

敗: 無 OAuth 2.0 設施→起於 API 鑰認證+計遷。勿部公代理以 none 認證。

四:指明能力

4.1. 宣告代理支何協議功能:

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

4.2. 按實作就緒設每能力標:

  • streamingtrue 若代理支經 tasks/sendSubscribe 之 SSE 流。啟長任務實時進度。
  • pushNotificationstrue 若代理可於任務狀態變時送 webhook 回調。需代理存+調 webhook URL。
  • stateTransitionHistorytrue 若代理維任務狀態轉換全史(submitted、working、completed 等)。利審計跡。

4.3. 僅當實作全支時設為 true。宣未支能力破互操作性。

得: 能力對象含匹實實作之布爾標。

敗: 未定能力將實作否→設為 false。能力可於後版加。除能力為破壞變。

五:驗+發代理卡

5.1. 組完整代理卡:

{
  "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. 驗代理卡:

  • 解 JSON 驗無語法錯
  • 驗諸必字段存(name、description、url、skills)
  • 驗每技能有 id、name、description,至少一入/出模式
  • 驗 URL 可達並於 /.well-known/agent.json 服卡

5.3. 發代理卡:

  • https://<agent-url>/.well-known/agent.json
  • Content-Type: application/json
  • 跨源發現→啟 CORS 頭
  • 於相關代理目錄/註冊處註冊

5.4. 以拉卡測發現:

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

得: 有效 JSON 代理卡於 well-known URL 服,可為任 A2A 客戶解析。

敗: JSON 驗失→用 JSON linter 察語法錯。URL 不可達→查 DNS、SSL 證、服務器配。需 CORS→加 Access-Control-Allow-Origin 頭。

  • 代理卡為有效 JSON 無語法錯
  • 諸必字段存:name、description、url、skills
  • 每技能有 id、name、description、inputModes、outputModes
  • 認證方案匹部署安全要求
  • 能力標準確反映實作狀態
  • 代理卡於 /.well-known/agent.json 含正 Content-Type 服
  • A2A 客戶可成拉+解卡
  • 技能之例現實且觸正技能

  • 過諾能力:設 streaming: truepushNotifications: true 而無實作→用此功能時客戶失敗。宜保守。
  • 技能述模糊:「做數據事」防精確匹。宜具體陳入、出、域。
  • 缺 CORS 頭:無正 CORS 配瀏覽器 A2A 客戶不可拉卡。
  • 技能重疊:兩技能可理同任務→客戶代理不能定調何。確清界。
  • 忘默認模式:省 defaultInputModesdefaultOutputModes→客戶或不知送何內容型。
  • 版本停滯:技能/能力變時更卡版本。客戶或緩舊版。
  • 實作前發:代理卡為契約。發未實作技能→運行時失。

  • implement-a2a-server
  • test-a2a-interop
  • build-custom-mcp-server
  • configure-mcp-server

GitHub 仓库

pjt222/agent-almanac
路径: i18n/wenyan-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是理想选择。

查看技能