算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
design-a2a-agent-card【设计与创意】Design an A2A Agent Card (.well-known/agent.json) manifest describing agent capabilities, skills, authentication requirements, and supported content types. Use when building an agent that must be discoverable by other A2A-compliant agents, exposing capabilities for multi-agent orchestration, migrating an existing agent to the A2A protocol, defining t…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Make A2A Agent Card. Advertises agent identity, skills, auth, capabilities. Other agents find it.
none, oauth2, oidc, api-key)text/plain (e.g., image/png, application/json)1.1. Pick 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 clear, actionable description. Answer:
1.3. Set canonical URL where Agent Card served at /.well-known/agent.json.
Got: Full identity block: name, description, URL, provider, version.
If fail: Agent covers many domains? Decide: one agent, many skills? Or many agents, focused scope? A2A prefers focused agents, clear boundaries.
2.1. Define each skill:
{
"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 needs:
2.3. Skill boundaries must be clear, no overlap. Each task → one skill.
Got: Skills array. Each entry: id, name, description, tags, examples, I/O modes.
If fail: Skills overlap big? Merge into broader skill with more examples. Skill too broad? Split into focused sub-skills.
3.1. Pick auth scheme by deploy context:
No auth (local/trusted network):
{
"authentication": {
"schemes": []
}
}
OAuth 2.0 (best for 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 (simple shared secret):
{
"authentication": {
"schemes": ["apiKey"],
"credentials": {
"apiKey": {
"headerName": "X-API-Key"
}
}
}
}
3.2. Pick minimum viable auth for env:
noneapiKeyoauth2 or oidc3.3. Document token/key provisioning in provider section or external docs.
Got: Auth block matches deploy security needs.
If fail: No OAuth 2.0 infra? Start with API key, plan migration. Never deploy public agent with none auth.
4.1. Declare protocol features agent supports:
{
"capabilities": {
"streaming": true,
"pushNotifications": false,
"stateTransitionHistory": true
}
}
4.2. Set each flag by impl readiness:
true if agent supports SSE streaming via tasks/sendSubscribe. Real-time progress for long tasks.true if agent can send webhook callbacks on state change. Agent stores + calls webhook URLs.true if agent keeps full state transition history (submitted, working, completed). Good for audit.4.3. Only set true if impl fully supports. Fake flags break interop.
Got: Capabilities object. Flags match real impl.
If fail: Unsure if capability coming? Set false. Add later. Removing capability = breaking change.
5.1. Assemble full 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:
/.well-known/agent.json5.3. Publish:
https://<agent-url>/.well-known/agent.jsonContent-Type: application/json5.4. Test by fetching:
curl -s https://agent.example.com/.well-known/agent.json | python3 -m json.tool
Got: Valid JSON Agent Card at well-known URL. Any A2A client can parse.
If fail: JSON invalid? Use linter to find syntax err. URL unreachable? Check DNS, SSL cert, web server config. CORS needed? Add Access-Control-Allow-Origin headers.
/.well-known/agent.json, right Content-Typestreaming: true or pushNotifications: true without impl = client fails when used. Be conservative.defaultInputModes/defaultOutputModes → clients unsure what content types to send.implement-a2a-server - impl server behind Agent Cardtest-a2a-interop - validate Agent Card conformance + interopbuild-custom-mcp-server - MCP as alt/complement to A2Aconfigure-mcp-server - MCP config patterns for A2A setup