{"id":"d0826991-27d0-4b75-bedf-1e334bc9501e","shortId":"rRMCck","kind":"skill","title":"pilot-heartbeat-monitor","tagline":"Detect agent failures and trigger automatic task redistribution or re-election.  Use this skill when: 1. You need to detect when swarm members become unreachable 2. You want to trigger failover actions on agent failure 3. You need health monitoring for load balancing or leader el","description":"# pilot-heartbeat-monitor\n\nMonitor agent health via periodic heartbeats and detect failures using timeout-based detection.\n\n## Commands\n\n### Send heartbeat to peers\n```bash\npilotctl --json publish \"registry-hostname\" \"heartbeat:$SWARM_NAME\" \\\n  --data \"{\\\"agent\\\":\\\"$AGENT_ID\\\",\\\"timestamp\\\":\\\"$(date -u +%s)\\\",\\\"status\\\":\\\"alive\\\"}\"\n```\n\n### Detect failed agents\n```bash\nTIMEOUT=30\nCURRENT_TIME=$(date -u +%s)\n\nFAILED_AGENTS=$(pilotctl --json inbox \\\n  | jq --arg now \"$CURRENT_TIME\" --arg timeout \"$TIMEOUT\" \\\n    '[.messages[] | select(.topic == \"heartbeat:'$SWARM_NAME'\") | {agent: .payload.agent, last_seen: .payload.timestamp}]\n    | group_by(.agent)\n    | map(select(($now | tonumber) - (map(.last_seen) | max) > ($timeout | tonumber)))\n    | .[].agent')\n```\n\n### Verify failure with direct ping\n```bash\nfor agent in $FAILED_AGENTS; do\n  AGENT_ADDR=$(pilotctl --json peers | jq -r '.[] | select(.node_id == \"'$agent'\") | .address')\n\n  PING_RESULT=$(pilotctl --json ping \"$AGENT_ADDR\" --count 3 --timeout 2s)\n  LOSS=$(echo \"$PING_RESULT\" | jq -r '.packet_loss_pct')\n\n  if [ \"$LOSS\" = \"100\" ]; then\n    echo \"Agent $agent CONFIRMED DOWN\"\n  fi\ndone\n```\n\n## Workflow Example\n\nHealth monitor for worker pool with automatic task redistribution:\n\n```bash\n#!/bin/bash\nSWARM_NAME=\"worker-pool\"\nHEARTBEAT_INTERVAL=5\nFAILURE_TIMEOUT=15\nREGISTRY_HOST=\"registry.example.com\"\n\n# Background: Send own heartbeats\n(\n  while true; do\n    pilotctl --json publish \"$REGISTRY_HOST\" \"heartbeat:$SWARM_NAME\" \\\n      --data \"{\\\"agent\\\":\\\"$AGENT_ID\\\",\\\"timestamp\\\":\\\"$(date -u +%s)\\\"}\"\n    sleep $HEARTBEAT_INTERVAL\n  done\n) &\n\n# Monitor peer heartbeats\nwhile true; do\n  CURRENT_TIME=$(date -u +%s)\n\n  # Detect timeouts and trigger recovery\n  # ...\n\n  sleep $HEARTBEAT_INTERVAL\ndone\n```\n\n## Dependencies\n\nRequires pilot-protocol skill, jq, and bc.","tags":["pilot","heartbeat","monitor","skills","teoslayer","agent-skills","ai-agents","clawhub","networking","openclaw","overlay-network","p2p"],"capabilities":["skill","source-teoslayer","skill-pilot-heartbeat-monitor","topic-agent-skills","topic-ai-agents","topic-clawhub","topic-networking","topic-openclaw","topic-overlay-network","topic-p2p","topic-pilot-protocol"],"categories":["pilot-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/TeoSlayer/pilot-skills/pilot-heartbeat-monitor","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add TeoSlayer/pilot-skills","source_repo":"https://github.com/TeoSlayer/pilot-skills","install_from":"skills.sh"}},"qualityScore":"0.453","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 6 github stars · SKILL.md body (1,829 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:14:56.722Z","embedding":null,"createdAt":"2026-05-18T13:22:41.903Z","updatedAt":"2026-05-18T19:14:56.722Z","lastSeenAt":"2026-05-18T19:14:56.722Z","tsv":"'/bin/bash':211 '1':21 '100':190 '15':222 '2':31 '2s':178 '3':41,176 '30':100 '5':219 'action':37 'addr':157,174 'address':167 'agent':6,39,57,86,87,97,107,125,132,143,151,154,156,166,173,193,194,242,243 'aliv':94 'arg':112,116 'automat':10,207 'background':226 'balanc':48 'base':68 'bash':75,98,149,210 'bc':281 'becom':29 'command':70 'confirm':195 'count':175 'current':101,114,259 'data':85,241 'date':90,103,246,261 'depend':273 'detect':5,25,63,69,95,264 'direct':147 'done':198,252,272 'echo':180,192 'el':51 'elect':16 'exampl':200 'fail':96,106,153 'failov':36 'failur':7,40,64,145,220 'fi':197 'group':130 'health':44,58,201 'heartbeat':3,54,61,72,82,122,217,229,238,250,255,270 'host':224,237 'hostnam':81 'id':88,165,244 'inbox':110 'interv':218,251,271 'jq':111,161,183,279 'json':77,109,159,171,234 'last':127,138 'leader':50 'load':47 'loss':179,186,189 'map':133,137 'max':140 'member':28 'messag':119 'monitor':4,45,55,56,202,253 'name':84,124,213,240 'need':23,43 'node':164 'packet':185 'payload.agent':126 'payload.timestamp':129 'pct':187 'peer':74,160,254 'period':60 'pilot':2,53,276 'pilot-heartbeat-monitor':1,52 'pilot-protocol':275 'pilotctl':76,108,158,170,233 'ping':148,168,172,181 'pool':205,216 'protocol':277 'publish':78,235 'r':162,184 're':15 're-elect':14 'recoveri':268 'redistribut':12,209 'registri':80,223,236 'registry-hostnam':79 'registry.example.com':225 'requir':274 'result':169,182 'seen':128,139 'select':120,134,163 'send':71,227 'skill':19,278 'skill-pilot-heartbeat-monitor' 'sleep':249,269 'source-teoslayer' 'status':93 'swarm':27,83,123,212,239 'task':11,208 'time':102,115,260 'timeout':67,99,117,118,141,177,221,265 'timeout-bas':66 'timestamp':89,245 'tonumb':136,142 'topic':121 'topic-agent-skills' 'topic-ai-agents' 'topic-clawhub' 'topic-networking' 'topic-openclaw' 'topic-overlay-network' 'topic-p2p' 'topic-pilot-protocol' 'trigger':9,35,267 'true':231,257 'u':91,104,247,262 'unreach':30 'use':17,65 'verifi':144 'via':59 'want':33 'worker':204,215 'worker-pool':214 'workflow':199","prices":[{"id":"8a8bd4af-e3ea-4cfb-952b-46077da0bd2b","listingId":"d0826991-27d0-4b75-bedf-1e334bc9501e","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"TeoSlayer","category":"pilot-skills","install_from":"skills.sh"},"createdAt":"2026-05-18T13:22:41.903Z"}],"sources":[{"listingId":"d0826991-27d0-4b75-bedf-1e334bc9501e","source":"github","sourceId":"TeoSlayer/pilot-skills/pilot-heartbeat-monitor","sourceUrl":"https://github.com/TeoSlayer/pilot-skills/tree/main/skills/pilot-heartbeat-monitor","isPrimary":false,"firstSeenAt":"2026-05-18T13:22:41.903Z","lastSeenAt":"2026-05-18T19:14:56.722Z"}],"details":{"listingId":"d0826991-27d0-4b75-bedf-1e334bc9501e","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"TeoSlayer","slug":"pilot-heartbeat-monitor","github":{"repo":"TeoSlayer/pilot-skills","stars":6,"topics":["agent-skills","ai-agents","clawhub","networking","openclaw","overlay-network","p2p","pilot-protocol"],"license":"agpl-3.0","html_url":"https://github.com/TeoSlayer/pilot-skills","pushed_at":"2026-05-13T06:08:49Z","description":"80+ agent skills for Pilot Protocol — communication, file transfer, trust, task routing, swarm coordination, and more","skill_md_sha":"82cdbc072465473e4fc23c6cc9ccfb3668418f45","skill_md_path":"skills/pilot-heartbeat-monitor/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/TeoSlayer/pilot-skills/tree/main/skills/pilot-heartbeat-monitor"},"layout":"multi","source":"github","category":"pilot-skills","frontmatter":{"name":"pilot-heartbeat-monitor","license":"AGPL-3.0","description":"Detect agent failures and trigger automatic task redistribution or re-election.  Use this skill when: 1. You need to detect when swarm members become unreachable 2. You want to trigger failover actions on agent failure 3. You need health monitoring for load balancing or leader election  Do NOT use this skill when: - Agents can safely fail without recovery (fire-and-forget tasks) - Network partitions are rare and acceptable (use simpler ping checks)","compatibility":"Requires pilot-protocol skill and pilotctl binary on PATH. The daemon must be running (pilotctl daemon start)."},"skills_sh_url":"https://skills.sh/TeoSlayer/pilot-skills/pilot-heartbeat-monitor"},"updatedAt":"2026-05-18T19:14:56.722Z"}}