{
  "schemaVersion": "1.0",
  "item": {
    "slug": "office-to-md-v2",
    "name": "Office To Md V2",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/Lkyyyy320/office-to-md-v2",
    "canonicalUrl": "https://clawhub.ai/Lkyyyy320/office-to-md-v2",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/office-to-md-v2",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=office-to-md-v2",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "examples/basic-usage.js",
      "office-to-md/SKILL.md",
      "office-to-md/convert.js",
      "office-to-md/openclaw-skill.js"
    ],
    "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-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/office-to-md-v2"
    },
    "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/office-to-md-v2",
    "agentPageUrl": "https://openagent3.xyz/skills/office-to-md-v2/agent",
    "manifestUrl": "https://openagent3.xyz/skills/office-to-md-v2/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/office-to-md-v2/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": "Description",
        "body": "Convert office documents (PDF, DOC, DOCX, PPTX) to Markdown format. This skill uses the word-extractor library for .doc support and provides full OpenClaw integration."
      },
      {
        "title": "When to Use",
        "body": "When you need to extract text from office documents\nWhen you want to convert documents to readable Markdown format\nWhen analyzing document content in OpenClaw\nSpecifically when dealing with legacy .doc format files"
      },
      {
        "title": "Supported Formats",
        "body": "PDF (.pdf): Text extraction using pdf-parse\nWord (.docx): Formatting preservation using mammoth + turndown\nLegacy Word (.doc): Text extraction using word-extractor (supports Chinese encoding)\nPowerPoint (.pptx): Basic text extraction using python-pptx"
      },
      {
        "title": "Dependencies",
        "body": "Node.js with npm packages: pdf-parse, mammoth, turndown, word-extractor\nPython3 with python-pptx (for PPTX conversion, optional)\nOpenClaw exec tool permission"
      },
      {
        "title": "1. Copy the skill to your workspace:",
        "body": "cp -r /root/.openclaw/workspace/office-to-md-v2/office-to-md /path/to/your/workspace/"
      },
      {
        "title": "2. Install dependencies:",
        "body": "cd /path/to/your/workspace/office-to-md\nnpm install"
      },
      {
        "title": "3. For PPTX support (optional):",
        "body": "pip3 install python-pptx"
      },
      {
        "title": "Method 1: Direct exec call",
        "body": "// Convert any supported document\nconst result = await exec(\n  'node /path/to/office-to-md/openclaw-skill.js /path/to/document.doc',\n  { workdir: '/path/to/workspace', timeout: 60000 }\n);\n\nif (result.exitCode === 0) {\n  console.log('✅ Document converted successfully');\n  // Output file: /path/to/document.md\n} else {\n  console.error('❌ Conversion failed:', result.stderr);\n}"
      },
      {
        "title": "Method 2: Using the wrapper function",
        "body": "// Import the converter\nconst { convertOfficeToMarkdown } = require('/path/to/office-to-md/openclaw-skill.js');\n\n// Convert document\nconst conversionResult = await convertOfficeToMarkdown('/path/to/document.pdf');\nif (conversionResult.success) {\n  console.log(`Output: ${conversionResult.outputPath}`);\n  console.log(`Preview: ${conversionResult.preview}`);\n} else {\n  console.error(`Error: ${conversionResult.error}`);\n}"
      },
      {
        "title": "Method 3: Complete OpenClaw integration function",
        "body": "async function convertDocumentToMarkdown(filePath) {\n  // Validate file exists\n  try {\n    await read(filePath);\n  } catch (error) {\n    return { success: false, error: `File not found: ${filePath}` };\n  }\n  \n  // Check file extension\n  const ext = filePath.toLowerCase().slice(-5);\n  const supported = ['.pdf', '.doc', '.docx', '.pptx'];\n  if (!supported.some(s => ext.endsWith(s))) {\n    return { \n      success: false, \n      error: `Unsupported file type. Supported: ${supported.join(', ')}` \n    };\n  }\n  \n  // Convert using the skill\n  const cmd = `node /path/to/office-to-md/openclaw-skill.js \"${filePath}\"`;\n  const result = await exec(cmd, { \n    workdir: '/path/to/workspace',\n    timeout: 120000 // 2 minutes for large files\n  });\n  \n  if (result.exitCode === 0) {\n    const outputPath = filePath.replace(/\\.[^/.]+$/, '.md');\n    return {\n      success: true,\n      outputPath: outputPath,\n      message: `Converted to: ${outputPath}`\n    };\n  } else {\n    return {\n      success: false,\n      error: result.stderr || 'Conversion failed'\n    };\n  }\n}\n\n// Usage example\nconst result = await convertDocumentToMarkdown('/path/to/document.doc');\nif (result.success) {\n  const markdown = await read(result.outputPath);\n  console.log(markdown.substring(0, 1000));\n}"
      },
      {
        "title": "Example 1: Convert and analyze a document",
        "body": "// Convert a .doc file and analyze its content\nconst docPath = '/path/to/document.doc';\nconst convertResult = await exec(\n  `node /path/to/office-to-md/openclaw-skill.js \"${docPath}\"`,\n  { workdir: '/path/to/workspace' }\n);\n\nif (convertResult.exitCode === 0) {\n  const mdPath = docPath.replace('.doc', '.md');\n  const content = await read(mdPath);\n  \n  // Analyze the content\n  const wordCount = content.split(/\\s+/).length;\n  const lines = content.split('\\n').length;\n  const hasChinese = /[\\u4e00-\\u9fff]/.test(content);\n  \n  console.log(`Document analysis:`);\n  console.log(`- Word count: ${wordCount}`);\n  console.log(`- Lines: ${lines}`);\n  console.log(`- Contains Chinese: ${hasChinese}`);\n  console.log(`- Preview: ${content.substring(0, 200)}...`);\n}"
      },
      {
        "title": "Example 2: Batch conversion",
        "body": "// Convert multiple documents of different formats\nconst documents = [\n  '/path/to/report.pdf',\n  '/path/to/legacy.doc',\n  '/path/to/modern.docx',\n  '/path/to/presentation.pptx'\n];\n\nconst results = [];\nfor (const doc of documents) {\n  console.log(`Converting ${doc}...`);\n  const result = await exec(\n    `node /path/to/office-to-md/openclaw-skill.js \"${doc}\"`,\n    { workdir: '/path/to/workspace', timeout: 90000 }\n  );\n  \n  const success = result.exitCode === 0;\n  results.push({\n    file: doc,\n    success: success,\n    error: success ? null : result.stderr\n  });\n  \n  console.log(success ? '✅ Success' : '❌ Failed');\n}\n\n// Summary\nconst successful = results.filter(r => r.success).length;\nconsole.log(`\\nConversion summary: ${successful}/${results.length} successful`);"
      },
      {
        "title": "convertOfficeToMarkdown(filePath)",
        "body": "Returns a Promise that resolves to:\n\n{\n  success: boolean,\n  outputPath?: string,\n  markdown?: string,\n  preview?: string,\n  fileType?: string,\n  message?: string,\n  stats?: {\n    lines: number,\n    characters: number,\n    words: number\n  },\n  error?: string,\n  stack?: string\n}"
      },
      {
        "title": "Timeout Settings",
        "body": "Small files (<1MB): 30 seconds\nMedium files (1-10MB): 60 seconds\nLarge files (>10MB): 120 seconds"
      },
      {
        "title": "Memory Limits",
        "body": "Default Node.js memory limit is sufficient for most documents\nFor very large files, you may need to increase memory:\nnode --max-old-space-size=4096 openclaw-skill.js large-file.doc"
      },
      {
        "title": "Common Issues",
        "body": "\"File not found\"\n\nCheck file path and permissions\nUse absolute paths for reliability\n\n\n\n\"Unsupported file type\"\n\nEnsure file has correct extension\nCheck if file is actually the claimed format\n\n\n\nConversion errors with .doc files\n\nThe file may be corrupted or in an unusual format\nTry opening in Word and saving as .docx first\n\n\n\nChinese text appears as gibberish\n\nword-extractor should handle Chinese encoding automatically\nIf issues persist, the file may use unusual encoding\n\n\n\nTimeout errors\n\nIncrease timeout for large files\nCheck system resources"
      },
      {
        "title": "Debug Mode",
        "body": "Enable debug logging by setting environment variable:\n\nDEBUG=office-to-md node openclaw-skill.js document.doc"
      },
      {
        "title": "Performance",
        "body": "PDF: Fast, depends on file size\nDOCX: Fast to medium, good formatting preservation\nDOC: Medium, requires binary parsing\nPPTX: Slow, requires Python and external library"
      },
      {
        "title": "Limitations",
        "body": "Images in documents are not extracted\nComplex formatting may not be fully preserved\nTables may convert imperfectly to Markdown\nVery old or corrupted .doc files may fail\nPassword-protected files are not supported"
      },
      {
        "title": "v2.0.0 (2026-02-15)",
        "body": "Added full .doc support using word-extractor\nFixed ESM compatibility issues with pptConverter\nAdded comprehensive OpenClaw integration\nImproved Chinese text extraction\nAdded structured output with statistics"
      },
      {
        "title": "v1.0.0 (Initial)",
        "body": "Basic PDF, DOCX, PPTX support\nSimple conversion without .doc support"
      },
      {
        "title": "License",
        "body": "This skill is provided as-is. The underlying libraries have their own licenses:\n\npdf-parse: MIT\nmammoth: BSD-2-Clause\nturndown: MIT\nword-extractor: MIT\npython-pptx: MIT"
      }
    ],
    "body": "Office to Markdown Converter Skill (v2)\nDescription\n\nConvert office documents (PDF, DOC, DOCX, PPTX) to Markdown format. This skill uses the word-extractor library for .doc support and provides full OpenClaw integration.\n\nWhen to Use\nWhen you need to extract text from office documents\nWhen you want to convert documents to readable Markdown format\nWhen analyzing document content in OpenClaw\nSpecifically when dealing with legacy .doc format files\nSupported Formats\nPDF (.pdf): Text extraction using pdf-parse\nWord (.docx): Formatting preservation using mammoth + turndown\nLegacy Word (.doc): Text extraction using word-extractor (supports Chinese encoding)\nPowerPoint (.pptx): Basic text extraction using python-pptx\nDependencies\nNode.js with npm packages: pdf-parse, mammoth, turndown, word-extractor\nPython3 with python-pptx (for PPTX conversion, optional)\nOpenClaw exec tool permission\nInstallation\n1. Copy the skill to your workspace:\ncp -r /root/.openclaw/workspace/office-to-md-v2/office-to-md /path/to/your/workspace/\n\n2. Install dependencies:\ncd /path/to/your/workspace/office-to-md\nnpm install\n\n3. For PPTX support (optional):\npip3 install python-pptx\n\nUsage in OpenClaw\nMethod 1: Direct exec call\n// Convert any supported document\nconst result = await exec(\n  'node /path/to/office-to-md/openclaw-skill.js /path/to/document.doc',\n  { workdir: '/path/to/workspace', timeout: 60000 }\n);\n\nif (result.exitCode === 0) {\n  console.log('✅ Document converted successfully');\n  // Output file: /path/to/document.md\n} else {\n  console.error('❌ Conversion failed:', result.stderr);\n}\n\nMethod 2: Using the wrapper function\n// Import the converter\nconst { convertOfficeToMarkdown } = require('/path/to/office-to-md/openclaw-skill.js');\n\n// Convert document\nconst conversionResult = await convertOfficeToMarkdown('/path/to/document.pdf');\nif (conversionResult.success) {\n  console.log(`Output: ${conversionResult.outputPath}`);\n  console.log(`Preview: ${conversionResult.preview}`);\n} else {\n  console.error(`Error: ${conversionResult.error}`);\n}\n\nMethod 3: Complete OpenClaw integration function\nasync function convertDocumentToMarkdown(filePath) {\n  // Validate file exists\n  try {\n    await read(filePath);\n  } catch (error) {\n    return { success: false, error: `File not found: ${filePath}` };\n  }\n  \n  // Check file extension\n  const ext = filePath.toLowerCase().slice(-5);\n  const supported = ['.pdf', '.doc', '.docx', '.pptx'];\n  if (!supported.some(s => ext.endsWith(s))) {\n    return { \n      success: false, \n      error: `Unsupported file type. Supported: ${supported.join(', ')}` \n    };\n  }\n  \n  // Convert using the skill\n  const cmd = `node /path/to/office-to-md/openclaw-skill.js \"${filePath}\"`;\n  const result = await exec(cmd, { \n    workdir: '/path/to/workspace',\n    timeout: 120000 // 2 minutes for large files\n  });\n  \n  if (result.exitCode === 0) {\n    const outputPath = filePath.replace(/\\.[^/.]+$/, '.md');\n    return {\n      success: true,\n      outputPath: outputPath,\n      message: `Converted to: ${outputPath}`\n    };\n  } else {\n    return {\n      success: false,\n      error: result.stderr || 'Conversion failed'\n    };\n  }\n}\n\n// Usage example\nconst result = await convertDocumentToMarkdown('/path/to/document.doc');\nif (result.success) {\n  const markdown = await read(result.outputPath);\n  console.log(markdown.substring(0, 1000));\n}\n\nExamples\nExample 1: Convert and analyze a document\n// Convert a .doc file and analyze its content\nconst docPath = '/path/to/document.doc';\nconst convertResult = await exec(\n  `node /path/to/office-to-md/openclaw-skill.js \"${docPath}\"`,\n  { workdir: '/path/to/workspace' }\n);\n\nif (convertResult.exitCode === 0) {\n  const mdPath = docPath.replace('.doc', '.md');\n  const content = await read(mdPath);\n  \n  // Analyze the content\n  const wordCount = content.split(/\\s+/).length;\n  const lines = content.split('\\n').length;\n  const hasChinese = /[\\u4e00-\\u9fff]/.test(content);\n  \n  console.log(`Document analysis:`);\n  console.log(`- Word count: ${wordCount}`);\n  console.log(`- Lines: ${lines}`);\n  console.log(`- Contains Chinese: ${hasChinese}`);\n  console.log(`- Preview: ${content.substring(0, 200)}...`);\n}\n\nExample 2: Batch conversion\n// Convert multiple documents of different formats\nconst documents = [\n  '/path/to/report.pdf',\n  '/path/to/legacy.doc',\n  '/path/to/modern.docx',\n  '/path/to/presentation.pptx'\n];\n\nconst results = [];\nfor (const doc of documents) {\n  console.log(`Converting ${doc}...`);\n  const result = await exec(\n    `node /path/to/office-to-md/openclaw-skill.js \"${doc}\"`,\n    { workdir: '/path/to/workspace', timeout: 90000 }\n  );\n  \n  const success = result.exitCode === 0;\n  results.push({\n    file: doc,\n    success: success,\n    error: success ? null : result.stderr\n  });\n  \n  console.log(success ? '✅ Success' : '❌ Failed');\n}\n\n// Summary\nconst successful = results.filter(r => r.success).length;\nconsole.log(`\\nConversion summary: ${successful}/${results.length} successful`);\n\nAPI Reference\nconvertOfficeToMarkdown(filePath)\n\nReturns a Promise that resolves to:\n\n{\n  success: boolean,\n  outputPath?: string,\n  markdown?: string,\n  preview?: string,\n  fileType?: string,\n  message?: string,\n  stats?: {\n    lines: number,\n    characters: number,\n    words: number\n  },\n  error?: string,\n  stack?: string\n}\n\nConfiguration\nTimeout Settings\nSmall files (<1MB): 30 seconds\nMedium files (1-10MB): 60 seconds\nLarge files (>10MB): 120 seconds\nMemory Limits\nDefault Node.js memory limit is sufficient for most documents\nFor very large files, you may need to increase memory:\nnode --max-old-space-size=4096 openclaw-skill.js large-file.doc\n\nTroubleshooting\nCommon Issues\n\n\"File not found\"\n\nCheck file path and permissions\nUse absolute paths for reliability\n\n\"Unsupported file type\"\n\nEnsure file has correct extension\nCheck if file is actually the claimed format\n\nConversion errors with .doc files\n\nThe file may be corrupted or in an unusual format\nTry opening in Word and saving as .docx first\n\nChinese text appears as gibberish\n\nword-extractor should handle Chinese encoding automatically\nIf issues persist, the file may use unusual encoding\n\nTimeout errors\n\nIncrease timeout for large files\nCheck system resources\nDebug Mode\n\nEnable debug logging by setting environment variable:\n\nDEBUG=office-to-md node openclaw-skill.js document.doc\n\nPerformance\nPDF: Fast, depends on file size\nDOCX: Fast to medium, good formatting preservation\nDOC: Medium, requires binary parsing\nPPTX: Slow, requires Python and external library\nLimitations\nImages in documents are not extracted\nComplex formatting may not be fully preserved\nTables may convert imperfectly to Markdown\nVery old or corrupted .doc files may fail\nPassword-protected files are not supported\nChangelog\nv2.0.0 (2026-02-15)\nAdded full .doc support using word-extractor\nFixed ESM compatibility issues with pptConverter\nAdded comprehensive OpenClaw integration\nImproved Chinese text extraction\nAdded structured output with statistics\nv1.0.0 (Initial)\nBasic PDF, DOCX, PPTX support\nSimple conversion without .doc support\nLicense\n\nThis skill is provided as-is. The underlying libraries have their own licenses:\n\npdf-parse: MIT\nmammoth: BSD-2-Clause\nturndown: MIT\nword-extractor: MIT\npython-pptx: MIT"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Lkyyyy320/office-to-md-v2",
    "publisherUrl": "https://clawhub.ai/Lkyyyy320/office-to-md-v2",
    "owner": "Lkyyyy320",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/office-to-md-v2",
    "downloadUrl": "https://openagent3.xyz/downloads/office-to-md-v2",
    "agentUrl": "https://openagent3.xyz/skills/office-to-md-v2/agent",
    "manifestUrl": "https://openagent3.xyz/skills/office-to-md-v2/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/office-to-md-v2/agent.md"
  }
}