libreoffice-calc
UNO で LibreOffice Calc スプレッドシートを自動化
手動でのスプレッドシート編集は時間がかかり、エラーが発生しやすくなります。このスキルは、信頼性の高いバッチ処理のために UNO API を介して Calc 操作をプログラムで自動化します。
スキルZIPをダウンロード
Claudeでアップロード
設定 → 機能 → スキル → スキルをアップロードへ移動
オンにして利用開始
テストする
「libreoffice-calc」を使用しています。 Create spreadsheet, add data to range A0:B2, export to PDF
期待される結果:
- Spreadsheet created at /reports/output.ods
- Data written to range Sheet1.A0:B2 (3 cells)
- Exported to PDF: /reports/output.pdf (127 KB)
「libreoffice-calc」を使用しています。 Read cell B5 from /data/sales.ods
期待される結果:
- Cell Sheet1.B5:
- Value: 4250.00
- Type: number
- Formula: None
「libreoffice-calc」を使用しています。 Create bar chart from A0:C10, anchor at row 12
期待される結果:
- Chart 'Sales Overview' created on Sheet1
- Data range: A0:C10 (11 rows, 3 columns)
- Position: Row 12, Column 0
- Dimensions: 8000 x 6000 units
セキュリティ監査
低リスクStatic analysis flagged 197 patterns across 13 files. After evaluation, all high-severity findings are false positives: cryptographic warnings misidentified UNO connection code, 'system reconnaissance' flagged exception class definitions, and 'dynamic imports' were standard Python import statements. Shell command patterns exist only in markdown documentation. The single confirmed external command (subprocess.Popen launching LibreOffice) uses hardcoded arguments with no user input injection risk. Temp file usage follows Python best practices with proper cleanup. Skill is safe for publication with minor documentation recommended.
低リスクの問題 (2)
リスク要因
⚙️ 外部コマンド (1)
📁 ファイルシステムへのアクセス (2)
🔑 環境変数 (1)
品質スコア
作れるもの
自動財務レポート生成
テンプレートにデータを埋め込み、通貨形式を適用し、ステークホルダーへのプレゼンテーション用の傾向チャートを作成することで、月次収益レポートを生成
一括データエクスポートと変換
データベースや API からデータを構造化されたスプレッドシートに抽出し、バリデーションルールを適用して、配布用に複数の形式にエクスポート
テンプレートベースのドキュメント生成
請求書、タイムシート、在庫レポートなどの定型フォーマットを持つ事前設計されたスプレッドシートテンプレートに動的データを埋め込む
これらのプロンプトを試す
Create a new Calc spreadsheet at /reports/monthly-data.ods with a sheet named 'Data'. Add headers 'Name', 'Value', 'Date' in row 0, then populate with 5 sample rows. Apply bold formatting to the header row and currency format to the Value column.
Open /reports/monthly-data.ods and export it to three formats: PDF at /exports/monthly-data.pdf, Excel at /exports/monthly-data.xlsx, and CSV at /exports/monthly-data.csv. Verify all exports complete successfully.
In /reports/sales.ods, create a line chart titled 'Monthly Sales' using data from Sheet1 range A0:B12. Anchor the chart at row 15, column 0 with width 8000 and height 6000. Then add data validation to column B requiring values between 0 and 10000 with error message 'Enter sales between 0 and 10000'.
Apply this patch to /reports/quarterly.ods in atomic mode: Update cells in range A0:D4 with new quarterly data, format the header row with bold and background color, create a pie chart showing category distribution, and recalculate all formulas. If any operation fails, roll back all changes.
ベストプラクティス
- Calc API を扱う際は、解決エラーを回避するために常に絶対ファイルパスを使用する
- LibreOffice リソースを解放するために、コンテキストマネージャーまたは明示的な close() 呼び出しを使用してセッションを適切に閉じる
- 関連する操作が同時に成功または失敗するように、アトミックパッチモードを使用する
- 型変換の問題を防ぐために、セルへの書き込み前にデータ型を検証する
回避
- Calc UI のような 1 ベースの座標を使用する - API は 0 ベースインデックスを使用
- セルと範囲のターゲットを混在させる - 単一セルでもこれらは異なる型
- close() 呼び出し後にセッションメソッドを呼び出す - 操作前に常にセッション状態を確認する
- チャート名が自動生成されると仮定する - 信頼性の高いターゲティングのために常に明示的なタイトルを指定する