apps/docs/skills/a2a-agent-networking/SKILL.md
Expose agents as A2A JSON-RPC servers discoverable via Agent Cards, and connect agents to remote A2A agents using the client discovery and capability-matching APIs.
npx skillsauth add tylerjrbuell/reactive-agents-ts a2a-agent-networkingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce a builder with .withA2A() configured to expose an agent as an A2A server, or connect to remote A2A agents using the client APIs from @reactive-agents/a2a.
import { ReactiveAgents } from "@reactive-agents/runtime";
const agent = await ReactiveAgents.create()
.withName("specialist")
.withProvider("anthropic")
.withReasoning({ defaultStrategy: "adaptive", maxIterations: 10 })
.withTools({ allowedTools: ["web-search", "http-get", "checkpoint"] })
.withA2A({ port: 8000 }) // starts A2A HTTP server on port 8000
.build();
// Agent is now discoverable at:
// GET http://localhost:8000/.well-known/agent.json (Agent Card)
// POST http://localhost:8000/rpc (JSON-RPC 2.0)
const lead = await ReactiveAgents.create()
.withProvider("anthropic")
.withReasoning({ defaultStrategy: "plan-execute-reflect", maxIterations: 20 })
.withOrchestration()
.withRemoteAgent("specialist", "http://specialist-service:8000")
// Registers the remote A2A agent as a callable tool named "specialist"
.withTools({ allowedTools: ["specialist", "checkpoint", "final-answer"] })
.build();
.withA2A()
// Default port: 3000, basePath: "/"
// Endpoints:
// /.well-known/agent.json → Agent Card
// /rpc → JSON-RPC 2.0 task endpoint
.withA2A({ port: 8000 })
// Custom port
.withA2A({ port: 8000, basePath: "/api/agents" })
// Agent Card at: http://localhost:8000/api/agents/.well-known/agent.json
// RPC at: http://localhost:8000/api/agents/rpc
import {
A2AClient,
createA2AClient,
discoverAgent,
discoverMultipleAgents,
matchCapabilities,
findBestAgent,
} from "@reactive-agents/a2a";
import { Effect } from "effect";
// Discover a single agent's card
const program = Effect.gen(function* () {
const card = yield* discoverAgent("http://specialist:8000");
console.log("Agent name:", card.name);
console.log("Skills:", card.skills);
});
// Discover multiple agents
const multi = Effect.gen(function* () {
const cards = yield* discoverMultipleAgents([
"http://researcher:8001",
"http://coder:8002",
"http://reviewer:8003",
]);
// Find best match for a capability
const best = findBestAgent(cards, { capability: "code-review" });
});
// Direct A2A client call
const call = Effect.gen(function* () {
const client = yield* A2AClient;
const result = yield* client.send({
agentCardUrl: "http://specialist:8000/.well-known/agent.json",
message: { role: "user", content: "Analyze this dataset..." },
});
console.log(result.output);
});
import { generateAgentCard, toolsToSkills } from "@reactive-agents/a2a";
const card = generateAgentCard({
name: "Data Analyst",
description: "Analyzes datasets and produces statistical summaries",
skills: toolsToSkills(myTools), // converts ToolDefinition[] to A2A skill format
version: "1.0.0",
url: "http://analyst-agent:8000",
});
Two ways to connect to remote agents:
// Option 1: withRemoteAgent() on the builder (simpler — agent-as-tool pattern)
.withRemoteAgent("analyst", "http://analyst:8000")
// The remote agent appears as a tool named "analyst" in the LLM's tool list.
// No client code needed — the framework handles the A2A protocol.
// Option 2: A2AClient directly (more control — for custom orchestration)
import { A2AClient } from "@reactive-agents/a2a";
// Use when you need capability discovery, load balancing, or custom retry logic.
| Field | Type | Default | Notes |
|-------|------|---------|-------|
| port | number | 3000 | HTTP port for the A2A server |
| basePath | string | "/" | Base path for A2A endpoints |
| Endpoint | Method | Description |
|----------|--------|-------------|
| <basePath>/.well-known/agent.json | GET | Agent Card (capabilities, skills, metadata) |
| <basePath>/rpc | POST | JSON-RPC 2.0 task execution endpoint |
.withA2A() starts an HTTP server — the agent process must stay alive for the server to serve requests (combine with .withGateway() for persistent agents).build() — port conflicts will throw at build time, not at call timewithRemoteAgent() connects to the remote agent at build time to fetch its Agent Card — the remote agent must be up when .build() is called.withName() and the system prompt for a meaningful cardport must be unique per agent process to avoid conflictsdevelopment
Orient to the Reactive Agents framework, understand the builder API shape, and select the right capability skills for your task.
testing
Enable output verification (hallucination detection, semantic entropy, self-consistency), add post-run verification steps, and run LLM-scored evals across 5 quality dimensions.
data-ai
Configure per-provider behavior, understand streaming quirks, and use the 7-hook adapter system for optimal performance across LLM providers.
data-ai
Configure the 4-layer memory system with SQLite/FTS5/vec storage for persistent agent knowledge that survives sessions.