{
  "schemaVersion": "1.0",
  "item": {
    "slug": "mkhaytman-token-optimizer",
    "name": "Token Optimizer",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/mkhaytman87/mkhaytman-token-optimizer",
    "canonicalUrl": "https://clawhub.ai/mkhaytman87/mkhaytman-token-optimizer",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/mkhaytman-token-optimizer",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mkhaytman-token-optimizer",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "agents/openai.yaml",
      "config/defaults.json",
      "examples/usage.md",
      "package.json",
      "references/operating-notes.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-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-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/mkhaytman-token-optimizer"
    },
    "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/mkhaytman-token-optimizer",
    "agentPageUrl": "https://openagent3.xyz/skills/mkhaytman-token-optimizer/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mkhaytman-token-optimizer/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mkhaytman-token-optimizer/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": "Overview",
        "body": "Use this skill to optimize OpenClaw token usage with a local CLI that performs analysis, compression snapshots, health checks, cleanup planning, and preflight token budgeting."
      },
      {
        "title": "Quick Start",
        "body": "$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --analyze --period 7d"
      },
      {
        "title": "Core Commands",
        "body": "Enable local optimizer config:\n\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --enable\n\nOptimization analysis:\n\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --analyze --period 7d\n\nForce context compression snapshot:\n\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --compress --threshold 0.7 --session agent:main:main\n\nSession health check:\n\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --health-check --active-minutes 120\n\nAuto-cleanup planning and apply:\n\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --cleanup\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --cleanup --apply"
      },
      {
        "title": "Preflight Optimization",
        "body": "Use preflight planning before expensive task batches:\n\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize \\\n  --preflight /path/to/actions.json \\\n  --session-limit 180000\n\nactions.json should be a JSON array of planned operations, for example:\n\n[\n  {\"type\": \"web_search\", \"query\": \"...\"},\n  {\"type\": \"web_fetch\", \"url\": \"...\"},\n  {\"type\": \"summarize\", \"target\": \"youtube\"}\n]"
      },
      {
        "title": "Output Artifacts",
        "body": "Compression snapshots: $OPENCLAW_WORKSPACE/token-usage/compressed/\nOptional JSON output: --format json --output /path/file.json\nBaseline config (from --enable): $OPENCLAW_WORKSPACE/token-usage/token-optimizer.config.json"
      },
      {
        "title": "Defaults",
        "body": "Default behavior is configured in:\n\nconfig/defaults.json\n\nOverride with:\n\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --config /path/custom.json --analyze"
      },
      {
        "title": "Resources",
        "body": "scripts/token_optimize.py: main CLI\nsrc/optimizer.py: core optimization engine\nsrc/models.py: model selection logic\nsrc/compression.py: context compression helpers\nsrc/cleanup.py: session hygiene evaluation\nreferences/operating-notes.md: implementation details and safe-operating guidance"
      },
      {
        "title": "Validation",
        "body": "python3 $OPENCLAW_SKILLS_DIR/.system/skill-creator/scripts/quick_validate.py \\\n  $OPENCLAW_SKILLS_DIR/token-optimizer"
      }
    ],
    "body": "Token Optimizer\nOverview\n\nUse this skill to optimize OpenClaw token usage with a local CLI that performs analysis, compression snapshots, health checks, cleanup planning, and preflight token budgeting.\n\nQuick Start\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --analyze --period 7d\n\nCore Commands\nEnable local optimizer config:\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --enable\n\nOptimization analysis:\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --analyze --period 7d\n\nForce context compression snapshot:\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --compress --threshold 0.7 --session agent:main:main\n\nSession health check:\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --health-check --active-minutes 120\n\nAuto-cleanup planning and apply:\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --cleanup\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --cleanup --apply\n\nPreflight Optimization\n\nUse preflight planning before expensive task batches:\n\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize \\\n  --preflight /path/to/actions.json \\\n  --session-limit 180000\n\n\nactions.json should be a JSON array of planned operations, for example:\n\n[\n  {\"type\": \"web_search\", \"query\": \"...\"},\n  {\"type\": \"web_fetch\", \"url\": \"...\"},\n  {\"type\": \"summarize\", \"target\": \"youtube\"}\n]\n\nOutput Artifacts\nCompression snapshots: $OPENCLAW_WORKSPACE/token-usage/compressed/\nOptional JSON output: --format json --output /path/file.json\nBaseline config (from --enable): $OPENCLAW_WORKSPACE/token-usage/token-optimizer.config.json\nDefaults\n\nDefault behavior is configured in:\n\nconfig/defaults.json\n\nOverride with:\n\n$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --config /path/custom.json --analyze\n\nResources\nscripts/token_optimize.py: main CLI\nsrc/optimizer.py: core optimization engine\nsrc/models.py: model selection logic\nsrc/compression.py: context compression helpers\nsrc/cleanup.py: session hygiene evaluation\nreferences/operating-notes.md: implementation details and safe-operating guidance\nValidation\npython3 $OPENCLAW_SKILLS_DIR/.system/skill-creator/scripts/quick_validate.py \\\n  $OPENCLAW_SKILLS_DIR/token-optimizer"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/mkhaytman87/mkhaytman-token-optimizer",
    "publisherUrl": "https://clawhub.ai/mkhaytman87/mkhaytman-token-optimizer",
    "owner": "mkhaytman87",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/mkhaytman-token-optimizer",
    "downloadUrl": "https://openagent3.xyz/downloads/mkhaytman-token-optimizer",
    "agentUrl": "https://openagent3.xyz/skills/mkhaytman-token-optimizer/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mkhaytman-token-optimizer/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mkhaytman-token-optimizer/agent.md"
  }
}