Chuyển đến nội dung
Skillpedia
Viết lách48k · #5054

writer

Skill này làm gì

Công cụ này giúp tạo, chỉnh sửa và chuyển đổi tài liệu văn bản. Bạn có thể dùng nó để tạo tài liệu từ mẫu, chuyển đổi file giữa các định dạng như DOCX và PDF, và tự động hóa các việc viết lặp lại.

Khi nào nên dùng

  • ✓Khi bạn tạo một tài liệu trống mới.
  • ✓Khi bạn cần chuyển file DOCX sang PDF.
  • ✓Khi bạn tạo nhiều tài liệu từ cùng một mẫu với dữ liệu khác nhau.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/libreoffice/writer/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/libreoffice/writer/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chuyển tài liệu ODT này sang PDF rồi sang DOCX.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ dùng chương trình LibreOffice Writer phía sau. Bạn có thể yêu cầu tạo tài liệu, chuyển đổi file, hoặc tự động tạo nhiều tài liệu từ một mẫu.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

soffice --writer template.odt

Method 2: Python with UNO

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

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

# 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

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

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

Python Libraries

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

killall soffice.bin
soffice --headless --accept="socket,host=localhost,port=8100;urp;"

Conversion Quality Issues

soffice --headless --convert-to pdf:writer_pdf_Export document.odt

Resources

…

Câu hỏi thường gặp

Tôi có thể dùng những định dạng file nào?

Bạn có thể làm việc với ODT (định dạng gốc), DOCX, PDF, HTML, RTF, TXT và nhiều định dạng khác.

'Mail merge' là gì?

Đây là cách tạo thư hoặc email cá nhân hóa hàng loạt. Bạn dùng một mẫu và danh sách liên hệ để tạo tài liệu riêng cho từng người.

Làm sao để tự động tạo tài liệu?

Bạn có thể dùng mẫu có sẵn và cung cấp dữ liệu (như tên và địa chỉ) để công cụ tự động tạo nhiều tài liệu.

Chi tiết

Mô tả gốc của tác giả

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

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5054
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự