Token导航 LogoToken导航TokenDH.com
研究检索只读clawhub未标认证来源可访问clear审计提醒

office-docs办公室文档

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

8,420

周安装

358

GitHub Stars

公开资料未说明

下载量

2,950
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:office-docs(办公室文档)
来源仓库:https://github.com/baiyunrei2025/office-docs
安装命令:
openclaw skills install office-docs
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install office-docs

简介

处理 Word 和 WPS 文档的创建、编辑与格式转换。

  • 支持文本提取、批量操作及跨平台兼容性问题排查。
  • 适用于企业文档管理与自动化流水线场景。office-docs 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 操作前需授权文件系统读写权限并备份重要文件。
  • 复杂排版变更建议人工介入以确保最终效果。

SKILL.md

name
office-docs
description
Comprehensive document processing for Microsoft Word (.docx) and WPS Office files. Use when Codex needs to work with professional documents for: (1) Creating new documents, (2) Modifying or editing content, (3) Converting between formats, (4) Extracting text and metadata, (5) Troubleshooting document issues, (6) Batch processing documents, or any other Office document tasks.

Office Documents Skill

This skill provides comprehensive tools and workflows for working with Microsoft Word (.docx) and WPS Office documents. It covers creation, editing, conversion, analysis, and troubleshooting of professional documents.

Quick Start

Basic Operations

Read document content:

# Use python-docx for .docx files
from docx import Document
doc = Document('document.docx')
text = '\
'.join([paragraph.text for paragraph in doc.paragraphs])

Create new document:

from docx import Document
from docx.shared import Inches

doc = Document()
doc.add_heading('Document Title', 0)
doc.add_paragraph('This is a new paragraph.')
doc.save('new_document.docx')

Common Tasks

  1. Text extraction - See TEXT_EXTRACTION.md
  2. Format conversion - See CONVERSION.md
  3. Document analysis - See ANALYSIS.md
  4. Troubleshooting - See TROUBLESHOOTING.md

Core Tools and Libraries

Python Libraries

For .docx files:

  • python-docx - Primary library for reading/writing .docx
  • docx2txt - Simple text extraction
  • docxcompose - Advanced document composition
  • docx-mailmerge - Mail merge functionality

For WPS files:

  • pywps - WPS file manipulation (when available)
  • Conversion to .docx first recommended

For format conversion:

  • pandoc - Universal document converter
  • libreoffice - Office suite for conversion
  • unoconv - Universal office converter

Command Line Tools

Document conversion:

# Convert .docx to PDF
libreoffice --headless --convert-to pdf document.docx

# Convert .docx to text
pandoc document.docx -o document.txt

# Batch convert WPS to .docx
for file in *.wps; do libreoffice --headless --convert-to docx "$file"; done

Document analysis:

# Extract metadata
exiftool document.docx

# Check file integrity
file document.docx

Workflows

1. Document Creation Workflow

When creating new documents:

  1. Choose template - Start from template or create from scratch
  2. Add structure - Headings, paragraphs, lists
  3. Apply formatting - Styles, fonts, spacing
  4. Add elements - Tables, images, hyperlinks
  5. Finalize - Page setup, headers/footers, save

See CREATION.md for detailed patterns.

2. Document Editing Workflow

When modifying existing documents:

  1. Backup original - Always create backup first
  2. Analyze structure - Understand document layout
  3. Make changes - Edit content, update formatting
  4. Preserve formatting - Maintain original styles
  5. Validate - Check for corruption, save new version

See EDITING.md for detailed patterns.

3. Conversion Workflow

When converting between formats:

  1. Identify source format - .docx, .wps, .doc, .rtf, etc.
  2. Choose conversion tool - Based on format and requirements
  3. Convert - With appropriate options
  4. Verify - Check content preservation
  5. Clean up - Remove temporary files

See CONVERSION.md for detailed patterns.

Common Issues and Solutions

1. Corrupted Documents

Symptoms: Won't open, error messages, missing content

Solutions:

  • Try opening in different application
  • Use recovery mode in Word/WPS
  • Extract content with python-docx ignoring errors
  • Convert to different format and back

See TROUBLESHOOTING.md for detailed recovery procedures.

2. Formatting Issues

Symptoms: Wrong fonts, broken layout, missing styles

Solutions:

  • Check style definitions
  • Verify font availability
  • Use template-based approach
  • Simplify complex formatting

3. Compatibility Problems

Symptoms: Different appearance in Word vs WPS, missing features

Solutions:

  • Stick to common features
  • Test in both applications
  • Use standard formats
  • Provide alternative versions

Advanced Features

Document Automation

Batch processing:

import os
from docx import Document

def process_documents(folder_path):
    for filename in os.listdir(folder_path):
        if filename.endswith('.docx'):
            doc_path = os.path.join(folder_path, filename)
            process_single_document(doc_path)

Template-based generation:

from docx import Document

def generate_from_template(template_path, data):
    doc = Document(template_path)
    # Replace placeholders with data
    for paragraph in doc.paragraphs:
        for key, value in data.items():
            if f'{{{{ {key} }}}}' in paragraph.text:
                paragraph.text = paragraph.text.replace(f'{{{{ {key} }}}}', value)
    return doc

Document Analysis

Extract statistics:

def analyze_document(doc_path):
    doc = Document(doc_path)
    stats = {
        'paragraphs': len(doc.paragraphs),
        'tables': len(doc.tables),
        'images': len(doc.inline_shapes),
        'sections': len(doc.sections),
        'styles': len(doc.styles)
    }
    return stats

Check formatting consistency:

def check_formatting(doc):
    issues = []
    for i, para in enumerate(doc.paragraphs):
        if para.style.name == 'Normal' and para.text.strip():
            # Check for inconsistent formatting
            if len(para.runs) > 1:
                issues.append(f"Paragraph {i}: Multiple runs in Normal style")
    return issues

Best Practices

1. Always Backup

import shutil
import os

def backup_document(filepath):
    backup_path = filepath + '.backup'
    shutil.copy2(filepath, backup_path)
    return backup_path

2. Use Version Control

  • Save incremental versions
  • Use descriptive filenames
  • Document changes made

3. Test Thoroughly

  • Test in target application
  • Verify all content preserved
  • Check formatting integrity

4. Handle Errors Gracefully

try:
    doc = Document(filepath)
except Exception as e:
    print(f"Error opening {filepath}: {e}")
    # Try alternative methods
    return extract_text_fallback(filepath)

Reference Files

For detailed information on specific topics, consult these reference files:

Scripts

Available scripts in the scripts/ directory:

  • extract_text.py - Extract text from .docx files
  • convert_format.py - Convert between document formats
  • batch_process.py - Process multiple documents
  • document_stats.py - Generate document statistics
  • repair_document.py - Attempt to repair corrupted documents

Run scripts with appropriate parameters:

python scripts/extract_text.py input.docx output.txt

Getting Help

If you encounter issues not covered in this skill:

  1. Check the relevant reference file
  2. Search for specific error messages
  3. Try alternative approaches
  4. Consider converting to simpler format

Remember: When in doubt, create a backup and work on a copy.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

89.45%
按下载量换算2,639

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills