pub const DOCTOR_SKILL: &str = "<!--\nSPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\nCopyright the opencode-ctl authors. License: https://polyformproject.org/licenses/noncommercial/1.0.0\nThe canonical source-of-truth for the doctor skill lives at `shared/opencode-ctl/skill/opencode-ctl-doctor.md`.\nThis file is a TEMPLATE: a later task renders it per host by substituting the host placeholders and the\nhost-specific install section; the engine embeds this template and renders it per host at run time, and the\ncommitted copies under each plugin\'s `skills/` are generated from that output; regenerate that plugin\'s copy from the shipped binary with\n`emit-skill opencode-ctl-doctor --host <cc|qwen|agy|opencode>` so it can never drift. Edit ONLY that canonical\nfile - if the copy you are viewing is under a plugin/CLI `skills/` dir, it is generated; do NOT edit it, your\nchanges will be overwritten on the next emit.\n-->\n---\nname: opencode-ctl-doctor\ndescription: Diagnoses why opencode-ctl-mcp tools fail or do not appear. Use when the user runs {{INVOCATION}}, when a tool returns OPENCODE_NOT_FOUND, SERVICE_DOWN, AUTH_FAILED, UNKNOWN_OPERATION or REFUSED_ON_HOST, when opencode-pair is missing or stale{{INSTALL_CLAUSE}}\nargument-hint: \"{{ARGUMENT_HINT}}\"\nallowed-tools: {{ALLOWED_TOOLS}}\n---\n\nRun `{{BINARY}} doctor-json{{HOST_FLAG}}`, and append ` verbose` when the user asked for more detail\n(`doctor-json` accepts `verbose` and `--host <h>` in either order). Report each check below in this order, and\ntreat a `skip \"server_info failed\"` as a check that could not run: tell the user to re-run the doctor once\n`server_info` is `ok`.\n\n1. **Binary.** That the `opencode` binary was found, and that its version is >= 2.0. Warn when\n `server.info.version` is outside the tested `2.0.x` range, since `session.diff` turn semantics and the\n experimental wait route are version behaviours.\n2. **Registration.** That the service registration file is present, that its pid is alive, and whether the\n service config\'s `disabled` flag selects a standalone server.\n3. **`server.info`.** That `opencode api server.info` answers; when the doctor had to start the service to\n get an answer, say so, and when it could not, say that.\n4. **Wait route.** That the operation table contains `experimental.session.wait`.\n5. **Pairing.** That any pairing resolves to a live session and that its record generation has a sentinel;\n show both liveness values with their meaning, `starting`, `unknown` and `none` included.\n6. **Lock and policy source.** Which source set `permissions_locked`, and which set `permission_policy`.\n7. **Protected keys.** Every protected key whose env value differs from the user-level file.\n8. **Windows leftovers.** On the Windows copy, the `.source` file and any `.old` leftovers.\n9. **Launcher link.** That the `opencode-pair` link resolves to the running binary; show the `--force` hint\n when the link is stale.\n10. **`server_url` password.** A `server_url` without `OPENCODE_SERVER_PASSWORD`.\n11. **`OPENCODE_PASSWORD`.** Whether a `OPENCODE_PASSWORD` is set; it precedes the server password.\n12. **`OPENCODE_CTL_HOME`.** Whether it is set; when it is set, report it as the FIRST line.\n13. **Log.** The newest log file and its last error.\n14. **Orphans.** Pairs whose controller side is `dead` (not `none`) while the TUI side is `alive`, and\n sessions in `session.active` whose pair has no living side (orphaned workers).\n15. **Ignored or clamped settings.** Any setting that was ignored or clamped.\n16. **Resolved settings.** Print the resolved settings when invoked with `verbose`.\n\n{{INSTALL_SECTION}}\n";Expand description
The doctor skill template, embedded at compile time.