{
  "schemaVersion": "1.0",
  "item": {
    "slug": "detect-file-type-local",
    "name": "Detect File Type - Local",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/pgeraghty/detect-file-type-local",
    "canonicalUrl": "https://clawhub.ai/pgeraghty/detect-file-type-local",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/detect-file-type-local",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=detect-file-type-local",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SECURITY.md",
      "SKILL.md",
      "THIRD_PARTY_LICENSES.md",
      "detect_file_type/__init__.py",
      "detect_file_type/__main__.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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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/detect-file-type-local"
    },
    "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/detect-file-type-local",
    "agentPageUrl": "https://openagent3.xyz/skills/detect-file-type-local/agent",
    "manifestUrl": "https://openagent3.xyz/skills/detect-file-type-local/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/detect-file-type-local/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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Detect File Type - Local",
        "body": "Local-only, offline file type detection. Uses an embedded ML model (Google Magika) to identify 214 file types by content — no network calls, no API keys, no data leaves the machine. All inference runs on-device via ONNX Runtime."
      },
      {
        "title": "When to Use",
        "body": "Identify unknown files by their content (not just extension) — locally, without sending data anywhere\nVerify that a file's extension matches its actual content\nCheck MIME types before processing uploads or downloads\nTriage files in a directory by type\nDetect extension mismatches and masquerading (e.g., .pdf.exe, .xlsx.lnk)\nFlag suspicious polyglot-style payloads (for example PDF/ZIP or PDF/HTA-style chains)\nWhen privacy matters — file bytes never leave the local machine"
      },
      {
        "title": "Installation",
        "body": "pip install detect-file-type-local\n\nFrom source:\n\npip install -e /path/to/detect-file-type-skill"
      },
      {
        "title": "Single file",
        "body": "detect_file_type path/to/file"
      },
      {
        "title": "Multiple files",
        "body": "detect_file_type file1.pdf file2.png file3.zip"
      },
      {
        "title": "Recursive directory scan",
        "body": "detect_file_type --recursive ./uploads/"
      },
      {
        "title": "From stdin",
        "body": "cat mystery_file | detect_file_type -\n\n# Optional best-effort fast path (head only)\ncat mystery_file | detect_file_type --stdin-mode head --stdin-max-bytes 1048576 -"
      },
      {
        "title": "Output formats",
        "body": "detect_file_type --json file.pdf    # JSON (default)\ndetect_file_type --human file.pdf   # Human-readable\ndetect_file_type --mime file.pdf    # Bare MIME type"
      },
      {
        "title": "Programmatic (Python)",
        "body": "python -m detect_file_type path/to/file"
      },
      {
        "title": "Output Schema (JSON)",
        "body": "Single file returns an object; multiple files return an array.\n\n{\n  \"path\": \"document.pdf\",\n  \"label\": \"pdf\",\n  \"mime_type\": \"application/pdf\",\n  \"score\": 0.99,\n  \"group\": \"document\",\n  \"description\": \"PDF document\",\n  \"is_text\": false\n}"
      },
      {
        "title": "Fields",
        "body": "FieldTypeDescriptionpathstringInput path (or - for stdin)labelstringDetected file type label (e.g., pdf, png, python)mime_typestringMIME type (e.g., application/pdf)scorefloatConfidence score (0.0–1.0)groupstringCategory (e.g., document, image, code)descriptionstringHuman-readable descriptionis_textboolWhether the file is text-based"
      },
      {
        "title": "Exit Codes",
        "body": "CodeMeaning0All files detected successfully1Fatal error (no results produced)2Partial failure (some files failed, some succeeded)"
      },
      {
        "title": "Error Handling",
        "body": "Errors are printed to stderr. Common cases:\n\nFile not found: error: path/to/file: No such file or directory\nPermission denied: error: path/to/file: Permission denied\nNot a regular file: error: path/to/dir: Not a regular file\n\nWhen processing multiple files, detection continues for remaining files even if some fail."
      },
      {
        "title": "Limitations",
        "body": "Default stdin mode (spool) writes stdin to a temporary file and uses Magika path detection.\n--stdin-mode head is best effort and may miss trailing-byte signatures.\nVery small files (< ~16 bytes) may produce low-confidence results\nEmpty files are detected as empty\nDetection is content-based — file extensions are ignored"
      },
      {
        "title": "Security Context",
        "body": "MITRE ATT&CK: Masquerading\nProofpoint: Call It What You Want, Threat Actor Delivers Highly Targeted Multistage Polyglot"
      }
    ],
    "body": "Detect File Type - Local\n\nLocal-only, offline file type detection. Uses an embedded ML model (Google Magika) to identify 214 file types by content — no network calls, no API keys, no data leaves the machine. All inference runs on-device via ONNX Runtime.\n\nWhen to Use\nIdentify unknown files by their content (not just extension) — locally, without sending data anywhere\nVerify that a file's extension matches its actual content\nCheck MIME types before processing uploads or downloads\nTriage files in a directory by type\nDetect extension mismatches and masquerading (e.g., .pdf.exe, .xlsx.lnk)\nFlag suspicious polyglot-style payloads (for example PDF/ZIP or PDF/HTA-style chains)\nWhen privacy matters — file bytes never leave the local machine\nInstallation\npip install detect-file-type-local\n\n\nFrom source:\n\npip install -e /path/to/detect-file-type-skill\n\nUsage\nSingle file\ndetect_file_type path/to/file\n\nMultiple files\ndetect_file_type file1.pdf file2.png file3.zip\n\nRecursive directory scan\ndetect_file_type --recursive ./uploads/\n\nFrom stdin\ncat mystery_file | detect_file_type -\n\n# Optional best-effort fast path (head only)\ncat mystery_file | detect_file_type --stdin-mode head --stdin-max-bytes 1048576 -\n\nOutput formats\ndetect_file_type --json file.pdf    # JSON (default)\ndetect_file_type --human file.pdf   # Human-readable\ndetect_file_type --mime file.pdf    # Bare MIME type\n\nProgrammatic (Python)\npython -m detect_file_type path/to/file\n\nOutput Schema (JSON)\n\nSingle file returns an object; multiple files return an array.\n\n{\n  \"path\": \"document.pdf\",\n  \"label\": \"pdf\",\n  \"mime_type\": \"application/pdf\",\n  \"score\": 0.99,\n  \"group\": \"document\",\n  \"description\": \"PDF document\",\n  \"is_text\": false\n}\n\nFields\nField\tType\tDescription\npath\tstring\tInput path (or - for stdin)\nlabel\tstring\tDetected file type label (e.g., pdf, png, python)\nmime_type\tstring\tMIME type (e.g., application/pdf)\nscore\tfloat\tConfidence score (0.0–1.0)\ngroup\tstring\tCategory (e.g., document, image, code)\ndescription\tstring\tHuman-readable description\nis_text\tbool\tWhether the file is text-based\nExit Codes\nCode\tMeaning\n0\tAll files detected successfully\n1\tFatal error (no results produced)\n2\tPartial failure (some files failed, some succeeded)\nError Handling\n\nErrors are printed to stderr. Common cases:\n\nFile not found: error: path/to/file: No such file or directory\nPermission denied: error: path/to/file: Permission denied\nNot a regular file: error: path/to/dir: Not a regular file\n\nWhen processing multiple files, detection continues for remaining files even if some fail.\n\nLimitations\nDefault stdin mode (spool) writes stdin to a temporary file and uses Magika path detection.\n--stdin-mode head is best effort and may miss trailing-byte signatures.\nVery small files (< ~16 bytes) may produce low-confidence results\nEmpty files are detected as empty\nDetection is content-based — file extensions are ignored\nSecurity Context\nMITRE ATT&CK: Masquerading\nProofpoint: Call It What You Want, Threat Actor Delivers Highly Targeted Multistage Polyglot"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/pgeraghty/detect-file-type-local",
    "publisherUrl": "https://clawhub.ai/pgeraghty/detect-file-type-local",
    "owner": "pgeraghty",
    "version": "0.2.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/detect-file-type-local",
    "downloadUrl": "https://openagent3.xyz/downloads/detect-file-type-local",
    "agentUrl": "https://openagent3.xyz/skills/detect-file-type-local/agent",
    "manifestUrl": "https://openagent3.xyz/skills/detect-file-type-local/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/detect-file-type-local/agent.md"
  }
}