discover-peers

Discovers A2A agents in a Kubernetes namespace via service env vars and agent-card probes.

2|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/witwave-ai/witwave --skill discover-peers-witwave-ai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: discover-peers
Source: https://github.com/witwave-ai/witwave/tree/main/.agents/self/iris/.claude/skills/discover-peers
Command: npx skills add https://github.com/witwave-ai/witwave --skill discover-peers-witwave-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Agents running in a Kubernetes namespace have no built-in way to know which sibling agents exist or what they can do. This Skill builds a current, cached view of every reachable A2A agent without requiring cluster API access, extra RBAC, or new infrastructure. ## Core Features & Use Cases - Env-var based discovery: Reads the <SERVICE_NAME>_SERVICE_HOST / _SERVICE_PORT variables Kubernetes injects at pod start to enumerate candidate peers, skipping the API server and the agent itself. - Agent-card probing: Probes each candidate's /.well-known/agent.json endpoint to confirm it is a real A2A agent and capture its name, description, and declared skills. - Memory caching with pruning: Writes one reference-type memory entry per confirmed peer, updates the MEMORY.md index, and deletes stale entries for peers that no longer exist. - Use Case: After a pod restart, an agent needs to delegate a task. Run this Skill to refresh the peer list, then use the cached cards to pick a collaborator and hand off work with the call-peer skill. ## Quick Start Ask the agent to discover peers and refresh its list of available A2A agents in the namespace.

Frequently Asked Questions about discover-peers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I discover other agents in my Kubernetes namespace?▼

Read the `<SERVICE_NAME>_SERVICE_HOST` and `_SERVICE_PORT` environment variables Kubernetes injects at pod start, then probe each candidate's `/.well-known/agent.json` endpoint. Candidates returning valid JSON with a `name` field are confirmed A2A agents.

How does Kubernetes service discovery work without API access?▼

Kubernetes automatically injects service host and port environment variables into every pod for each Service in the same namespace. Filtering out `KUBERNETES_*` entries and your own service yields a candidate list with zero RBAC requirements.

Does this discovery method work across namespaces?▼

No. Service environment variables only cover the pod's own namespace. Cross-namespace discovery needs a different mechanism such as an operator-rendered peers list or DNS with an out-of-band peers manifest.

Why are newly deployed agents missing from the peer list?▼

Environment variable injection is a pod-start snapshot, so peers that joined after your pod started will not appear. Restart the pod and re-run discovery to pick up the fresh set of services.

What happens to cached entries for deleted agents?▼

After each probe loop, the Skill scans for `reference_peer_*.md` files whose peers are no longer in the candidate set, deletes those files, and removes their lines from the `MEMORY.md` index to prevent stale URLs.