writer

Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.

31,392 stars
Complexity: medium

About this skill

This skill empowers AI agents to fully leverage LibreOffice Writer for comprehensive document management and automation. It facilitates the creation of new ODT documents from scratch, seamless conversion between various formats including ODT, DOCX, PDF, HTML, RTF, and TXT, and advanced operations like mail merge. Agents can automate complex document generation workflows, perform batch processing, and standardize document formats through template creation, making it ideal for tasks requiring robust, open-source document handling and office suite integration.

Best use case

Automating report generation, creating standardized contracts or invoices, converting legacy documents to modern formats, processing large volumes of personalized letters (mail merge), or scripting custom document workflows that require LibreOffice Writer's capabilities.

Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.

Correctly formatted documents in ODT, DOCX, or PDF; automated document conversions; personalized mail merge documents; or the successful execution of complex, scripted document workflows, all managed through LibreOffice Writer.

Practical example

Example input

Convert the document 'meeting_notes.odt' into a PDF file and save it as 'meeting_notes_final.pdf'.

Example output

Successfully converted 'meeting_notes.odt' to 'meeting_notes_final.pdf'. The PDF document is now available.

When to use this skill

  • Creating new documents in ODT format.
  • Converting documents between various formats (ODT to/from DOCX, PDF, HTML, RTF, TXT).
  • Automating complex document generation workflows.
  • Performing batch document operations, such as converting multiple files or applying templates.

When not to use this skill

  • When document processing must occur directly within a cloud-native, browser-based environment without a LibreOffice installation.
  • For very simple text manipulation that doesn't require structured document formats, advanced layout, or LibreOffice-specific features.
  • When the primary requirement is advanced desktop publishing features that go beyond standard office document creation.
  • If the underlying system where the AI agent operates does not have LibreOffice Writer installed or accessible.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/writer/SKILL.md --create-dirs "https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/plugins/antigravity-awesome-skills-claude/skills/libreoffice/writer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/writer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How writer Compares

Feature / AgentwriterStandard Approach
Platform SupportClaudeLimited / Varies
Context Awareness High Baseline
Installation ComplexitymediumN/A

Frequently Asked Questions

What does this skill do?

Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.

Which AI agents support this skill?

This skill is designed for Claude.

How difficult is it to install?

The installation complexity is rated as medium. You can find the installation instructions above.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# LibreOffice Writer

## Overview

LibreOffice Writer skill for creating, editing, converting, and automating document workflows using the native ODT (OpenDocument Text) format.

## When to Use This Skill

Use this skill when:
- Creating new documents in ODT format
- Converting documents between formats (ODT <-> DOCX, PDF, HTML, RTF, TXT)
- Automating document generation workflows
- Performing batch document operations
- Creating templates and standardized document formats

## Core Capabilities

### 1. Document Creation
- Create new ODT documents from scratch
- Generate documents from templates
- Create mail merge documents
- Build forms with fillable fields

### 2. Format Conversion
- ODT to other formats: DOCX, PDF, HTML, RTF, TXT, EPUB
- Other formats to ODT: DOCX, DOC, RTF, HTML, TXT
- Batch conversion of multiple documents

### 3. Document Automation
- Template-based document generation
- Mail merge with data sources (CSV, spreadsheet, database)
- Batch document processing
- Automated report generation

### 4. Content Manipulation
- Text extraction and insertion
- Style management and application
- Table creation and manipulation
- Header/footer management

### 5. Integration
- Command-line automation via soffice
- Python scripting with UNO
- Integration with workflow automation tools

## Workflows

### Creating a New Document

#### Method 1: Command-Line
```bash
soffice --writer template.odt
```

#### Method 2: Python with UNO
```python
import uno

def create_document():
    local_ctx = uno.getComponentContext()
    resolver = local_ctx.ServiceManager.createInstanceWithContext(
        "com.sun.star.bridge.UnoUrlResolver", local_ctx
    )
    ctx = resolver.resolve(
        "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext"
    )
    smgr = ctx.ServiceManager
    doc = smgr.createInstanceWithContext("com.sun.star.text.TextDocument", ctx)
    text = doc.Text
    cursor = text.createTextCursor()
    text.insertString(cursor, "Hello from LibreOffice Writer!", 0)
    doc.storeToURL("file:///path/to/document.odt", ())
    doc.close(True)
```

#### Method 3: Using odfpy
```python
from odf.opendocument import OpenDocumentText
from odf.text import P, H

doc = OpenDocumentText()
h1 = H(outlinelevel='1', text='Document Title')
doc.text.appendChild(h1)
doc.save("document.odt")
```

### Converting Documents

```bash
# ODT to DOCX
soffice --headless --convert-to docx document.odt

# ODT to PDF
soffice --headless --convert-to pdf document.odt

# DOCX to ODT
soffice --headless --convert-to odt document.docx

# Batch convert
for file in *.odt; do
    soffice --headless --convert-to pdf "$file"
done
```

### Template-Based Generation
```python
import subprocess
import tempfile
from pathlib import Path

def generate_from_template(template_path, variables, output_path):
    with tempfile.TemporaryDirectory() as tmpdir:
        subprocess.run(['unzip', '-q', template_path, '-d', tmpdir])
        content_file = Path(tmpdir) / 'content.xml'
        content = content_file.read_text()
        for key, value in variables.items():
            content = content.replace(f'${{{key}}}', str(value))
        content_file.write_text(content)
        subprocess.run(['zip', '-rq', output_path, '.'], cwd=tmpdir)
    return output_path
```

## Format Conversion Reference

### Supported Input Formats
- ODT (native), DOCX, DOC, RTF, HTML, TXT, EPUB

### Supported Output Formats
- ODT, DOCX, PDF, PDF/A, HTML, RTF, TXT, EPUB

## Command-Line Reference

```bash
soffice --headless
soffice --headless --convert-to <format> <file>
soffice --writer    # Writer
soffice --calc      # Calc
soffice --impress   # Impress
soffice --draw      # Draw
```

## Python Libraries

```bash
pip install odfpy     # ODF manipulation
pip install ezodf     # Easier ODF handling
```

## Best Practices

1. Use styles for consistency
2. Create templates for recurring documents
3. Ensure accessibility (heading hierarchy, alt text)
4. Fill document metadata
5. Store ODT source files in version control
6. Test conversions thoroughly
7. Embed fonts for PDF distribution
8. Handle conversion failures gracefully
9. Log automation operations
10. Clean temporary files

## Troubleshooting

### Cannot open socket
```bash
killall soffice.bin
soffice --headless --accept="socket,host=localhost,port=8100;urp;"
```

### Conversion Quality Issues
```bash
soffice --headless --convert-to pdf:writer_pdf_Export document.odt
```

## Resources

- [LibreOffice Writer Guide](https://documentation.libreoffice.org/)
- [LibreOffice SDK](https://wiki.documentfoundation.org/Documentation/DevGuide)
- [UNO API Reference](https://api.libreoffice.org/)
- [odfpy](https://pypi.org/project/odfpy/)

## Related Skills

- calc
- impress
- draw
- base
- docx-official
- pdf-official
- workflow-automation

Related Skills

latex-paper-conversion

31392
from sickn33/antigravity-awesome-skills

This skill should be used when the user asks to convert an academic paper in LaTeX from one format (e.g., Springer, IPOL) to another format (e.g., MDPI, IEEE, Nature). It automates extraction, injection, fixing formatting, and compiling.

Document ProcessingClaude

docx-official

31392
from sickn33/antigravity-awesome-skills

A user may ask you to create, edit, or analyze the contents of a .docx file. A .docx file is essentially a ZIP archive containing XML files and other resources that you can read or edit. You have different tools and workflows available for different tasks.

Document ProcessingClaude

visa-doc-translate

144923
from affaan-m/everything-claude-code

将签证申请文件(图片)翻译成英文,并创建包含原文和译文的双语PDF

Document ProcessingClaude

doc-cleaner

162
from notoriouslab/doc-cleaner

Convert PDF, DOCX, XLSX, and text files to clean, structured Markdown. CJK-friendly, table-friendly, privacy-first.

Document Processing

nft-standards

31392
from sickn33/antigravity-awesome-skills

Master ERC-721 and ERC-1155 NFT standards, metadata best practices, and advanced NFT features.

Web3 & BlockchainClaude

nextjs-app-router-patterns

31392
from sickn33/antigravity-awesome-skills

Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

Web FrameworksClaude

new-rails-project

31392
from sickn33/antigravity-awesome-skills

Create a new Rails project

Code GenerationClaude

networkx

31392
from sickn33/antigravity-awesome-skills

NetworkX is a Python package for creating, manipulating, and analyzing complex networks and graphs.

Network AnalysisClaude

network-engineer

31392
from sickn33/antigravity-awesome-skills

Expert network engineer specializing in modern cloud networking, security architectures, and performance optimization.

Network EngineeringClaude

nestjs-expert

31392
from sickn33/antigravity-awesome-skills

You are an expert in Nest.js with deep knowledge of enterprise-grade Node.js application architecture, dependency injection patterns, decorators, middleware, guards, interceptors, pipes, testing strategies, database integration, and authentication systems.

Frameworks & LibrariesClaude

nerdzao-elite

31392
from sickn33/antigravity-awesome-skills

Senior Elite Software Engineer (15+) and Senior Product Designer. Full workflow with planning, architecture, TDD, clean code, and pixel-perfect UX validation.

Software DevelopmentClaude

nerdzao-elite-gemini-high

31392
from sickn33/antigravity-awesome-skills

Modo Elite Coder + UX Pixel-Perfect otimizado especificamente para Gemini 3.1 Pro High. Workflow completo com foco em qualidade máxima e eficiência de tokens.

Software DevelopmentClaudeGemini