OpenClaw Workspace

作者 @greenfood

openclaw-workspace Summary This workspace provides tools and scripts for creating, reading, editing, validating, and managing DOCX (Word) documents. It focus...

openclaw-workspace

Summary

This workspace provides tools and scripts for creating, reading, editing, validating, and managing DOCX (Word) documents. It focuses on document unpacking, XML-level manipulation, tracked changes processing, and schema validation. Environment and agent notes are also included for workspace configuration and continuity.

Included Assets

  • AGENTS.md — Guidance for the workspace agent, session flow, and memory strategy.
  • MEMORY.md — Example of long-term structured memory, with project context.
  • SOUL.md — Defines the agent's personality, operating norms, and boundaries.
  • TOOLS.md — Local configuration notes (project folder info, device and service details).
  • skills/docx/SKILL.md — Docx skill manifest and quick reference.
  • skills/docx/scripts/ — Python scripts for DOCX/Office document processing:
    • accept_changes.py — Accepts all tracked changes in a Word file (needs LibreOffice).
    • comment.py — Adds or replies to comments in unpacked DOCX files.
    • office/pack.py — Re-packs a modified (unpacked) Office file, with validation options.
    • office/unpack.py — Unpacks Office files for raw XML editing, with options to merge runs and simplify tracked changes.
    • office/soffice.py — Runs LibreOffice safely in restricted environments.
    • office/validate.py — Validates unpacked or packed Office files against schemas and tracked change rules.
    • office/helpers/merge_runs.py — Merges adjacent <w:r> runs with identical formatting.
    • office/helpers/simplify_redlines.py — Merges adjacent tracked changes (w:ins/w:del) by the same author.
    • office/validators/ — Python modules for schema validation (base, docx, pptx, redlining).

How to Use

  1. Unpack a DOCX
    Extract XML for editing:

    python skills/docx/scripts/office/unpack.py myfile.docx unpacked/
    
  2. Merge Runs & Simplify Tracked Changes
    (Optional, enabled by default during unpacking.)

  3. Edit XML
    Make your desired changes to the Office XML in unpacked/.

  4. Validate Changes
    Validate before packing:

    python skills/docx/scripts/office/validate.py unpacked/
    
  5. Pack to DOCX
    Re-zip and create a new DOCX:

    python skills/docx/scripts/office/pack.py unpacked/ output.docx
    
  6. Working with Tracked Changes and Comments

    • To accept all tracked changes:
      python skills/docx/scripts/accept_changes.py input.docx output.docx
      
    • To add or reply to a comment in an unpacked DOCX:
      python skills/docx/scripts/comment.py unpacked/ 0 "Comment text"
      python skills/docx/scripts/comment.py unpacked/ 1 "Reply text" --parent 0
      
  7. LibreOffice Integration
    Some scripts require LibreOffice; the workspace provides helpers to run soffice even in restricted environments.

Notes

  • For XML editing and validation, Python 3 is required.
  • Install LibreOffice for scripts that accept/reject changes or convert files.
  • Validation modules use official OOXML schemas; strict validation can be toggled.
  • Agent configuration and docx skill triggers are controlled by the supplied markdown files.
  • Local environment and project-specific information should be recorded in TOOLS.md and MEMORY.md.
  • Keep your agent’s context up to date by maintaining AGENTS.md, SOUL.md, and memory logs.
  • Do not use these tools for PDFs, spreadsheets, or non-docx document types.
  • See each script’s docstring or the SKILL.md for advanced options and CLI usage.

Add configuration and new skills as your setup evolves.

Workspace

这里展示的是当前已发布快照。新的发布会覆盖这个视图。

下载 .zip
18 文件数更新时间 2026/03/15 12:38:58 UTC
发布方式 clawlodge-cli/0.1.8
AGENTS.mdtext · 7.7 KB

社区

还没有评论。

相关推荐