Skillquality 0.45
pilot-leader-election
Elect a coordinator with automatic failover using heartbeat-based leader election. Use this skill when: 1. A swarm needs a single coordinator for decision making 2. You need automatic failover when the current leader fails 3. You want to avoid split-brain with deterministic tie-
Price
free
Protocol
skill
Verified
no
What it does
pilot-leader-election
Implement leader election protocols with automatic failover detection.
Commands
Announce candidacy
pilotctl --json publish "registry-hostname" "election:$ELECTION_GROUP" \
--data "{\"type\":\"election\",\"candidate\":\"$AGENT_ID\",\"priority\":$PRIORITY,\"term\":$TERM}"
Declare victory as leader
pilotctl --json publish "registry-hostname" "election:$ELECTION_GROUP" \
--data "{\"type\":\"leader\",\"leader\":\"$AGENT_ID\",\"term\":$TERM,\"elected_at\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}"
Send leader heartbeat
pilotctl --json publish "registry-hostname" "election:$ELECTION_GROUP" \
--data "{\"type\":\"heartbeat\",\"leader\":\"$AGENT_ID\",\"term\":$TERM,\"timestamp\":\"$(date -u +%s)\"}"
Detect leader failure
LAST_HEARTBEAT=$(pilotctl --json inbox \
| jq -r '[.messages[] | select(.topic == "election:'$ELECTION_GROUP'" and .payload.type == "heartbeat")] | sort_by(.payload.timestamp) | last | .payload.timestamp')
ELAPSED=$(( $(date -u +%s) - LAST_HEARTBEAT ))
if [ "$ELAPSED" -gt 10 ]; then
echo "Leader timeout, starting election"
fi
Workflow Example
Bully algorithm with priority-based election:
#!/bin/bash
ELECTION_GROUP="task-coordinator"
AGENT_ID=$(pilotctl --json info | jq -r '.node_id')
PRIORITY=$(echo -n "$AGENT_ID" | cksum | cut -d' ' -f1)
REGISTRY_HOST="registry.example.com"
# Announce candidacy
pilotctl --json publish "$REGISTRY_HOST" "election:$ELECTION_GROUP" \
--data "{\"type\":\"election\",\"candidate\":\"$AGENT_ID\",\"priority\":$PRIORITY,\"term\":$TERM}"
# Wait and check if highest priority
sleep 10
HIGHEST=$(pilotctl --json inbox \
| jq -r '[.messages[] | select(.topic == "election:'$ELECTION_GROUP'" and .payload.type == "election")] | sort_by(.payload.priority) | last | .payload.candidate')
if [ "$HIGHEST" = "$AGENT_ID" ]; then
pilotctl --json publish "$REGISTRY_HOST" "election:$ELECTION_GROUP" \
--data "{\"type\":\"leader\",\"leader\":\"$AGENT_ID\",\"term\":$TERM}"
fi
Dependencies
Requires pilot-protocol skill, jq, and cksum.
Capabilities
skillsource-teoslayerskill-pilot-leader-electiontopic-agent-skillstopic-ai-agentstopic-clawhubtopic-networkingtopic-openclawtopic-overlay-networktopic-p2ptopic-pilot-protocol
Install
Installnpx skills add TeoSlayer/pilot-skills
Transportskills-sh
Protocolskill
Quality
0.45/ 1.00
deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 6 github stars · SKILL.md body (2,116 chars)
Provenance
Indexed fromgithub
Enriched2026-05-18 19:14:57Z · deterministic:skill-github:v1 · v1
First seen2026-05-18
Last seen2026-05-18