libreoffice-writer
أتمتة مستندات LibreOffice Writer
تعديل المستندات يدوياً يستغرق وقتاً طويلاً وعرضة للأخطاء. تقوم هذه المهارة بأتمتة عمليات LibreOffice Writer من خلال تكامل UNO، مما يتيح إنشاء المستندات وتحريرها وتنسيقها وتصديرها برمجياً.
تنزيل ZIP المهارة
رفع في Claude
اذهب إلى Settings → Capabilities → Skills → Upload skill
فعّل وابدأ الاستخدام
اختبرها
استخدام "libreoffice-writer". Create a new document with a title and export to PDF
النتيجة المتوقعة:
- Document created successfully: /path/to/report.odt
- Exported to PDF: /path/to/report.pdf
استخدام "libreoffice-writer". Find and format text in existing document
النتيجة المتوقعة:
- Opened document: /path/to/draft.odt
- Formatted text range: bold, center-aligned
- Changes saved and document closed
استخدام "libreoffice-writer". Apply patch with multiple operations
النتيجة المتوقعة:
- 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
التدقيق الأمني
مخاطر منخفضة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.
مشكلات منخفضة المخاطر (3)
عوامل الخطر
⚙️ الأوامر الخارجية (1)
📁 الوصول إلى نظام الملفات (2)
🔑 متغيرات البيئة (1)
⚡ يحتوي على سكربتات (2)
درجة الجودة
ماذا يمكنك بناءه
توليد التقارير الآلي
توليد تقارير موحدة عن طريق إنشاء المستندات وإدراج النص المنسق والجداول، ثم تصديرها إلى PDF للتوزيع.
معالجة قوالب المستندات
تحميل قوالب المستندات واستبدال النصوص النائبة بمحتوى ديناميكي وتحديث الجداول بالبيانات الجديدة وتصدير الإصدارات المخصصة.
عمليات المستندات بالدفعة
تطبيق تغييرات التنسيق المتسقة عبر مستندات متعددة باستخدام سير عمل التصحيح مع التراجع الذري عند الفشل.
جرّب هذه الموجهات
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.
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.
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.
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.
أفضل الممارسات
- استخدم دائماً مسارات الملفات المطلقة عند العمل مع واجهات برمجة تطبيقات Writer المستندة إلى UNO
- اربط أهداف النص بجمل كاملة أو عبارات على مستوى الفقرة، وليس كلمات مفردة
- استخدم حدود after وbefore لتقييد عمليات البحث عندما قد يظهر النص عدة مرات
- لف العمليات في try/finally أو مديري السياق لضمان التنظيف السليم
- اختبر سير عمل التصحيح في وضع المحاولة الأفضل قبل التبديل إلى الذري للإنتاج
تجنب
- استخدام المسارات النسبية - يتطلب UNO مسارات ملفات مطلقة لجميع عمليات المستندات
- إهمال معامل الحدوث عندما يظهر نفس النص عدة مرات في مستند
- استدعاء طرق الجلسة بعد استدعاء session.close()
- تقديم JSON سيئ التنسيق في عناصر التصحيح أو حقول البيانات
- توقع تطبيق محاذاة الفقرة على النص المطابق فقط بدلاً من الفقرة الكاملة