---
name: "tini-docker-init-zombie-reaper"
description: "Reap zombie child processes and handle POSIX signals correctly inside Docker containers."
metadata:
  author: "Thomas Orozco"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "setup tini docker init"
  - "reap zombie processes container"
  - "graceful shutdown docker tini"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Tini Lightweight Init System & Zombie Process Reaping

Configures Tini inside container images: running as PID 1, properly forwarding signals (SIGTERM, SIGINT) to child processes, reaping orphaned zombie processes, and preventing resource leaks in long-running containers.

## When to Invoke
Invoke this skill whenever you need to:
- setup tini docker init
- reap zombie processes container
- graceful shutdown docker tini

## Execution SOP & Rules
1. Install tini via package manager: RUN apk add --no-cache tini.
2. Define entrypoint with tini: ENTRYPOINT ['/sbin/tini', '--', '/app/entrypoint.sh'].
3. Alternatively enable Docker daemon built-in init flag: docker run --init <image>.
4. Verify PID 1 is occupied by tini by inspecting ps aux inside the running container.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
