cron-aware-watchdog
Skill2 starsChanged 4 months agoMITView on GitHub
Use when building or debugging a monitor, watchdog, or health check for scheduled jobs, or when investigating an alert that says a job is stale. Prevents blanket staleness rules that fire on weekends and prevents auto-repair loops.
In this repository3 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
Before wiring any automatic action:
- Distinctive: line 41
Cooldown: No second intervention on the same target inside a window.
- Distinctive: line 44
Visibility: Every single intervention produces an alert, including the successful ones.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
A watchdog needs to know the schedule
The tempting health check is "no execution in N hours means broken". It is wrong for every job that does not run continuously.
A Monday-to-Friday job is legitimately silent for 60 hours every weekend. A monthly job is silent for weeks. A blanket rule flags both, and if the watchdog also repairs what it flags, it will restart healthy systems on a schedule of its own.
Ask when the job was actually due
Compute the previous fire time from the job's own schedule expression and the zone the scheduler runs in. Compare the last execution against that, not against a fixed window.
due = previous_fire_time(cron, zone, now)
if last_execution < due - tolerance: -> genuinely missed
else: -> healthy, only quietTwo details that produce false alarms on their own:
- Zones. Schedulers commonly run in a local zone while their API reports execution times in UTC. Compare like with like, and get the current time from a tool rather than assuming.
- Tolerance. A job that fires at :00 and takes four minutes has not missed its slot at :03. Give the comparison a margin.
Auto-repair needs three guard rails
A watchdog that repairs what it flags will eventually repair something healthy. Before wiring any automatic action:
- Cooldown. No second intervention on the same target inside a window.
- Cap. A hard maximum of interventions per day. On reaching it, stop acting and escalate instead.
- Visibility. Every single intervention produces an alert, including the successful ones. A repair nobody sees is indistinguishable from a system that never broke.
Without these, a false positive turns into a repair cycle, and a repair cycle against a scheduler can take out the scheduler itself.
Diagnose before acting
A symptom that looks like a known failure can have a different cause. Before a restart, a re-deploy or a deletion, check that the evidence actually supports the action. Restarting is not a diagnostic step; it destroys the state you would have needed to understand the problem.
Why this exists
A blanket "no execution in 36 hours means stale" rule false-positived every weekend on Monday-to-Friday jobs. The watchdog attached to it repaired what it flagged, the repair cycling took out the scheduler, and the outage looked exactly like the condition the rule was meant to detect.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

