CF 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.
Design, deploy, and discipline macOS launchd watchdogs — LaunchAgents/LaunchDaemons that detect a recurring problem and auto-remediate it.
As a process F 61/100 · Will not run — References files that are not bundled: assets/launchagent.template.plist
What is at stake
The skill contains fragments that, in the wrong hands, cost money or data. Below: what the installer risks and what the author should do.
The skill contains commands that delete files, rewrite disks or execute code fetched from the network. The agent may run them without asking if it believes the instructions require it.
Replace destructive commands with safe equivalents that ask for confirmation, scope them to one folder, and stop piping curl into a shell: pin a version and a checksum.
How to improve
- Address the high-severity findings: each costs 18 safety points. If one is a false positive, add the rule id to guard.allow in spec.yaml.
- The text references files that are not there: add them or drop the references.
- A spec.yaml with trigger phrases and assertions — a behaviour contract for CI; `skilltest init` writes a template.
Guard findings · 10
-
high Dangerous commands
cmd-persistencescripts/new-launchagent.sh:120Persistence mechanism (cron / launchd / scheduled task / autorun registry)$SUDO launchctl bootstrap "$DOMAIN" "$PLIST"
Medium and low: 9
-
medium Dangerous commands
cmd-privilegescripts/new-launchagent.sh:114Privilege escalation / world-writable permissionssudo chown root:wheel "$tmp_plist"
-
medium Dangerous commands
cmd-privilegescripts/new-launchagent.sh:115Privilege escalation / world-writable permissionssudo chmod 644 "$tmp_plist"
-
medium Dangerous commands
cmd-privilegescripts/new-launchagent.sh:117Privilege escalation / world-writable permissions$SUDO mv "$tmp_plist" "$PLIST"
-
medium Dangerous commands
cmd-persistenceSKILL.md:4Persistence mechanism (cron / launchd / scheduled task / autorun registry) (documentation of a security skill)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 moni
security skill -
low Dangerous commands
cmd-persistencereferences/launchd-plist-reference.md:17Persistence mechanism (cron / launchd / scheduled task / autorun registry) (documentation table row; documentation of a security skill)| LaunchAgent | `~/Library/LaunchAgents/` | `gui/$(id -u)` | User GUI session: can `open` apps/URL schemes, show notifications, read user TCC grants |
tablesecurity skill -
low Dangerous commands
cmd-persistencereferences/launchd-plist-reference.md:18Persistence mechanism (cron / launchd / scheduled task / autorun registry) (documentation table row; documentation of a security skill)| LaunchDaemon | `/Library/LaunchDaemons/` | `system` (sudo) | Root (or `UserName`/`GroupName` override); no GUI session, no per-user TCC |
tablesecurity skill -
low Dangerous commands
cmd-persistencereferences/launchd-plist-reference.md:81Persistence mechanism (cron / launchd / scheduled task / autorun registry) (documentation table row; documentation of a security skill)| Load | `launchctl bootstrap gui/$(id -u) <plist>` (daemon: `sudo launchctl bootstrap system <plist>`) |
tablesecurity skill
A further 2 matches are quotations in this security skill's documentation and are not counted as findings.
Files scanned: 6. Evidence is masked. Grey chips explain why severity was lowered.
Against the Agent Skills spec
- warning
missing-refreference to a missing file: assets/launchagent.template.plist - note
edit-residuethe text marks something as outdated (lines 65, 73): check that old rules are not kept next to new ones — the full check reads the text for contradictions
Process rating: all ten parameters 61/100
- 0Tools and files. 1 referenced file(s) missing: assets/launchagent.template.plist
- 0Result and completion. Does not say what the result is
- 70When it triggers. States when to use, but not when not to
- 70Inputs and preconditions. Inputs and preconditions are listed
- 100Steps. 13 steps
- 100Failures and branches. 1 branches, has a failure section
- 100Consistency. Name and required fields are in place
- 100Execution cost. Instruction body is 2051 tokens
- 100Running it twice. Mutating operations check current state
- 100Progress reporting. Reports progress
- low The response is described with custom markup (7 tags): a typed call is more reliable
- medium 3 test cases, all positive: not one "should refuse" or "should ask first"
Everything here is measured from the skill text rather than judged by a model, so the numbers are checkable. A parameter weighs more when it is a more common reason for the process to stall.
Quality signals
- +5Description has no quoted example phrases that should trigger the skill
- +4Description does not say when NOT to use the skill (false activations)
- +3Description length 952: 120–800 characters recommended
- +3Output format is not stated: the model decides each time
- +4No input/output examples
- +1No license
- +2Single-language instructions
- +4Structure: 10 headings
- +3Step-by-step instructions: 13 items
- +4Reference files are cited in the instructions (3 of 3)
- +3All 2 scripts are documented
Quality base 70; lint remarks subtract, signals add up to 100. Result: 78.