Repository navigation
docs(agents): add a guide to writing an A2A agent - #279
Merged
Merged
Conversation
A short guide in the agents bundle for contributors and coding agents writing or changing an A2A agent: the folder layout, where each pattern lives in the claude-code and pi agents, where the protocol and the control plane's side are defined, the rules that most often break an agent, and the commands to check a change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the guidance on changing the framework itself (release pins, where the shipped agents' tests and README entries go, protocol changes) and keep what someone writing an agent needs: the agent's shape, where each pattern lives in the claude-code and pi agents, the protocol references, the rules that most often break an agent, and how to register and validate it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ptile review findings - Point every pattern at the Claude Code agent, the default and most tested one, and use pi only for what Claude Code doesn't do: native trajectory, the snapshot changelog and custom peer tools. - Prefix the agent paths with agents/ so they resolve from this folder. - Say that validate runs a fixed set of checks, and list what it doesn't cover, so a green run isn't read as proof for every advertised extension. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a section per urn:agentenv:* extension (agent-config, mcp-config, trajectory, skill-config, snapshot, peer-agents, triggers, attribution-probe, install, staging) and custom extensions: what agent-env uses it for, what the SDK implements and what the agent does, and where to copy it from, in the Claude Code agent first, then pi, the protocol examples or its tests. The extension rules move into their sections, and kit.py is named explicitly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Organize AGENTS.md as Agent, Agent loop, Agent Card and Extensions. The agent loop section covers core A2A task handling: the JSON-RPC methods agent-env calls, the task lifecycle the SDK owns, what run() receives and returns, errors, contexts and sessions, deadlines and cancellation, and streaming. The Agent Card section covers identity, what the SDK derives and what updates it live. Each points to the Claude Code agent and its tests; the remaining rules move into those sections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
psinghal20
force-pushed
the
pratyush/agents-md
branch
from
October 21, 2026 16:54
9531fdd to
e5fb7c4
Compare
revan-aleti
approved these changes
Oct 21, 2026
A numbered walk-through from an empty bundle to a validated agent: copy the Claude Code agent's folder, declare the agent, write the turn, map the model endpoint, add extensions, test offline, add defaults and a smoke task, run the bundle, register and validate, and use the agent from a task or as the default. It absorbs the registering and validating section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
approved these changes
Oct 21, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
src/agent_env/agents/AGENTS.md, a short guide to writing an A2A agent that agent-env can deploy, prompt, inspect and validate. It uses the Claude Code agent, agent-env's default and most tested agent, as the reference implementation, with pi only for the patterns Claude Code doesn't use (native trajectory, the snapshot changelog, custom peer tools), and points to the code rather than repeating it:agents/claude-code/a2a_server.pyand itsentrypoint.shas the whole entry point, and where the agent-level plumbing lives (model endpoint mapping, error bodies, lifespan, image, offline tests).message/send,tasks/get,tasks/cancel), the task lifecycle the SDK owns, whatrun()receives and returns, errors, contexts and sessions, deadlines and cancellation, and streaming, each pointing toClaudeCodeAgent.run,claude_bridge.pyand their tests.input_modes, what the SDK derives (RPC URL, streaming, the extensions list and agent-config'ssupportedfields), and what updates it live, pinned bytest_card_contract.py.urn:agentenv:*extension (agent-config, mcp-config, trajectory, skill-config, snapshot, peer-agents, triggers, attribution-probe, install, staging) and for custom extensions: what agent-env uses it for, what the SDK implements versus the agent, and the reference to copy, in Claude Code first, then pi, the protocol examples or its tests.extensions.pyas the wire-format source of truth,tasks/v1.py,transfers.py, the protocol README, and thedeploy_agent/prompt_agentsteps that show what agent-env sends an agent.agents/claude-code/, declare the agent, write the turn, map the model endpoint, add extensions, test offline, addagent.tomland a smoke task,agent-env run,a2a-agent put/validate, and use it from a task or as[agents] default_a2a_agent_id, with whatvalidatedoesn't cover.It is about writing agents, not about changing the framework. Docs only; no code changes.
Test plan
main.pytest tst/unit/agents tst/unit/bundle: 1040 passed.agent-env run agents --dry-runstill plans both agents and both smoke tasks with the file in the bundle.agents/claude-code/asagents/my-agent/in a new bundle, with a smoke task naming it by folder) plans withagent-env run <bundle> --dry-run.🤖 Generated with Claude Code


Confidence Score: 5/5
The documentation change appears safe to merge.Summary
Adds
src/agent_env/agents/AGENTS.md, a guide to building, testing and registering an A2A agent.Reviews (6) · Last reviewed commit: "docs(agents): drop the reference-agent s..." · Reviewed by Greptile