hermit-doctor
Runs the hermit's read-only health checks (runtime, config, hooks, state integrity, cost and spend, scheduling and watchdog, channels, credentials, permissions, docker, backup) and reports the summary. Use when diagnosing an install, before a release, or after suspicious behavior. Activates on messages like "/hermit-doctor", "health check", "diagnose the hermit", "what's wrong", "run diagnostic".
- License 许可
- MIT
- 所属仓库
- gtapps/hermitd
- 最近更新
- 2026-11-15
- Stars
- ★ 85
- Forks
- 16
01 前言 Front Matter
- name
- hermit-doctor
- description
- Runs the hermit's read-only health checks (runtime, config, hooks, state integrity, cost and spend, scheduling and watchdog, channels, credentials, permissions, docker, backup) and reports the summary. Use when diagnosing an install, before a release, or after suspicious behavior. Activates on messages like "/hermit-doctor", "health check", "diagnose the hermit", "what's wrong", "run diagnostic".
02 资源文件 1
- 参考文档reference.md24.3 KB
03 SKILL.md 正文
Record notes only inside an open record's turn, using bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts note .hermit <id> with the note on stdin. Otherwise skip record notes. Never edit a task file directly.
Hermit Doctor
Runs read-only health checks against the current hermitd install (channel-liveness
is the only one that performs outbound API calls — see Notes) and surfaces the summary. Safe
to run at any time. Produces no side effects beyond writing
.hermit/state/doctor-report.json and .hermit/state/doctor-alerts.json,
and appending a summary block to the open task record.
Commands
task-note:bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts note .hermit
Notification route
A finding gets one notification per unresolved episode: the check script records it, you send it
once, and it stays silent until it resolves. A send that never reached the operator is re-offered
on the next run rather than counted as delivered.
Every run sends the same two-leg notice and channel-send.ts resolves each leg against this
install's own config: the maintainer leg reaches the configured maintainer_channel_id, else the
primary chat on a technical profile (both parts arrive together there), else state/watchdog-events.jsonl on a non-technical one. A configured maintainer destination that
is unreachable fails closed to state/watchdog-events.jsonl and never spills into the primary chat.
--maintainer is accepted and ignored (routine strings may still pass it): audience is decided by
the row's own tier and the operator's config, not by the flag.
Steps
-
Run the check script:
bun ${CLAUDE_PLUGIN_ROOT}/scripts/doctor-check.ts .hermitThe script writes
.hermit/state/doctor-report.jsonand prints the same JSON to stdout. It exits 0 unconditionally — on any internal failure the failing check reportsstatus: "fail"in its own entry rather than crashing the report. -
Parse the JSON. For each check in the report (one entry per id), emit one line using this format:
✓ <id> — <detail>whenstatus: ok⚠ <id> — <detail>whenstatus: warn✗ <id> — <detail>whenstatus: fail
-
Inside an open record's turn, record the per-check summary with
task.ts note .hermit <id>. Otherwise skip the note. -
Return the per-check lines to the caller and nothing else.
-
Escalation. The script already computed this — do not recompute it, and do not write alert state yourself. Read the
escalationobject from the step-1 JSON:escalation.new— findings owed to the operator, each{id, status, detail}plus an optionaltier. Empty means everything currently failing has already been announced; say nothing.escalation.resolved— check ids whose finding cleared. Recorded, never announced: there is no "recovered" ping.escalation.persisted: false— the ledger could not be written.prior_state_known: false— the ledger was unreadable and had to be rebuilt, so what was already announced is unknown. On either, send nothing and let the maintainer fallback record the findings instate/watchdog-events.jsonlinstead; a notification you cannot dedup would repeat every run.
When
escalation.newis non-empty. Compose one complete, concise summary covering every listed check, its detail, and a named next action, in the operator's configured language. When the finding isclassifier-denials, name what was blocked by kind: abunblock is usually a hermit script, a call-shape/upstream matter the hermit reports; interpreter heredocs (python3,node) are something the hermit stops doing itself; an operator's own host needs anautoMode.environmententry naming it, managed through/hermitd:hermit-settings rules.Rows carrying
tier: "maintainer"go on the maintainer leg only. Their content is what thePermissionDeniedhook already keeps off a client chat, so the payload splits by audience andchannel-send.tsdecides where each leg lands (§ Notification route).Before sending, check the completed payload. Use the configured language already in context (including the worker's language instruction); if unavailable, read only
config.language. When unset, match the operator's conversation language. Check bothclientandmaintainerprose and correct any language mismatch before sending. Only literal diagnostic excerpts may stay quoted in their original language; explanations and next actions must use the target language. Preserve identifiers, commands and paths. Keep a concrete next action for each finding; awarnstatus alone does not establish that it is minor or causes no blockage. Do this in the current turn, without another agent or model call.Deliver it once through the canonical notice path:
bun ${CLAUDE_PLUGIN_ROOT}/scripts/channel-send.ts .hermit --noticeOne payload, whatever the invocation:
{"client": "<plain headline for the rows without a tier, plus the one next step>", "maintainer": "<technical rows only>"}. The client leg is the only part of this notice that can land in a client chat, so write it to the channel voice rule — no check ids, file paths, USD or token figures; what is wrong in plain words and what the operator should do about it. The maintainer leg carries only technical rows (IDs, paths, spend, diagnostics and errors). When both audiences share a chat the script sends both parts together, so neither repeats the other. Omitclientwhen every new row is tiered. Send nofallbackkey: its default is what routes a maintainer leg tostate/watchdog-events.jsonlon anon-technicalinstall.When doctor was invoked from a channel, do not quote a tiered row back into your reply; say a maintainer diagnostic was recorded and leave it at that.
Then confirm delivery, so those findings stop being re-offered — only when the send actually landed (exit 0; on
relay, only after the reply-tool send succeeds):bun ${CLAUDE_PLUGIN_ROOT}/scripts/doctor-check.ts .hermit --mark-notified <id> [<id>…]Pass every
escalation.new[].idyou just announced, tiered rows included. If the send failed or degraded, skip this step: an id left unconfirmed keepsescalation.newnon-empty, so the next run retries it instead of dropping it, and the doctor routine keeps waking on it. For exit-code handling and the event-log fallback, followskills/channel-responder/outbound.md.
Silence policy
- If every check is
ok, return only:All checks passed.Do not notify via channel (Tier 0). Still append to the open task record so the run is traceable. Clearing the staledoctor:*entries is the script's job, not yours — it happens on every run. - If any check is
warnorfail, return the full per-check summary. Notification is governed byescalation.new(step 5), not a blanket per-run ping: only findings not yet confirmed delivered notify the selected route.
What each check looks at
Per-check semantics and status rules: ${CLAUDE_SKILL_DIR}/reference.md, read only when a row
needs interpreting.
This skill reports findings. Safe repairs run from a terminal with hermitd doctor --fix: it queues a pending upgrade once and reinstalls an already-authorized watchdog scheduler. In chat, name that command as the next step for whoever has a terminal. Remaining findings list the manual actions.
Notes
- The check logic lives in
scripts/doctor-check.tsso it can be unit-tested without invoking the model. - Re-runs are cheap. No locking needed.
permission-rulesnever writes. It reports which seededaskentries are inert and names theapply-settings.ts <file> deny hardenedcommand; converting them to hard blocks is the operator's call, from a terminal.channel-livenessis the only check that leaves the machine: one token-authed liveness call per already-configured, enabled channel, 5s timeout, fail-soft. Disabling a channel disables its probe. Every other check is a local filesystem read.
04 同仓库更多 Skills
task-decide
Record the operator's typed task decision.
dream
Nightly memory maintenance from transcript ground truth. Verifies, enriches and tidies auto-memory and topic pages with snapshot validation and undo. Also handles 'undo the dream'.
when-done-switch-to
Arm a deferred model or effort switch. Use for "when done switch to", "after this drop to sonnet", or "switch model when idle".
weekly-review
Generate the weekly review report for the current ISO week. Writes to .hermit/compiled/review-weekly-YYYY-Www.md (dev-facing detail) and sends a plain-language channel summary (Delivered / Decisions / Waiting on you / Spend). Runs every Sunday at 23:00 via routine.
watch
Background events via the config watch monitor or ad-hoc Monitor tool. Quiet watches cost zero tokens.
watch-activate
Activate the config watch monitor.