{
  "schemaVersion": "1.0",
  "item": {
    "slug": "gateway-token-doctor",
    "name": "Gateway Token Doctor",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/Dalomeve/gateway-token-doctor",
    "canonicalUrl": "https://clawhub.ai/Dalomeve/gateway-token-doctor",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/gateway-token-doctor",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=gateway-token-doctor",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "references/privacy-checklist.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/gateway-token-doctor"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/gateway-token-doctor",
    "agentPageUrl": "https://openagent3.xyz/skills/gateway-token-doctor/agent",
    "manifestUrl": "https://openagent3.xyz/skills/gateway-token-doctor/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/gateway-token-doctor/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Gateway Token Doctor",
        "body": "Diagnose and fix 401 errors from token mismatches."
      },
      {
        "title": "Problem",
        "body": "Gateway token inconsistencies cause:\n\n401 Unauthorized errors\nCLI/UI authentication failures\nService startup failures\nSilent auth degradation"
      },
      {
        "title": "1. Token Audit",
        "body": "# Check all token surfaces\n$cfg = Get-Content \"$HOME/.openclaw/openclaw.json\" -Raw | ConvertFrom-Json\n$auth = $cfg.gateway.auth.token\n$remote = $cfg.gateway.remote.token\n$service = $env:OPENCLAW_GATEWAY_TOKEN\n\n\"auth.token   = $auth\"\n\"remote.token = $remote\"\n\"service.token = $service\"\n\nif ($auth -and $remote -and $auth -ne $remote) {\n    Write-Warning \"Token mismatch: auth != remote\"\n}"
      },
      {
        "title": "2. Alignment Fix",
        "body": "# Generate or use existing token\n$token = $auth\n\n# Update config\n$cfg.gateway.auth.token = $token\n$cfg.gateway.remote.token = $token\n$cfg | ConvertTo-Json -Depth 10 | Out-File \"$HOME/.openclaw/openclaw.json\" -Encoding UTF8\n\n# Update service startup script\n$servicePath = \"$HOME/.openclaw/gateway.cmd\"\n$content = Get-Content $servicePath -Raw\n$content = $content -replace 'OPENCLAW_GATEWAY_TOKEN=.*', \"OPENCLAW_GATEWAY_TOKEN=$token\"\n$content | Out-File $servicePath -Encoding UTF8\n\n# Restart\nopenclaw gateway restart"
      },
      {
        "title": "3. Verification",
        "body": "# Test gateway access\nopenclaw gateway status\n\n# Test CLI auth\nopenclaw whoami"
      },
      {
        "title": "Executable Completion Criteria",
        "body": "CriteriaVerificationAll tokens alignedauth == remote == serviceGateway respondsopenclaw gateway status succeedsCLI auth worksopenclaw whoami returns userNo 401 in logsSelect-String \"401\" logs returns nothing"
      },
      {
        "title": "Privacy/Safety",
        "body": "Never log actual token values\nRedact tokens in output (show first 4 chars only)\nStore tokens only in config files"
      },
      {
        "title": "Self-Use Trigger",
        "body": "Use when:\n\n401 errors appear\nGateway restart after config change\nCLI shows auth mismatch\nService fails to start\n\nAlign tokens. Restore access."
      }
    ],
    "body": "Gateway Token Doctor\n\nDiagnose and fix 401 errors from token mismatches.\n\nProblem\n\nGateway token inconsistencies cause:\n\n401 Unauthorized errors\nCLI/UI authentication failures\nService startup failures\nSilent auth degradation\nWorkflow\n1. Token Audit\n# Check all token surfaces\n$cfg = Get-Content \"$HOME/.openclaw/openclaw.json\" -Raw | ConvertFrom-Json\n$auth = $cfg.gateway.auth.token\n$remote = $cfg.gateway.remote.token\n$service = $env:OPENCLAW_GATEWAY_TOKEN\n\n\"auth.token   = $auth\"\n\"remote.token = $remote\"\n\"service.token = $service\"\n\nif ($auth -and $remote -and $auth -ne $remote) {\n    Write-Warning \"Token mismatch: auth != remote\"\n}\n\n2. Alignment Fix\n# Generate or use existing token\n$token = $auth\n\n# Update config\n$cfg.gateway.auth.token = $token\n$cfg.gateway.remote.token = $token\n$cfg | ConvertTo-Json -Depth 10 | Out-File \"$HOME/.openclaw/openclaw.json\" -Encoding UTF8\n\n# Update service startup script\n$servicePath = \"$HOME/.openclaw/gateway.cmd\"\n$content = Get-Content $servicePath -Raw\n$content = $content -replace 'OPENCLAW_GATEWAY_TOKEN=.*', \"OPENCLAW_GATEWAY_TOKEN=$token\"\n$content | Out-File $servicePath -Encoding UTF8\n\n# Restart\nopenclaw gateway restart\n\n3. Verification\n# Test gateway access\nopenclaw gateway status\n\n# Test CLI auth\nopenclaw whoami\n\nExecutable Completion Criteria\nCriteria\tVerification\nAll tokens aligned\tauth == remote == service\nGateway responds\topenclaw gateway status succeeds\nCLI auth works\topenclaw whoami returns user\nNo 401 in logs\tSelect-String \"401\" logs returns nothing\nPrivacy/Safety\nNever log actual token values\nRedact tokens in output (show first 4 chars only)\nStore tokens only in config files\nSelf-Use Trigger\n\nUse when:\n\n401 errors appear\nGateway restart after config change\nCLI shows auth mismatch\nService fails to start\n\nAlign tokens. Restore access."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Dalomeve/gateway-token-doctor",
    "publisherUrl": "https://clawhub.ai/Dalomeve/gateway-token-doctor",
    "owner": "Dalomeve",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/gateway-token-doctor",
    "downloadUrl": "https://openagent3.xyz/downloads/gateway-token-doctor",
    "agentUrl": "https://openagent3.xyz/skills/gateway-token-doctor/agent",
    "manifestUrl": "https://openagent3.xyz/skills/gateway-token-doctor/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/gateway-token-doctor/agent.md"
  }
}