返回技能列表

design-a2a-agent-card

pjt222
更新于 Yesterday
8 次查看
17
2
17
在 GitHub 上查看
design

关于

This skill generates an A2A Agent Card manifest (.well-known/agent.json) that defines an agent's capabilities, skills, and authentication requirements for interoperability. Use it when building discoverable agents for the A2A protocol, enabling multi-agent orchestration and registry integration. It establishes the public contract for agent capabilities before implementation.

快速安装

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 Agent Card

建合標之 A2A Agent Card,告代理之身、技、認證、能,供他代理發現。

用時

  • 建代理宜由他 A2A 合規代理發現
  • 為多代理編排曝能
  • 將既有代理遷至 A2A(Agent-to-Agent)協議
  • 於實裝前定代理之公契
  • 與消費 Agent Card 之代理冊合

  • 必要:代理名與述
  • 必要:代理所行之技單(名、述、入出之 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,Agent Card 於 /.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. 將令牌/鑰發程記於 Agent Card 之 provider 段或外文檔。

得: 認證塊合部署安要。

敗則: 若無 OAuth 2.0 設施,由 API key 認證始,謀遷。勿以 none 認證部公代理。

第四步:陳能

4.1. 宣代理所支之協議特:

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

4.2. 依實裝備度設各能旗:

  • streaming:若代理支經 tasks/sendSubscribe 之 SSE 流,則 true。啟實時進度更供久任。
  • pushNotifications:若代理可於任變時送 webhook 回調,則 true。代理宜存並呼 webhook URL。
  • stateTransitionHistory:若代理維任全狀變史(submitted、working、completed 等),則 true。審計有用。

4.3. 實裝全支乃設 true。告未支之能破互操。

得: 能塊含布爾旗合實實裝。

敗則: 若不定某能將實裝,設 false。能可後版加。移能為破壞之變。

第五步:驗並發布 Agent Card

5.1. 集全 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. 驗 Agent Card:

  • 以 JSON 解並驗無法錯
  • 驗諸必字段存(name、description、url、skills)
  • 驗各技有 id、name、description 及至少一入/出型
  • 驗 URL 可達且於 /.well-known/agent.json 服卡

5.3. 發布 Agent Card:

  • 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 Agent Card 於 well-known URL 服,諸 A2A 客可解。

敗則: 若 JSON 驗敗,以 linter 尋法錯。若 URL 不達,察 DNS、SSL 證書、web 伺配。若需 CORS,加 Access-Control-Allow-Origin 頭。

  • Agent Card 為有效 JSON 無法錯
  • 諸必字段皆存:name、description、url、skills
  • 各技有 id、name、description、inputModes、outputModes
  • 認證方案合部署安要
  • 能旗準反實裝態
  • Agent Card 於 /.well-known/agent.json 以正 Content-Type 服
  • A2A 客成取並解卡
  • 技之 examples 實際且觸正確之技

  • 過諾能:無實裝而設 streaming: truepushNotifications: true 致客用時敗。宜保守。
  • 技述含糊:「行數據事」之述阻準技匹。對入、出、域宜具體。
  • 缺 CORS 頭:瀏覽器 A2A 客無正 CORS 配不能取 Agent Card。
  • 技疊:若二技可理同任,客代理不能定呼何者。確界清。
  • 忘默模:若 defaultInputModesdefaultOutputModes 略,客或不知送何內容型。
  • 版停:技或能變時宜更 Agent Card 版。客或緩舊版。
  • 實前發布:Agent Card 為契。發布未實之技致運時敗。

Related Skills

  • implement-a2a-server - 實 Agent Card 後之服
  • test-a2a-interop - 驗 Agent Card 合規與互操
  • build-custom-mcp-server - MCP 伺為 A2A 之替/補
  • configure-mcp-server - MCP 配模式可施 A2A 設

GitHub 仓库

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

查看技能