DC macos-watchdog
Designs and audits macOS launchd watchdogs: LaunchAgent/LaunchDaemon setup, plist edits, scheduled self-healing, repeated notifications, apps reopening after quit, crash/repair loops, Script Editor alerts, stop/disable/restart, cooldown/backoff, notification throttling, alert decisions, schedule readback, WatchPaths/FSEvents event triggers. Supports periodic observers. launchd 守护进程、常驻任务、开机自启、后台监控、定时自愈、通知来源排查、事件驱动监控。
Designs and audits macOS launchd watchdogs: LaunchAgent/LaunchDaemon setup, plist edits, scheduled self-healing, repeated notifications, apps reopening after…
As a process C 56/100 · Has gaps — References files that are not bundled: ../macos-permissions/references/uv-fda-trap.md, 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.
- Say in the description WHEN to use the skill ("use when…", example requests): that is the agent's main cue.
- The SKILL.md body is over 5,000 tokens: move reference detail into references/ and load it when needed.
- 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:130Persistence mechanism (cron / launchd / scheduled task / autorun registry)$SUDO launchctl bootstrap "$DOMAIN" "$PLIST"
Medium and low: 9
-
medium Dangerous commands
cmd-privilegescripts/new-launchagent.sh:124Privilege escalation / world-writable permissionssudo chown root:wheel "$tmp_plist"
-
medium Dangerous commands
cmd-privilegescripts/new-launchagent.sh:125Privilege escalation / world-writable permissionssudo chmod 644 "$tmp_plist"
-
medium Dangerous commands
cmd-privilegescripts/new-launchagent.sh:127Privilege escalation / world-writable permissions$SUDO mv "$tmp_plist" "$PLIST"
-
low Dangerous commands
cmd-persistencereferences/launchd-plist-reference.md:9Persistence 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:10Persistence 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
A further 4 matches are quotations in this security skill's documentation and are not counted as findings.
Files scanned: 10. Evidence is masked. Grey chips explain why severity was lowered.
Against the Agent Skills spec
- warning
description-no-whendescription does not say WHEN to use the skill (no "use when") - warning
body-longSKILL.md body ≈ 5422 tokens (recommended < 5000); move details to references/ - warning
missing-refreference to a missing file: ../macos-permissions/references/uv-fda-trap.md - warning
missing-refreference to a missing file: assets/launchagent.template.plist - note
edit-residuethe text marks something as outdated (lines 167, 178): check that old rules are not kept next to new ones — the full check reads the text for contradictions
Process rating: all ten parameters 56/100
- 0Tools and files. 2 referenced file(s) missing: ../macos-permissions/references/uv-fda-trap.md, assets/launchagent.template.plist
- 20When it triggers. No condition that starts the skill
- 30Running it twice. 23 mutating operations with no state check
- 40Result and completion. Does not say what the result is
- 70Inputs and preconditions. Inputs and preconditions are listed
- 70Execution cost. Instruction body is 5422 tokens
- 100Steps. 27 steps
- 100Failures and branches. 2 branches, has a failure section
- 100Consistency. Name and required fields are in place
- 100Progress reporting. Reports progress
- high The skill tells the model to perform an irreversible action with no human approval
- low The response is described with custom markup (9 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)
- +3Output format is not stated: the model decides each time
- +4No input/output examples
- +1No license
- +2Single-language instructions
- +3Description length 419: enough signal without eating the budget
- +4Structure: 13 headings
- +3Step-by-step instructions: 27 items
- +4Reference files are cited in the instructions (6 of 6)
- +3All 3 scripts are documented
Quality base 70; lint remarks subtract, signals add up to 100. Result: 56.