A2a messaging

From NaveedTechLab/skills-library · View interactive version

A2a messaging is an AI agent skill from the GitHub repository NaveedTechLab/skills-library. Agent-to-Agent (A2A) messaging system for direct communication between Cloud and Local agents. Replaces file-based handoffs with real-time messaging while maintaining vault as audit record. Supports task delegation, status updates, approval requests, and result delivery between distributed AI Employ

How to use this skill

Skill file

A2A Messaging System

Overview

The A2A (Agent-to-Agent) Messaging skill provides a direct communication layer between Cloud and Local Claude Code agents. It replaces file-based handoffs with structured messages while preserving the Obsidian vault as the authoritative audit record. This is the Platinum Phase 2 requirement for the Personal AI Employee project.

Architecture

Agents

Message Broker

The A2AMessageBroker sits between agents and handles:

Transport Layers

  1. File-based transport (default): Messages written as JSON files to shared vault directories under /Messages/outbox/ and /Messages/inbox/. Compatible with git-based vault sync.
  2. Redis transport (optional): Pub/sub channels for real-time delivery. Requires Redis server. Falls back to file-based if Redis is unavailable.

Message Types

| Type | Direction | Description |

|------|-----------|-------------|

| task_delegation | Cloud -> Local or Local -> Cloud | Delegate a task to the other agent |

| approval_request | Cloud -> Local | Request human approval for a sensitive action |

| approval_response | Local -> Cloud | Respond to an approval request |

| status_update | Either direction | Report progress on an ongoing task |

| result_delivery | Either direction | Deliver completed task results |

| heartbeat | Either direction | Health check signal |

| error | Either direction | Report an error condition |

Message Priority

Security Rules

  1. No secrets in messages: Messages are scanned for API keys, tokens, passwords, and credential patterns before sending. Any message containing detected secrets is rejected.
  2. Vault as audit trail: Every message is written to the vault as a markdown file under /Updates/ or /Signals/ for full auditability.
  3. Claim-by-move: The first agent to move a file from /Needs_Action/ to /In_Progress/<agent>/ owns that task. No concurrent claims.
  4. Single-writer for Dashboard.md: Only the Local agent may write to Dashboard.md to prevent merge conflicts.
  5. Security filter on sync: .env files, token stores, WhatsApp session data, and banking credentials are never synced between agents.

Vault Audit Trail

Every A2A message generates a vault entry:

/Updates/a2a-messages/YYYY-MM-DD/
  {timestamp}-{message_type}-{sender}-{message_id_short}.md

The markdown file contains:

Configuration

Environment variables:

CLI Usage

# Send a task delegation
python cli.py send --type task_delegation --to local --payload '{"task": "approve_payment", "amount": 150.00}'

# Check inbox
python cli.py receive --limit 10

# Check agent status
python cli.py status

# Trigger vault sync
python cli.py sync

# Send heartbeat
python cli.py heartbeat

File Structure

.claude/skills/a2a-messaging/
  SKILL.md                    # This file
  scripts/
    a2a_messaging.py          # Core messaging system
    message_router.py          # Message routing and transport
    vault_sync.py              # Vault synchronization
    cli.py                     # Command-line interface
  assets/
    requirements.txt           # Python dependencies
  references/                  # Reference materials

Integration Points

When NOT to Use This Skill

Common Mistakes

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.