| 1 | --- |
| 2 | name: calc-spreadsheets |
| 3 | description: Use when creating, opening, or editing LibreOffice Calc ODS spreadsheets, or XLSX workbooks only when Excel compatibility is explicitly required. |
| 4 | version: "1.1.0" |
| 5 | author: "Agent Zero Core Team" |
| 6 | tags: ["calc", "ods", "opendocument", "excel", "xlsx", "spreadsheet", "workbook", "tables", "charts", "budget"] |
| 7 | triggers: |
| 8 | - "Calc" |
| 9 | - "ODS" |
| 10 | - "ods" |
| 11 | - "OpenDocument Spreadsheet" |
| 12 | - "Excel" |
| 13 | - "XLSX" |
| 14 | - "xlsx" |
| 15 | - "spreadsheet" |
| 16 | - "workbook" |
| 17 | - "budget" |
| 18 | - "sheet" |
| 19 | - "chart" |
| 20 | allowed_tools: |
| 21 | - office_artifact |
| 22 | --- |
| 23 | |
| 24 | # Calc Spreadsheets |
| 25 | |
| 26 | Use ODS when the user asks for a spreadsheet, workbook, editable table, budget, formulas, or Calc file. Use XLSX only when the user asks for Excel/XLSX compatibility, provides an existing `.xlsx`, or needs embedded spreadsheet charts supported by the tool. |
| 27 | |
| 28 | The document UI and Desktop are user-owned. Creating or editing an ODS or XLSX must save the workbook, but must not open a document modal or Desktop surface automatically. Use Desktop/Calc only for explicit GUI requests, visual chart/layout polish, or final visual confirmation. Do not write faux UI action labels such as "Open document" or "Download file", and do not add a note saying the canvas was not opened automatically unless the user explicitly asks about UI behavior. |
| 29 | |
| 30 | ## Workflow |
| 31 | |
| 32 | Create a workbook: |
| 33 | |
| 34 | ```json |
| 35 | { |
| 36 | "tool_name": "office_artifact", |
| 37 | "tool_args": { |
| 38 | "action": "create", |
| 39 | "kind": "spreadsheet", |
| 40 | "title": "Budget", |
| 41 | "format": "ods", |
| 42 | "content": "Item,Amount\nPlatform,1000" |
| 43 | } |
| 44 | } |
| 45 | ``` |
| 46 | |
| 47 | For a blank workbook request, create a simple workbook with the requested title and `format: "ods"`; do not call `status` first unless the user asked for availability. |
| 48 | |
| 49 | Edit cells: |
| 50 | |
| 51 | ```json |
| 52 | { |
| 53 | "tool_name": "office_artifact", |
| 54 | "tool_args": { |
| 55 | "action": "edit", |
| 56 | "file_id": "abc123", |
| 57 | "operation": "set_cells", |
| 58 | "cells": { |
| 59 | "Sheet1!A1": "Item", |
| 60 | "Sheet1!B1": "Amount" |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | ``` |
| 65 | |
| 66 | Practical rules: |
| 67 | |
| 68 | - `content` may be CSV, TSV, or a Markdown table; the tool writes real spreadsheet cells. |
| 69 | - Use `rows` for whole-table replacement, `append_rows` for adding records, and `set_cells` for precise edits. |
| 70 | - Use `create_chart` with a chart object for embedded charts when working in XLSX compatibility format; otherwise use Calc/Desktop or code execution for chart workflows that ODS direct editing does not yet cover. |
| 71 | - Do not open Calc/Desktop automatically. The user can choose Open in Desktop when they want the visible spreadsheet. |