Skill: rangeking/skill-deps-doctor (version 0.1.0)

--- name: Skill Deps Doctor description: "Cross-platform skill dependency doctor — preflight check for missing binaries, version mismatches, system libraries, CJK fonts, Playwright/Chromium runtime, and project-level deps. Use before running skills to prevent late runtime dependency failures." metadata: {"clawdbot": {"emoji": "🧰", "requires": {"bins": ["python3", "skill-deps-doctor"]}, "install": [{"id": "skill-deps-doctor", "kind": "pip", "package": "skill-deps-doctor", "bins": ["skill-deps-doctor"], "label": "Install skill-deps-doctor (package: skill-deps-doctor) from PyPI"}]}} --- # 🧰 Skill Deps Doctor > **Complementary to `openclaw doctor`** — `doctor` checks gateway/config/services; > this skill checks **skill runtime dependencies** (bins, versions, libs, fonts). Use this skill to **detect missing or broken dependencies before a skill fails at runtime**. ## What it checks - 🔎 **Binary presence** — scans `skills/*/SKILL.md` declared `requires.bins` against `$PATH` - 📌 **Version constraints** — `node>=18`, `python3>=3.10` syntax with actual version probing - 🧩 **Shared libraries** — Playwright/Chromium native deps via `ldconfig` (Linux) - 🔤 **CJK fonts** — prevents PDF tofu (□) via `fc-list` - 🔗 **Transitive native deps** — e.g. `playwright` → 13 `.so` libraries - 📦 **Project presets** via `--check-dir`: - Node (`package.json`), Python (`pyproject.toml` / `requirements.txt`), Docker (`Dockerfile`) - Cross-references npm/pip packages against system-dep hints - 🎚️ **Playwright probes** — Node + Python detection + Chromium headless launch smoke test - 📦 **Dependency profiles** — `--profile slidev`, `--profile whisper`, `--profile pdf-export` - 🔌 **Plugin system** — third-party checkers via Python entry points ## Install ```bash pip install skill-deps-doctor ``` Legacy command `skill-deps-doctor` remains supported for compatibility. ## Usage ### Basic check ```bash skill-deps-doctor --skills-dir /path/to/workspace/skills ``` ### Scan a project directory (with probes) ```bash skill-deps-doctor --skills-dir ./skills --check-dir ./project --probe ``` ### Monorepo recursive scan ```bash skill-deps-doctor --skills-dir ./skills --check-dir ./monorepo --recursive ``` ### Dependency profiles ```bash skill-deps-doctor --skills-dir ./skills --profile slidev --profile pdf-export skill-deps-doctor --skills-dir ./skills --list-profiles ``` ### Generate fix script ```bash skill-deps-doctor --skills-dir ./skills --fix > fix.sh ``` ### Dependency graph ```bash skill-deps-doctor --skills-dir ./skills --graph tree skill-deps-doctor --skills-dir ./skills --graph dot | dot -Tsvg -o deps.svg ``` ### Cross-platform fix matrix ```bash skill-deps-doctor --skills-dir ./skills --platform-matrix ``` ### JSON output (CI) ```bash skill-deps-doctor --skills-dir ./skills --json ``` ### Environment snapshot + baseline regression gating ```bash # Save baseline skill-deps-doctor --skills-dir ./skills --snapshot baseline.json # Gate on new issues skill-deps-doctor --skills-dir ./skills --baseline baseline.json --fail-on-new # Exit: 0 = pass, 2 = errors, 3 = new findings vs baseline ``` ### Validate hints schema & plugin contracts ```bash skill-deps-doctor --skills-dir ./skills --validate-hints skill-deps-doctor --skills-dir ./skills --validate-plugins ``` ### Custom hints override ```bash skill-deps-doctor --skills-dir ./skills --hints-file my-hints.yaml ``` ### Verbosity ```bash skill-deps-doctor --skills-dir ./skills -v # Show all (including info) skill-deps-doctor --skills-dir ./skills -q # Errors only skill-deps-doctor --skills-dir ./skills --no-plugins # Skip third-party plugins ``` ### Fallback wrapper (repo/dev layout) ```bash python {baseDir}/scripts/skill-deps-doctor.py --skills-dir ./skills ``` ## Notes - **Linux**: shared-lib checks via `ldconfig`; font checks via `fc-list`; auto-adapts `apt` hints to host package manager (dnf / yum / apk / pacman). - **macOS / Windows**: binary + version + font checks work; Playwright checks rely on probes (`--probe`). - **CI integration**: use `--json` for machine-readable output, `--snapshot` + `--baseline --fail-on-new` for regression gating.

path: scripts/skill-deps-doctor.py
content: #!/usr/bin/env python3
from __future__ import annotations

"""Thin wrapper for running skill-deps-doctor from ClawHub skill context.

Behavior:
- Prefer vendored package inside the installed skill folder: <skill>/vendor/skill_deps_doctor
- If running inside this repository, add repo root to sys.path.
- Otherwise, rely on installed package (`pip install skill-deps-doctor` or git URL).
- On import failure, print actionable install commands.
"""

import sys
from pathlib import Path

HERE = Path(__file__).resolve()


def _inject_repo_root_if_present() -> None:
    # 1) Prefer vendored package inside the installed skill folder
    skill_dir = HERE.parents[1]
    vendor_dir = skill_dir / "vendor"
    if (vendor_dir / "skill_deps_doctor").is_dir():
        sys.path.insert(0, str(vendor_dir))
        return

    # 2) Repo mode
    for candidate in (HERE.parents[3], HERE.parents[2], Path.cwd()):
        pkg_dir = candidate / "skill_deps_doctor"
        if pkg_dir.is_dir():
            sys.path.insert(0, str(candidate))
            return


_inject_repo_root_if_present()

try:
    from skill_deps_doctor.cli import main  # type: ignore[attr-defined]  # noqa: E402
except Exception as e:
    msg = (
        "Unable to import skill_deps_doctor.\n"
        "Fix options:\n"
        "  1) Ensure vendored code exists at: {baseDir}/vendor/skill_deps_doctor\n"
        "  2) Or install via pip: pip install skill-deps-doctor\n"
        '  3) Or install via git: pip install "git+https://github.com/RangeKing/skill-deps-doctor.git"\n'
        f"Import error: {e}"
    )
    print(msg, file=sys.stderr)
    raise SystemExit(2) from e


if __name__ == "__main__":
    raise SystemExit(main())


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)