writer
Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.
Best use case
writer is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.
Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "writer" skill to help with this workflow task. Context: Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
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 | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.
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.
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
prd-doc-writer
Write and iteratively refine PRD/需求文档 with a story-driven structure and strict staged confirmations (journey map alignment, per-story single-point confirmation, final generation gate). Use when the user asks to 梳理/撰写/完善 PRD、需求文档、用户故事、验收标准,并希望用 ASCII 线框图与 Mermaid(流程图/状态图/时序图)来减少歧义、共同完成文档。
svelte-code-writer
CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating, editing or analyzing any Svelte component (.svelte) or Svelte module (.svelte.ts/.svelte.js). If possible, this skill should be executed within the svelte-file-editor agent for optimal results.
wiki-page-writer
Generates rich technical documentation pages with dark-mode Mermaid diagrams, source code citations, and first-principles depth. Use when writing documentation, generating wiki pages, creating technical deep-dives, or documenting specific components or systems.
seo-content-writer
Writes SEO-optimized content based on provided keywords and topic briefs. Creates engaging, comprehensive content following best practices. Use PROACTIVELY for content creation tasks.
blog-writer
Write and add new blog posts for this Next.js site by matching the existing BlogPost structure in `src/lib/blog-data.ts`. Use when asked to draft a new blog article, update blog content, or produce SEO metadata/slug/image details for a new post.
pr-description-writer
Generates comprehensive, reviewer-friendly PR descriptions with visual diagrams, summary tables, collapsible sections, and structured test plans. Optimized for readability without sacrificing detail.
code-review-digest-writer
Generates weekly code-review digest docs from PR review comments for any GitHub repository. If present, follows project-specific docs/review-digests/AGENTS.md guidelines. Use this to turn a date-bounded set of PR reviews into a structured markdown “newsletter” that captures themes, repeated issues, and concrete takeaways.
libreoffice-writer
Use when creating, editing, formatting, exporting, or extracting LibreOffice Writer (.odt) documents via UNO, including session-based edits, structured text targets, tables, images, lists, patch workflows, and snapshots.
skill-writer
Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, write, author, or design a new Skill, or needs help with SKILL.md files, frontmatter, or skill structure.
content-research-writer
Assists in writing high-quality content by conducting research, adding citations, improving hooks, iterating on outlines, and providing real-time feedback on each section. Transforms your writing process from solo effort to collaborative partnership.
documentation-writer
Expert technical writer for Logseq Template Graph project. Generates comprehensive, accurate, and well-structured documentation for modules, features, guides, and APIs. Activates when asked to "write docs", "document this", "create README", "update documentation", or similar requests. Analyzes code/templates to extract information and writes clear, user-focused documentation following project style.
constitutional-writer
Extracts and writes project constitutional information from documents (PDF, MD, TXT). Focuses exclusively on identifying principles, values, governance structures, and formatting them into a proper project constitution.