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
-
Unpack a DOCX
Extract XML for editing:python skills/docx/scripts/office/unpack.py myfile.docx unpacked/ -
Merge Runs & Simplify Tracked Changes
(Optional, enabled by default during unpacking.) -
Edit XML
Make your desired changes to the Office XML inunpacked/. -
Validate Changes
Validate before packing:python skills/docx/scripts/office/validate.py unpacked/ -
Pack to DOCX
Re-zip and create a new DOCX:python skills/docx/scripts/office/pack.py unpacked/ output.docx -
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
- To accept all tracked changes:
-
LibreOffice Integration
Some scripts require LibreOffice; the workspace provides helpers to runsofficeeven 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.mdandMEMORY.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.
还没有评论。