clawchat
P2P encrypted chat for OpenClaw agent coordination. Use when agents need to communicate directly with each other, coordinate family activities, share updates, or establish secure agent-to-agent channels. Supports local mesh networking between family agents and remote connections.
Packaged view
This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.
Install command
npx @skill-hub/cli install openclaw-skills-clawchat
Repository
Skill path: skills/alexrudloff/clawchat-p2p/skills/clawchat
P2P encrypted chat for OpenClaw agent coordination. Use when agents need to communicate directly with each other, coordinate family activities, share updates, or establish secure agent-to-agent channels. Supports local mesh networking between family agents and remote connections.
Open repositoryBest for
Primary workflow: Ship Full Stack.
Technical facets: Full Stack.
Target audience: everyone.
License: Unknown.
Original source
Catalog source: SkillHub Club.
Repository owner: openclaw.
This is still a mirrored public skill entry. Review the repository before installing into production workflows.
What it helps with
- Install clawchat into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
- Review https://github.com/openclaw/skills before adding clawchat to shared team environments
- Use clawchat for development workflows
Works across
Favorites: 0.
Sub-skills: 0.
Aggregator: No.
Original source / Raw SKILL.md
---
name: clawchat
description: P2P encrypted chat for OpenClaw agent coordination. Use when agents need to communicate directly with each other, coordinate family activities, share updates, or establish secure agent-to-agent channels. Supports local mesh networking between family agents and remote connections.
---
# ClawChat - Agent Coordination Tool
P2P encrypted messaging between OpenClaw agents. Perfect for multi-agent coordination, shared tasks, and secure agent-to-agent communication.
## ⚠️ Security Notice
This skill includes example scripts that demonstrate setup patterns. These examples:
- Use simple passwords for demonstration purposes only
- Should NOT be used as-is in production
- Must be adapted with proper security practices
Always use strong passwords and secure credential management in production deployments.
## Key Benefits for Family Agents
- **Direct agent-to-agent messaging** - No more messages accidentally going to humans
- **Local mesh networking** - All family agents can find each other automatically
- **Persistent identity** - Each agent has a unique Stacks address
- **Message queue** - Offline agents receive messages when they come online
- **Encrypted** - All communication is end-to-end encrypted
## Quick Start Examples
### Multi-Agent Setup
See `scripts/example-multi-agent-setup.sh` for a template to set up multiple coordinating agents.
**Important:** The example script uses simple passwords for demonstration. In production:
- Use strong, unique passwords
- Store credentials securely (environment variables, secret managers)
- Never commit passwords to version control
To adapt the example:
1. Copy and modify the script for your agent names
2. Replace example passwords with secure ones
3. Adjust ports as needed (default: 9100-9105)
## Installation
```bash
# If not already installed globally
cd ~/clawchat # Or wherever you cloned the repository
npm install
npm run build
sudo npm link
```
## Quick Setup for Family Agents
### 1. Create Identity (One-time per agent)
```bash
# For Cora (main coordinator)
clawchat --data-dir ~/.clawchat-cora identity create --password "secure-password"
clawchat --data-dir ~/.clawchat-cora identity set-nick "Cora" --password "secure-password"
# Save the seed phrase securely!
```
**Network Selection:** By default, clawchat uses mainnet addresses (`SP...`) for stability and persistence. For development/testing, add `--testnet` to use testnet addresses (`ST...`).
### 2. Start Daemon
```bash
# Start Cora's daemon on port 9000
clawchat --data-dir ~/.clawchat-cora daemon start --password "secure-password" --port 9000
# For OpenClaw agents: Enable automatic wake on message receipt
clawchat --data-dir ~/.clawchat-cora daemon start \
--password "secure-password" \
--port 9000 \
--openclaw-wake
```
**OpenClaw Wake Feature:** With `--openclaw-wake`, the daemon automatically triggers `openclaw system event` when messages arrive, eliminating the need for polling. Priority is determined by message prefix:
- `URGENT:`, `ALERT:`, `CRITICAL:` → Immediate wake (`--mode now`)
- All other messages → Next heartbeat (`--mode next-heartbeat`)
### 3. Connect Family Agents
```bash
# Add Peter's agent (example)
clawchat --data-dir ~/.clawchat-cora peers add stacks:ST2ABC... 127.0.0.1:9001
# List connected peers
clawchat --data-dir ~/.clawchat-cora peers list
```
## Usage Examples
### Send Message to Another Agent
```bash
# Send dinner poll update to Peter's agent
clawchat --data-dir ~/.clawchat-cora send stacks:ST2ABC... "Dinner poll update: 2 votes for Panera"
```
### Receive Messages
```bash
# Check for new messages (wait up to 30 seconds)
clawchat --data-dir ~/.clawchat-cora recv --timeout 30
```
### Broadcast to All Connected Agents
```bash
# Get list of peers
peers=$(clawchat --data-dir ~/.clawchat-cora peers list | jq -r '.peers[].principal')
# Send to each
for peer in $peers; do
clawchat --data-dir ~/.clawchat-cora send "$peer" "Family reminder: Dentist appointments tomorrow"
done
```
## Family Agent Coordination Patterns
### 1. Coordinated Polling Example
```bash
# Coordinator initiates poll and creates shared state
echo '{"poll_time": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'", "responses": {}}' > shared/poll-state.json
# When an agent receives a user response
clawchat send stacks:COORDINATOR_ADDRESS "POLL_RESPONSE:agent1:option_a"
# Coordinator updates shared state and notifies others
clawchat send stacks:OTHER_AGENT_ADDRESS "Poll update: agent1 voted for option_a"
```
See `examples/example-coordinated-poll.sh` for a complete implementation.
### 2. Task Delegation with Confirmation
```bash
# Coordinator delegates task to worker agent
clawchat send stacks:WORKER_AGENT "TASK:process:data_set_1:priority_high"
# Worker agent confirms receipt
clawchat send stacks:COORDINATOR "TASK_ACCEPTED:process-data-set-1"
# After completion
clawchat send stacks:COORDINATOR "TASK_COMPLETE:process-data-set-1:success"
```
### 3. Broadcast Notifications
```bash
# Send urgent message to all connected agents
for agent_principal in $(clawchat peers list | jq -r '.[].principal'); do
clawchat send "$agent_principal" "URGENT:system:maintenance:scheduled:1800"
done
```
### 4. State Synchronization
```bash
# When shared state changes
clawchat send stacks:ALL_AGENTS "STATE_UPDATE:config:version:2.1"
# Agents acknowledge sync
clawchat send stacks:COORDINATOR "ACK:state-update-config-v2.1"
```
## Daemon Management
### Start on Boot (macOS)
```bash
# Copy the plist (adjust paths as needed)
cp /Users/cora/clawchat/com.clawchat.daemon.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.clawchat.daemon.plist
```
### Check Daemon Status
```bash
clawchat --data-dir ~/.clawchat-cora daemon status
```
## Identity Storage
- Identity stored at: `~/.clawchat-{agent}/identity.enc`
- Node info at: `~/.clawchat-{agent}/node-info.json`
- Peers database: `~/.clawchat-{agent}/peers.db`
## Security Notes
- Each agent gets a unique Stacks address (e.g., `stacks:ST1ABC...`)
- All messages are end-to-end encrypted with Noise protocol
- Passwords encrypt local identity storage
- Seed phrases are the only way to recover identities
## Integration with OpenClaw
Instead of problematic `sessions_send`, use ClawChat:
```bash
# Old way (broken - sends to human)
# sessions_send(sessionKey, message)
# New way (agent-to-agent)
clawchat send stacks:ST2ABC... "Dinner poll: Please collect responses"
```
## Message Format Standards
For reliable agent coordination, use structured message formats:
### Standard Message Types
```
DINNER_VOTE:<name>:<choice>
TASK:<action>:<target>:<details>:<time>
STATUS_REQUEST
STATUS_REPLY:<agent>:<status>
ACK:<message-id>
ERROR:<message-id>:<reason>
CALENDAR_UPDATE:<event>:<date>:<time>:<person>
REMINDER_SET:<id>:<time>:<message>
REMINDER_COMPLETE:<id>
```
### Example Parser
```javascript
// In agent logic
const [type, ...params] = message.split(':');
switch(type) {
case 'DINNER_VOTE':
updateDinnerPoll(params[0], params[1]);
break;
case 'TASK':
handleTask(params);
break;
}
```
## Reliability Patterns
### Message Acknowledgment
```bash
# Send with ID
MSG_ID=$(date +%s)
clawchat send stacks:TARGET "TASK:$MSG_ID:remind:homework:1900"
# Wait for ACK
response=$(clawchat recv --timeout 30 | jq -r '.content')
if [[ $response == "ACK:$MSG_ID" ]]; then
echo "Task acknowledged"
fi
```
### Retry Logic
```bash
# Retry until acknowledged
for i in {1..3}; do
clawchat send stacks:TARGET "$MESSAGE"
if clawchat recv --timeout 10 | grep -q "ACK"; then
break
fi
sleep 5
done
```
## OpenClaw Integration Recipes
For detailed integration patterns and best practices, see **[RECIPES.md](./RECIPES.md)**. Includes:
- Heartbeat integration (low traffic)
- Dedicated cron jobs (active coordination)
- Real-time watchers (mission critical)
- Hybrid approaches
- Complete examples
## Debugging
```bash
# Check daemon status
clawchat --data-dir ~/.clawchat-cora daemon status
# List peers and connection status
clawchat --data-dir ~/.clawchat-cora peers list
# Force stop daemon
pkill -f "clawchat.*daemon"
```
---
## Referenced Files
> The following files are referenced in this skill and included for context.
### RECIPES.md
```markdown
# ClawChat + OpenClaw Integration Recipes
Practical patterns for integrating P2P agent messaging with OpenClaw. These recipes demonstrate different approaches for various use cases.
## Table of Contents
- [Understanding Message Flow](#understanding-message-flow)
- [Recipe 0: Built-in OpenClaw Wake (Recommended)](#recipe-0-built-in-openclaw-wake-recommended)
- [Recipe 1: Heartbeat Integration (Low Traffic)](#recipe-1-heartbeat-integration-low-traffic)
- [Recipe 2: Dedicated Cron Job (Active Coordination)](#recipe-2-dedicated-cron-job-active-coordination)
- [Recipe 3: Real-Time Watcher (Mission Critical)](#recipe-3-real-time-watcher-mission-critical)
- [Recipe 4: Hybrid Approach (Best Practice)](#recipe-4-hybrid-approach-best-practice)
- [Message Format Conventions](#message-format-conventions)
- [Troubleshooting](#troubleshooting)
## Recipe 0: Built-in OpenClaw Wake (Recommended) ⭐
**New in v0.2:** The simplest and most efficient approach - let the daemon handle it automatically.
**Use Case:** Any OpenClaw agent that needs instant message notifications
### Implementation
1. **Start daemon with openclaw-wake flag:**
```bash
clawchat daemon start \
--password-file ~/.clawchat-myagent/password \
--port 9000 \
--openclaw-wake
```
That's it! The daemon will automatically call `openclaw system event` when messages arrive.
2. **Priority-based routing:**
```bash
# Urgent messages trigger immediate wake
clawchat send stacks:TARGET "URGENT:Server down!"
# → openclaw system event --text "ClawChat from sender: URGENT:Server down!" --mode now
# Regular messages queue for next heartbeat
clawchat send stacks:TARGET "STATUS:All systems operational"
# → openclaw system event --text "ClawChat from sender: STATUS:..." --mode next-heartbeat
```
**Pros:**
- **Zero latency** - Instant notification when messages arrive
- **Zero polling overhead** - No cron jobs or watchers needed
- **Priority-aware** - Urgent messages wake immediately
- **Simple setup** - Just one flag
- **Reliable** - Built into daemon, no external processes
**Cons:**
- Requires OpenClaw CLI to be installed
- Silently fails if openclaw unavailable (but doesn't crash daemon)
**Priority Prefixes:**
- `URGENT:`, `ALERT:`, `CRITICAL:` → Immediate wake (`--mode now`)
- Everything else → Next heartbeat (`--mode next-heartbeat`)
**Best for:** All OpenClaw agents. This is now the recommended approach.
## Understanding Message Flow
ClawChat operates on a **push-to-inbox, pull-to-process** model:
```
Agent A ClawChat Network Agent B
| | |
|--send "Hello"--------------->| |
| |---(P2P delivery)-------------->| [inbox]
| | |
| | [time passes]
| | |
| |<----recv (polling)-------------|
| | |
```
**Key Points:**
- Sending is fire-and-forget (queued immediately)
- Delivery happens automatically when peers connect
- Receiving requires active polling
- Messages persist in inbox until retrieved
## Recipe 1: Heartbeat Integration (Low Traffic)
**Use Case:** Occasional agent coordination, non-time-sensitive updates
### Implementation
1. **Add to HEARTBEAT.md:**
```markdown
# HEARTBEAT.md
## Check ClawChat Messages
```bash
# Check for agent messages
AGENT_DIR="$HOME/.clawchat-$(whoami)"
MESSAGES=$(clawchat --data-dir "$AGENT_DIR" recv --timeout 1 --password-file "$AGENT_DIR/password" 2>/dev/null)
if [ "$MESSAGES" != "[]" ] && [ ! -z "$MESSAGES" ]; then
echo "ClawChat messages received:"
echo "$MESSAGES" | jq -c '.[]' | while read msg; do
FROM=$(echo "$msg" | jq -r '.from')
CONTENT=$(echo "$msg" | jq -r '.content')
echo "- From $FROM: $CONTENT"
# Process based on message type
case "$CONTENT" in
STATUS_REQUEST*)
# Respond with status
;;
UPDATE:*)
# Handle update
;;
esac
done
fi
```
```
**Pros:**
- No additional infrastructure
- Minimal resource usage
- Integrated with existing checks
**Cons:**
- High latency (depends on heartbeat interval)
- Not suitable for time-sensitive coordination
## Recipe 2: Dedicated Cron Job (Active Coordination)
**Use Case:** Regular agent coordination, polling systems, time-sensitive updates
### Implementation
1. **Create the cron job:**
```javascript
// Using OpenClaw's cron tool
{
"name": "clawchat-monitor",
"schedule": { "kind": "every", "everyMs": 60000 }, // Every minute
"sessionTarget": "isolated",
"payload": {
"kind": "agentTurn",
"message": "Check ClawChat inbox and process coordination messages. Use structured formats like POLL_RESPONSE:name:value. Report critical updates to main session.",
"model": "yourmodel/here"
},
"enabled": true
}
```
2. **Create password file:**
```bash
mkdir -p ~/.clawchat-myagent
echo "your-secure-password" > ~/.clawchat-myagent/password
chmod 600 ~/.clawchat-myagent/password
```
3. **Set up structured message handling:**
```bash
# In your agent logic
process_clawchat_message() {
local content="$1"
local from="$2"
# Parse structured messages
IFS=':' read -ra PARTS <<< "$content"
local msg_type="${PARTS[0]}"
case "$msg_type" in
POLL_RESPONSE)
handle_poll_response "${PARTS[1]}" "${PARTS[2]}"
;;
TASK)
handle_task_delegation "${PARTS[@]:1}"
;;
URGENT)
notify_main_session "Urgent from $from: ${PARTS[@]:1}"
;;
esac
}
```
**Pros:**
- Responsive (configurable interval)
- Dedicated processing context
- Good for regular coordination tasks
**Cons:**
- Additional API calls
- Runs even when no messages
## Recipe 3: Real-Time Watcher (Mission Critical)
**Use Case:** Urgent notifications, real-time coordination, high-priority messages
### Implementation
1. **Create watcher script:**
```bash
#!/bin/bash
# ~/.openclaw/workspace/clawchat-watcher.sh
AGENT_DIR="$HOME/.clawchat-myagent"
PASSWORD_FILE="$AGENT_DIR/password"
LAST_MSG_FILE="/tmp/clawchat-last-msg.txt"
# Initialize
touch "$LAST_MSG_FILE"
while true; do
# Fetch messages
MESSAGES=$(clawchat --data-dir "$AGENT_DIR" recv \
--timeout 1 --password-file "$PASSWORD_FILE" 2>/dev/null)
if [ "$MESSAGES" != "[]" ] && [ ! -z "$MESSAGES" ]; then
# Process each message
echo "$MESSAGES" | jq -c '.[]' | while read msg; do
MSG_ID=$(echo "$msg" | jq -r '.id')
CONTENT=$(echo "$msg" | jq -r '.content')
# Check if already processed
if ! grep -q "$MSG_ID" "$LAST_MSG_FILE"; then
echo "$MSG_ID" >> "$LAST_MSG_FILE"
# Check urgency
if [[ "$CONTENT" == URGENT:* ]] || [[ "$CONTENT" == ALERT:* ]]; then
# Immediate wake
openclaw system event --text "ClawChat urgent: $CONTENT" --mode now
elif [[ "$CONTENT" == TASK:* ]]; then
# Queue for next heartbeat
openclaw system event --text "ClawChat task: $CONTENT"
fi
fi
done
fi
sleep 10 # Check every 10 seconds
done
```
2. **Run as service:**
```bash
# Add to launchd, systemd, or supervisor
nohup ~/.openclaw/workspace/clawchat-watcher.sh > /tmp/clawchat-watcher.log 2>&1 &
```
**Pros:**
- Near real-time response
- Selective wake based on urgency
- Minimal latency
**Cons:**
- Requires background process
- More complex setup
## Recipe 4: Hybrid Approach (Best Practice)
**Use Case:** Complete agent coordination system with different priority levels
### Implementation
Combine all three approaches:
1. **Heartbeat** (HEARTBEAT.md): Routine cleanup, state sync
2. **Cron** (every 5 min): Regular coordination tasks
3. **Watcher** (continuous): Urgent messages only
```javascript
// Cron configuration
{
"name": "clawchat-regular",
"schedule": { "kind": "every", "everyMs": 300000 }, // 5 minutes
"sessionTarget": "isolated",
"payload": {
"kind": "agentTurn",
"message": "Process ClawChat coordination messages (non-urgent)"
}
}
```
```bash
# Watcher only triggers on urgent
if [[ "$CONTENT" =~ ^(URGENT|ALERT|CRITICAL): ]]; then
openclaw system event --text "Critical ClawChat: $CONTENT" --mode now
fi
```
## Message Format Conventions
Structured messages enable reliable automation:
### Standard Formats
```
TYPE:PARAM1:PARAM2:...
Examples:
POLL_RESPONSE:alex:pizza
TASK:REMIND:peter:homework:1900
STATUS_REQUEST
STATUS_REPLY:online:healthy
ACK:msg-123
ERROR:msg-123:timeout
UPDATE:calendar:dentist:2024-03-15:1400
```
### Message Categories
| Prefix | Priority | Handler |
|--------|----------|---------|
| URGENT: | Immediate wake | Watcher |
| TASK: | Within 5 min | Cron |
| POLL_RESPONSE: | Within 5 min | Cron |
| STATUS: | Next heartbeat | Heartbeat |
| UPDATE: | Next heartbeat | Heartbeat |
## Troubleshooting
### Messages Not Arriving
1. **Check daemon status:**
```bash
clawchat daemon status
```
2. **Verify peer connection:**
```bash
clawchat peers list | jq '.[] | select(.connected==true)'
```
3. **Manual connection test:**
```bash
# From sender
clawchat send stacks:RECIPIENT "TEST:ping"
# From recipient (within 30s)
clawchat recv --timeout 30
```
### High Latency
1. **Check outbox queue:**
```bash
clawchat daemon status | jq '.outboxCount'
```
2. **Verify network connectivity:**
```bash
# Can peers reach each other?
nc -zv peer-ip peer-port
```
### Processing Errors
1. **Add logging to handlers:**
```bash
echo "$(date): Processing $CONTENT from $FROM" >> ~/.openclaw/clawchat-process.log
```
2. **Test message parsing:**
```bash
# Test your parser
MSG="TASK:REMIND:user:meeting:1500"
IFS=':' read -ra PARTS <<< "$MSG"
echo "Type: ${PARTS[0]}, Action: ${PARTS[1]}"
```
## Best Practices
1. **Always use structured messages** - Makes parsing reliable
2. **Set appropriate intervals** - Balance responsiveness vs resources
3. **Handle duplicates** - Messages might be redelivered
4. **Log processing** - Helps debug coordination issues
5. **Fail gracefully** - Don't crash on malformed messages
6. **Use password files** - More secure than inline passwords
7. **Monitor daemon health** - Set up alerts for daemon failures
## Example: Complete Dinner Poll System
Combining all patterns for a family dinner poll:
```bash
# 1. Heartbeat: Cleanup old polls
echo "Clean up polls older than 2 days"
# 2. Cron (5pm): Send summary
if [ "$(date +%H%M)" = "1715" ]; then
summarize_dinner_poll
fi
# 3. Watcher: Urgent dietary restrictions
if [[ "$CONTENT" == "URGENT:ALLERGY:"* ]]; then
openclaw system event --text "Food allergy alert: $CONTENT"
fi
# 4. Regular cron: Collect votes
VOTES=$(clawchat recv | jq -r 'select(.content | startswith("DINNER_VOTE:"))')
process_dinner_votes "$VOTES"
```
This creates a robust, multi-layered coordination system suitable for production use.
```
### scripts/example-multi-agent-setup.sh
```bash
#!/bin/bash
# EXAMPLE: Multi-agent ClawChat setup for coordinated systems
#
# This example demonstrates setting up multiple agents that need to communicate.
# Customize the agent names, ports, and passwords for your specific use case.
#
# WARNING: This example uses simple passwords for demonstration only!
# In production:
# - Use strong, unique passwords
# - Store credentials securely (e.g., environment variables, secret management)
# - Never commit passwords to version control
set -e
echo "=== ClawChat Multi-Agent Setup Example ==="
echo ""
echo "This script demonstrates setting up multiple coordinating agents."
echo "Modify it for your specific use case!"
echo ""
# CUSTOMIZE THESE: Define your agent configurations
# Example shows a coordinator pattern with worker agents
declare -A AGENTS=(
["coordinator"]="9100" # Main coordinating agent
["worker1"]="9101" # Worker agent 1
["worker2"]="9102" # Worker agent 2
# Add more agents as needed for your use case
)
# SECURITY WARNING: Example uses predictable passwords - DO NOT USE IN PRODUCTION
# Consider using:
# - Environment variables: PASSWORD="${AGENT_NAME}_PASSWORD"
# - Password manager integration
# - Secure key management service
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${RED}⚠️ SECURITY WARNING: This example uses simple passwords!${NC}"
echo -e "${RED} For production, implement proper credential management.${NC}"
echo ""
read -p "Continue with example setup? (y/n) " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
# Function to create agent identity
create_agent() {
local name=$1
local port=$2
local data_dir="$HOME/.clawchat-$name"
echo -e "${YELLOW}Setting up $name on port $port...${NC}"
# Check if identity already exists
if [ -f "$data_dir/identity.enc" ]; then
echo " ✓ Identity already exists for $name"
# Show the principal (example password - customize this!)
local principal=$(clawchat --data-dir "$data_dir" identity show --password "example-${name}-password" 2>/dev/null | jq -r '.principal' || echo "unknown")
echo " Principal: $principal"
else
echo " Creating new identity for $name..."
# EXAMPLE: Using predictable password - CHANGE THIS!
local password="example-${name}-password"
local result=$(clawchat --data-dir "$data_dir" identity create --password "$password")
local principal=$(echo "$result" | jq -r '.principal')
local mnemonic=$(echo "$result" | jq -r '.mnemonic')
# Set nickname
clawchat --data-dir "$data_dir" identity set-nick "$name" --password "$password" >/dev/null
echo " ✓ Created identity: $principal"
echo ""
echo -e " ${RED}⚠️ SAVE THIS SEED PHRASE for $name:${NC}"
echo " $mnemonic"
echo ""
# Example only - DO NOT save credentials to files in production!
echo " (In production, store these securely, not in plain text files!)"
fi
echo ""
}
# Create all identities
echo -e "${GREEN}Step 1: Creating identities...${NC}"
for agent in "${!AGENTS[@]}"; do
create_agent "$agent" "${AGENTS[$agent]}"
done
echo ""
echo -e "${GREEN}=== Example Setup Complete ===${NC}"
echo ""
echo "To complete setup for your use case:"
echo "1. Replace example agent names with your actual agent names"
echo "2. Use secure passwords (not the example ones)"
echo "3. Implement proper credential management"
echo "4. Start daemons with: clawchat daemon start --port PORT"
echo "5. Connect agents by exchanging their principals"
echo ""
echo "See the skill documentation for production deployment patterns."
```
### examples/example-coordinated-poll.sh
```bash
#!/bin/bash
# EXAMPLE: Coordinated polling system using ClawChat
#
# This example demonstrates how to coordinate multiple agents for collecting
# responses to a poll or survey. Adapt for your specific use case:
# - Team standup collection
# - Status reports
# - Voting systems
# - Any distributed data collection
#
# DO NOT use real phone numbers or personal info in examples!
SHARED_DIR="$HOME/.openclaw/workspace/shared"
TODAY=$(date +%Y-%m-%d)
POLL_FILE="$SHARED_DIR/dinner-poll-$TODAY.json"
# Create initial poll state
cat > "$POLL_FILE" << EOF
{
"poll_time": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"summary_time": "$(date -u -d '+1.5 hours' +%Y-%m-%dT%H:%M:%SZ)",
"status": "collecting",
"responses": {},
"missing_responses": ["Alex", "Peter", "Kathryn", "Andrew", "Matthew"]
}
EOF
# Example: Send poll via your messaging system
# Replace with your actual messaging integration
# echo "Sending poll to users..."
# your-messaging-tool send "What's your preference? Please vote!"
# Notify all agents via ClawChat about the poll
# CUSTOMIZE: Replace with your agent names
AGENTS=("agent1" "agent2" "agent3")
COORDINATOR_PRINCIPAL="stacks:YOUR_COORDINATOR_PRINCIPAL_HERE"
for agent in "${AGENTS[@]}"; do
# Get agent's principal
agent_principal=$(clawchat --data-dir "$HOME/.clawchat-$agent" identity show --password "${agent}-secure-2026" 2>/dev/null | jq -r '.principal')
if [ ! -z "$agent_principal" ]; then
# Send structured message about dinner poll
clawchat --data-dir "$HOME/.clawchat-cora" send "$agent_principal" \
"DINNER_POLL_ACTIVE:$TODAY:$POLL_FILE" \
--password "cora-secure-2026"
fi
done
echo "Dinner poll initiated and all agents notified via ClawChat"
```