算法艺术创作
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 快照 · 自动分类 · 以原作者文档为准
Standards-compliant A2A Agent Card → advertises identity, skills, auth, caps for discovery.
none, oauth2, oidc, api-key)text/plain1.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:
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.
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:
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.
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:
noneapiKeyoauth2 / oidc3.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.
4.1. Protocol features:
{
"capabilities": {
"streaming": true,
"pushNotifications": false,
"stateTransitionHistory": true
}
}
4.2. Flags by impl:
true if SSE via tasks/sendSubscribe. Real-time progress.true if webhook callbacks on state. Requires store + call webhooks.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.
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:
/.well-known/agent.json5.3. Publish:
https://<agent-url>/.well-known/agent.jsonContent-Type: application/json5.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.
/.well-known/agent.json + Content-Typestreaming: true / pushNotifications: true w/o impl → client fails. Conservative.defaultInputModes/defaultOutputModes → clients no MIME.implement-a2a-server — server behind cardtest-a2a-interop — validate conformance + interopbuild-custom-mcp-server — MCP alt/complementconfigure-mcp-server — MCP patterns applicable