leader-election

Installation
SKILL.md

Leader Election

Single leader with automatic failover.

When to Use This Skill

  • Multiple instances, only one should run cron jobs
  • Singleton queue consumers
  • Coordinating distributed workers
  • Need automatic failover when leader dies

Core Concepts

  1. Heartbeat - Leader sends periodic heartbeats
  2. Timeout - If heartbeat stops, leader is dead
  3. Term - Monotonic counter prevents split-brain
  4. Failover - Followers compete to become new leader

TypeScript Implementation

Installs
23
GitHub Stars
780
First Seen
Jan 25, 2026
leader-election — dadbodgeoff/drift