{
  "schemaVersion": "1.0",
  "item": {
    "slug": "file-compression",
    "name": "File Compression",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/HeXavi8/file-compression",
    "canonicalUrl": "https://clawhub.ai/HeXavi8/file-compression",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/file-compression",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=file-compression",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "package.json",
      "requirements.txt",
      "scripts/compress_image.py",
      "scripts/compress_image_node.mjs",
      "scripts/compress_pdf.py"
    ],
    "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-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.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/file-compression"
    },
    "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/file-compression",
    "agentPageUrl": "https://openagent3.xyz/skills/file-compression/agent",
    "manifestUrl": "https://openagent3.xyz/skills/file-compression/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/file-compression/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": "File Compression",
        "body": "Compress files with Python-first workflows and Node.js fallback workflows."
      },
      {
        "title": "Supported File Types",
        "body": "PDF: .pdf\nImage: .jpg, .jpeg, .png, .webp"
      },
      {
        "title": "What This Skill Can Do",
        "body": "Compress PDF with preset quality levels.\nCompress image with quality/resize/format controls.\nSwitch backend automatically when dependencies are missing.\nDetect bad compression results and retry with better strategy."
      },
      {
        "title": "Installation Spec (Before Running)",
        "body": "Required binaries:\n\npython3 (recommended >= 3.8)\nnode\ngs (Ghostscript, required for PDF Ghostscript paths)\n\nPython install spec:\n\npython3 -m pip install -r {baseDir}/requirements.txt\n\nNode install spec:\n\ncd {baseDir}\nnpm install\n\nGhostscript install examples:\n\nmacOS: brew install ghostscript\nUbuntu/Debian: sudo apt-get update && sudo apt-get install -y ghostscript\n\nSafety note:\n\nExplain to the user before each install command that third-party packages are being installed.\nIf installation fails, report the failing command and switch to available fallback backend."
      },
      {
        "title": "CLI Options Cheat Sheet",
        "body": "PDF (scripts/compress_pdf.py):\n\n--preset screen|ebook|printer|prepress\n--strategy auto|ghostscript|pikepdf\n--remove-metadata\n--no-linearize\n--overwrite\n\nPDF Node (scripts/compress_pdf_node.mjs):\n\n--preset screen|ebook|printer|prepress\n\nImage (scripts/compress_image.py):\n\n--quality <1-100>\n--format keep|jpeg|png|webp\n--max-width <n>\n--max-height <n>\n--strategy auto|pillow|node\n--overwrite\n\nImage Node (scripts/compress_image_node.mjs):\n\n--quality <1-100>\n--format keep|jpeg|png|webp\n--max-width <n>\n--max-height <n>"
      },
      {
        "title": "Example Set (Python + Node)",
        "body": "PDF default:\n\npython {baseDir}/scripts/compress_pdf.py in.pdf out.pdf\n\nPDF aggressive:\n\npython {baseDir}/scripts/compress_pdf.py in.pdf out.pdf --preset screen --strategy ghostscript\n\nPDF with pikepdf:\n\npython {baseDir}/scripts/compress_pdf.py in.pdf out.pdf --strategy pikepdf --remove-metadata\n\nPDF via Node:\n\nnode {baseDir}/scripts/compress_pdf_node.mjs in.pdf out.pdf --preset ebook\n\nImage default:\n\npython {baseDir}/scripts/compress_image.py in.jpg out.jpg --quality 75\n\nImage convert + resize:\n\npython {baseDir}/scripts/compress_image.py in.png out.webp --format webp --quality 72 --max-width 1920\n\nImage force Node backend:\n\npython {baseDir}/scripts/compress_image.py in.jpg out.jpg --strategy node --quality 70\n\nImage direct Node:\n\nnode {baseDir}/scripts/compress_image_node.mjs in.jpg out.jpg --quality 70 --max-width 1600"
      },
      {
        "title": "Environment and Fallback",
        "body": "Check and install in this order:\n\nPython: python3 --version (fallback: python --version)\nNode: node --version\nGhostscript: gs --version (required for PDF Ghostscript paths)\nPython deps when needed:\n\npip install pikepdf\npip install pillow\n\n\nNode deps when needed:\n\nnpm install\n\nFallback policy:\n\nPDF: ghostscript -> pikepdf -> node-ghostscript\nImage: pillow -> node-sharp\n\nIf python3.8+ is unavailable, try python3.11/3.10/3.9/3.8; if still blocked, use Node flow when possible."
      },
      {
        "title": "Execution Transparency",
        "body": "Always communicate each step:\n\nTell user what you are checking or running.\nShow the exact command before execution.\nFor slow steps (pip install, npm install, large Ghostscript jobs), say you are waiting.\nAfter each step, report result and next action."
      },
      {
        "title": "Bad Result Recovery",
        "body": "When output_size >= input_size, do not stop:\n\nReport exact from/to numbers and compression ratio.\nExplain likely cause:\n\nPDF: already optimized, scanned-image content, metadata overhead, unsuitable preset.\nImage: unsuitable format conversion, quality too high, small-file overhead.\n\n\nRetry with alternate strategy:\n\nPDF: ebook -> screen, then switch backend.\nImage: lower quality, switch backend, convert to webp, optionally resize.\n\n\nReturn the best attempt and state which command produced it."
      },
      {
        "title": "Agent Response Contract",
        "body": "After every compression task, always return:\n\nOutput absolute path.\nfrom <before_size> to <after_size>.\nsaved <delta_size> (<ratio>%).\nBackend used."
      }
    ],
    "body": "File Compression\n\nCompress files with Python-first workflows and Node.js fallback workflows.\n\nSupported File Types\nPDF: .pdf\nImage: .jpg, .jpeg, .png, .webp\nWhat This Skill Can Do\nCompress PDF with preset quality levels.\nCompress image with quality/resize/format controls.\nSwitch backend automatically when dependencies are missing.\nDetect bad compression results and retry with better strategy.\nInstallation Spec (Before Running)\n\nRequired binaries:\n\npython3 (recommended >= 3.8)\nnode\ngs (Ghostscript, required for PDF Ghostscript paths)\n\nPython install spec:\n\npython3 -m pip install -r {baseDir}/requirements.txt\n\n\nNode install spec:\n\ncd {baseDir}\nnpm install\n\n\nGhostscript install examples:\n\nmacOS: brew install ghostscript\nUbuntu/Debian: sudo apt-get update && sudo apt-get install -y ghostscript\n\nSafety note:\n\nExplain to the user before each install command that third-party packages are being installed.\nIf installation fails, report the failing command and switch to available fallback backend.\nCLI Options Cheat Sheet\n\nPDF (scripts/compress_pdf.py):\n\n--preset screen|ebook|printer|prepress\n--strategy auto|ghostscript|pikepdf\n--remove-metadata\n--no-linearize\n--overwrite\n\nPDF Node (scripts/compress_pdf_node.mjs):\n\n--preset screen|ebook|printer|prepress\n\nImage (scripts/compress_image.py):\n\n--quality <1-100>\n--format keep|jpeg|png|webp\n--max-width <n>\n--max-height <n>\n--strategy auto|pillow|node\n--overwrite\n\nImage Node (scripts/compress_image_node.mjs):\n\n--quality <1-100>\n--format keep|jpeg|png|webp\n--max-width <n>\n--max-height <n>\nExample Set (Python + Node)\n\nPDF default:\n\npython {baseDir}/scripts/compress_pdf.py in.pdf out.pdf\n\n\nPDF aggressive:\n\npython {baseDir}/scripts/compress_pdf.py in.pdf out.pdf --preset screen --strategy ghostscript\n\n\nPDF with pikepdf:\n\npython {baseDir}/scripts/compress_pdf.py in.pdf out.pdf --strategy pikepdf --remove-metadata\n\n\nPDF via Node:\n\nnode {baseDir}/scripts/compress_pdf_node.mjs in.pdf out.pdf --preset ebook\n\n\nImage default:\n\npython {baseDir}/scripts/compress_image.py in.jpg out.jpg --quality 75\n\n\nImage convert + resize:\n\npython {baseDir}/scripts/compress_image.py in.png out.webp --format webp --quality 72 --max-width 1920\n\n\nImage force Node backend:\n\npython {baseDir}/scripts/compress_image.py in.jpg out.jpg --strategy node --quality 70\n\n\nImage direct Node:\n\nnode {baseDir}/scripts/compress_image_node.mjs in.jpg out.jpg --quality 70 --max-width 1600\n\nEnvironment and Fallback\n\nCheck and install in this order:\n\nPython: python3 --version (fallback: python --version)\nNode: node --version\nGhostscript: gs --version (required for PDF Ghostscript paths)\nPython deps when needed:\npip install pikepdf\npip install pillow\nNode deps when needed:\nnpm install\n\nFallback policy:\n\nPDF: ghostscript -> pikepdf -> node-ghostscript\nImage: pillow -> node-sharp\n\nIf python3.8+ is unavailable, try python3.11/3.10/3.9/3.8; if still blocked, use Node flow when possible.\n\nExecution Transparency\n\nAlways communicate each step:\n\nTell user what you are checking or running.\nShow the exact command before execution.\nFor slow steps (pip install, npm install, large Ghostscript jobs), say you are waiting.\nAfter each step, report result and next action.\nBad Result Recovery\n\nWhen output_size >= input_size, do not stop:\n\nReport exact from/to numbers and compression ratio.\nExplain likely cause:\nPDF: already optimized, scanned-image content, metadata overhead, unsuitable preset.\nImage: unsuitable format conversion, quality too high, small-file overhead.\nRetry with alternate strategy:\nPDF: ebook -> screen, then switch backend.\nImage: lower quality, switch backend, convert to webp, optionally resize.\nReturn the best attempt and state which command produced it.\nAgent Response Contract\n\nAfter every compression task, always return:\n\nOutput absolute path.\nfrom <before_size> to <after_size>.\nsaved <delta_size> (<ratio>%).\nBackend used."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/HeXavi8/file-compression",
    "publisherUrl": "https://clawhub.ai/HeXavi8/file-compression",
    "owner": "HeXavi8",
    "version": "1.0.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/file-compression",
    "downloadUrl": "https://openagent3.xyz/downloads/file-compression",
    "agentUrl": "https://openagent3.xyz/skills/file-compression/agent",
    "manifestUrl": "https://openagent3.xyz/skills/file-compression/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/file-compression/agent.md"
  }
}