nano-doctor
Skill207 starsChanged 8 months agoApache-2.0View on GitHub
Install health check for nanostack. Diagnoses dependencies, permissions, telemetry config, and pre-V5 detection. Triggers on /nano-doctor. Flags - --json, --offline, --fix.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Run the health check script, then summarize what the user actually needs to do:
- Distinctive: line 64
If the skill_dir check fails, the install itself is missing or corrupted.
- Very specific: line 74
Read session_profile from the JSON envelope (or default to professional if no session exists).
- Distinctive: line 97
Never read the internal category names ("install", "detection") to a Guided user.
- Distinctive: line 117
Do not interpret the output for the user when it is clean: If exit is 0 and there are no warnings, say "healthy" and stop.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
/nano-doctor — Install Health Check
You diagnose the local nanostack install. Ten checks across dependencies, install integrity, the user-scoped home directory, telemetry config, the pre-V5 detection path, and Worker reachability. Output names the category, the check, and a one-line detail. No decorative prose.
This is a diagnostic skill, not a fix-everything skill. Mechanical issues (file permissions, missing chmod +x) repair with --fix. Anything that needs human judgment stays as a warning or failure.
Telemetry preamble
Defensive telemetry init. No-op if telemetry is disabled via NANOSTACK_NO_TELEMETRY=1, ~/.nanostack/.telemetry-disabled, or if the helpers are removed.
_P="$HOME/.claude/skills/nanostack/bin/lib/skill-preamble.sh"
[ -f "$_P" ] && . "$_P" nano-doctor
unset _PProcess
Run the health check script, then summarize what the user actually needs to do:
~/.claude/skills/nanostack/bin/nano-doctor.shOptional flags:
--json— machine-readable output. Use when invoked by another tool or when piping tojq. The envelope includesfix_available(boolean),fix_command(the suggested command ornull), andsession_profile("guided","professional", ornullwhen no session exists in the current project). These three fields let calling skills decide whether to surface a one-line repair prompt or a full warning report.--offline— skip Worker reachability. Use in air-gapped environments or during CI.--fix— repair mechanical issues. Currently covers:chmod 700on~/.nanostack/,chmod +xon the sender, and adding the missing PreToolUse hooks for Bash and Write/Edit/MultiEdit to the local.claude/settings.json. Always backs up the file first as.claude/settings.json.YYYYMMDD-HHMMSS.bak. Never touches your existing permission entries; only adds hooks alongside them.
Interpreting the output
The script prints one line per check, grouped by category. Status values:
ok— passed, nothing to do.warn— minor issue. Telemetry may reportunknown, permissions may be too open, Worker may be unreachable. None of these block/think,/nano, etc.FAIL— critical issue. A missing dependency or missing skill file. Usage is impaired.
The host category reports the protection level for every detected agent CLI (Claude Code, Cursor, Codex, OpenCode, Gemini). Each row reads a host's declared capability from adapters/<host>.json and cross-checks against this install. When the declaration says enforced but the local hook is missing, the row warns about the drift and points at /nano-doctor --fix. When a host's adapter declares instructions_only, the row passes with a note that the workflow is guided rather than enforced on that host. See reference/host-adapter-schema.md for the full vocabulary.
Exit codes:
| Exit | Meaning |
| 0 | Everything checks out |
| 1 | Warnings only, skill still works |
| 2 | Critical, needs repair before use |
When to recommend --fix
If the report shows warnings for home permissions, sender_executable, bash_guard, or write_guard, re-run with --fix. The --fix mode handles those four mechanically and leaves a backup. For any other warning or failure (missing VERSION, broad Bash(rm:*), broken telemetry tier), surface the detail to the user and let them decide. Do NOT try to fix missing dependencies or rewrite permission lists automatically.
When to recommend a reinstall
If the skill_dir check fails, the install itself is missing or corrupted. Tell the user:
npx create-nanostackThat reinstalls and preserves the existing ~/.nanostack/ (telemetry config, installation-id, past opt-in choice).
Profile-aware output
Read session_profile from the JSON envelope (or default to professional if no session exists). Branch the user-facing summary by profile:
Guided profile (also: local mode, no git, non-technical user). Do not dump the raw report and do not lead with "hooks/settings JSON". Follow reference/plain-language-contract.md. Translate the outcome into the four-block skeleton:
<!-- guided-output:start -->Resultado: Nanostack esta sano y listo para acompañarte.
Como verlo:
1. No hace falta hacer nada. Cuando empieces tu proximo trabajo, te aviso si algo necesita atencion.
Que revise:
- Las herramientas que necesita estan instaladas.
- Los permisos del directorio personal son correctos.
- Las protecciones automaticas estan activas.
Pendiente:
- No revise si hay actualizaciones nuevas (corre /nano-update si queres).<!-- guided-output:end -->When the report has warnings, replace the result line with: "Encontre algunos avisos menores. ¿Queres que los repare?" and offer --fix only if fix_available is true. When it has failures: "Hay un problema con la instalacion. Lo mas probable es que necesites reinstalar con npx create-nanostack. ¿Queres que te guie?"
Never read the internal category names ("install", "detection") to a Guided user. Those are for the report, not for the conversation.
Professional profile. Print the full report. Lead with the failed/warned rows, name the missing hook or permission directly, and surface fix_command verbatim when fix_available is true. Example: write_guard: warn — check-write.sh missing from .claude/settings.json. Fix: nano-doctor.sh --fix.
Telemetry finalize
Before returning control:
_F="$HOME/.claude/skills/nanostack/bin/lib/skill-finalize.sh"
[ -f "$_F" ] && . "$_F" nano-doctor success
unset _FOutcome stays success even if the diagnosis found issues; the skill itself ran, the install is what has the problem. Pass error only if the script failed to execute (missing, not readable, etc.).
Gotchas
- Do not run
--fixwithout reporting what it will change. The user should see the warnings before they are repaired, not after. Default to read-only;--fixis opt-in. - Do not treat warn as fail. A missing VERSION file is not a broken install; it just means events report
unknown. - Do not interpret the output for the user when it is clean. If exit is 0 and there are no warnings, say "healthy" and stop. No need to recite the ten lines.
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.

