Scheduled Agent Doctor
Use this when someone says "我的定时任务没跑 / 跑错时间了 / 帮我看看有哪些定时任务 / 先手动跑一次试试 /
把它删了重建".
You (the agent) drive the diagnosis yourself with agent_builder (actions: list_agents,
run_agent, disable_agent, delete_agent) and scheduled_agent_creator (params: schedule_cron,
schedule_timezone, skill_ref, execution_prompt). Tool errors are findings — quote them
verbatim, never fail the run.
How to run it
Inventory. agent_builder {action:"list_agents"} — show: agent id, skill, cron, timezone,
status, last run. If the list is EMPTY but the user swears one exists: agents are owned per
(user, platform, bot registration, conversation scope) — listing in a DM can miss agents created
in a group and vice versa. Tell the user to run the doctor in the SAME chat where the agent was
created.
Sanity-check the schedule. Read back the cron + timezone in plain words ("每周一 09:00
Asia/Shanghai"). Known trap: stating a local time AND a timezone while the cron was already
converted — double timezone shift. The contract is schedule_cron interpreted IN
schedule_timezone, no extra conversion. If the user reports "提前/晚了 8 小时", this is almost
always it → fix by recreating with the cron written in local wall-clock time + the right tz.
Test-fire. agent_builder {action:"run_agent", agent_id} triggers one manual run now
(owner-only). Use it to separate "schedule wrong" from "run broken": if the manual run fails
too, the problem is the skill/credentials, not cron.
Credential reality check. A scheduled run uses a minted key whose service grant is NARROWER
than interactive chat: skills calling extra services (search/enrichment) can work via ::skill
but 403 on cron fire. If the manual interactive run works and the cron run 403s, report exactly
that and suggest nyxid-service-doctor for the binding fix; do not blame the skill.
Repair = delete + recreate. There is no in-place edit. Agents created before
creation-time cron/timezone validation existed can be zombies (bad cron persisted, never fire).
Flow: confirm with the user → {action:"delete_agent", agent_id} (or disable_agent to keep it
paused) → scheduled_agent_creator with corrected schedule_cron + schedule_timezone +
skill_ref + execution_prompt → verify: list_agents again and show the new entry.
"Creator said ok" is NOT proof — only the new list entry is.
Report. One block per agent touched: before → action taken → after (from the post-action
list), plus the next expected fire time in the user's local words.
Guardrails
delete_agent only after the user confirms the specific agent id in this conversation; prefer
disable_agent when intent is ambiguous.
- Never create duplicates: before recreating, check the inventory for an existing agent with the
same skill + cron and point it out.
- Only use real returned data; never invent agent ids, crons, or run results.
- Never ask the user for tokens — your NyxID-brokered tools handle all credentials.
1---2name: scheduled-agent-doctor3version: "1.0"4description: Audit, debug, trigger, and repair scheduled (cron) agents from chat — list what exists, verify cron and timezone really mean what the user intended, manually run one to test, disable or delete-and-recreate broken ones. Encodes the known failure modes (timezone double-conversion, zombie agents from older runtimes, cron-mode credential 403, DM-vs-group visibility) so users can self-serve.5metadata:6 source: https://skillmd.com/skills/chronoaiproject/scheduled-agent-doctor7 category: plain8 tag:9 - aevatar10 - s-capability11 - scheduled12 - cron13 - agents14 - diagnostics15 - self-service16---1718# Scheduled Agent Doctor1920Use this when someone says "我的定时任务没跑 / 跑错时间了 / 帮我看看有哪些定时任务 / 先手动跑一次试试 /21把它删了重建".2223**You (the agent) drive the diagnosis yourself** with `agent_builder` (actions: `list_agents`,24`run_agent`, `disable_agent`, `delete_agent`) and `scheduled_agent_creator` (params: `schedule_cron`,25`schedule_timezone`, `skill_ref`, `execution_prompt`). Tool errors are findings — quote them26verbatim, never fail the run.2728## How to run it29301. **Inventory.** `agent_builder` `{action:"list_agents"}` — show: agent id, skill, cron, timezone,31 status, last run. If the list is EMPTY but the user swears one exists: agents are owned per32 (user, platform, bot registration, conversation scope) — listing in a DM can miss agents created33 in a group and vice versa. Tell the user to run the doctor in the SAME chat where the agent was34 created.35362. **Sanity-check the schedule.** Read back the cron + timezone in plain words ("每周一 09:0037 Asia/Shanghai"). Known trap: stating a local time AND a timezone while the cron was already38 converted — double timezone shift. The contract is `schedule_cron` interpreted IN39 `schedule_timezone`, no extra conversion. If the user reports "提前/晚了 8 小时", this is almost40 always it → fix by recreating with the cron written in local wall-clock time + the right tz.41423. **Test-fire.** `agent_builder` `{action:"run_agent", agent_id}` triggers one manual run now43 (owner-only). Use it to separate "schedule wrong" from "run broken": if the manual run fails44 too, the problem is the skill/credentials, not cron.45464. **Credential reality check.** A scheduled run uses a minted key whose service grant is NARROWER47 than interactive chat: skills calling extra services (search/enrichment) can work via `::skill`48 but 403 on cron fire. If the manual interactive run works and the cron run 403s, report exactly49 that and suggest `nyxid-service-doctor` for the binding fix; do not blame the skill.50515. **Repair = delete + recreate.** There is no in-place edit. Agents created before52 creation-time cron/timezone validation existed can be zombies (bad cron persisted, never fire).53 Flow: confirm with the user → `{action:"delete_agent", agent_id}` (or `disable_agent` to keep it54 paused) → `scheduled_agent_creator` with corrected `schedule_cron` + `schedule_timezone` +55 `skill_ref` + `execution_prompt` → **verify**: `list_agents` again and show the new entry.56 "Creator said ok" is NOT proof — only the new list entry is.57586. **Report.** One block per agent touched: before → action taken → after (from the post-action59 list), plus the next expected fire time in the user's local words.6061## Guardrails6263- `delete_agent` only after the user confirms the specific agent id in this conversation; prefer64 `disable_agent` when intent is ambiguous.65- Never create duplicates: before recreating, check the inventory for an existing agent with the66 same skill + cron and point it out.67- Only use real returned data; never invent agent ids, crons, or run results.68- Never ask the user for tokens — your NyxID-brokered tools handle all credentials.