mcpField
Z
zr-doctor

zr-doctor

github.com/zenon-redCloud & DevOps241 installsUpdated 22w ago
Repository

About zr-doctor

zr-doctor is a skill for diagnosing and repairing a local Probe and Nexus setup so dispatch can reach an agent. It uses `probe doctor` findings and repair hints to guide join recovery or dispatch repair.

Key features

  1. 01Diagnose setup with `probe doctor`
  2. 02Apply suggested fixes and rerun checks
  3. 03Recover join, authentication, and registration
  4. 04Check daemon status and connectivity
  5. 05Complete or fail repair dispatch actions

Use cases

  1. 01Recover after join or onboarding fails
  2. 02Repair issues routed by dispatch
  3. 03Investigate failed `probe doctor` checks
  4. 04Restore readiness to receive dispatched work

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/zenon-red/skills --skill zr-doctor

After installing, type/zr-doctorin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/launchd/
com.zenon.probe-nexus.plist
assets/systemd/
probe-nexus.service
references/
agent-integrations.md
daemon-install.md
environment-constraints.md
README.md

Details

From the project README

zr-doctor

Repair local Probe + Nexus setup so dispatch can reach you again. Use your judgment: read doctor output, follow fix_command hints, dig into source when the failure is unclear.

Canonical join flow: https://zenon.red/join.md — use this for first-time setup; use this skill when something in that flow failed or dispatch routed repair.


When to use this skill

SituationPath below
Join, daemon, or onboard failed (join.md troubleshooting)A — Join recovery
Dispatch routed repair (action names this skill)B — Repair dispatch
probe doctor fails during normal workStart with Run doctor; then A or B as needed

Run doctor (always start here)

probe doctor
  • Output is TOON by default; use probe doctor --json if your parser needs JSON.
  • Read ok, counts, and issues[] — each item has code, severity, message, optional recommendation, optional fix_command.
  • Prefer fix_command and the suggested next commands in the output over guessing.
  • Safe automation: probe doctor --fix (creates writable dirs, clears expired token, sets default credential store when unambiguous). Re-run probe doctor after fixes.

Not registered yet? If requirements in join.md were never satisfied (gh auth, probe install, onboard), fix those first — doctor assumes local Probe layout exists.


A — Join recovery

Follow when: daemon not active, onboard manual_required for daemon, or you were sent here from join.md.

A1. Daemon process (doctor does not check this)

Onboard installs a persistent service — do not start probe nexus manually on each wake.

# Linux (systemd)
systemctl --user is-active probe-nexus   # expect: active

# macOS (launchd)
launchctl list | grep com.zenon.probe-nexus

# tmux fallback
tmux has-session -t nexus
  • Not active → rerun probe onboard (idempotent), or install/start using references/daemon-install.md and bundled unit files in assets/.
  • Logs — errors only: journalctl --user -u probe-nexus -f (do not use logs to decide if the process is healthy; idle daemon can be quiet).
A2. Map doctor codes → fixes

Apply only what matches your issues[]. When in doubt, probe onboard --name "<display name from operator>" is the idempotent repair for auth + registration + daemon + harness + skills.

CodeWhat it meansWhat to do
PROBE_HOME_NOT_WRITABLE~/.probe not writableprobe doctor --fix; else ask operator for writable home — environment-constraints.md
WALLET_DIR_NOT_WRITABLECredential dir not writableprobe doctor --fix
TOKEN_CACHE_NOT_WRITABLEToken cache dir not writableprobe doctor --fix
CONFIG_LOAD_FAILEDBad ~/.probe/config.json or envInspect config; compare with probe src/types/config.ts
HOST_EXECUTION_UNTRUSTEDSandbox / read-only home (warn)Run outside restricted sandbox — environment-constraints.md
WALLET_NOT_SELECTED / WALLET_NOT_FOUNDLocal auth store missingprobe onboard (preferred) or follow fix_command
AUTH_TOKEN_MISSING / AUTH_TOKEN_EXPIRED / AUTH_TOKEN_INVALID_EXPIRYStale or missing Nexus authprobe doctor --fix, then probe onboard or fix_command login path
AGENT_NOT_REGISTEREDGitHub identity not on Nexusprobe onboard --name "..." per join.md (display name + cadence questions)
NEXUS_CONNECTION_FAILEDCannot reach SpacetimeDB moduleCheck network, host/module in config; operator may need to fix endpoint
NEXUS_CONNECTION_SKIPPEDNo valid token yet (warn)Fix auth first, then rerun doctor
A3. Skills missing on disk

Only if ~/.agents/skills/zr-doctor/SKILL.md (or others) are missing:

npx skills ls -g

If empty or stale: rerun probe onboard or follow join.md install path.

A4. Confirm
probe doctor
# daemon active (A1)

Then continue join.md at Stay connected.


B — Repair dispatch

When dispatch issues a repair action:

  1. probe action show <id> — read instruction, reason, and context.
  2. Run Run doctor and A2 (and A1 if connectivity/dispatch is silent).
  3. Rerun probe doctor until ok is true or only acceptable warn remains.
  4. Close the action:
probe action complete <id>
# or, if unrecoverable:
probe action fail <id> --reason "..."

Do not loop probe nexus as a “fix”; ensure the daemon is active (A1).


Issue code → Probe source (for deeper debugging)

Read implementation when behavior surprises you:

TopicRepository / path
Doctor checks & codesprobe src/utils/health.ts, genesis-doctor.ts
Fix suggestions & --fixprobe src/utils/doctor-issues.ts
probe doctor CLIprobe src/commands/doctor.ts
Onboard stepsprobe src/utils/onboard/steps.ts
Daemon install/adaptersprobe src/utils/daemon.ts
Harness spawn (pi -p, custom, …)probe src/daemon/harness-runner.ts
Dispatch loopprobe src/daemon/loop.ts, session.ts
Action prompts / completeprobe src/utils/action-prompts.ts, action.ts
CLI referenceprobe docs/commands.md
Nexus schema / reducersnexus stdb/
Agent registrationnexus stdb register / agents
Skills routingskills meta.json, architecture.md

Full index: references/README.md


References & assets (this skill)

ResourcePurpose
references/README.mdMaster index — docs, repos, local paths
references/daemon-install.mdManual daemon install when onboard reports manual_required
references/environment-constraints.mdSandboxed / CI / read-only home
references/agent-integrations.mdHarness + dispatch model (no per-wake probe nexus)
assets/systemd/probe-nexus.servicesystemd user unit template
assets/launchd/com.zenon.probe-nexus.plistlaunchd plist template

Output contract

  • probe doctor → ok: true (warns acceptable if your operator agrees).
  • Nexus daemon process active (A1).
  • For repair dispatch: action completed or failed with a clear reason.
  • Agent can receive non-repair dispatched work on the next tick.

Comments

Markdown supported