Agent skill · software engineering · oimiragieo
a2a-worker
Builds A2A protocol integration - auto-start hook, client library, router wiring
Why this skill is useful
Adds executable scripts for A2A server auto-start and client library integration that are not in public documentation.
What it needs
Requires node installed locally. About 2k tokens when loaded. Last updated 2026-07-14. 36 stars on the source repository.
What this skill does
A2A Worker NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE. When to Use This Skill Features involving: A2A server auto-start hook creation A2A client library development Router-to-A2A integration Cross-session communication via A2A HTTP A2A test suite development Work Procedure 1. Read CTO Directive #3 from AGENTS.md: A2A server MUST be spawned as fully detached background subprocess. NEVER synchronous. 2. Study the existing pattern in .claude/hooks/channels/channel-auto-start.cjs: How it checks env vars and prerequisites How it uses lockfile with wx flag for cooldown How it records PID in terminal-pids.json How it spawns a detached process via .bat file + start "" /D How it uses VBScript for auto-accept 3. Write tests first (red) for the component you're building: Auto-start hook: test lockfile creation, PID tracking, duplicate prevention Client library: test discovery, send, get, cancel, subscribe Router integration: test dispatch flow 4. Implement following existing A2A code patterns: Server code is in .claude/lib/a2a/server.cjs (Express, JSON-RPC 2.0) Task state machine in .claude/lib/a2a/task-state-machine.cjs Agent card in .claude/lib/a2a/agent-card.cjs SSE in .claude/lib/a2a/sse-stream.cjs JSON-RPC in .claude/lib/a2a/jsonrpc-handler.cjs 5. For auto-start hook (a2a-server-autostart.cjs): Register as UserPromptSubmit hook in settings.json Check A2AAUTOSTART=true env var Check not already inside A2A session Use atomic lockfile with 2-min cooldown Check terminal-pids.json for existing live PID Spawn via .bat file + start "" /D pattern (Windows) Record PID in terminal-pids.json with purpose: 'a2a-server' Exit hook promptly (< 5 seconds) 6. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills oimiragieo/a2a-worker