[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F4WY500321G5TH1126YQQ1":3,"skill-same:01M7F4WY500321G5TH1126YQQ1":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":45},"01M7F4WY500321G5TH1126YQQ1","skill-doctor",null,"Environment diagnostics — check providers, auth, config, hooks, scheduler, and more","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fskill-doctor\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: skill-doctor\ndescription: \"Environment diagnostics — check providers, auth, config, hooks, scheduler, and more\"\ndisable-model-invocation: true\n---\n\n> **Host: Codex CLI** — This skill was designed for Claude Code and adapted for Codex.\n> Cross-reference commands use installed skill names in Codex rather than `\u002Focto:*` slash commands.\n> Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it.\n> For host tool equivalents, see `skills\u002Fblocks\u002Fcodex-host-adapter.md`.\n\n\n# Environment Doctor\n\n## Overview\n\nRun environment diagnostics across 14 check categories. Doctor 2.0 identifies\nmisconfigured providers, stale loaded or cached plugin versions, invalid plugin\nassembly, unwritable state, non-terminal run records, orphan process evidence,\nbroken hooks, and other issues that prevent Claude Octopus from working\ncorrectly.\n\n**Core principle:** Detect problems before they surface in workflows.\n\n\n## When to Use\n\n**Use this skill when:**\n- Something isn't working and you're not sure why\n- After installing or updating the plugin\n- Before a demo or important workflow run\n- Checking if providers are properly authenticated\n- Verifying scheduler, hooks, or skills are correctly configured\n\n**Do NOT use for:**\n- First-time setup (use `\u002Focto:setup` — it guides configuration)\n- Project workflow status (use `\u002Focto:status`)\n- Debugging application code (use `\u002Focto:debug`)\n\n\n## The Process\n\n### Step 1: Resolve Plugin Root and Run Full Diagnostics\n\nUse this resolver before running Octopus scripts. Do not assume\n`~\u002F.claude-octopus\u002Fplugin` exists; Windows Git Bash installs may not support the\nstable symlink. Run this as a single Bash call.\n\n```bash\nOCTO_PLUGIN_ROOT=\"${CLAUDE_PLUGIN_ROOT:-}\"\nif [[ -z \"$OCTO_PLUGIN_ROOT\" || ! -x \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" ]]; then\n  OCTO_PLUGIN_ROOT=\"${HOME}\u002F.claude-octopus\u002Fplugin\"\nfi\nif [[ ! -x \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" ]] && command -v octopus >\u002Fdev\u002Fnull 2>&1; then\n  OCTO_BIN=\"$(command -v octopus)\"\n  OCTO_PLUGIN_ROOT=\"$(cd \"$(dirname \"$OCTO_BIN\")\u002F..\" && pwd)\"\nfi\nif [[ ! -x \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" ]]; then\n  OCTO_PLUGIN_ROOT=\"$(\n    find \"${HOME}\u002F.claude\u002Fplugins\" -type f -path \"*\u002Fscripts\u002Forchestrate.sh\" -print 2>\u002Fdev\u002Fnull \\\n      | sed 's#\u002Fscripts\u002Forchestrate.sh$##' \\\n      | { grep -E '(nyldn-plugins|claude-octopus|\u002Focto(\u002F[0-9]|$))' || true; } \\\n      | sort \\\n      | tail -1\n  )\"\nfi\nif [[ -z \"$OCTO_PLUGIN_ROOT\" || ! -x \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" ]]; then\n  echo \"Claude Octopus plugin root not found. Reinstall the octo plugin, then retry doctor diagnostics.\"\n  exit 1\nfi\nmkdir -p \"${HOME}\u002F.claude-octopus\"\n_octo_stable=\"${HOME}\u002F.claude-octopus\u002Fplugin\"\nif [[ ! -L \"$_octo_stable\" ]] || [[ \"$(cd \"$OCTO_PLUGIN_ROOT\" 2>\u002Fdev\u002Fnull && pwd -P)\" != \"$(cd \"$_octo_stable\" 2>\u002Fdev\u002Fnull && pwd -P)\" ]]; then\n  [[ -L \"$_octo_stable\" || -f \"$_octo_stable\" ]] && rm -f \"$_octo_stable\" 2>\u002Fdev\u002Fnull || true\n  ln -s \"$OCTO_PLUGIN_ROOT\" \"$_octo_stable\" 2>\u002Fdev\u002Fnull || true\nfi\nunset _octo_stable\nexport OCTO_PLUGIN_ROOT\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor --verbose\n```\n\nThis runs all 14 check categories and displays a formatted report.\n\n### Step 2: Filter by Category (Optional)\n\nIf the user asks about a specific area, reuse the resolver from Step 1 and\nreplace its final `doctor --verbose` invocation with one of these lines. These\nare replacement lines, not standalone shell calls; `OCTO_PLUGIN_ROOT` must be\nresolved in the same Bash call.\n\n```bash\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor providers\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor providers --live\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor companions\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor auth\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor config\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor updates\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor state\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor smoke\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor hooks\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor scheduler\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor skills\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor conflicts\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor agents\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor recurrence\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor cache\n```\n\n### Step 3: Check & Install Dependencies\n\nReuse the Step 1 resolver and replace its final invocation with the dependency\nchecker to find missing CLIs, statusline config, and recommended plugins:\n\n```bash\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Finstall-deps.sh\" check\n```\n\nIf the check reports missing deps, offer to install them:\n\n```bash\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Finstall-deps.sh\" install\n```\n\nThis auto-installs Codex CLI, jq, and the statusline resolver. Antigravity CLI (`agy`) setup is detected and reported with install guidance. For plugins (claude-mem, document-skills), it prints `\u002Fplugin install` commands the user must run manually.\n\n### Step 4: Verbose or JSON Output\n\nAs above, run these as the final line of the Step 1 resolver call:\n\n```bash\n# Detailed output for troubleshooting\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor --verbose\n\n# Machine-readable output\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor --json\n\n# Combine: specific category + verbose\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor auth --verbose\n```\n\nDoctor 2.0 JSON always uses this outer contract:\n\n```json\n{\n  \"schema_version\": \"10.0\",\n  \"summary\": {\"passed\": 0, \"warnings\": 0, \"failures\": 0, \"exit_code\": 0},\n  \"results\": []\n}\n```\n\nA check with status `fail` makes both `summary.exit_code` and the process exit\ncode `1`, while stdout remains valid JSON. Warnings remain structured but do not\nmake the command fail. Unknown flags, unknown categories, and multiple category\narguments are usage errors with exit code `2`; do not retry them as full scans.\n\nThe `providers --live` variant is an explicit, bounded AGY capability check. It\nuses one small real request to verify the CLI version, live model catalog and\nkeyring authentication, configured model, and print-mode dispatch. Do not run\nit from startup hooks or routine preflight. If its catalog\u002Fauth stage fails,\ntell the user to launch plain `agy` and complete the browser sign-in; AGY has no\nseparate login shell subcommand. On macOS keyring errors, direct them to Keychain\nAccess, the Antigravity CLI item, and its Access Control settings.\n\n### Step 5: Interactive Remediation (MANDATORY for fixable issues)\n\nAfter running diagnostics, if ANY fixable issues are found, you MUST use AskUserQuestion to offer fixes. Do NOT just print instructions — offer to execute them.\n\nBefore each accepted repair, restate the exact target and action. Configuration\nrepairs must use a validated sibling temporary file and atomic rename; if any\nstep fails, keep the original and report the failure. Cache cleanup, stale PID\ncleanup, login flows, package installation, and plugin updates always require\nexplicit confirmation. After repair, rerun only the affected category first,\nthen offer a full scan.\n\n**RTK not installed:**\n\n```javascript\nAskUserQuestion({\n  questions: [{\n    question: \"RTK saves 60-90% on bash output tokens. Install it now?\",\n    header: \"Install RTK\",\n    multiSelect: false,\n    options: [\n      {label: \"Install via brew (Recommended)\", description: \"brew install rtk — fast, macOS\"},\n      {label: \"Install via cargo\", description: \"cargo install rtk-token-killer\"},\n      {label: \"Skip\", description: \"Continue without RTK\"}\n    ]\n  }]\n})\n```\n\nIf user chooses install, run it, then offer hook setup.\n\n**RTK installed but hook not configured on macOS\u002FLinux:**\n\nOn Windows Git Bash, do not offer `rtk init -g`. RTK uses CLAUDE.md injection\nmode there, so report the hook check as skipped.\n\n```javascript\nAskUserQuestion({\n  questions: [{\n    question: \"RTK is installed but the Claude Code hook isn't active. Configure it?\",\n    header: \"RTK Hook\",\n    multiSelect: false,\n    options: [\n      {label: \"Run rtk init -g (Recommended)\", description: \"Auto-installs Claude Code bash hook on macOS\u002FLinux\"},\n      {label: \"Skip\", description: \"I'll configure it later\"}\n    ]\n  }]\n})\n```\n\n**Missing optional providers:**\n\n```javascript\nAskUserQuestion({\n  questions: [{\n    question: \"Some providers are missing. Install them?\",\n    header: \"Providers\",\n    multiSelect: true,\n    options: [\n      {label: \"Codex CLI\", description: \"npm install -g @openai\u002Fcodex\"},\n      {label: \"Antigravity CLI\", description: \"Install agy, then verify with agy --version && agy models\"},\n      {label: \"Skip all\", description: \"Continue with available providers\"}\n    ]\n  }]\n})\n```\n\n**Auth expired:**\nOffer to run the login command for the expired provider.\n\n**Multiple fixable issues:** Batch them into a single AskUserQuestion with multiSelect where appropriate, rather than asking one at a time.\n\n\n## Check Categories\n\n| Category | What it checks |\n|----------|---------------|\n| `providers` | Claude Code version, Codex CLI installed, Antigravity CLI installed, Perplexity API key, Ollama local LLM (server + models), circuit breaker status, provider fallback history |\n| `companions` | Optional companion tools and integrations |\n| `auth` | Authentication status for each provider |\n| `config` | Plugin version, install scope, feature flags, strict `claude plugin validate` result |\n| `updates` | Loaded, installed, catalog, and cache versions; Claude marketplace auto-update; reload requirement |\n| `state` | Project state.json, workspace and probe-cache writability, stale results, non-terminal runs, orphan and stale PID evidence |\n| `smoke` | Smoke test cache, model configuration |\n| `hooks` | hooks.json validity, hook scripts |\n| `scheduler` | Scheduler daemon, jobs, budget gates, kill switches |\n| `skills` | Skill files loaded and valid |\n| `conflicts` | Conflicting plugins detection |\n| `agents` | Agent definitions, worktree isolation, CLI registration, version compatibility |\n| `recurrence` | Failure pattern detection — flags repeated quality gate failures, source hotspots, 48h trends |\n| `cache` | Cache size, freshness, and hygiene |\n\nSoftware dependency installation is checked separately by\n`scripts\u002Finstall-deps.sh check` in Step 3, including Node.js, jq, provider CLIs,\nRTK token compression, the statusline resolver, and recommended plugins.\n\n\n## Interpreting Results\n\n### Healthy Output\n\nAll checks pass — no action needed.\n\n### Common Issues and Fixes\n\n| Issue | Fix |\n|-------|-----|\n| Codex CLI not found | `npm install -g @openai\u002Fcodex` or install via `codex login` |\n| Antigravity CLI not found | Install `agy`, then verify with `agy --version` and `agy models` |\n| Perplexity not configured | `export PERPLEXITY_API_KEY=\"pplx-...\"` (optional) |\n| Auth expired | Re-run `codex login`; for AGY, launch plain `agy` and complete its browser sign-in |\n| Circuit breaker OPEN | Provider had 3+ consecutive transient failures — wait for cooldown or check provider status |\n| Stale state | Delete `.octo\u002Fstate.json` and re-initialize |\n| Invalid hooks.json | Check `hooks.json` syntax — must be valid JSON |\n| RTK not installed | Offer to install: `brew install rtk && rtk init -g` (saves 60-90% tokens). Use AskUserQuestion to offer brew vs cargo install. |\n| RTK installed but hook not configured | On macOS\u002FLinux, offer `rtk init -g`; on Windows Git Bash, report skipped because RTK uses CLAUDE.md injection mode |\n| RTK gain stats unavailable | Run some bash commands first, then check `rtk gain` to see token savings |\n| Conflicting plugins | Uninstall conflicting plugins or adjust scope |\n\n\n## Integration with Other Skills\n\n| Scenario | Route |\n|----------|-------|\n| Doctor finds missing provider | Suggest `\u002Focto:setup` to configure |\n| Doctor finds stale project state | Suggest `\u002Focto:status` to review |\n| Doctor finds hook errors | Guide user to fix hooks.json |\n| All checks pass, user still has issues | Suggest `\u002Focto:debug` for deeper investigation |\n\n\n## Hook Profile\n\nClaude Octopus hooks can run in different profiles to balance cost and coverage.\n\nCurrent profile: `$OCTO_HOOK_PROFILE` (default: standard)\n\nAvailable profiles:\n- **minimal** — Only session lifecycle and cost tracking hooks (lowest overhead)\n- **standard** — All hooks except expensive review\u002Fsecurity gates (default)\n- **strict** — All hooks enabled including quality and security gates\n\nOverride: Set `OCTO_PROFILE=budget|balanced|quality` or `OCTO_DISABLED_HOOKS=hook1,hook2` to fine-tune. Legacy `OCTO_HOOK_PROFILE` still works (minimal→budget, standard→balanced, strict→quality).\n\n\n## Intensity Profile\n\nThe doctor reports the active intensity profile — a single knob controlling hook gating, model selection, phase skipping, and context verbosity.\n\n### What the Doctor Checks\n\n- **Current profile**: `OCTO_PROFILE` value (budget\u002Fbalanced\u002Fquality, default: balanced)\n- **Profile source**: env var, legacy `OCTO_HOOK_PROFILE`, or auto-selected from intent\n- **Hook gating**: which hooks are enabled\u002Fdisabled at this profile level\n- **Model hints**: which model (sonnet\u002Fopus) is recommended for each phase\n- **Context verbosity**: compressed\u002Fstandard\u002Ffull\n\n### Profile Summary\n\n| Dimension | budget | balanced | quality |\n|-----------|--------|----------|---------|\n| Hooks | essential only | standard (no quality gates) | all hooks |\n| Models | Sonnet everywhere | Sonnet + Opus for synthesis | Opus for most phases |\n| Phases | Skip discover if context given | Skip re-discovery | All phases run |\n| Context | Compressed | Standard | Full inlining |\n\n\n## Project Tier Hint\n\nAlso report `OCTO_TIER` when set. This is a recommendation hint, not a hard policy.\n\n| Tier | Doctor guidance |\n|------|-----------------|\n| `prototype` | Prefer faster checks and warn before high-cost provider fanout |\n| `mvp` | Use balanced defaults and consensus on risky changes |\n| `production` | Recommend full verification, security review, and stricter release gates |\n\nIf unset, show `OCTO_TIER=unset` and suggest setting it only when the project has a stable risk profile.\n\n\n## Remote Session Checks\n\nIf `CLAUDE_CODE_REMOTE=true` or `OCTOPUS_REMOTE_SESSION=true`, report:\n\n- remote session detected\n- autonomous mode default active when no explicit autonomy is set\n- provider probes skipped to conserve time\u002Fquota\n- full HUD disabled unless `OCTOPUS_REMOTE_STATUSLINE=full`\n- provider CLIs may need to be installed in the cloud setup script\n\nSuggest `\u002Focto:setup` only for configuration guidance; do not recommend interactive provider logins inside the remote session.\n\n\n## Runtime Context\n\nThe doctor checks for project-level `RUNTIME.md` — a file that provides project-specific context (API endpoints, env vars, test commands, build steps) to orchestration prompts.\n\n### What the Doctor Checks\n\n- **RUNTIME.md exists** in the project root (also checks `.octopus\u002FRUNTIME.md` and `.claude-octopus\u002FRUNTIME.md`)\n- If missing, suggest creating one from the template: `cp \"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fconfig\u002Ftemplates\u002FRUNTIME.md\" .\u002FRUNTIME.md`\n- If present, confirm it contains at least one populated section (not just the template defaults)\n\n### Why It Matters\n\nWithout a `RUNTIME.md`, orchestration prompts lack project-specific details — leading to generic advice about test commands, environment variables, and build steps. A populated `RUNTIME.md` makes every workflow more accurate.\n\n\n## Quick Reference\n\n`\u002Focto:doctor` was removed in v9.41.0 to preserve Claude Code's native `\u002Fdoctor` command.\nInvoke this manual skill explicitly, or run the CLI directly:\n\n| What to say \u002F run | Action |\n|-------------------|--------|\n| `\u002Focto:skill-doctor` | Run all 14 categories inside Claude Code |\n| `octopus doctor providers` | Check provider installation only |\n| `octopus doctor auth --verbose` | Detailed auth status |\n| `octopus doctor --json` | Machine-readable output |\n| `bash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor auth --verbose` | Detailed auth status when the CLI is unavailable |\n| `bash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor --json` | Machine-readable output when the CLI is unavailable |\n\nIf the `octopus` CLI is not on `PATH`, resolve and export `OCTO_PLUGIN_ROOT`\nwith the Step 1 resolver, then run the equivalent `scripts\u002Forchestrate.sh`\ncommand directly.\n","> **Host: Codex CLI** — This skill was designed for Claude Code and adapted for Codex.\n> Cross-reference commands use installed skill names in Codex rather than `\u002Focto:*` slash commands.\n> Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it.\n> For host tool equivalents, see `skills\u002Fblocks\u002Fcodex-host-adapter.md`.\n\n\n# Environment Doctor\n\n## Overview\n\nRun environment diagnostics across 14 check categories. Doctor 2.0 identifies\nmisconfigured providers, stale loaded or cached plugin versions, invalid plugin\nassembly, unwritable state, non-terminal run records, orphan process evidence,\nbroken hooks, and other issues that prevent Claude Octopus from working\ncorrectly.\n\n**Core principle:** Detect problems before they surface in workflows.\n\n\n## When to Use\n\n**Use this skill when:**\n- Something isn't working and you're not sure why\n- After installing or updating the plugin\n- Before a demo or important workflow run\n- Checking if providers are properly authenticated\n- Verifying scheduler, hooks, or skills are correctly configured\n\n**Do NOT use for:**\n- First-time setup (use `\u002Focto:setup` — it guides configuration)\n- Project workflow status (use `\u002Focto:status`)\n- Debugging application code (use `\u002Focto:debug`)\n\n\n## The Process\n\n### Step 1: Resolve Plugin Root and Run Full Diagnostics\n\nUse this resolver before running Octopus scripts. Do not assume\n`~\u002F.claude-octopus\u002Fplugin` exists; Windows Git Bash installs may not support the\nstable symlink. Run this as a single Bash call.\n\n```bash\nOCTO_PLUGIN_ROOT=\"${CLAUDE_PLUGIN_ROOT:-}\"\nif [[ -z \"$OCTO_PLUGIN_ROOT\" || ! -x \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" ]]; then\n  OCTO_PLUGIN_ROOT=\"${HOME}\u002F.claude-octopus\u002Fplugin\"\nfi\nif [[ ! -x \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" ]] && command -v octopus >\u002Fdev\u002Fnull 2>&1; then\n  OCTO_BIN=\"$(command -v octopus)\"\n  OCTO_PLUGIN_ROOT=\"$(cd \"$(dirname \"$OCTO_BIN\")\u002F..\" && pwd)\"\nfi\nif [[ ! -x \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" ]]; then\n  OCTO_PLUGIN_ROOT=\"$(\n    find \"${HOME}\u002F.claude\u002Fplugins\" -type f -path \"*\u002Fscripts\u002Forchestrate.sh\" -print 2>\u002Fdev\u002Fnull \\\n      | sed 's#\u002Fscripts\u002Forchestrate.sh$##' \\\n      | { grep -E '(nyldn-plugins|claude-octopus|\u002Focto(\u002F[0-9]|$))' || true; } \\\n      | sort \\\n      | tail -1\n  )\"\nfi\nif [[ -z \"$OCTO_PLUGIN_ROOT\" || ! -x \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" ]]; then\n  echo \"Claude Octopus plugin root not found. Reinstall the octo plugin, then retry doctor diagnostics.\"\n  exit 1\nfi\nmkdir -p \"${HOME}\u002F.claude-octopus\"\n_octo_stable=\"${HOME}\u002F.claude-octopus\u002Fplugin\"\nif [[ ! -L \"$_octo_stable\" ]] || [[ \"$(cd \"$OCTO_PLUGIN_ROOT\" 2>\u002Fdev\u002Fnull && pwd -P)\" != \"$(cd \"$_octo_stable\" 2>\u002Fdev\u002Fnull && pwd -P)\" ]]; then\n  [[ -L \"$_octo_stable\" || -f \"$_octo_stable\" ]] && rm -f \"$_octo_stable\" 2>\u002Fdev\u002Fnull || true\n  ln -s \"$OCTO_PLUGIN_ROOT\" \"$_octo_stable\" 2>\u002Fdev\u002Fnull || true\nfi\nunset _octo_stable\nexport OCTO_PLUGIN_ROOT\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor --verbose\n```\n\nThis runs all 14 check categories and displays a formatted report.\n\n### Step 2: Filter by Category (Optional)\n\nIf the user asks about a specific area, reuse the resolver from Step 1 and\nreplace its final `doctor --verbose` invocation with one of these lines. These\nare replacement lines, not standalone shell calls; `OCTO_PLUGIN_ROOT` must be\nresolved in the same Bash call.\n\n```bash\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor providers\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor providers --live\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor companions\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor auth\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor config\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor updates\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor state\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor smoke\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor hooks\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor scheduler\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor skills\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor conflicts\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor agents\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor recurrence\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor cache\n```\n\n### Step 3: Check & Install Dependencies\n\nReuse the Step 1 resolver and replace its final invocation with the dependency\nchecker to find missing CLIs, statusline config, and recommended plugins:\n\n```bash\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Finstall-deps.sh\" check\n```\n\nIf the check reports missing deps, offer to install them:\n\n```bash\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Finstall-deps.sh\" install\n```\n\nThis auto-installs Codex CLI, jq, and the statusline resolver. Antigravity CLI (`agy`) setup is detected and reported with install guidance. For plugins (claude-mem, document-skills), it prints `\u002Fplugin install` commands the user must run manually.\n\n### Step 4: Verbose or JSON Output\n\nAs above, run these as the final line of the Step 1 resolver call:\n\n```bash\n# Detailed output for troubleshooting\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor --verbose\n\n# Machine-readable output\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor --json\n\n# Combine: specific category + verbose\nbash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor auth --verbose\n```\n\nDoctor 2.0 JSON always uses this outer contract:\n\n```json\n{\n  \"schema_version\": \"10.0\",\n  \"summary\": {\"passed\": 0, \"warnings\": 0, \"failures\": 0, \"exit_code\": 0},\n  \"results\": []\n}\n```\n\nA check with status `fail` makes both `summary.exit_code` and the process exit\ncode `1`, while stdout remains valid JSON. Warnings remain structured but do not\nmake the command fail. Unknown flags, unknown categories, and multiple category\narguments are usage errors with exit code `2`; do not retry them as full scans.\n\nThe `providers --live` variant is an explicit, bounded AGY capability check. It\nuses one small real request to verify the CLI version, live model catalog and\nkeyring authentication, configured model, and print-mode dispatch. Do not run\nit from startup hooks or routine preflight. If its catalog\u002Fauth stage fails,\ntell the user to launch plain `agy` and complete the browser sign-in; AGY has no\nseparate login shell subcommand. On macOS keyring errors, direct them to Keychain\nAccess, the Antigravity CLI item, and its Access Control settings.\n\n### Step 5: Interactive Remediation (MANDATORY for fixable issues)\n\nAfter running diagnostics, if ANY fixable issues are found, you MUST use AskUserQuestion to offer fixes. Do NOT just print instructions — offer to execute them.\n\nBefore each accepted repair, restate the exact target and action. Configuration\nrepairs must use a validated sibling temporary file and atomic rename; if any\nstep fails, keep the original and report the failure. Cache cleanup, stale PID\ncleanup, login flows, package installation, and plugin updates always require\nexplicit confirmation. After repair, rerun only the affected category first,\nthen offer a full scan.\n\n**RTK not installed:**\n\n```javascript\nAskUserQuestion({\n  questions: [{\n    question: \"RTK saves 60-90% on bash output tokens. Install it now?\",\n    header: \"Install RTK\",\n    multiSelect: false,\n    options: [\n      {label: \"Install via brew (Recommended)\", description: \"brew install rtk — fast, macOS\"},\n      {label: \"Install via cargo\", description: \"cargo install rtk-token-killer\"},\n      {label: \"Skip\", description: \"Continue without RTK\"}\n    ]\n  }]\n})\n```\n\nIf user chooses install, run it, then offer hook setup.\n\n**RTK installed but hook not configured on macOS\u002FLinux:**\n\nOn Windows Git Bash, do not offer `rtk init -g`. RTK uses CLAUDE.md injection\nmode there, so report the hook check as skipped.\n\n```javascript\nAskUserQuestion({\n  questions: [{\n    question: \"RTK is installed but the Claude Code hook isn't active. Configure it?\",\n    header: \"RTK Hook\",\n    multiSelect: false,\n    options: [\n      {label: \"Run rtk init -g (Recommended)\", description: \"Auto-installs Claude Code bash hook on macOS\u002FLinux\"},\n      {label: \"Skip\", description: \"I'll configure it later\"}\n    ]\n  }]\n})\n```\n\n**Missing optional providers:**\n\n```javascript\nAskUserQuestion({\n  questions: [{\n    question: \"Some providers are missing. Install them?\",\n    header: \"Providers\",\n    multiSelect: true,\n    options: [\n      {label: \"Codex CLI\", description: \"npm install -g @openai\u002Fcodex\"},\n      {label: \"Antigravity CLI\", description: \"Install agy, then verify with agy --version && agy models\"},\n      {label: \"Skip all\", description: \"Continue with available providers\"}\n    ]\n  }]\n})\n```\n\n**Auth expired:**\nOffer to run the login command for the expired provider.\n\n**Multiple fixable issues:** Batch them into a single AskUserQuestion with multiSelect where appropriate, rather than asking one at a time.\n\n\n## Check Categories\n\n| Category | What it checks |\n|----------|---------------|\n| `providers` | Claude Code version, Codex CLI installed, Antigravity CLI installed, Perplexity API key, Ollama local LLM (server + models), circuit breaker status, provider fallback history |\n| `companions` | Optional companion tools and integrations |\n| `auth` | Authentication status for each provider |\n| `config` | Plugin version, install scope, feature flags, strict `claude plugin validate` result |\n| `updates` | Loaded, installed, catalog, and cache versions; Claude marketplace auto-update; reload requirement |\n| `state` | Project state.json, workspace and probe-cache writability, stale results, non-terminal runs, orphan and stale PID evidence |\n| `smoke` | Smoke test cache, model configuration |\n| `hooks` | hooks.json validity, hook scripts |\n| `scheduler` | Scheduler daemon, jobs, budget gates, kill switches |\n| `skills` | Skill files loaded and valid |\n| `conflicts` | Conflicting plugins detection |\n| `agents` | Agent definitions, worktree isolation, CLI registration, version compatibility |\n| `recurrence` | Failure pattern detection — flags repeated quality gate failures, source hotspots, 48h trends |\n| `cache` | Cache size, freshness, and hygiene |\n\nSoftware dependency installation is checked separately by\n`scripts\u002Finstall-deps.sh check` in Step 3, including Node.js, jq, provider CLIs,\nRTK token compression, the statusline resolver, and recommended plugins.\n\n\n## Interpreting Results\n\n### Healthy Output\n\nAll checks pass — no action needed.\n\n### Common Issues and Fixes\n\n| Issue | Fix |\n|-------|-----|\n| Codex CLI not found | `npm install -g @openai\u002Fcodex` or install via `codex login` |\n| Antigravity CLI not found | Install `agy`, then verify with `agy --version` and `agy models` |\n| Perplexity not configured | `export PERPLEXITY_API_KEY=\"pplx-...\"` (optional) |\n| Auth expired | Re-run `codex login`; for AGY, launch plain `agy` and complete its browser sign-in |\n| Circuit breaker OPEN | Provider had 3+ consecutive transient failures — wait for cooldown or check provider status |\n| Stale state | Delete `.octo\u002Fstate.json` and re-initialize |\n| Invalid hooks.json | Check `hooks.json` syntax — must be valid JSON |\n| RTK not installed | Offer to install: `brew install rtk && rtk init -g` (saves 60-90% tokens). Use AskUserQuestion to offer brew vs cargo install. |\n| RTK installed but hook not configured | On macOS\u002FLinux, offer `rtk init -g`; on Windows Git Bash, report skipped because RTK uses CLAUDE.md injection mode |\n| RTK gain stats unavailable | Run some bash commands first, then check `rtk gain` to see token savings |\n| Conflicting plugins | Uninstall conflicting plugins or adjust scope |\n\n\n## Integration with Other Skills\n\n| Scenario | Route |\n|----------|-------|\n| Doctor finds missing provider | Suggest `\u002Focto:setup` to configure |\n| Doctor finds stale project state | Suggest `\u002Focto:status` to review |\n| Doctor finds hook errors | Guide user to fix hooks.json |\n| All checks pass, user still has issues | Suggest `\u002Focto:debug` for deeper investigation |\n\n\n## Hook Profile\n\nClaude Octopus hooks can run in different profiles to balance cost and coverage.\n\nCurrent profile: `$OCTO_HOOK_PROFILE` (default: standard)\n\nAvailable profiles:\n- **minimal** — Only session lifecycle and cost tracking hooks (lowest overhead)\n- **standard** — All hooks except expensive review\u002Fsecurity gates (default)\n- **strict** — All hooks enabled including quality and security gates\n\nOverride: Set `OCTO_PROFILE=budget|balanced|quality` or `OCTO_DISABLED_HOOKS=hook1,hook2` to fine-tune. Legacy `OCTO_HOOK_PROFILE` still works (minimal→budget, standard→balanced, strict→quality).\n\n\n## Intensity Profile\n\nThe doctor reports the active intensity profile — a single knob controlling hook gating, model selection, phase skipping, and context verbosity.\n\n### What the Doctor Checks\n\n- **Current profile**: `OCTO_PROFILE` value (budget\u002Fbalanced\u002Fquality, default: balanced)\n- **Profile source**: env var, legacy `OCTO_HOOK_PROFILE`, or auto-selected from intent\n- **Hook gating**: which hooks are enabled\u002Fdisabled at this profile level\n- **Model hints**: which model (sonnet\u002Fopus) is recommended for each phase\n- **Context verbosity**: compressed\u002Fstandard\u002Ffull\n\n### Profile Summary\n\n| Dimension | budget | balanced | quality |\n|-----------|--------|----------|---------|\n| Hooks | essential only | standard (no quality gates) | all hooks |\n| Models | Sonnet everywhere | Sonnet + Opus for synthesis | Opus for most phases |\n| Phases | Skip discover if context given | Skip re-discovery | All phases run |\n| Context | Compressed | Standard | Full inlining |\n\n\n## Project Tier Hint\n\nAlso report `OCTO_TIER` when set. This is a recommendation hint, not a hard policy.\n\n| Tier | Doctor guidance |\n|------|-----------------|\n| `prototype` | Prefer faster checks and warn before high-cost provider fanout |\n| `mvp` | Use balanced defaults and consensus on risky changes |\n| `production` | Recommend full verification, security review, and stricter release gates |\n\nIf unset, show `OCTO_TIER=unset` and suggest setting it only when the project has a stable risk profile.\n\n\n## Remote Session Checks\n\nIf `CLAUDE_CODE_REMOTE=true` or `OCTOPUS_REMOTE_SESSION=true`, report:\n\n- remote session detected\n- autonomous mode default active when no explicit autonomy is set\n- provider probes skipped to conserve time\u002Fquota\n- full HUD disabled unless `OCTOPUS_REMOTE_STATUSLINE=full`\n- provider CLIs may need to be installed in the cloud setup script\n\nSuggest `\u002Focto:setup` only for configuration guidance; do not recommend interactive provider logins inside the remote session.\n\n\n## Runtime Context\n\nThe doctor checks for project-level `RUNTIME.md` — a file that provides project-specific context (API endpoints, env vars, test commands, build steps) to orchestration prompts.\n\n### What the Doctor Checks\n\n- **RUNTIME.md exists** in the project root (also checks `.octopus\u002FRUNTIME.md` and `.claude-octopus\u002FRUNTIME.md`)\n- If missing, suggest creating one from the template: `cp \"${HOME}\u002F.claude-octopus\u002Fplugin\u002Fconfig\u002Ftemplates\u002FRUNTIME.md\" .\u002FRUNTIME.md`\n- If present, confirm it contains at least one populated section (not just the template defaults)\n\n### Why It Matters\n\nWithout a `RUNTIME.md`, orchestration prompts lack project-specific details — leading to generic advice about test commands, environment variables, and build steps. A populated `RUNTIME.md` makes every workflow more accurate.\n\n\n## Quick Reference\n\n`\u002Focto:doctor` was removed in v9.41.0 to preserve Claude Code's native `\u002Fdoctor` command.\nInvoke this manual skill explicitly, or run the CLI directly:\n\n| What to say \u002F run | Action |\n|-------------------|--------|\n| `\u002Focto:skill-doctor` | Run all 14 categories inside Claude Code |\n| `octopus doctor providers` | Check provider installation only |\n| `octopus doctor auth --verbose` | Detailed auth status |\n| `octopus doctor --json` | Machine-readable output |\n| `bash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor auth --verbose` | Detailed auth status when the CLI is unavailable |\n| `bash \"$OCTO_PLUGIN_ROOT\u002Fscripts\u002Forchestrate.sh\" doctor --json` | Machine-readable output when the CLI is unavailable |\n\nIf the `octopus` CLI is not on `PATH`, resolve and export `OCTO_PLUGIN_ROOT`\nwith the Step 1 resolver, then run the equivalent `scripts\u002Forchestrate.sh`\ncommand directly.\n",{"name":5,"description":7,"disable-model-invocation":24},true,"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","05-技能与代理开发\u002Fskill-doctor",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":24},[35,38,41],{"tool":36,"command":37},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill skill-doctor",{"tool":39,"command":40},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill skill-doctor",{"tool":42,"command":43},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill skill-doctor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fskill-doctor\u002FSKILL.md",[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"agents\u002Fopenai.yaml","REFERENCE","参考文档",164,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fskill-doctor\u002Fagents\u002Fopenai.yaml",[53,60,65,72,79,86],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":61,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]