Agent skill
libsupervision
libsupervision - Process supervision system. Supervisor manages process tree inspired by s6-svscan. LongRunner handles persistent processes with restart. OneShot handles single-execution tasks. ProcessState tracks process lifecycle. LogWriter manages process logging. Use for service management, process control, and graceful shutdown handling.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/libsupervision
SKILL.md
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.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?