Skills libreoffice-writer
📄

libreoffice-writer

Low Risk ⚙️ External commands📁 Filesystem access🔑 Env variables⚡ Contains scripts

Automate LibreOffice Writer Documents

Manually editing documents is time-consuming and error-prone. This skill automates LibreOffice Writer operations through UNO integration, enabling programmatic document creation, editing, formatting, and export.

Supports: Claude Codex Code(CC)
🥉 74 Bronze
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

Toggle on and start using

Test it

Using "libreoffice-writer". Create a new document with a title and export to PDF

Expected outcome:

  • Document created successfully: /path/to/report.odt
  • Exported to PDF: /path/to/report.pdf

Using "libreoffice-writer". Find and format text in existing document

Expected outcome:

  • Opened document: /path/to/draft.odt
  • Formatted text range: bold, center-aligned
  • Changes saved and document closed

Using "libreoffice-writer". Apply patch with multiple operations

Expected outcome:

  • Patch parsed: 3 operations
  • Operation 1 (replace_text): success
  • Operation 2 (format_text): success
  • Operation 3 (insert_table): success
  • Overall status: ok
  • Document persisted: true

Security Audit

Low Risk
v2 • 3/19/2026

Static analysis flagged 175 patterns but evaluation confirms these are false positives. The skill legitimately uses subprocess to launch LibreOffice with hardcoded arguments, tempfile for secure temp directories, and importlib for module detection. All external command usage has no user input injection vectors. Risk is low due to filesystem and external command dependencies requiring LibreOffice installation.

14
Files scanned
2,550
Lines analyzed
7
findings
2
Total audits
Low Risk Issues (3)
External Process Execution
subprocess.Popen launches LibreOffice soffice binary. All arguments are hardcoded strings with no user input injection. This is legitimate automation of installed software.
Temporary Directory Creation
Uses tempfile.mkdtemp() to create isolated profile directories for LibreOffice instances. Directories are cleaned up in finally blocks.
Environment Variable Access
Reads LIBREOFFICE_PROGRAM_PATH environment variable to locate UNO module. Value is used only for path resolution, not executed.
Audited by: claude View Audit History →

Quality Score

64
Architecture
100
Maintainability
87
Content
25
Community
84
Security
91
Spec Compliance

What You Can Build

Automated Report Generation

Generate standardized reports by creating documents, inserting formatted text and tables, then exporting to PDF for distribution.

Document Template Processing

Load template documents, replace placeholder text with dynamic content, update tables with new data, and export customized versions.

Batch Document Operations

Apply consistent formatting changes across multiple documents using patch workflows with atomic rollback on failures.

Try These Prompts

Create and Populate Document
Create a new LibreOffice Writer document at /path/to/report.odt. Insert a title "Monthly Report", add a section heading "Summary", then insert a paragraph describing this month's achievements. Export the final document to PDF.
Edit with Structured Targeting
Open /path/to/draft.odt and find the sentence "Quarterly revenue grew significantly" that appears after "Financial Overview" and before "Next Steps". Make it bold and centered. Then insert a bulleted list after "Action Items" with three tasks: Review budget, Schedule meeting, Send updates.
Table Operations with Data
Open the document at /path/to/data-report.odt. Insert a table with 4 rows and 3 columns named "Sales Data". Populate it with headers [Region, Q1, Q2] and data rows for North, South, East regions. Later update the Q2 values when new numbers arrive.
Atomic Patch Workflow
Apply this patch to /path/to/manuscript.odt in atomic mode: First, replace all instances of "Draft" with "Final". Second, format the chapter titles bold with 14pt font. Third, insert a table of contents. If any operation fails, rollback all changes and report the error.

Best Practices

  • Always use absolute file paths when working with UNO-based Writer APIs
  • Anchor text targets with full sentences or paragraph-level phrases, not single words
  • Use after and before bounds to constrain searches when text may appear multiple times
  • Wrap session operations in try/finally or context managers to ensure proper cleanup
  • Test patch workflows in best_effort mode before switching to atomic for production

Avoid

  • Using relative paths - UNO requires absolute file paths for all document operations
  • Omitting occurrence parameter when the same text appears multiple times in a document
  • Calling session methods after session.close() has been invoked
  • Supplying malformed JSON in patch items or data fields
  • Expecting paragraph alignment to apply only to matched text instead of the full paragraph

Frequently Asked Questions

Why does the skill require LibreOffice to be installed?
This skill uses LibreOffice's UNO (Universal Network Objects) API to interact with Writer documents. UNO is LibreOffice's native automation interface, requiring a local LibreOffice installation with Python UNO bindings.
What file formats can I export to?
The skill supports exporting to PDF and DOCX formats out of the box. Additional formats may be available depending on your LibreOffice installation and filter availability.
How do I fix 'ModuleNotFoundError: No module named uno'?
Add your system's LibreOffice Python path to PYTHONPATH. On Linux, this is typically /usr/lib/python3/dist-packages. Set PYTHONPATH to include both the skill scripts directory and the LibreOffice Python modules.
What is the difference between atomic and best_effort patch modes?
Atomic mode stops on the first failure, resets the session, and persists nothing. Best_effort mode continues through all operations and records which succeeded, persisting successful changes even if some operations fail.
Can I edit documents that are currently open in LibreOffice?
No. Documents should be closed before editing via UNO. Attempting to open a document already locked by another LibreOffice instance will fail or cause conflicts.
How do I target specific text when the same phrase appears multiple times?
Use the occurrence field to specify which match to target (0-indexed), or add after and before bounds to narrow the search window to a specific section of the document.