智能文档处理Skill

# 智能文档处理Skill

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "智能文档处理Skill" with this command: npx skills add yezhaowang888-stack/huimai-smart-document-processing

智能文档处理Skill

🚀 概述

基于惠迈智能体三层架构的文档处理框架,提供多格式文档解析和信息提取的基础能力,开发者可基于此框架扩展AI分析功能。

🌟 核心亮点

  • 惠迈文档协作实践:将惠迈三层智能体架构应用于文档处理流程
  • 多格式全能支持:PDF、Word、Excel、PPT等全格式覆盖
  • 可扩展设计:预留AI服务接口,支持接入文档理解、智能分析等能力
  • 三层架构保障:解析智能体、分析智能体、输出智能体协同工作

🏆 用户价值

  • 处理效率提升20倍:自动化处理文档解析、信息提取等复杂任务
  • 多格式全能支持:PDF、Word、Excel、PPT等全格式覆盖
  • 灵活扩展:支持接入外部AI服务增强文档分析能力
  • 三层架构保障:解析智能体、分析智能体、输出智能体协同工作

功能特性

  • 文档解析:支持PDF、Word、Excel、PPT、TXT等格式
  • 信息提取:自动提取关键信息、实体识别、数据抽取
  • 内容分析:文本分析、情感分析、关键词提取
  • 格式转换:文档格式互转、标准化处理
  • 智能处理:自动摘要、分类、标签生成(需接入AI服务)
  • 批量处理:支持批量文档处理

安装

# 通过ClawHub安装
clawhub install huimai-smart-document-processing

# 或手动安装
npm install smart-document-processing

配置

创建配置文件 config/smart-document-processing.json

{
  "supportedFormats": ["pdf", "docx", "xlsx", "pptx", "txt", "md"],
  "processing": {
    "extractText": true,
    "extractTables": true,
    "extractImages": true,
    "detectLanguage": true,
    "summarize": true
  },
  "output": {
    "format": "json",
    "encoding": "utf-8",
    "prettyPrint": true
  },
  "aiService": {
    "provider": "openai|deepseek|anthropic",
    "apiKey": "YOUR_API_KEY_HERE"
  }
}

使用方法

基本处理

const SmartDocumentProcessing = require('smart-document-processing');

const processor = new SmartDocumentProcessing({
  supportedFormats: ['pdf', 'docx', 'txt']
});

// 处理文档
const result = await processor.processDocument('document.pdf', {
  extractText: true,
  extractTables: true,
  summarize: true
});

文档解析

// 解析PDF文档
const pdfResult = await processor.parsePDF('document.pdf', {
  extractPages: [1, 2, 3],
  extractMetadata: true
});

// 解析Word文档
const wordResult = await processor.parseWord('document.docx', {
  extractStyles: true,
  extractComments: true
});

// 解析Excel文档
const excelResult = await processor.parseExcel('data.xlsx', {
  sheetNames: ['Sheet1', 'Sheet2'],
  includeFormulas: false
});

信息提取

// 提取关键信息
const extractedInfo = await processor.extractInformation('contract.pdf', {
  entities: ['dates', 'names', 'amounts', 'companies'],
  patterns: ['合同编号', '签订日期', '有效期']
});

// 提取表格数据
const tables = await processor.extractTables('report.docx', {
  format: 'json',
  includeHeaders: true
});

// 提取图片
const images = await processor.extractImages('presentation.pptx', {
  format: 'base64',
  quality: 80
});

内容分析

// 文本分析
const analysis = await processor.analyzeText('document.txt', {
  language: 'auto',
  sentiment: true,
  keywords: true,
  entities: true
});

// 自动摘要
const summary = await processor.summarize('long_document.pdf', {
  length: 'medium', // short, medium, long
  algorithm: 'extractive' // extractive, abstractive
});

// 文档分类
const classification = await processor.classify('document.docx', {
  categories: ['contract', 'report', 'proposal', 'manual']
});

格式转换

// PDF转Word
await processor.convertFormat('document.pdf', 'docx', {
  preserveLayout: true,
  includeImages: true
});

// Word转PDF
await processor.convertFormat('document.docx', 'pdf', {
  quality: 'high',
  security: {
    password: 'optional',
    permissions: ['print', 'copy']
  }
});

// 批量转换
await processor.batchConvert(['doc1.pdf', 'doc2.docx'], 'txt', {
  outputDir: './converted',
  overwrite: true
});

在OpenClaw中使用

@agent 解析这个PDF文档
@agent 提取合同中的关键信息
@agent 为这篇文档生成摘要
@agent 将Word文档转换为PDF
@agent 分析文档的情感倾向

API参考

构造函数

new SmartDocumentProcessing(config)

参数:

  • config.supportedFormats (array): 支持的文档格式
  • config.processing (object): 处理配置
  • config.output (object): 输出配置
  • config.aiService (object, 可选): AI服务配置(用于智能分析)

核心方法

processDocument(filePath, options)

处理文档,根据选项执行多种处理任务。

parsePDF(filePath, options)

解析PDF文档。

parseWord(filePath, options)

解析Word文档。

parseExcel(filePath, options)

解析Excel文档。

extractInformation(filePath, options)

从文档中提取关键信息。

extractTables(filePath, options)

提取表格数据。

analyzeText(filePath, options)

分析文本内容。

summarize(filePath, options)

生成文档摘要。

classify(filePath, options)

文档分类。

convertFormat(inputPath, outputFormat, options)

转换文档格式。

支持格式

输入格式

  • PDF (.pdf)
  • Word (.docx, .doc)
  • Excel (.xlsx, .xls)
  • PowerPoint (.pptx, .ppt)
  • 纯文本 (.txt, .md)
  • HTML (.html, .htm)
  • 图片 (.png, .jpg, .jpeg)

输出格式

  • JSON
  • XML
  • CSV
  • Markdown
  • 纯文本
  • HTML

处理能力

文本处理

  • 字符编码检测和转换
  • 语言检测
  • 文本清理和标准化
  • 段落和句子分割

信息提取

  • 命名实体识别
  • 日期、时间提取
  • 数字、金额提取
  • 联系方式提取
  • 地址提取

内容分析

  • 情感分析
  • 关键词提取
  • 主题建模
  • 可读性分析
  • 抄袭检测

格式处理

  • 文档合并
  • 页面分割
  • 水印添加
  • 加密解密
  • 压缩解压

依赖项

  • pdf-parse: ^1.1.1
  • mammoth: ^1.6.0
  • xlsx: ^0.18.0
  • natural: ^6.0.0

开发

# 克隆仓库
git clone https://gitee.com/yezhaowang888/huimai-skills.git

# 安装依赖
npm install

# 运行测试
npm test

# 启动开发服务器
npm run dev

贡献

欢迎提交Issue和Pull Request。

许可证

MIT License

版本历史

  • v1.0.1 (2026-04-24): 修正描述,强调框架定位
  • v1.0.0 (2026-04-22): 初始发布,基础文档处理功能

支持

如有问题,请提交Issue或联系维护团队。

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

MasterSwarm AI Document Analysis

Analyze any document with 15 parallel AI engines via the MasterSwarm cloud API. Upload receipts, contracts, lab results, or ask business/crypto/legal questio...

Registry SourceRecently Updated
5492Profile unavailable
General

DBCheck 数据库巡检

执行 MySQL、PostgreSQL、Oracle、SQL Server、DM8、TiDB 数据库健康巡检,内置 130+ 条增强风险分析规则 + 慢查询深度分析引擎 + 本地 Ollama AI 大模型诊断建议,一键生成专业 Word 巡检报告。适用于 DBA 和运维人员快速掌握数据库运行状况、排查风险。项目...

Registry SourceRecently Updated
2910Profile unavailable
General

Trinity Evolution Engine

每日自动化能力进化工具。运行后会:1)自检发现能力缺陷,2)自动阅读学习,3)生成新洞察,4)验证能力提升。适合希望持续提升AI能力的用户,,每天运行看到具体进步。

Registry SourceRecently Updated
420Profile unavailable
General

Arch Video Cut

自动合并建筑视频,生成字幕和背景音乐,输出横屏与竖屏双版本,支持自学习优化剪辑偏好。

Registry SourceRecently Updated
3240Profile unavailable