スキル libreoffice-writer
📄

libreoffice-writer

低リスク ⚙️ 外部コマンド📁 ファイルシステムへのアクセス🔑 環境変数⚡ スクリプトを含む

LibreOffice Writer ドキュメントの自動化

手動でのドキュメント編集は時間がかかり、エラーが発生しやすいものです。このスキルは UNO 統合を通じて LibreOffice Writer 操作を自動化し、プログラムによるドキュメントの作成、編集、フォーマット設定、エクスポートを可能にします。

対応: Claude Codex Code(CC)
🥉 74 ブロンズ
1

スキルZIPをダウンロード

2

Claudeでアップロード

設定 → 機能 → スキル → スキルをアップロードへ移動

3

オンにして利用開始

テストする

「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

セキュリティ監査

低リスク
v2 • 3/19/2026

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.

14
スキャンされたファイル
2,550
解析された行数
7
検出結果
2
総監査数
低リスクの問題 (3)
External Process Execution
subprocess.Popen launches LibreOffice soffice binary. All arguments are hardcoded strings with no user input injection. This is legitimate automation of installed software.
Temporary Directory Creation
Uses tempfile.mkdtemp() to create isolated profile directories for LibreOffice instances. Directories are cleaned up in finally blocks.
Environment Variable Access
Reads LIBREOFFICE_PROGRAM_PATH environment variable to locate UNO module. Value is used only for path resolution, not executed.

リスク要因

⚙️ 外部コマンド (1)
📁 ファイルシステムへのアクセス (2)
🔑 環境変数 (1)
⚡ スクリプトを含む (2)
監査者: claude 監査履歴を表示 →

品質スコア

64
アーキテクチャ
100
保守性
87
コンテンツ
24
コミュニティ
84
セキュリティ
91
仕様準拠

作れるもの

自動レポート生成

ドキュメントを作成し、フォーマット済みテキストとテーブルを挿入してから、配布用に 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 を供給する
  • 段落配置が一致テキストのみに適用されると期待する(実際は段落全体に適用される)

よくある質問

なぜこのスキルには LibreOffice のインストールが必要なのですか?
このスキルは Writer ドキュメントと対話するために LibreOffice の UNO(Universal Network Objects)API を使用します。UNO は LibreOffice のネイティブ自動化インターフェースであり、Python UNO バインディング付きのローカル LibreOffice インストールを必要とします。
どのファイル形式にエクスポートできますか?
このスキルは PDF および DOCX 形式へのエクスポートをデフォルトでサポートしています。追加の形式は、LibreOffice のインストールとフィルターの可用性に応じて利用可能な場合があります。
'ModuleNotFoundError: No module named uno' を修正するにはどうすればよいですか?
システムの LibreOffice Python パスを PYTHONPATH に追加してください。Linux では、通常 /usr/lib/python3/dist-packages です。PYTHONPATH にスキルスクリプトディレクトリと LibreOffice Python モジュールの両方を含めるように設定します。
atomic と best_effort パッチモードの違いは何ですか?
atomic モードは最初の失敗で停止し、セッションをリセットし、何も永続化しません。best_effort モードはすべての操作を継続し、どれが成功したかを記録し、一部の操作が失敗しても成功した変更を永続化します。
現在 LibreOffice で開いているドキュメントを編集できますか?
いいえ。ドキュメントは UNO 経由で編集する前に閉じる必要があります。他の LibreOffice インスタンスによって既にロックされているドキュメントを開こうとすると、失敗するか競合を引き起こします。
同じフレーズが複数回出現する場合に特定のテキストを対象とするにはどうすればよいですか?
occurrence フィールドを使用してどの一致を対象とするかを指定するか(0 インデックス)、after および before バウンズを追加して検索ウィンドウをドキュメントの特定セクションに絞り込みます。

開発者の詳細

作成者

dfk1352

ライセンス

MIT

参照

main

ファイル構成