跳到正文
cccskills
免费在 GitHub 公开

a2a-skill

Use this skill when agents need to communicate peer-to-peer via the a2a shared SQLite bus. Register agents, send/receive messages, broadcast announcements, search conversation history, and monitor bus stats — all without a central orchestrator.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli星标 56(GitHub 56 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(1)

  • SKILL.md12.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

a2a-skill Plugin — Quickstart Guide

The a2a-skill plugin wraps the a2a agent-to-agent messaging system for SuperCLI. It lets any number of AI coding agents (Claude Code, OpenCode, pi, ...) share messages over a local SQLite bus.

Commands

  • a2a-skill <resource> <action> — Execute a2a-skill commands
  • a2a-skill self version — Show a2a-skill help/version info
  • a2a-skill self learn — Teach the agent the a2a-skill quickstart guide (run: sc skills teach a2a-skill:quickstart)
  • a2a-skill project init — Create a new a2a project database at ~/.a2a/{project}/database.db. Project resolves from A2A_PROJECT env or basename($PWD).
  • a2a-skill project info — Show resolved project info (name, db path, exists). Project resolves from A2A_PROJECT env or basename($PWD).
  • a2a-skill agent register — Register a new agent on the bus (or upsert if already registered). Set A2A_PROJECT for custom project.
  • a2a-skill agent unregister — Remove an agent from the bus
  • a2a-skill agent list — List all registered agents with their role, CLI, status, and PID
  • a2a-skill agent status — Update an agent's status (active, idle, done, blocked)
  • a2a-skill message send — Send a message to an agent or broadcast to all ('all' = broadcast to everyone)
  • a2a-skill message recv — Receive messages addressed to an agent (blocks with --wait)
  • a2a-skill message peek — Peek at recent messages without marking them read (observable by all)
  • a2a-skill message thread — Show all messages in a thread
  • a2a-skill message search — Search messages by content (FTS5 with LIKE fallback)
  • a2a-skill message wait — Block until N unread messages arrive for an agent, or timeout
  • a2a-skill stats show — Show bus statistics: message count, agent counts, top senders
  • a2a-skill clear run — Delete the project database (requires --yes confirmation). Set A2A_PROJECT for custom project.
  • a2a-skill _ _ — Passthrough: run any raw a2a command. Useful when you need --project flag. Example: a2a-skill _ _ list --project myapp

Architecture

Agent A (Claude) ──┐
                   ├──► ~/.a2a/{project}/database.db (WAL mode)
Agent B (OpenCode) ─┘      ▲
                            │
Agent C (pi) ──────────────┘
  • No central orchestrator — agents write to and read from the same SQLite database
  • Per-agent read tracking — each agent sees messages independently
  • Broadcast support — send a message to all / * to reach every registered agent
  • Thread support — group messages under a --thread ID for topic-based conversations
  • TTL support — messages auto-expire after N seconds
  • WAL mode — safe for concurrent writers from different processes

Prerequisites

# 1. Install a2a
git clone https://github.com/javier-arancibia/a2a-skill.git
cd a2a-skill
chmod +x install.sh && ./install.sh

# 2. Verify
a2a init
a2a list

# 3. Install the SuperCLI plugin (if not already)
supercli plugins install ./plugins/a2a-skill --on-conflict replace --json

Available Commands

All commands are invoked via sc a2a-skill <resource> <action>.

Self

CommandDescription
sc a2a-skill self versionShow a2a help/info
sc a2a-skill self learnTeach the agent this quickstart guide

Project Management

CommandDescription
sc a2a-skill project init --project my-teamCreate a new project database
sc a2a-skill project info --project my-teamShow project info (path, exists)

Agent Management

CommandDescription
sc a2a-skill agent register alice --role researcher --cli claudeRegister an agent
sc a2a-skill agent register bob --role critic --cli opencode --upsertRegister or update
sc a2a-skill agent listList all registered agents (JSON)
sc a2a-skill agent status done --as aliceUpdate agent state (active/idle/done/blocked)
sc a2a-skill agent unregister bobRemove an agent from the bus

Messaging

CommandDescription
sc a2a-skill message send alice "hello" --from bobSend a direct message
sc a2a-skill message send all "status check" --from aliceBroadcast to all agents
sc a2a-skill message recv --as aliceFetch unread messages
sc a2a-skill message recv --as alice --wait 10Block 10s waiting for messages
sc a2a-skill message peek --limit 10Peek at recent bus activity
sc a2a-skill message thread T-42 --jsonShow all messages in a thread
sc a2a-skill message search "bug AND critical" --jsonFull-text search
sc a2a-skill message wait --as alice --count 3 --timeout 30Wait for N messages

Bus Management

CommandDescription
sc a2a-skill stats showShow bus statistics
sc a2a-skill clear run --yesDelete the project database

Passthrough (any raw a2a command)

sc a2a-skill _ _ init
sc a2a-skill _ _ list --json
sc a2a-skill _ _ send all "hello world" --from alice --project my-team

Quickstart Workflow

# 1. Initialize the project
sc a2a-skill project init --project my-sprint

# 2. Register agents
sc a2a-skill agent register alice --role researcher --cli claude
sc a2a-skill agent register bob --role critic --cli opencode

# 3. Alice sends a message to Bob
sc a2a-skill message send bob "Review this plan: ..." --from alice --thread PLANNING

# 4. Bob receives
sc a2a-skill message recv --as bob

# 5. Bob replies
sc a2a-skill message send alice "Looks good, one concern: ..." --from bob --thread PLANNING

# 6. Alice checks for replies (blocks 15s)
sc a2a-skill message recv --as alice --wait 15

# 7. Broadcast update to everyone
sc a2a-skill message send all "Sprint planning complete" --from alice --thread PLANNING

# 8. Check bus stats
sc a2a-skill stats show

# 9. Search conversation history
sc a2a-skill message search "planning" --json

Agent-to-Agent Coordination Patterns

Task Claim Protocol

Use broadcast messages for coordination:

# Agent claims a task
sc a2a-skill message send all "CLAIM: fix login bug — alice" --from alice

# Other agent backs off
sc a2a-skill message send all "ACK-CLAIM: alice backing off from login bug — bob" --from bob

Status Updates

# Mark yourself done when finished
sc a2a-skill agent status done --as alice

# Check who's still active
sc a2a-skill agent list --json

Role-Based Workflows

# Register with roles
sc a2a-skill agent register reviewer --role code-reviewer --cli claude --upsert
sc a2a-skill agent register tester --role qa-engineer --cli opencode --upsert

# Reviewer asks tester to verify
sc a2a-skill message send tester "PR #42 needs QA verification" --from reviewer --thread PR-42

Best Practices

  1. Always register before sending — a2a send and a2a recv verify the agent exists
  2. Use --upsert for re-registration — avoids "already registered" errors
  3. Use --wait for blocking recv — agents that poll in a loop will spin
  4. Use --thread for topic grouping — makes a2a thread <id> and a2a search more useful
  5. Set --ttl for ephemeral messages — CLAIM status updates can expire after 5 minutes
  6. Use --json for programmatic consumption — all major commands support JSON output
  7. Use --peek to inspect without marking read — useful for monitoring agents
  8. Use project-level isolation — different teams/projects get different databases

Key Concepts

  • The bus is the source of truth — anything not on the bus didn't happen
  • Read-tracking is per-agent — a broadcast is "seen" once by each agent, individually
  • No locking — coordination is by convention (use the Task Claim protocol)
  • WAL mode — safe for concurrent writers from different processes
  • Zero external dependencies — only Python stdlib + sqlite3

Further Reading

Troubleshooting

ProblemSolution
a2a: no python3 with sqlite3Set A2A_PYTHON=/path/to/python3 or install sqlite3 module
no a2a project at...Run a2a init or sc a2a-skill project init first
unknown senderRegister the agent first: a2a register <id>
already registeredUse --upsert flag when re-registering
Bus is emptyMake sure agents are registered and messages were sent with correct sender IDs
Concurrent writer issuesCheck WAL mode: a2a exec "PRAGMA journal_mode" should return wal
Agents don't see each other's messagesLikely a project mismatch. All agents must use the same --project or A2A_PROJECT. See "Common pitfalls" below.
Empty log files from spawned agentsNormal — CLIs buffer stdout. Check a2a peek or ps aux instead.
--project flag doesn't workThe Go binary expects --project AFTER the subcommand (a2a peek --project X). The Python script expects it BEFORE (a2a.py --project X peek). Use A2A_PROJECT env var for safest results.

Common pitfalls

These were discovered while smoke-testing a2a with spawned agents. Future agents should review this before using the CLI.

A2A_PROJECT must be exported, not just set

When spawning background agents (Pattern 3), the spawned process inherits the parent's environment. Writing A2A_PROJECT=myproject without export means the spawned agent won't see it. It falls back to basename($PWD), which may resolve to the wrong project.

# WRONG — not exported, spawned agents won't see it
A2A_PROJECT=myteam
a2a-spawn --cli claude --id alice ...

# RIGHT — export before spawning
export A2A_PROJECT=myteam
a2a-spawn --cli claude --id alice ...

# ALSO RIGHT — use --project explicitly in every a2a command
a2a send bob "hello" --from alice --project myteam

--project flag position: Go binary vs Python

The installed a2a at ~/.local/bin/a2a may be a Go binary (check with file $(which a2a)). The Go binary and the Python a2a.py expect --project in different positions:

BinaryCorrect syntaxWrong syntax
Go (~/.local/bin/a2a)a2a peek --project Xa2a --project X peek ✗
Python (a2a.py)python3 a2a.py --project X peekpython3 a2a.py peek --project X ✗

Safest: Use the A2A_PROJECT env var — it works identically for both.

export A2A_PROJECT=myteam
a2a peek --limit 10    # works for Go AND Python

Empty agent logs ≠ stuck agent

When spawning via a2a-spawn, log files (--log FILE) may appear empty for minutes. CLIs like claude buffer stdout and flush only on exit. Don't assume the agent is stuck.

Check progress via the bus instead:

ps aux | grep claude              # verify process is running
sc a2a-skill agent list           # check agent status (active? done?)
sc a2a-skill message peek         # see if any messages were sent

Cross-project contamination is invisible

If agents end up on different projects (each resolves basename($PWD) to a different name), they silently write to different databases. No error, no warning — they just never see each other.

Fix: Always verify:

sc a2a-skill project info    # check which project you're on
sc a2a-skill agent list      # verify all expected agents are visible

Kit prompts must be project-aware

When writing kit prompts for spawned agents, never assume A2A_PROJECT is set in the spawned environment. Either export it before spawning, or include --project $PROJECT in every a2a command within the kit.

Register PIDs with the right project

Running a2a register alice --pid 1234 --upsert uses the current project. If A2A_PROJECT isn't set correctly, the PID is registered on the wrong bus. Pass --project or verify A2A_PROJECT before running.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Use this skill when the user wants to use 100-exercises-to-learn-rust.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

2to3

免费

Use this skill when the user wants to use 2to3, cli tool: 2to3.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

2to3-2.7

免费

Use this skill when the user wants to use 2to3-2.7, cli tool: 2to3-2.7.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

2to3-3.11

免费

Use this skill when the user wants to use 2to3-3.11, cli tool: 2to3-3.11.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

411toppm

免费

Use this skill when the user wants to use 411toppm, cli tool: 411toppm.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

53AIHub

免费

Use this skill when the user wants to use 53AIHub.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

查看 javimosch 的全部技能

报告此技能的问题