Claude-skill-registry libsupervision
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/libsupervision" ~/.claude/skills/majiayu000-claude-skill-registry-libsupervision && rm -rf "$T"
manifest:
skills/data/libsupervision/SKILL.mdsource content
libsupervision Skill
When to Use
- Managing long-running service processes
- Implementing process supervision with restart
- Running one-shot initialization tasks
- Handling graceful shutdown across processes
Key Concepts
Supervisor: Manages a tree of processes, handling startup order and shutdown.
LongRunner: Process that restarts automatically on exit (for services).
OneShot: Process that runs once (for migrations, initialization).
ProcessState: Tracks process state transitions (starting, running, stopped).
Usage Patterns
Pattern 1: Create supervision tree
import { Supervisor, LongRunner, OneShot } from "@copilot-ld/libsupervision"; const supervisor = new Supervisor(); supervisor.add(new OneShot("migrate", "npm run migrate")); supervisor.add(new LongRunner("web", "npm start")); await supervisor.start();
Pattern 2: Handle signals
process.on("SIGTERM", async () => { await supervisor.stop(); // Graceful shutdown });
Integration
Powers the service supervision system. Used by librc for service management.