libreoffice-writer
LibreOffice Writer ドキュメントの自動化
手動でのドキュメント編集は時間がかかり、エラーが発生しやすいものです。このスキルは UNO 統合を通じて LibreOffice Writer 操作を自動化し、プログラムによるドキュメントの作成、編集、フォーマット設定、エクスポートを可能にします。
スキルZIPをダウンロード
Claudeでアップロード
設定 → 機能 → スキル → スキルをアップロードへ移動
オンにして利用開始
テストする
「libreoffice-writer」を使用しています。 タイトル付きの新規ドキュメントを作成して PDF にエクスポート
期待される結果:
- Document created successfully: /path/to/report.odt
- Exported to PDF: /path/to/report.pdf
「libreoffice-writer」を使用しています。 既存ドキュメント内のテキストを検出してフォーマット設定
期待される結果:
- Opened document: /path/to/draft.odt
- Formatted text range: bold, center-aligned
- Changes saved and document closed
「libreoffice-writer」を使用しています。 複数の操作を伴うパッチを適用
期待される結果:
- 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.
ベストプラクティス
- UNO ベースの Writer API を使用する場合、常に絶対ファイルパスを使用する
- テキストターゲットを単語ではなく、完全な文または段落レベルのフレーズでアンカーする
- テキストが複数回出現する可能性がある場合は、after および before バウンズを使用して検索を制限する
- 適切なクリーンアップを確実にするため、セッション操作を try/finally またはコンテキストマネージャーでラップする
- 本番環境で atomic に切り替える前に、best_effort モードでパッチワークフローをテストする
回避
- 相対パスを使用する - UNO はすべてのドキュメント操作に絶対ファイルパスを必要とする
- 同一テキストがドキュメント内に複数回出現する場合に occurrence パラメータを省略する
- session.close() が呼び出された後にセッションメソッドを呼び出す
- パッチアイテムまたはデータフィールドに不正な JSON を供給する
- 段落配置が一致テキストのみに適用されると期待する(実際は段落全体に適用される)