$npx -y skills add aviflombaum/claude-code-in-avinyc --skill doctorRun qmd health check for this project. Triggers on "qmd doctor", "check qmd health", "qmd problems", "diagnose qmd".
| 1 | # QMD Doctor |
| 2 | |
| 3 | Run a comprehensive health check on the qmd configuration for this project. Perform each check below in order and report results as `[PASS]`, `[FAIL]`, or `[WARN]`. At the end, summarize the total number of issues found. |
| 4 | |
| 5 | ## Remediation Reference |
| 6 | |
| 7 | For any failure, suggest the appropriate fix: |
| 8 | |
| 9 | | Failure | Fix | |
| 10 | |---------|-----| |
| 11 | | qmd binary not found | `npm install -g @tobilu/qmd` | |
| 12 | | .claude/qmd.json missing | Run `/avinyc:qmd-configure` | |
| 13 | | Missing project field | Run `/avinyc:qmd-configure` | |
| 14 | | Collection not in qmd index | Run `/avinyc:qmd-configure` | |
| 15 | | Collection naming mismatch | Run `/avinyc:qmd-configure` to rename | |
| 16 | | Git hook missing/wrong marker | Run `/avinyc:qmd-configure` and re-enable git hook | |
| 17 | | Git hook has old --index flag | Run `/avinyc:qmd-configure` and re-enable git hook | |
| 18 | | MCP server not responding | Run `claude mcp add qmd -- qmd mcp` or add qmd to `.mcp.json` | |
| 19 | | YAML config missing collection | Run `/avinyc:qmd-configure` | |
| 20 | |
| 21 | ## Checks |
| 22 | |
| 23 | ### 1. qmd binary |
| 24 | |
| 25 | ```bash |
| 26 | command -v qmd |
| 27 | ``` |
| 28 | |
| 29 | `[PASS]` if found (print the path), `[FAIL]` if not. |
| 30 | |
| 31 | ### 2. Config file exists |
| 32 | |
| 33 | Check if `.claude/qmd.json` exists using Read. If it does not exist, report `[FAIL]` and stop — remaining checks depend on it. |
| 34 | |
| 35 | ### 3. Valid JSON |
| 36 | |
| 37 | Read `.claude/qmd.json`. If you can parse it as JSON, `[PASS]`. If the content is malformed, `[FAIL]` and stop. |
| 38 | |
| 39 | ### 4. Has "project" field |
| 40 | |
| 41 | Check the parsed JSON has a non-empty `project` string. `[PASS]` or `[FAIL]`. |
| 42 | |
| 43 | ### 5. Default index database |
| 44 | |
| 45 | ```bash |
| 46 | test -f "$HOME/.cache/qmd/index.sqlite" && echo "exists" || echo "missing" |
| 47 | ``` |
| 48 | |
| 49 | `[PASS]` if exists, `[FAIL]` if missing. |
| 50 | |
| 51 | ### 6. Global config |
| 52 | |
| 53 | ```bash |
| 54 | test -f "$HOME/.config/qmd/index.yml" && echo "exists" || echo "missing" |
| 55 | ``` |
| 56 | |
| 57 | `[PASS]` if exists, `[FAIL]` if missing. |
| 58 | |
| 59 | ### 7-9. Collection checks |
| 60 | |
| 61 | For each key in the `collections` object: |
| 62 | |
| 63 | **7. Collection in qmd index:** |
| 64 | |
| 65 | ```bash |
| 66 | qmd collection list |
| 67 | ``` |
| 68 | |
| 69 | Check if the collection name appears in the output. `[PASS]` or `[FAIL]`. |
| 70 | |
| 71 | **8. Naming convention:** If the project name is set, check that the collection name starts with `{project}_`. `[PASS]` or `[WARN]`. |
| 72 | |
| 73 | ### 9. YAML config entries |
| 74 | |
| 75 | If `~/.config/qmd/index.yml` exists, check that each collection name appears in it: |
| 76 | |
| 77 | ```bash |
| 78 | grep -F "{collection_name}:" "$HOME/.config/qmd/index.yml" |
| 79 | ``` |
| 80 | |
| 81 | `[PASS]` or `[FAIL]` per collection. |
| 82 | |
| 83 | ### 10-11. Git hook checks (only if `gitHook` is `true`) |
| 84 | |
| 85 | **10.** Check `.git/hooks/post-commit` exists. If it does, verify it contains the marker comment `# qmd-auto-index:{project}`. `[PASS]`, `[WARN]` (marker mismatch), or `[FAIL]` (missing). |
| 86 | |
| 87 | **11.** Check the hook does NOT contain the deprecated `--index` flag. `[PASS]` or `[WARN]`. |
| 88 | |
| 89 | ### 12. MCP server connectivity |
| 90 | |
| 91 | Try calling `mcp__qmd__status`. If it returns data, `[PASS]`. If the tool is not available or returns an error, `[WARN]` with message: |
| 92 | |
| 93 | > MCP server not configured or not responding. Search will fall back to CLI. Run `claude mcp add qmd -- qmd mcp` or add qmd to `.mcp.json`. |
| 94 | |
| 95 | ## Output Format |
| 96 | |
| 97 | Print each result on its own line: |
| 98 | |
| 99 | ``` |
| 100 | [PASS] qmd binary found: /path/to/qmd |
| 101 | [PASS] .claude/qmd.json exists |
| 102 | [PASS] .claude/qmd.json is valid JSON |
| 103 | [PASS] Project name: myproject |
| 104 | [FAIL] Default index database missing: ~/.cache/qmd/index.sqlite |
| 105 | [WARN] MCP server not configured — search will use CLI fallback |
| 106 | ... |
| 107 | |
| 108 | N issue(s) found. |
| 109 | ``` |
| 110 | |
| 111 | If all checks pass, end with: `All checks passed.` |