libsupervision

Supervise a process tree with automatic restarts, graceful shutdowns, and rotating logs.

1|1|Updated Aug 7, 2025
One-click install
npx skills add https://github.com/copilot-ld/copilot-ld --skill libsupervision
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: libsupervision
Source: https://github.com/copilot-ld/copilot-ld/tree/main/packages/libsupervision
Command: npx skills add https://github.com/copilot-ld/copilot-ld --skill libsupervision

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Supervises long-running services by coordinating a process tree, automatic restarts, graceful shutdowns, and centralized logging to improve reliability.

Core Features & Use Cases

  • Supervises a tree of long-running and one-shot tasks to ensure orderly startup and shutdown.
  • Provides persistent restarts for services, one-shot task execution, and structured process state tracking.
  • Suitable for microservice style deployments requiring predictable lifecycle management and robust logging.

Quick Start

Add a service with a name and command to the supervision tree, then start supervision.

Frequently Asked Questions about libsupervision

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage automatic restarts and graceful shutdowns for multiple Node.js services?

You can manage automatic restarts and graceful shutdowns for Node.js services by orchestrating a supervision tree. This approach coordinates long-running processes and one-shot tasks to ensure orderly startup and shutdown.

What is a supervision tree for long-running services and when do I need one?

A supervision tree for long-running services is a process management structure that coordinates persistent tasks, automatic restarts, and centralized logging. You need one for microservice deployments requiring predictable lifecycle management.

How do I set up centralized logging with rotating logs for a Node.js daemon?

Centralized logging with rotating logs for a Node.js daemon is implemented through a LogWriter component within a supervision tree. It captures logs across multiple components to improve service reliability.

Can I run one-shot init tasks alongside persistent services in the same process tree?

Yes, you can run one-shot init tasks alongside persistent services in the same process tree. The supervision structure uses OneShot for init tasks and LongrunProcess for persistent services, tracking both through ProcessState.

What is the best way to track the lifecycle state of multiple Node.js processes?

The best way to track the lifecycle state of multiple Node.js processes is through structured process state tracking within a supervision tree. It monitors persistent services and one-shot tasks for predictable lifecycle management.

Does this process management approach work for microservice style deployments?

Yes, this process management approach works for microservice style deployments. It provides predictable lifecycle management, automatic restarts, graceful shutdowns, and centralized logging across multiple components.