agentleFS
mmccallammccalla/coding-agent-skill-library/skills/inter-agent-communication-a2a/SKILL.md

inter-agent-communication-a2a

Skill4 starsChanged 5 months agoApache-2.0View on GitHub

Use when designing agent-to-agent communication, delegation protocols, agent cards, asynchronous task exchange, or interoperable multi-agent systems.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when multiple agents must collaborate across process, service, framework, repository or organisation boundaries.

    line 13
  2. Distinctive:

    Use a minimal lifecycle unless the domain needs more detail:

    line 30
  3. Distinctive:

    Every state transition should include timestamp, actor, reason and optional artefact references.

    line 34
  4. Distinctive:

    Do not expose internal prompts, secrets or private state through agent cards.

    line 53
  5. Distinctive:

    Treat remote agents as untrusted until validated.

    line 55
  6. Distinctive:

    Use timeouts and cancellation for long-running tasks.

    line 56
  7. Very specific:

    Use skills_docs/security/OWASP_ASI_CROSSWALK.md for the shared risk map.

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Inter-Agent Communication (A2A)

When to use

Use this skill when multiple agents must collaborate across process, service, framework, repository or organisation boundaries. Apply it for delegation, capability discovery, task status tracking, streaming results and standardised hand-offs.

Objective

Define safe, interoperable contracts for agent identity, delegation, task exchange, and result hand-off.

Procedure

  1. Define each agent as an opaque service with a clear public contract.
  2. Publish an agent card describing identity, endpoint, version, capabilities, skills, input/output modes and authentication.
  3. Represent work as tasks with unique identifiers and explicit states.
  4. Exchange messages containing metadata and content parts.
  5. Return artefacts as structured outputs, files or streamed parts.
  6. Preserve context using a context identifier where multi-step collaboration is required.

Task lifecycle

Use a minimal lifecycle unless the domain needs more detail:

submitted -> working -> input_required -> completed | failed | cancelled

Every state transition should include timestamp, actor, reason and optional artefact references.

Implementation guidance

For coding agents, keep payloads structured:

{
  "task_id": "task-123",
  "context_id": "ctx-456",
  "skill": "run_tests",
  "input": {"path": "tests/"},
  "constraints": ["no network", "read-only except reports/"],
  "expected_output": "test_report"
}

Guardrails

  • Do not expose internal prompts, secrets or private state through agent cards.
  • Authenticate server endpoints and restrict discovery where capabilities are sensitive.
  • Treat remote agents as untrusted until validated.
  • Use timeouts and cancellation for long-running tasks.

OWASP ASI mapping

Use skills_docs/security/OWASP_ASI_CROSSWALK.md for the shared risk map.

ASI riskA2A control
ASI04 Agentic Supply Chain VulnerabilitiesVerify agent cards, versions, endpoints and allowed capabilities before delegation.
ASI07 Insecure Inter-Agent CommunicationAuthenticate peers, version message schemas and treat peer output as untrusted.
ASI08 Cascading FailuresUse fan-out limits, cancellation, bounded retries and explicit failure states.
ASI10 Rogue AgentsAdd containment, revocation and audit trails for agents that deviate from declared scope.

References

Verification

  • Agent card exists.
  • Task states are explicit.
  • Message schema is versioned.
  • Authentication and authorisation are defined.
  • Failure and cancellation paths are implemented.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.