ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

Document Organizer

Skill by byteuser1977

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/byteuser1977/document-organizer
Or

文档整理技能 (document-organizer)

概述

专业的文档批量处理技能,支持旧版 Office 文档(.doc/.xls)高质量转换为 Markdown,保持格式结构完整。


核心能力

✅ 格式转换

  • Word 文档: .doc.md(LibreOffice 直接转换)
  • Word 文档: .docx.md(LibreOffice 直接转换)
  • Excel 表格: .xls.xlsx.md(保留表格结构)
  • PowerPoint: .ppt.pptx.md(可选支持)
  • 现代格式: .xlsx/.pptx.md(MarkItDown 直接处理)

✅ 批量处理

  • 支持按目录批量转换
  • 自动保持原目录结构
  • 分类处理不同类型文件
  • 错误自动记录,不中断流程

✅ 质量保证

  • 完美保留标题层级(H1-H6)
  • 表格结构完整(Markdown 表格)
  • 加粗/斜体样式保留
  • 列表有序/无序完整
  • 中文无乱码(UTF-8 编码)

快速开始

1. 环境准备

# 安装 LibreOffice(系统级)
# 下载: https://zh-cn.libreoffice.org/

# 安装 Python 依赖
pip install markitdown[docx,xlsx]

2. 使用方法

# 交互模式(推荐)
npx skills run document-organizer

# 命令行参数
npx skills run document-organizer --source "源目录" --output "输出目录" --type doc,xls

3. 配置

首次运行会检测 LibreOffice 路径,默认:

  • Windows: D:\Program Files\LibreOffice\program\soffice.exe
  • Linux: /usr/bin/soffice
  • macOS: /Applications/LibreOffice.app/Contents/MacOS/soffice

详细功能

文档类型处理

源格式转换流程输出格式质量
.docLibreOffice → Markdown.md✅ 完美
.docxLibreOffice → Markdown.md✅ 完美
.xlsLibreOffice → .xlsx → MarkItDown → .md.md✅ 完美
.xlsxMarkItDown → .md.md✅ 完美
.pptLibreOffice → .pptx → MarkItDown → .md.md✅ 良好
.pptxMarkItDown → .md.md✅ 良好
.pdfMarkItDown → .md.md✅ 优秀(文本+表格)

批量处理策略

方案一:分类批量(推荐)

批量转换所有 .doc 文件:
  soffice --convert-to md *.doc

批量转换所有 .docx 文件:
  soffice --convert-to md *.docx

批量转换所有 .xls 文件:
  soffice --convert-to xlsx *.xls  →  markitdown *.xlsx

批量转换所有 .ppt 文件:
  soffice --convert-to pptx *.ppt  →  markitdown *.pptx

方案二:递归处理

扫描目录树,按文件类型分组
分别批量转换每个子目录
保持完整目录结构输出

使用示例

示例 1: 转换单个目录

# 扫描源目录
npx skills run document-organizer --source "G:\历史文档" --output "d:\知识库"

输出结构:

知识库/
├── 项目A/
│   ├── 需求文档.md
│   └── 设计文档.md
└── 项目B/
    └── 会议记录.md

示例 2: 仅处理 Word 文档

npx skills run document-organizer --source "G:\docs" --output "d:\md" --filter .doc,.docx

示例 3: 处理 PDF 文档

npx skills run document-organizer --source "G:\pdfs" --type pdf --output "d:\pdf_md"

示例 4: 先扫描统计

npx skills run document-organizer --scan-only "G:\docs"
# 输出: 文件统计,不执行转换

配置选项

参数类型默认值说明
--sourcestring必需源目录路径
--outputstring./output输出目录
--typestringdoc,xls,docx,xlsx,ppt,pptx,pdf处理的文件类型(逗号分隔)
--soffice-pathstring自动检测LibreOffice soffice.exe 路径
--log-filestringconversion.log日志文件路径
--dry-runboolfalse仅模拟,不实际转换

性能参考

测试环境: i5 CPU, 16GB RAM, SSD...

Metadata

Stars4097
Views0
Updated2026-04-14
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-byteuser1977-document-organizer": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.