[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76Y7ZJ4GEJNKG5F6RM7W727":3,"skill-same:01M76Y7ZJ4GEJNKG5F6RM7W727":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M76Y7ZJ4GEJNKG5F6RM7W727","Agent Swarm Network",null,"Agent communication protocol skill. Provides: inter-agent messaging, context snapshot\u002Frestore, event-driven collaboration, model dispatch notifications, sub-agent management, task routing, file transfer, and network diagnostics. Invoke this Skill when cross-session context persistence, multi-agent coordination, or context overflow handling is needed. Built on top of Pilot Protocol (https:\u002F\u002Fgithub.com\u002FTeoSlayer\u002Fpilotprotocol).","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fa\u002Fagent-swarm-network\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: Agent Swarm Network\nversion: 1.0.6\ndescription: >\n  Agent communication protocol skill. Provides: inter-agent messaging, context\n  snapshot\u002Frestore, event-driven collaboration, model dispatch notifications,\n  sub-agent management, task routing, file transfer, and network diagnostics.\n  Invoke this Skill when cross-session context persistence, multi-agent coordination,\n  or context overflow handling is needed.\n  Built on top of Pilot Protocol (https:\u002F\u002Fgithub.com\u002FTeoSlayer\u002Fpilotprotocol).\n---\n\n# Agent Swarm Network — Agent Communication Skill\n\n> A unified communication backbone for every AI tool in the OpenClaw ecosystem\n> (OpenClaw \u002F Antigravity \u002F Codex).\n>\n> Analogy: This network = the Agent's nervous system. OpenClaw = the Agent's brain.\n\n## Acknowledgments\n\nThis Skill is built on top of [Pilot Protocol](https:\u002F\u002Fgithub.com\u002FTeoSlayer\u002Fpilotprotocol) by [@TeoSlayer](https:\u002F\u002Fgithub.com\u002FTeoSlayer). Pilot Protocol provides the core daemon, encrypted tunnels, NAT traversal, and peer-to-peer addressing that this Skill leverages. Huge thanks to the Pilot Protocol team for building the Internet of Agents.\n\n---\n\n## Permissions & Privacy\n\n**This Skill executes local CLI commands and writes files to the `~\u002F.pilot\u002F` directory.** Full transparency:\n\n| Permission | What | Why |\n|------------|------|-----|\n| **CLI Exec** | `~\u002F.pilot\u002Fbin\u002Fpilotctl` | All agent operations go through this binary |\n| **File Write** | `~\u002F.pilot\u002Finbox\u002F` | Context snapshots and incoming messages land here |\n| **File Write** | `~\u002F.pilot\u002Freceived\u002F` | Received files from peer agents |\n| **File Read** | `~\u002F.pilot\u002Finbox\u002F` | Reading snapshots for context restoration |\n| **File Read** | `~\u002F.pilot\u002Freceived\u002F` | Reading transferred files |\n| **Network** | Local Unix socket | Daemon communication (localhost only) |\n| **Network** | UDP tunnels (encrypted) | Agent-to-agent communication (AES-256-GCM) |\n| **Script Exec** | `~\u002F.pilot\u002Fcontext-snapshot.sh` | Context snapshot helper script |\n| **Script Exec** | `~\u002F.pilot\u002Fpilot-publish.sh` | Event publishing helper script |\n| **Process** | Daemon lifecycle | Start\u002Fstop\u002Fstatus of the pilotctl daemon |\n\n> **Privacy Note:** All inter-agent traffic is encrypted end-to-end using X25519 key exchange + AES-256-GCM. Agents are private by default and require mutual trust handshake before communication. No data passes through relay servers. The rendezvous registry defaults to localhost (`127.0.0.1:9000`) — no peer-discovery metadata leaves the machine unless you explicitly change `registry_url` to a remote address. Snapshots are unencrypted JSON; you must secure the `~\u002F.pilot\u002F` directory (`chmod 700`).\n\n---\n\n## Prerequisites\n\n| Tool | Purpose | Required? |\n|------|---------|-----------|\n| **Pilot Protocol** | Core daemon + CLI (`pilotctl`) | ✅ Required |\n| **OpenClaw** | Skill host + Agent orchestration | ✅ Required |\n\n## Configuration\n\nEdit `config.json` after installation:\n\n```json\n{\n  \"pilotctl_path\": \"~\u002F.pilot\u002Fbin\u002Fpilotctl\",\n  \"daemon_start_script\": \"~\u002F.pilot\u002Fstart-local.sh\",\n  \"snapshot_script\": \"~\u002F.pilot\u002Fcontext-snapshot.sh\",\n  \"publish_script\": \"~\u002F.pilot\u002Fpilot-publish.sh\",\n  \"inbox_path\": \"~\u002F.pilot\u002Finbox\u002F\",\n  \"received_path\": \"~\u002F.pilot\u002Freceived\u002F\",\n  \"agent_hostname\": \"keke-agent\"\n}\n```\n\n| Field | Description | Default |\n|-------|-------------|---------|\n| `pilotctl_path` | Path to the pilotctl binary | `~\u002F.pilot\u002Fbin\u002Fpilotctl` |\n| `daemon_start_script` | Script to start the daemon | `~\u002F.pilot\u002Fstart-local.sh` |\n| `snapshot_script` | Context snapshot helper script | `~\u002F.pilot\u002Fcontext-snapshot.sh` |\n| `publish_script` | Event publish helper script | `~\u002F.pilot\u002Fpilot-publish.sh` |\n| `inbox_path` | Directory for incoming messages\u002Fsnapshots | `~\u002F.pilot\u002Finbox\u002F` |\n| `received_path` | Directory for received files | `~\u002F.pilot\u002Freceived\u002F` |\n| `agent_hostname` | This agent's hostname on the Pilot network | `keke-agent` |\n\n### First-time Setup\n\n1. **Install Pilot Protocol securely:** We strongly recommend **building from source** to eliminate supply-chain risk. Clone `https:\u002F\u002Fgithub.com\u002FTeoSlayer\u002Fpilotprotocol`, audit the source, compile via `go build`, and place the binary at `~\u002F.pilot\u002Fbin\u002Fpilotctl`.\n2. Secure your directories: `chmod 700 ~\u002F.pilot`\n3. Start the daemon: `~\u002F.pilot\u002Fstart-local.sh`\n4. Verify: `~\u002F.pilot\u002Fbin\u002Fpilotctl --json daemon status`\n\n---\n\n## Global Rules\n\n1. All `pilotctl` commands use the full path: `~\u002F.pilot\u002Fbin\u002Fpilotctl`\n2. Always append the `--json` flag for structured output\n3. Check the returned `status` field: `ok` = success, `error` = failure\n4. On failure, read the `hint` field for remediation guidance\n\n---\n\n## ⚠️ Single-Node Mode (Current State)\n\nCurrently running with only one node (`keke-agent`). **Cannot send network messages to self** (publish\u002Fsend-message will return `connection_failed`).\n\n### Single-Node Workarounds\n\n| Operation | Multi-node Command | Single-node Alternative |\n|-----------|-------------------|------------------------|\n| Publish event | `pilotctl publish keke-agent topic --data ...` | `~\u002F.pilot\u002Fpilot-publish.sh topic '{\"key\":\"val\"}'` |\n| Send to inbox | `pilotctl send-message keke-agent --data ...` | Write file directly to `~\u002F.pilot\u002Finbox\u002F` |\n| Context snapshot | `pilotctl send-message ...` | `~\u002F.pilot\u002Fcontext-snapshot.sh` |\n| Read inbox | `pilotctl inbox` → read `~\u002F.pilot\u002Finbox\u002F` | Same (read directory directly) |\n| Check status | `pilotctl info` | ✅ Works normally |\n| Set tags | `pilotctl set-tags ...` | ✅ Works normally |\n\nWhen a second node joins (e.g., VPS or another Mac), network commands will activate automatically.\n\n---\n\n## Capability 1: Context Snapshot & Restore (Highest Priority)\n\n### 1.1 Save Context Snapshot\n\nWhen a session ends, compaction triggers, or manual request is made, save critical context:\n\n```bash\n# Using the snapshot script (works in both single-node and multi-node)\n~\u002F.pilot\u002Fcontext-snapshot.sh SESSION_ID \"Key summary of current context\"\n\n# Or manually write to inbox\necho '{\"type\":\"context_snapshot\",\"session_id\":\"ID\",\"summary\":\"Summary\"}' > ~\u002F.pilot\u002Finbox\u002Fsnapshot_$(date +%Y%m%d_%H%M%S).json\n```\n\n### 1.2 Restore Context\n\nWhen a new session starts, read the previous session's snapshot:\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json inbox\n```\n\nReturns a `messages` array sorted by `received_at`. Read the most recent `context_snapshot` type message.\n\n### 1.3 Context Overflow Protocol\n\nWhen context usage exceeds 80%:\n\n```\nStep 1: Extract critical information from current context\nStep 2: Serialize as JSON snapshot\nStep 3: pilotctl send-message keke-agent --data \"{snapshot}\" --type json\nStep 4: pilotctl publish keke-agent context.overflow --data \"overflow at TOKEN_COUNT tokens\"\nStep 5: Suggest user starts a new session\nStep 6: New session automatically restores from inbox\n```\n\n---\n\n## Capability 2: Event-Driven Collaboration\n\n### 2.1 Publish Events\n\nWhen significant events occur, use `pilot-publish.sh` (automatically handles single-node\u002Fmulti-node):\n\n```bash\n# Model switch\n~\u002F.pilot\u002Fpilot-publish.sh model.switch '{\"from\":\"flash-lite\",\"to\":\"opus-4.6\",\"reason\":\"strategic analysis\"}'\n\n# Task completion\n~\u002F.pilot\u002Fpilot-publish.sh task.complete '{\"task\":\"intelligence_ingestion\",\"source\":\"twitter\"}'\n\n# Context compaction\n~\u002F.pilot\u002Fpilot-publish.sh context.compaction '{\"before_tokens\":150000,\"after_tokens\":30000}'\n\n# Error alert\n~\u002F.pilot\u002Fpilot-publish.sh error.alert '{\"type\":\"model_402\",\"model\":\"gemini\",\"action\":\"fallback\"}'\n\n# Intelligence ingested\n~\u002F.pilot\u002Fpilot-publish.sh intel.ingested '{\"source\":\"url\",\"title\":\"Article Title\",\"category\":\"infra\"}'\n```\n\n### 2.2 Subscribe to Events\n\nListen for specific topics (used by sub-agents or external monitors):\n\n```bash\n# Listen to all events\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json subscribe keke-agent \"*\" --timeout 60s\n\n# Listen only to model switches\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json subscribe keke-agent model.switch --count 1\n\n# Listen for error alerts\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json subscribe keke-agent error.* --timeout 300s\n```\n\n### 2.3 Standard Event Topics\n\n| Topic | Trigger | Data Schema |\n|-------|---------|-------------|\n| `context.snapshot` | Session end \u002F manual save | `{session_id, summary, key_decisions}` |\n| `context.overflow` | Token usage > 80% | `{token_count, threshold}` |\n| `context.compaction` | Compaction triggered | `{before_tokens, after_tokens}` |\n| `model.switch` | Model changed | `{from, to, reason}` |\n| `model.error` | Model failure | `{model, error, fallback}` |\n| `task.start` | Task initiated | `{task, type, model}` |\n| `task.complete` | Task finished | `{task, result_summary}` |\n| `task.error` | Task failed | `{task, error, retry}` |\n| `intel.ingested` | Information ingested | `{source, title, category, value}` |\n| `error.alert` | Error notification | `{type, details, action}` |\n| `agent.spawn` | Sub-agent created | `{hostname, purpose, model}` |\n| `agent.exit` | Sub-agent exited | `{hostname, reason, result}` |\n\n---\n\n## Capability 3: Sub-Agent Management\n\n### 3.1 Naming Convention\n\n```\nPrimary agent:    keke-agent\nSub-agents:       keke-sub-{purpose}  (e.g., keke-sub-code, keke-sub-writer)\nNested sub:       keke-sub-{purpose}-{n}\n```\n\n### 3.2 Spawning Sub-Agents\n\nWhen OpenClaw needs to create a sub-agent for overflow tasks:\n\n```bash\n# Publish agent spawn event\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json publish keke-agent agent.spawn \\\n  --data '{\"hostname\":\"keke-sub-code\",\"purpose\":\"code refactoring\",\"model\":\"sonnet-4.6\"}'\n```\n\n### 3.3 Collecting Sub-Agent Results\n\n```bash\n# Sub-agent sends results via Data Exchange\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json send-message keke-agent \\\n  --data '{\"type\":\"sub_agent_result\",\"from\":\"keke-sub-code\",\"result\":\"refactoring complete\",\"files_changed\":3}' \\\n  --type json\n\n# Primary agent checks results\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json inbox\n```\n\n---\n\n## Capability 4: Task Routing\n\n### 4.1 Route by Tags\n\nAssign capability tags to different agents:\n\n```bash\n# Tag self\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json set-tags orchestrator chinese fast\n```\n\nTag conventions:\n\n| Tag | Meaning | Best Fit Agent |\n|-----|---------|---------------|\n| `orchestrator` | Scheduling & dispatch | OpenClaw primary agent |\n| `deep-reasoning` | Deep reasoning tasks | Antigravity (Opus) |\n| `code-gen` | Code generation | Codex (Sonnet) |\n| `local-inference` | Local model inference | LM Studio (Qwen) |\n| `fast` | Fast responses | Flash Lite instances |\n| `chinese` | Chinese language tasks | Qwen \u002F Chinese-optimized models |\n\n### 4.2 Find the Best Agent\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json peers --search \"code-gen\"\n```\n\n---\n\n## Capability 5: Model Dispatch Notifications\n\n### 5.1 Publish Model Switch Events\n\nEvery model switch gets logged to the event stream:\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json publish keke-agent model.switch \\\n  --data '{\"from\":\"CURRENT_MODEL\",\"to\":\"NEW_MODEL\",\"reason\":\"reason\",\"timestamp\":\"ISO8601\"}'\n```\n\n### 5.2 Model Fallback Chain\n\nOn model failure, automatically publish degradation events:\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json publish keke-agent model.error \\\n  --data '{\"model\":\"gemini-3-flash\",\"error\":\"402 quota exceeded\",\"fallback\":\"minimax-m2.5\"}'\n```\n\n---\n\n## Capability 6: File Transfer\n\n### 6.1 Send File\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json send-file keke-agent \u002Fpath\u002Fto\u002Ffile\n```\n\nFiles are saved to `~\u002F.pilot\u002Freceived\u002F`.\n\n### 6.2 View Received Files\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json received\n```\n\n### 6.3 Use Cases\n\n- Transfer context snapshot files\n- Transfer code diffs\n- Transfer analysis reports\n- Share configuration across agents\n\n---\n\n## Capability 7: Network Diagnostics\n\n### 7.1 Health Checks\n\n```bash\n# Daemon status\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json daemon status\n\n# Agent info\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json info\n\n# Connection list\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json connections\n\n# Peer list\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json peers\n```\n\n### 7.2 Performance Testing\n\n```bash\n# Ping latency\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json ping keke-agent --count 3\n\n# Throughput benchmark\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json bench keke-agent 1\n```\n\n---\n\n## Capability 8: Gateway IP Bridging\n\n### 8.1 Map Agent to Local IP\n\n```bash\n# Gateway bridging on user-space ports (>1024) does NOT require root\u002Fsudo.\n~\u002F.pilot\u002Fbin\u002Fpilotctl gateway start --ports 1234,8080 0:0000.0000.0001\n```\n\nOnce mapped, standard HTTP tools can be used:\n```bash\ncurl http:\u002F\u002F10.4.0.1:1234\u002Fv1\u002Fchat\u002Fcompletions  # Like calling LM Studio directly\n```\n\n### 8.2 Use Cases\n\n- Expose LM Studio through Gateway as a Pilot address\n- Unify all model endpoints under one entry point\n- Access agent services with standard HTTP tools\n\n---\n\n## Capability 9: Webhook Real-time Monitoring\n\n### 9.1 Set Up Webhook\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json set-webhook http:\u002F\u002Flocalhost:8080\u002Fpilot-events\n```\n\n### 9.2 Event Types\n\nAll native daemon events are pushed to the webhook:\n- `node.registered` \u002F `node.reregistered`\n- `conn.established` \u002F `conn.fin` \u002F `conn.rst`\n- `handshake.received` \u002F `handshake.approved`\n- `message.received` \u002F `file.received`\n- `pubsub.published` \u002F `pubsub.subscribed`\n- `security.syn_rate_limited` \u002F `security.nonce_replay`\n\n---\n\n## Standing Orders (Automation Rules)\n\n### Rule 1: Snapshot Before Session End\nAutomatically execute a context snapshot (Capability 1.1) before every session ends.\n\n### Rule 2: Critical Events Must Be Published\nThe following events must always be published to the Event Stream:\n- Model switches\n- Intelligence ingestion completions\n- Task completions\u002Ffailures\n- Context compactions\n- Error alerts\n\n### Rule 3: Auto-Restore on New Session\nOn every new session start, check `pilotctl inbox` for the latest snapshot and restore context.\n\n### Rule 4: Daemon Heartbeat\nCheck daemon status every 30 minutes. Auto-restart on failure.\n\n---\n\n## Troubleshooting\n\n| Problem | Diagnostic Command | Solution |\n|---------|--------------------|----------|\n| Daemon not running | `pilotctl daemon status` | `~\u002F.pilot\u002Fstart-local.sh` |\n| Registry unreachable | `pilotctl info` (check peers) | Verify rendezvous server is running |\n| Messages not sending | `pilotctl connections` | Check trust state with target |\n| Inbox overflowing | `pilotctl inbox` | `pilotctl inbox --clear` |\n","# Agent Swarm Network — Agent Communication Skill\n\n> A unified communication backbone for every AI tool in the OpenClaw ecosystem\n> (OpenClaw \u002F Antigravity \u002F Codex).\n>\n> Analogy: This network = the Agent's nervous system. OpenClaw = the Agent's brain.\n\n## Acknowledgments\n\nThis Skill is built on top of [Pilot Protocol](https:\u002F\u002Fgithub.com\u002FTeoSlayer\u002Fpilotprotocol) by [@TeoSlayer](https:\u002F\u002Fgithub.com\u002FTeoSlayer). Pilot Protocol provides the core daemon, encrypted tunnels, NAT traversal, and peer-to-peer addressing that this Skill leverages. Huge thanks to the Pilot Protocol team for building the Internet of Agents.\n\n---\n\n## Permissions & Privacy\n\n**This Skill executes local CLI commands and writes files to the `~\u002F.pilot\u002F` directory.** Full transparency:\n\n| Permission | What | Why |\n|------------|------|-----|\n| **CLI Exec** | `~\u002F.pilot\u002Fbin\u002Fpilotctl` | All agent operations go through this binary |\n| **File Write** | `~\u002F.pilot\u002Finbox\u002F` | Context snapshots and incoming messages land here |\n| **File Write** | `~\u002F.pilot\u002Freceived\u002F` | Received files from peer agents |\n| **File Read** | `~\u002F.pilot\u002Finbox\u002F` | Reading snapshots for context restoration |\n| **File Read** | `~\u002F.pilot\u002Freceived\u002F` | Reading transferred files |\n| **Network** | Local Unix socket | Daemon communication (localhost only) |\n| **Network** | UDP tunnels (encrypted) | Agent-to-agent communication (AES-256-GCM) |\n| **Script Exec** | `~\u002F.pilot\u002Fcontext-snapshot.sh` | Context snapshot helper script |\n| **Script Exec** | `~\u002F.pilot\u002Fpilot-publish.sh` | Event publishing helper script |\n| **Process** | Daemon lifecycle | Start\u002Fstop\u002Fstatus of the pilotctl daemon |\n\n> **Privacy Note:** All inter-agent traffic is encrypted end-to-end using X25519 key exchange + AES-256-GCM. Agents are private by default and require mutual trust handshake before communication. No data passes through relay servers. The rendezvous registry defaults to localhost (`127.0.0.1:9000`) — no peer-discovery metadata leaves the machine unless you explicitly change `registry_url` to a remote address. Snapshots are unencrypted JSON; you must secure the `~\u002F.pilot\u002F` directory (`chmod 700`).\n\n---\n\n## Prerequisites\n\n| Tool | Purpose | Required? |\n|------|---------|-----------|\n| **Pilot Protocol** | Core daemon + CLI (`pilotctl`) | ✅ Required |\n| **OpenClaw** | Skill host + Agent orchestration | ✅ Required |\n\n## Configuration\n\nEdit `config.json` after installation:\n\n```json\n{\n  \"pilotctl_path\": \"~\u002F.pilot\u002Fbin\u002Fpilotctl\",\n  \"daemon_start_script\": \"~\u002F.pilot\u002Fstart-local.sh\",\n  \"snapshot_script\": \"~\u002F.pilot\u002Fcontext-snapshot.sh\",\n  \"publish_script\": \"~\u002F.pilot\u002Fpilot-publish.sh\",\n  \"inbox_path\": \"~\u002F.pilot\u002Finbox\u002F\",\n  \"received_path\": \"~\u002F.pilot\u002Freceived\u002F\",\n  \"agent_hostname\": \"keke-agent\"\n}\n```\n\n| Field | Description | Default |\n|-------|-------------|---------|\n| `pilotctl_path` | Path to the pilotctl binary | `~\u002F.pilot\u002Fbin\u002Fpilotctl` |\n| `daemon_start_script` | Script to start the daemon | `~\u002F.pilot\u002Fstart-local.sh` |\n| `snapshot_script` | Context snapshot helper script | `~\u002F.pilot\u002Fcontext-snapshot.sh` |\n| `publish_script` | Event publish helper script | `~\u002F.pilot\u002Fpilot-publish.sh` |\n| `inbox_path` | Directory for incoming messages\u002Fsnapshots | `~\u002F.pilot\u002Finbox\u002F` |\n| `received_path` | Directory for received files | `~\u002F.pilot\u002Freceived\u002F` |\n| `agent_hostname` | This agent's hostname on the Pilot network | `keke-agent` |\n\n### First-time Setup\n\n1. **Install Pilot Protocol securely:** We strongly recommend **building from source** to eliminate supply-chain risk. Clone `https:\u002F\u002Fgithub.com\u002FTeoSlayer\u002Fpilotprotocol`, audit the source, compile via `go build`, and place the binary at `~\u002F.pilot\u002Fbin\u002Fpilotctl`.\n2. Secure your directories: `chmod 700 ~\u002F.pilot`\n3. Start the daemon: `~\u002F.pilot\u002Fstart-local.sh`\n4. Verify: `~\u002F.pilot\u002Fbin\u002Fpilotctl --json daemon status`\n\n---\n\n## Global Rules\n\n1. All `pilotctl` commands use the full path: `~\u002F.pilot\u002Fbin\u002Fpilotctl`\n2. Always append the `--json` flag for structured output\n3. Check the returned `status` field: `ok` = success, `error` = failure\n4. On failure, read the `hint` field for remediation guidance\n\n---\n\n## ⚠️ Single-Node Mode (Current State)\n\nCurrently running with only one node (`keke-agent`). **Cannot send network messages to self** (publish\u002Fsend-message will return `connection_failed`).\n\n### Single-Node Workarounds\n\n| Operation | Multi-node Command | Single-node Alternative |\n|-----------|-------------------|------------------------|\n| Publish event | `pilotctl publish keke-agent topic --data ...` | `~\u002F.pilot\u002Fpilot-publish.sh topic '{\"key\":\"val\"}'` |\n| Send to inbox | `pilotctl send-message keke-agent --data ...` | Write file directly to `~\u002F.pilot\u002Finbox\u002F` |\n| Context snapshot | `pilotctl send-message ...` | `~\u002F.pilot\u002Fcontext-snapshot.sh` |\n| Read inbox | `pilotctl inbox` → read `~\u002F.pilot\u002Finbox\u002F` | Same (read directory directly) |\n| Check status | `pilotctl info` | ✅ Works normally |\n| Set tags | `pilotctl set-tags ...` | ✅ Works normally |\n\nWhen a second node joins (e.g., VPS or another Mac), network commands will activate automatically.\n\n---\n\n## Capability 1: Context Snapshot & Restore (Highest Priority)\n\n### 1.1 Save Context Snapshot\n\nWhen a session ends, compaction triggers, or manual request is made, save critical context:\n\n```bash\n# Using the snapshot script (works in both single-node and multi-node)\n~\u002F.pilot\u002Fcontext-snapshot.sh SESSION_ID \"Key summary of current context\"\n\n# Or manually write to inbox\necho '{\"type\":\"context_snapshot\",\"session_id\":\"ID\",\"summary\":\"Summary\"}' > ~\u002F.pilot\u002Finbox\u002Fsnapshot_$(date +%Y%m%d_%H%M%S).json\n```\n\n### 1.2 Restore Context\n\nWhen a new session starts, read the previous session's snapshot:\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json inbox\n```\n\nReturns a `messages` array sorted by `received_at`. Read the most recent `context_snapshot` type message.\n\n### 1.3 Context Overflow Protocol\n\nWhen context usage exceeds 80%:\n\n```\nStep 1: Extract critical information from current context\nStep 2: Serialize as JSON snapshot\nStep 3: pilotctl send-message keke-agent --data \"{snapshot}\" --type json\nStep 4: pilotctl publish keke-agent context.overflow --data \"overflow at TOKEN_COUNT tokens\"\nStep 5: Suggest user starts a new session\nStep 6: New session automatically restores from inbox\n```\n\n---\n\n## Capability 2: Event-Driven Collaboration\n\n### 2.1 Publish Events\n\nWhen significant events occur, use `pilot-publish.sh` (automatically handles single-node\u002Fmulti-node):\n\n```bash\n# Model switch\n~\u002F.pilot\u002Fpilot-publish.sh model.switch '{\"from\":\"flash-lite\",\"to\":\"opus-4.6\",\"reason\":\"strategic analysis\"}'\n\n# Task completion\n~\u002F.pilot\u002Fpilot-publish.sh task.complete '{\"task\":\"intelligence_ingestion\",\"source\":\"twitter\"}'\n\n# Context compaction\n~\u002F.pilot\u002Fpilot-publish.sh context.compaction '{\"before_tokens\":150000,\"after_tokens\":30000}'\n\n# Error alert\n~\u002F.pilot\u002Fpilot-publish.sh error.alert '{\"type\":\"model_402\",\"model\":\"gemini\",\"action\":\"fallback\"}'\n\n# Intelligence ingested\n~\u002F.pilot\u002Fpilot-publish.sh intel.ingested '{\"source\":\"url\",\"title\":\"Article Title\",\"category\":\"infra\"}'\n```\n\n### 2.2 Subscribe to Events\n\nListen for specific topics (used by sub-agents or external monitors):\n\n```bash\n# Listen to all events\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json subscribe keke-agent \"*\" --timeout 60s\n\n# Listen only to model switches\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json subscribe keke-agent model.switch --count 1\n\n# Listen for error alerts\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json subscribe keke-agent error.* --timeout 300s\n```\n\n### 2.3 Standard Event Topics\n\n| Topic | Trigger | Data Schema |\n|-------|---------|-------------|\n| `context.snapshot` | Session end \u002F manual save | `{session_id, summary, key_decisions}` |\n| `context.overflow` | Token usage > 80% | `{token_count, threshold}` |\n| `context.compaction` | Compaction triggered | `{before_tokens, after_tokens}` |\n| `model.switch` | Model changed | `{from, to, reason}` |\n| `model.error` | Model failure | `{model, error, fallback}` |\n| `task.start` | Task initiated | `{task, type, model}` |\n| `task.complete` | Task finished | `{task, result_summary}` |\n| `task.error` | Task failed | `{task, error, retry}` |\n| `intel.ingested` | Information ingested | `{source, title, category, value}` |\n| `error.alert` | Error notification | `{type, details, action}` |\n| `agent.spawn` | Sub-agent created | `{hostname, purpose, model}` |\n| `agent.exit` | Sub-agent exited | `{hostname, reason, result}` |\n\n---\n\n## Capability 3: Sub-Agent Management\n\n### 3.1 Naming Convention\n\n```\nPrimary agent:    keke-agent\nSub-agents:       keke-sub-{purpose}  (e.g., keke-sub-code, keke-sub-writer)\nNested sub:       keke-sub-{purpose}-{n}\n```\n\n### 3.2 Spawning Sub-Agents\n\nWhen OpenClaw needs to create a sub-agent for overflow tasks:\n\n```bash\n# Publish agent spawn event\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json publish keke-agent agent.spawn \\\n  --data '{\"hostname\":\"keke-sub-code\",\"purpose\":\"code refactoring\",\"model\":\"sonnet-4.6\"}'\n```\n\n### 3.3 Collecting Sub-Agent Results\n\n```bash\n# Sub-agent sends results via Data Exchange\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json send-message keke-agent \\\n  --data '{\"type\":\"sub_agent_result\",\"from\":\"keke-sub-code\",\"result\":\"refactoring complete\",\"files_changed\":3}' \\\n  --type json\n\n# Primary agent checks results\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json inbox\n```\n\n---\n\n## Capability 4: Task Routing\n\n### 4.1 Route by Tags\n\nAssign capability tags to different agents:\n\n```bash\n# Tag self\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json set-tags orchestrator chinese fast\n```\n\nTag conventions:\n\n| Tag | Meaning | Best Fit Agent |\n|-----|---------|---------------|\n| `orchestrator` | Scheduling & dispatch | OpenClaw primary agent |\n| `deep-reasoning` | Deep reasoning tasks | Antigravity (Opus) |\n| `code-gen` | Code generation | Codex (Sonnet) |\n| `local-inference` | Local model inference | LM Studio (Qwen) |\n| `fast` | Fast responses | Flash Lite instances |\n| `chinese` | Chinese language tasks | Qwen \u002F Chinese-optimized models |\n\n### 4.2 Find the Best Agent\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json peers --search \"code-gen\"\n```\n\n---\n\n## Capability 5: Model Dispatch Notifications\n\n### 5.1 Publish Model Switch Events\n\nEvery model switch gets logged to the event stream:\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json publish keke-agent model.switch \\\n  --data '{\"from\":\"CURRENT_MODEL\",\"to\":\"NEW_MODEL\",\"reason\":\"reason\",\"timestamp\":\"ISO8601\"}'\n```\n\n### 5.2 Model Fallback Chain\n\nOn model failure, automatically publish degradation events:\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json publish keke-agent model.error \\\n  --data '{\"model\":\"gemini-3-flash\",\"error\":\"402 quota exceeded\",\"fallback\":\"minimax-m2.5\"}'\n```\n\n---\n\n## Capability 6: File Transfer\n\n### 6.1 Send File\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json send-file keke-agent \u002Fpath\u002Fto\u002Ffile\n```\n\nFiles are saved to `~\u002F.pilot\u002Freceived\u002F`.\n\n### 6.2 View Received Files\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json received\n```\n\n### 6.3 Use Cases\n\n- Transfer context snapshot files\n- Transfer code diffs\n- Transfer analysis reports\n- Share configuration across agents\n\n---\n\n## Capability 7: Network Diagnostics\n\n### 7.1 Health Checks\n\n```bash\n# Daemon status\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json daemon status\n\n# Agent info\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json info\n\n# Connection list\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json connections\n\n# Peer list\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json peers\n```\n\n### 7.2 Performance Testing\n\n```bash\n# Ping latency\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json ping keke-agent --count 3\n\n# Throughput benchmark\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json bench keke-agent 1\n```\n\n---\n\n## Capability 8: Gateway IP Bridging\n\n### 8.1 Map Agent to Local IP\n\n```bash\n# Gateway bridging on user-space ports (>1024) does NOT require root\u002Fsudo.\n~\u002F.pilot\u002Fbin\u002Fpilotctl gateway start --ports 1234,8080 0:0000.0000.0001\n```\n\nOnce mapped, standard HTTP tools can be used:\n```bash\ncurl http:\u002F\u002F10.4.0.1:1234\u002Fv1\u002Fchat\u002Fcompletions  # Like calling LM Studio directly\n```\n\n### 8.2 Use Cases\n\n- Expose LM Studio through Gateway as a Pilot address\n- Unify all model endpoints under one entry point\n- Access agent services with standard HTTP tools\n\n---\n\n## Capability 9: Webhook Real-time Monitoring\n\n### 9.1 Set Up Webhook\n\n```bash\n~\u002F.pilot\u002Fbin\u002Fpilotctl --json set-webhook http:\u002F\u002Flocalhost:8080\u002Fpilot-events\n```\n\n### 9.2 Event Types\n\nAll native daemon events are pushed to the webhook:\n- `node.registered` \u002F `node.reregistered`\n- `conn.established` \u002F `conn.fin` \u002F `conn.rst`\n- `handshake.received` \u002F `handshake.approved`\n- `message.received` \u002F `file.received`\n- `pubsub.published` \u002F `pubsub.subscribed`\n- `security.syn_rate_limited` \u002F `security.nonce_replay`\n\n---\n\n## Standing Orders (Automation Rules)\n\n### Rule 1: Snapshot Before Session End\nAutomatically execute a context snapshot (Capability 1.1) before every session ends.\n\n### Rule 2: Critical Events Must Be Published\nThe following events must always be published to the Event Stream:\n- Model switches\n- Intelligence ingestion completions\n- Task completions\u002Ffailures\n- Context compactions\n- Error alerts\n\n### Rule 3: Auto-Restore on New Session\nOn every new session start, check `pilotctl inbox` for the latest snapshot and restore context.\n\n### Rule 4: Daemon Heartbeat\nCheck daemon status every 30 minutes. Auto-restart on failure.\n\n---\n\n## Troubleshooting\n\n| Problem | Diagnostic Command | Solution |\n|---------|--------------------|----------|\n| Daemon not running | `pilotctl daemon status` | `~\u002F.pilot\u002Fstart-local.sh` |\n| Registry unreachable | `pilotctl info` (check peers) | Verify rendezvous server is running |\n| Messages not sending | `pilotctl connections` | Check trust state with target |\n| Inbox overflowing | `pilotctl inbox` | `pilotctl inbox --clear` |\n",{"name":5,"version":24,"description":7},"1.0.6","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fa\u002Fagent-swarm-network",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill \"Agent Swarm Network\"",{"tool":40,"command":41},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill \"Agent Swarm Network\"",{"tool":43,"command":44},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill \"Agent Swarm Network\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fa\u002Fagent-swarm-network\u002FSKILL.md",true,[],[49,57,64,71,78,85],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":56},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":56},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":56},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":56},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":56},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":56},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]