{
  "$schema": "https://bestaiskill.com/schemas/agent-install/2.json",
  "skill": "tunnel-doctor",
  "built": "2026-10-26",
  "control_level": 4,
  "control_level_label": "L4 高权限",
  "capabilities": [
    "execute_command",
    "network",
    "write_file"
  ],
  "required_controls": {
    "agent": [
      "sandbox_recommended",
      "graded_authorization"
    ],
    "admin": [
      "approval_process",
      "rollback_support",
      "full_audit"
    ]
  },
  "evidence": [
    {
      "file": "scripts/",
      "summary": "Executes local scripts or commands: python3 scripts/quick_diagnose.py --host … --url … [--tailscale-ip …] (bundled in repo)"
    },
    {
      "file": "网络端点",
      "summary": "Declares external network access: curl via local/LAN proxy ports (127.0.0.1:1082, host.internal:1082, etc.) and direct connections to external endpoints for path health and capacity testing"
    },
    {
      "file": "本地工作目录",
      "summary": "File I/O and artifact generation: writes back Shadowrocket config: POST /api/save --data-binary @config.txt to replace the editor buffer (reference)"
    }
  ],
  "verification": {
    "method": "第二遍独立复核（找茬视角）：①glob 清点目录（含隐藏）确认资产面：SKILL.md + references×5 + scripts×1，共 7 个文件，无隐藏脚本；②以 raw 整读 quick_diagnose.py 前 120 行并逐段抽取其 subprocess/环境变量/写盘行为，核对文档声明与代码一致；③以 headings 索引重读 SKILL.md 全 1290 行的结构，再针对 Step 2H/2J/2K/5C 与 SOP 段落逐段取原文核对（避免只读开头就下结论）；④提取全目录域名与 CLI 清单逐条回查调用点；⑤专门检索『安全降级』类 token（StrictHostKeyChecking、CERT_NONE、--no-verify、shell=True、eval、sudo、chmod、keychain、token、password、UUID）并逐项判定是否构成降级或凭据读取；⑥扫描 >200 字符无空格长行（混淆）与 base64 大块；⑦核对文档内部是否存在自相矛盾的安全表述；⑧git 核对 pin commit 与目录最后一次提交。",
    "second_pass": [
      {
        "item": "每条外部依赖的调用点是否真实存在（13 个 CLI/API/network 条目）",
        "status": "discrepancy",
        "detail": "【本项在第二遍自查时曾误判为 ok，后经磁盘级校验工具抓出并已修正】。逐条回查后确认：tailscale 调用点见 Step 2D 的 `tailscale status` 与诊断纪律表的 `| Tailscale daemon | \\`tailscale status\\` returns peer list (not connection error) |`、Step 5 的 `sudo tailscale up --ssh` / `--ssh=false` / `tailscale ssh` / `tailscale version`；其余依赖亦各有真实调用点（env/ifconfig/route/scutil 见 2A/2B、curl 见 2A/2C/2E 与容量参考、dig 见 2I/2J/2K、nc/tcpdump/ss 见 2K 与 Step 6、ssh 见 Step 6 与 SSH 双隧道、docker 见 2G、pnpm 见 SOP 第 5 节、aliyun ecs 与 journalctl 见 2K、Shadowrocket config API 见 proxy_conflict_reference.md、google/github/alpine CDN 见 2H/2K/2G、Tailscale 官方站点见 Step 4/5B、localhost/local.<domain> 见 Step 1 症状清单）。**纠正的具体错误**：首稿有两条 evidence 的 quote 被误取自同批另一份源码（windows-remote-desktop-connection-doctor/SKILL.md）——`tailscale status` / `tailscale netcheck` 与 `ifconfig | grep -E \"^[a-z]|inet |utun\"` / `netstat -rn | head -40` / `scutil --proxy` 均属该文件而非本 skill；本 skill 内 tailscale 的实际命令是 `tailscale status`、`tailscale ssh`、`sudo tailscale up --ssh`、`tailscale version`（**不含 netcheck**），macOS 工具的实际命令是 `ifconfig | grep -A2 'inet 100\\.'`。两条 quote 已按 pin 源码逐字替换，`netcheck` 相关表述已从 name/scripts_executed 中清除。教训记录：跨文件批量取证时，同批并行读取的相邻源码极易被错误归属，evidence 必须在写入前逐条回到目标文件复核。"
      },
      {
        "item": "自带脚本是否与文档声明一致（是否只做诊断、不写盘、无 shell 注入）",
        "status": "ok",
        "detail": "quick_diagnose.py 的 docstring 自述只做五类冲突检测（env+NO_PROXY、系统代理例外、代理路径 vs 直连、本地 TLS 信任、可选路由归属）；其 subprocess.run 全部传参数列表（无 shell=True）；os.environ.copy() 后仅 pop 代理变量以做对照请求；无文件写入、无 subprocess 之外的网络栈。结论成立。"
      },
      {
        "item": "是否漏记外发目标（把每个域名回查调用点）",
        "status": "ok",
        "detail": "全目录域名提取：api.github.com、www.google.com、dl-cdn.alpinelinux.org、registry.npmmirror.com、login.tailscale.com、pkgs.tailscale.com、docs.python.org、docs.ansible.com、tailscale.com、local.example.com、localhost（多端口）、127.0.0.1:1082、host.internal:1082、192.168.31.110:8080（Shadowrocket IP 占位）、100.101.102.103:8002、203.0.113.199（RFC 5737 对照）、198.18.x.x（fake-IP 段）。均已归入 external_deps 或注入面说明；无未记载的隐蔽外发。"
      },
      {
        "item": "『安全降级』检索是否有命中",
        "status": "discrepancy",
        "detail": "命中并构成文档内部张力：Step 6 的端到端验证命令为 `ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no <user>@<tailscale-ip> 'echo SSH_OK && hostname && whoami'`，即关闭主机密钥校验；而 Step 2H 在讨论『不要硬编码 GitHub IP』时明确把『pressure you into loosening `StrictHostKeyChecking`』列为真实成本，并称「That is a real cost paid for an uncertain benefit.」。同一文档一处反对放宽该检查、另一处把它写进推荐验证命令，属于未消解的表述张力（实际影响有限：该命令只执行 echo/hostname/whoami，无数据外发）。按分级范式这不足以把本 skill 判红，但应作为使用提醒记录下来。"
      },
      {
        "item": "『读取代理配置』这一凭据接触面是否被文档自己披露",
        "status": "ok",
        "detail": "披露且被谨慎处理：proxy_conflict_reference.md 明确要求不要硬编码设备 IP（'The device IP changes with DHCP. Do not hardcode it.'）、给出端口 8080 可能被别的服务占用的 lsof 检查、并用粗体警告 -d 会 URL 编码从而『destroys the entire configuration』。即作者意识到了该接口的高风险性。此事以「凭据读取 + 配置写入」双重性质记入 security，不构成隐蔽行为。"
      },
      {
        "item": "是否存在混淆或隐蔽脚本",
        "status": "ok",
        "detail": "全目录扫描 >200 字符无空格长行零命中；无 base64 大块（仅 2K 节的 aliyun --ContentEncoding Base64 说明与 RFC 引述）；唯一可执行文件 quick_diagnose.py 全文可读、无动态代码加载。"
      },
      {
        "item": "文档内部是否另有自相矛盾（除 StrictHostKeyChecking 外）",
        "status": "ok",
        "detail": "抽查了 nc -z 的表述：Step 1 的关键区分里曾以 nc -z 成功作为判据，Step 2K 则明确『This supersedes the plain `nc -z` reading in the bullet above whenever a TUN — not just Tailscale — is in the path』——即作者主动标注了覆盖关系而非留矛盾，属已消解的张力。其余抽查（utun MTU 判据、TUN 可信探针清单）内部一致。"
      },
      {
        "item": "pin commit 与 skill.path 是否与任务书表格一致",
        "status": "ok",
        "detail": "git rev-parse HEAD = d5c4678cb5d4fd6acc9c922690df035dbd33d247，与任务书表格『库内 HEAD』一致；目录位于仓库根，相对路径 tunnel-doctor；本目录最后一次提交 829d9758（2026-09-08 22:22）。GitHub API 复核 MIT / stars 1392 / pushed 2026-09-15T09:30:04Z。"
      }
    ],
    "level": 1,
    "level_label": "V1 已固定",
    "commit": "d5c4678cb5d4fd6acc9c922690df035dbd33d247",
    "sha256": "a9f26e4f66655f0ef18b5a982ac1a2c1302a5973bece492ccf98aec4c272d3ad",
    "reviewed_by": null,
    "reviewed_at": null
  },
  "assessed_at": "2026-10-25",
  "method_version": "2.0",
  "mirror": {
    "archive": "https://skillpub.pages.dev/r2/v/2026-09-15/tunnel-doctor.tar.gz",
    "sha256": "a9f26e4f66655f0ef18b5a982ac1a2c1302a5973bece492ccf98aec4c272d3ad",
    "commit": "d5c4678cb5d4fd6acc9c922690df035dbd33d247"
  },
  "original": {
    "github": "https://github.com/daymade/claude-code-skills/tree/main/tunnel-doctor",
    "path": "tunnel-doctor",
    "commit": "d5c4678cb5d4fd6acc9c922690df035dbd33d247"
  }
}