writer
Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.
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
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/writer/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How writer Compares
| Feature / Agent | writer | Standard Approach |
|---|---|---|
| Platform Support | Claude | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | medium | N/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
Top AI Agents for Productivity
See the top AI agent skills for productivity, workflow automation, operational systems, documentation, and everyday task execution.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
AI Agent for YouTube Script Writing
Find AI agent skills for YouTube script writing, video research, content outlining, and repeatable channel production workflows.
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-automationRelated Skills
latex-paper-conversion
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.
docx-official
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.
visa-doc-translate
将签证申请文件(图片)翻译成英文,并创建包含原文和译文的双语PDF
doc-cleaner
Convert PDF, DOCX, XLSX, and text files to clean, structured Markdown. CJK-friendly, table-friendly, privacy-first.
nft-standards
Master ERC-721 and ERC-1155 NFT standards, metadata best practices, and advanced NFT features.
nextjs-app-router-patterns
Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.
new-rails-project
Create a new Rails project
networkx
NetworkX is a Python package for creating, manipulating, and analyzing complex networks and graphs.
network-engineer
Expert network engineer specializing in modern cloud networking, security architectures, and performance optimization.
nestjs-expert
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.
nerdzao-elite
Senior Elite Software Engineer (15+) and Senior Product Designer. Full workflow with planning, architecture, TDD, clean code, and pixel-perfect UX validation.
nerdzao-elite-gemini-high
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.