Agent skill · daymade

macos-watchdog

Design, deploy, and discipline macOS launchd watchdogs — LaunchAgents/LaunchDaemons that detect a recurring problem and auto-remediate it. Use whenever creating or editing a persistent background monitor / daemon / agent on macOS, writing a launchd plist, scheduling a self-healing script, or when a watchdog has become a disturbance itself: re-launching apps the user quit, firing repeated notifications, re-running its full repair ladder every few minutes on an unfixable network, or hammering the system (crash loops, fork storms, runaway restarts). Also use for stop/disable semantics (bootout vs bootstrap vs disable vs unload), adding cooldown / backoff / notification throttling to a self-healer, binding a monitor's lifecycle to its premise state, or auditing existing LaunchAgents. 中文触发:launchd 守护进程、常驻任务、开机自启、后台监控、定时自愈脚本。 Covers KeepAlive/ThrottleInterval/domains/logging, premise self-checks, auto-cooldown, alert layering, batch throttling.

What it needs

About 6k tokens when loaded.

What this skill does

macOS Watchdog A watchdog is a launchd job that periodically detects a recurring problem and remediates it without a human. The craft is not "how to install a plist" — it is how to keep the watchdog from becoming a new disturbance: every watchdog on this machine was born from an incident, and the recurring failure mode afterward is the watchdog itself (false "all good" reports, notification floods, re-launching apps the user quit, fork-bomb replays). The governing principle, learned the expensive way: a watchdog's lifecycle is bound to its premise state. When the condition it exists to fix cannot be fixed by it (broken WiFi, user quit the target app, prerequisite state gone), the watchdog must stand down by itself — not wait for a human to disable it. Entry decision tree The situation is… Go to --- --- Installing a NEW watchdog from scratch § Deploy, then § The quiet-watchdog contract An existing watchdog misbehaves (spam, re-launches apps, hammers) § The quiet-watchdog contract, diagnose which clause it violates Stopping / disabling / restarting a job § Stop semantics plist key details (KeepAlive forms, domains, logging, resource limits) references/launchd-plist-reference.md Cooldown/backoff/notification-throttle patterns + sanitized war stories references/quiet-watchdog-patterns.md SRE alert layering (page vs ticket, fatigue numbers) references/alert-discipline.md The quiet-watchdog contract (the four clauses) Before shipping or blessing any watchdog, all four must hold. Each clause exists because a real watchdog violated it. 1. Premise-state self-check — it knows when it has no job The script's first act on every run: verify the state that justifies its existence still holds. If not, exit silently — no remediation, no notification, no side effects. A proxy-repair watchdog checks the proxy app is running first; user quit it → skip the cycle. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills daymade/macos-watchdog

View the source on GitHub

Browse the @skills marketplace