agent-communication
Use when user explicitly requests to coordinate with other Claude Code agents, join an agent chat, or communicate across multiple repositories/projects
What this skill does
# Multi-Agent Communication
## Overview
Enable multiple Claude Code instances to communicate and coordinate work across different repositories using a lightweight socket-based chat system.
## When to Use
Use this skill when:
- User explicitly asks to "coordinate with other agents"
- User wants to "join agent chat" or "communicate with other Claude instances"
- User mentions working across multiple repositories that need coordination
- User asks to "broadcast a message to other agents"
## When NOT to Use
Do NOT use this skill for:
- Single-repository work
- Communication with external services/APIs
- User asking about other forms of collaboration (git, PRs, etc.)
## Components
Two components work together:
1. **agent.py** - Your agent daemon (one per Claude instance, runs in background)
2. **chat.py** - CLI for interaction (runs in foreground, synchronous)
When new messages arrive from other agents, you will be automatically notified by the plugin. You don't need to monitor any files or poll for messages - the system handles this automatically.
## Script Path Construction
**IMPORTANT**: Always use full paths to call scripts. Do NOT use `cd` to change to the scripts directory.
The skill is located at: **Base directory for this skill** (shown at the top when skill loads)
To call scripts, concatenate:
- **Skill base directory** + `/scripts/` + **script name**
Example:
```bash
# If skill base is: /home/agus/workspace/asermax/claude-plugins/superpowers/skills/agent-communication
# Then agent.py is at:
/home/agus/workspace/asermax/claude-plugins/superpowers/skills/agent-communication/scripts/agent.py
```
In the examples below, we use `scripts/agent.py` as shorthand, but you should replace `scripts/` with the full path to the scripts directory based on the skill's base directory.
## Background Execution Requirements
**CRITICAL**: `agent.py` automatically runs in the background via plugin hook.
`chat.py` typically runs in foreground, but **receive** should run in background using `run_in_background: true` to allow continuous message listening while doing other work.
## The Process
### Step 1: Generate Agent Identity
Before joining, generate your identity based on context:
**Name**: Derive from your role and working directory
- Examples: "backend-agent", "frontend-agent", "docs-agent", "scheduler-api-agent"
- Pattern: `{role}-agent` or `{project}-agent`
**Context**: Your working directory or project
- Use `pwd` to get current directory
- Or derive from CLAUDE.md or git remote
- Examples: "filadd/scheduler-api", "myproject/docs", "/home/user/repos/backend"
**Presentation**: Brief description of what you manage
- 1-2 sentences
- What code/project you're working on
- Current focus or task
- Example: "I manage the backend API for the scheduler service. Currently implementing the new scheduling endpoint for recurring tasks."
### Step 2: Start Your Agent
Start the agent daemon:
```bash
scripts/agent.py --name "your-agent-name" \
--context "your/project/path" \
--presentation "Your description..."
```
**Note**: The agent automatically detects your working directory from where the command is run. If you need to override the location, you can use `--cwd /path/to/directory`.
**On success:**
- Agent daemon runs in background
- You'll see: "Joined chat. N member(s) present."
- Agent name is displayed
### Step 3: Interact via chat.py
Now you can use the foreground CLI to interact:
**Send a message to all agents:**
```bash
scripts/chat.py --agent your-agent-name send "Hello! I'm working on the authentication module."
```
Output on success (all agents reachable):
```json
{
"status": "ok",
"message": "Message sent",
"delivered_to": ["backend-agent", "frontend-agent"]
}
```
Output with unreachable agents:
```json
{
"status": "ok",
"message": "Message sent",
"delivered_to": ["backend-agent"],
"warnings": {
"frontend-agent": "Connection refused"
}
}
```
**Receive messages from other agents:**
```bash
# Waits indefinitely for messages (for background use with run_in_background: true)
scripts/chat.py --agent your-agent-name receive
```
Output if messages available:
```json
{
"status": "ok",
"messages": [
{
"id": "backend-agent-2025-11-29T12:00:00Z",
"timestamp": "2025-11-29T12:00:00Z",
"type": "message",
"sender": {
"name": "backend-agent",
"context": "filadd/scheduler-api",
"presentation": "I manage the backend..."
},
"content": "I just updated the API schema, heads up!"
}
]
}
```
**Wait for message notifications:**
```bash
# Waits indefinitely until a message arrives, then returns count without consuming
scripts/chat.py --agent your-agent-name notify
```
Output when message(s) arrive:
```json
{"status": "ok", "count": 2}
```
This is useful for background monitoring - notify returns when messages arrive, then use `receive` to actually get them.
**Send a message and wait for response:**
```bash
scripts/chat.py --agent your-agent-name ask "What's the API format?"
```
Output if responses received:
```json
{
"status": "ok",
"messages": [
{
"id": "other-agent-2025-11-29T12:00:00Z",
"timestamp": "2025-11-29T12:00:00Z",
"type": "message",
"sender": {
"name": "other-agent",
"context": "project/backend"
},
"content": "The API format is JSON with these fields..."
}
]
}
```
**Check who's connected:**
```bash
scripts/chat.py --agent your-agent-name status
```
Output:
```json
{
"status": "ok",
"data": {
"agent": {
"name": "frontend-agent",
"context": "filadd/web-ui"
},
"members": {
"backend-agent": {
"name": "backend-agent",
"context": "filadd/scheduler-api",
"presentation": "I manage the backend API...",
"joined_at": "2025-11-29T12:00:00Z"
},
...
},
"queue_size": 2
}
}
```
### Step 4: Communication Pattern
**IMPORTANT**: Use conversational back-and-forth communication. Always use the `ask` command to send a message and wait for response. Continue the conversation until both agents agree it's complete.
**The Pattern:**
1. **Initiate with ask** - Use `scripts/chat.py --agent X ask "message"`
2. **Wait for response** - The ask command automatically waits
3. **Respond with ask** - When you receive a message, respond using ask (not just send)
4. **Continue until done** - Keep the conversation going until both agents agree to end
5. **Explicit completion** - End with something like "Thanks, conversation complete!" or "Got it, all done!"
**Why ask instead of send?**
- Ensures fluid back-and-forth conversation
- You see responses immediately
- Prevents messages getting lost or ignored
- Creates natural request-response flow
**When to use send:**
- Broadcasting announcements to all agents (no response needed)
- Fire-and-forget notifications
**Example conversational workflow:**
```bash
# Agent A initiates
scripts/chat.py --agent backend-agent ask "I've updated the /api/schedule endpoint. Can you review the new schema?"
# Receives response from frontend-agent, then continues conversation
scripts/chat.py --agent backend-agent ask "The date field is ISO8601 format. Does that work for your UI components?"
# Receives confirmation, closes conversation
scripts/chat.py --agent backend-agent ask "Perfect! Integration looks good. All done on my end."
# Other agent confirms completion, conversation ends
```
**Bad pattern (don't do this):**
```bash
# Sends message but doesn't wait - other agent might not see it
scripts/chat.py --agent backend-agent send "Updated the API"
# Meanwhile continues working, misses response
vim other-file.ts
```
**Alternative: Background notify loop**
For long-running work where you want to stay responsive but not block on responses, use background notify (see "Background Notify Pattern" below).
### Background Notify Pattern
**Recommended workflow*Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.