[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CVJ9X32B48W4KCYDQQFHG4":3,"skill-same:01M7CVJ9X32B48W4KCYDQQFHG4":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7CVJ9X32B48W4KCYDQQFHG4","Spreadsheets",null,"Use this skill when a user requests to create, modify, analyze, visualize, or work with spreadsheet files (`.xlsx`, `.xls`, `.csv`, `.tsv`) with formulas, formatting, charts, tables, and recalculation.","realsudarshan\u002FSD-skill","realsudarshan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128029723?v=4","01M7CTP2JEKQ9KBJ51NRZ2777Z","Sudarshan Dhakal","01M7CTP2JYR2PRY3BWGA30HX7J",0,"MIT","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-primary-spreadsheets-spreadsheets\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"Spreadsheets\"\ndescription: \"Use this skill when a user requests to create, modify, analyze, visualize, or work with spreadsheet files (`.xlsx`, `.xls`, `.csv`, `.tsv`) with formulas, formatting, charts, tables, and recalculation.\"\n---\n\n# Spreadsheets skill\n\nThis skill includes requirements and guidance for producing a correct, polished spreadsheet artifact quickly that completes the user's request. When producing spreadsheets or workbooks, you will be judged on layout, readability, style, adherence to industry norms\u002Fconventions and correctness. Follow the requirements below for how to use the APIs effectively and how to verify your output before finalizing work for the user.\n\nFor complex, analytical, financial or research involved tasks, you are especially judged on correctness and quality. You need to be professional. For these, always make sure you have a plan for how you're organizing the spreadsheet, and the data or visualizations within each sheet. For business, finance, operations, dashboard, and data-analysis prompts, aim for an output that can compete with a strong analyst-built workbook, not just a functional grid. A good default shape is an executive summary or dashboard first, then source\u002Fassumptions, then model\u002Fdetail sheets. For simpler tasks like a creating template or tracker, or things that do not require research, prioritize doing the spreadsheet build and edits quickly, while ensuring the user's request is fulfilled.\n\nFor additional stylistic best practices, follow: `style_guidelines.md`\n\nRead `charts.md` when creating or editing substantive charts, dashboards, or chart-ready summaries.\n\n# Tools + Contract\n- Use Codex workspace dependencies for spreadsheet artifact work: resolve them through the workspace dependency loader or runtime skill, then treat the returned Node\u002FPython runtimes, package directory, and verification details as authoritative. Do not use system `node`, system `python`, global npm packages, or repo-local installs.\n- Use `@oai\u002Fartifact-tool` JS library, which exists in the default Codex workspace dependencies node_modules, for authoring, editing, inspecting, rendering, and exporting spreadsheet `.xlsx` workbooks.\n- Run builders from a writable conversation-specific temp or workspace directory, not from the managed dependency directory. Outputs and scratch files may live under the OS temp directory.\n- Start by setting up the work directory to work with normal Node module resolution: link or junction local `node_modules` to the workspace dependency node_modules so `import \"@oai\u002Fartifact-tool\"` resolves.\n- Prefer one executable `.mjs` builder; patch and rerun it when iterating. Do NOT use shell heredocs or keep extra builder copies.\n- If workspace dependencies or `@oai\u002Fartifact-tool` are unavailable, report a setup blocker; do not guess paths, install packages, use system deps, alter module resolution, copy\u002Fimport bundled internals, or do a broad file system search.\n- Do not search package internals or dump prototypes to discover APIs. Use the API reference below; if blocked, run at most one exact `workbook.help(\"\u003Capi_or_feature>\")` query before building.\n- Final response: include a short user-visible summary and standalone Markdown link(s) only to final `.xlsx` artifact(s), one per line: `[Revenue Model - MNST.xlsx](\u002Fabsolute\u002Fpath\u002Fto\u002Frevenue_model_mnst.xlsx)`.\n- Do not mention internal tooling or support artifacts such as builders, rendered previews, JSON\u002FCSV\u002Flog files, or scratch files unless explicitly requested.\n- Do not use alternate workbook creation\u002Fediting libraries such as `openpyxl`, `xlsxwriter`, or `pandas.ExcelWriter` unless the user explicitly asks for a non-artifact-tool fallback.\n- For analysis outside workbook authoring, use JS or spreadsheet formulas when sufficient. If Python is needed, use bundled Python libraries, save JSON\u002FCSV intermediates, and have the JS builder create the workbook. Keep auditable\u002Fuser-editable calculations as formulas.\n- For nontrivial work, use `update_plan`: build quickly, verify\u002Frender, repair meaningful issues, then finalize without long polish loops. Incrementally rendering your work and assessing overall aesthetics, formatting and correctness along the way is very important (rigorously inspect the output and be confident in quality), but do not get stuck in a long render-verify loop. As part of your plan, think about the best practices and conventions to follow for the specific type of spreadsheet you're creating and the best way to structure the workbook for readability and usability.\n\n# Domain Requirements\nRead these domain templates only when the request clearly relates to the domain:\n- Finance, accounting, valuation, forecasting, budgeting, investing, operations metrics, investment banking, DCF, multi-statement models, sensitivity\u002Fscenario models, or source-backed financial filing analysis: `templates\u002Ffinancial_models.md`\n- Healthcare, clinical, patient, medical, hospital, staffing, care delivery, or healthcare administration workbooks: `templates\u002Fhealthcare.md`\n- Marketing, advertising, campaign, funnel, lead, CRM, growth, attribution, ROI, or web\u002Fad performance workbooks: `templates\u002Fmarketing_advertising.md`\n- Scientific research, experiments, lab measurements, surveys, statistical analysis, reproducibility, protocol, or raw\u002Fprocessed research data workbooks: `templates\u002Fscientific_research.md`\n\nRead all templates that clearly apply. Do not load domain templates for unrelated routine, lightweight, or basic formatting\u002Fediting tasks unless the user explicitly asks.\n\nOnly add Checks sheets for models where correctness depends on linked calculations, source reconciliation, or financial statement\u002Fmodel integrity.\n\n# General Rules\n- Start meaningful edits quickly; avoid long upfront API exploration.\n- Core APIs are listed in the API reference section below. Use them.\n- If these skill instructions are already loaded in context, do not spend a shell turn re-reading this `SKILL.md` from disk. Move directly to the prompt, attachments, and workbook build.\n- For workbook with multiple tabs\u002Fsheets, create\u002Fpopulate non-formula inputs\u002Ftables and sheets prior to populating cross-sheet formulas.\n\n## Approach for quickly building a new spreadsheet\n1. Setup: import `@oai\u002Fartifact-tool`, create workbook\u002Fsheets for new files.\n2. Build quickly: bulk-write headers\u002Fdata\u002Fformulas; then formatting\u002Fvalidation\u002Fconditional formatting; add charts\u002Ftables only when needed.\n3. Use additional focused calls if helpful for streamed progress.\n4. Near completion: inspect key ranges, scan formula errors, render all the sheets and verify, run a validation pass\n5. Export `.xlsx`\n\n## Making edits on a spreadsheet\nIf a user asks to edit or add to an existing spreadsheet:\n- For visual fix requests, start with the smallest plausible local change rather than applying sheet-wide autofit, wrapping, or restyling.\n- When making edits, ensure existing formulas and patterns are consistent. For example, if asked to add another column or row to a table and there is conditional formatting applied to the whole table, it should extend to the new column or rows as well.\n- If specific cells\u002Frows\u002Fcolumns are specified in prompt, limit edits to those ranges unless a broader change is clearly necessary. The exceptions are when other parts of the spreadsheet depend on them, e.g. if there's a dynamic chart that is based on the range of values in a table and a new row is added, the chart should include that new row. Another example is if conditional formatting was already set for a table from A1:C5, and you add a new column D, the conditional formatting should be updated (or deleted and re-created) to cover A1:D5.\n- For column resizing, avoid autofitting by default: instead, inspect only relevant data range, measure the longest text entry in that range, and set columnWidthPx to an estimated width based on text length (with a reasonable min\u002Fmax cap). Use autofit only when the user explicitly asks for it.\n\n## Handling queries and questions\n- The user may ask questions about the sheet instead of requesting an edit or a change. Simply answer those questions about the spreadsheet based on the context available rather than making an edit the user didn't intend for. You can use inspect to learn more or directly read values\u002Fformulas\u002Ftables etc via accessor methods.\n\n# Error Recovery\nOn first error:\n1. Read error text.\n2. Run one targeted `workbook.help(\"\u003Cexact_api>\")` query only if needed.\n3. Retry with minimal patch (not full rewrite).\n4. Continue from existing workbook state.\n\nDo not loop indefinitely on similar failures.\n\n# Quality Guidelines\n- Keep layout readable and bounded, contents visible:\n  - avoid extreme width\u002Fheight from unconstrained autofit\n  - cap oversized widths\u002Fheights after `autofit` + `wrap_text`\n- Prefer formula-driven logic over manual painted cells when logic is expected.\n- Derived values must be formulas (not hardcoded) and legible.\n- Use absolute\u002Frelative references correctly for fill\u002Fcopy behavior.\n- Do not use magic numbers in formulas; reference cells (e.g. `=H6*(1+$B$3)`).\n- Blank editable templates must look blank\u002Fneutral before user data is entered. Count, ranking, best\u002Fworst, IRR\u002FRATE\u002FXIRR, variance, and status formulas should guard on required input cells and return `\"\"`, `0`, or a clear \"No entries yet\" state as appropriate. Alternatively, prefill with a few rows of example data.\n- Include at least one visual summary for tracker\u002Fplanning requests when appropriate (KPI block, chart, dashboard area).\n- For dashboard, visualization, chart-ready analysis, budget\u002Freporting, trend, schedule\u002Ftimeline, and KPI prompts with plottable data, include at least one native Excel chart unless a verified export failure remains after simplifying the chart. Do not silently replace all charts with styled tables.\n- For presentation-ready analytical workbooks, plain range formatting alone is usually not enough. Prefer real Excel structures where useful: tables, freeze panes, filters, data validation, conditional formats, and at least one chart\u002FKPI\u002Fdashboard visual when the prompt implies summary analysis.\n- In rendered previews of dashboards and summary sheets, check financial values and row labels at normal zoom. Widen columns, adjust row heights, or move chart panels until important numbers and text are not clipped, awkwardly wrapped, or hidden.\n\n# Completion Criteria\nComplete only when:\n- Workbook content is populated and formulas compute.\n- No obvious formula errors in key scanned ranges (no bad refs\u002Foff-by-one\u002Fcircular errors).\n- `.xlsx` saved to `outputs\u002F\u003Cunique_thread_id>\u002F`.\n- Layout is organized, legible, and aligned to request style (or default formatting baseline).\n\n# Verification Rules\nBefore final response, verify values\u002Fformulas and visual quality.\n\n1. Inspect key ranges:\n```js\nconst check = await workbook.inspect({\n  kind: \"table\",\n  range: \"Dashboard!A1:H20\",\n  include: \"values,formulas\",\n  tableMaxRows: 20,\n  tableMaxCols: 12,\n});\nconsole.log(check.ndjson);\n```\n\nInspect targeting:\n- Prefer sheet-qualified ranges (`\"Sheet!A1:H20\"`) or `sheetId`.\n\n2. Scan formula errors:\n```js\nconst errors = await workbook.inspect({\n  kind: \"match\",\n  searchTerm: \"#REF!|#DIV\u002F0!|#VALUE!|#NAME\\\\?|#N\u002FA\",\n  options: { useRegex: true, maxResults: 300 },\n  summary: \"final formula error scan\",\n});\nconsole.log(errors.ndjson);\n```\n\n3. Render sheets\u002Franges to verify visual output (skip if already verified and no style changes):\n```js\nconst blob = await workbook.render({ sheetName: \"Sheet1\", range: \"A1:H20\", scale: 2 });\n```\nMake sure you do at least one visual pass of all the sheets in the workbook before the final export.\n\nVisual requirements:\n- Fix severe defects before finalizing: blank\u002Fbroken charts, clipped key headers or numbers, unreadable colors, obvious formula errors, default blank sheets, or content outside the visible working area.\n- Ensure logical labels or titles appear once, texts are all clearly visible, and merged ranges exist where labels or content intentionally span multiple columns.\n- Do one focused visual repair pass after the initial render. Do not spend additional passes on minor polish once the workbook is correct, legible, and exported; note any minor limitation briefly and finalize.\n\n4. Keep verification compact:\n- Inspect key ranges.\n- Avoid huge NDJSON dumps.\n\n5. Export:\n```js\nawait fs.mkdir(outputDir, { recursive: true });\nconst output = await SpreadsheetFile.exportXlsx(workbook);\nawait output.save(`${outputDir}\u002Foutput.xlsx`);\n```\n\n6. Finalize immediately after successful export + compact verification.\n- Do not export extra `.xlsx` variants unless asked.\n- Do not keep iterating on alternate designs once requirements are met, unless asked.\n\n# Source, PDF, and Attachment Processing\n- Use bundled runtime libraries for source extraction. For PDF or 10-K\u002F10-Q style inputs, read PDF via bundled Python `pypdf` when available, then use one small structured extraction script to collect all required facts into a dict\u002FJSON object. Avoid many ad hoc `rg`\u002F`sed` passes over the same text.\n- Keep source notes compact: record file name, section\u002Ftable label, and enough context to audit the number. Do not paste large PDF excerpts into the workbook unless requested.\n- Bundled Python libraries available for extraction\u002Fanalysis include `pandas`, `numpy`, `pypdf`, `python-docx`, and `reportlab`.\n- Bundled JS libraries available for document\u002FPDF work include `docx`, `pdf-lib`, and `pdfjs-dist`.\n\n# Using artifact_tool APIs (JavaScript)\n\n## Imports + Startup\n\nImport existing workbook only when needed:\n```js\nimport { FileBlob, SpreadsheetFile } from \"@oai\u002Fartifact-tool\";\n\nconst input = await FileBlob.load(\"path\u002Fto\u002Finput.xlsx\");\nconst workbook = await SpreadsheetFile.importXlsx(input);\n```\n\nImport CSV text directly when the source or intermediate data is CSV:\n```js\nimport fs from \"node:fs\u002Fpromises\";\nimport { Workbook } from \"@oai\u002Fartifact-tool\";\n\nconst csvText = await fs.readFile(\"path\u002Fto\u002Finput.csv\", \"utf8\");\nconst workbook = await Workbook.fromCSV(csvText, { sheetName: \"Sheet1\" });\n```\nPrefer `Workbook.fromCSV(...)` over hand-parsing CSV rows; clean or analyze CSV with Python\u002FNode first only when needed.\n\nCreate new workbook:\n```js\nimport fs from \"node:fs\u002Fpromises\";\nimport { SpreadsheetFile, Workbook } from \"@oai\u002Fartifact-tool\";\n\nconst workbook = Workbook.create();\nconst sheet = workbook.worksheets.add(\"Inputs\");\n```\n\nFinal export:\n```js\nawait fs.mkdir(outputDir, { recursive: true });\nconst output = await SpreadsheetFile.exportXlsx(workbook);\nawait output.save(`${outputDir}\u002Foutput.xlsx`);\n```\n\n## Build Patterns\n- Prefer block writes (`range.values`, `range.formulas`) over per-cell loops. Matrix shape must match the target range (for example `\"D4:M4\"` should be a 1x10 matrix, row x col).\n- Seed scalar formulas once, then `fillDown()` \u002F `fillRight()`. For dynamic-array formulas (`SEQUENCE`, `UNIQUE`, `FILTER`, `SORT`, `VSTACK`, `HSTACK`), write only the anchor cell and let the result spill after.\n- Use `range.displayFormulas` plus `range.formulaInfos` when you need to understand a spill child or a data-table output cell.\n- You do not need to call recalculate; calculation automatically happens.\n- Date handling:\n  - Prefer real `Date` objects for sortable\u002Fcharted\u002Fformula date columns.\n  - Apply date formats explicitly (for example `yyyy-mm-dd`).\n- Use JSON-serializable values for non-Date cells: `string | number | boolean | null`.\n- If a cell is intended to display literal text that begins with `=`, write it as a value prefixed with a single quote (for example `'=B2*C2`). This includes formula descriptions, validation examples, and labels; do not write these cells through `range.formulas`.\n- Create every worksheet referenced by formulas before writing any cross-sheet formulas.\n- When rebuilding dashboards, delete drawings first with `sheet.deleteAllDrawings()`. `range.clear()` does not remove charts, shapes, or images.\n- Verify with `await workbook.inspect(...)`; use `workbook.help(...)` only when the quick surface below is insufficient.\n- For formula audits or tracing how a formula is calculated, use `workbook.trace(\"Sheet!A1\")` on the key output\u002Fcheck cells. It takes only a cell reference and returns the full tree, so print a capped summary. Do not dump raw traces.\n\n## Conventions\n- Use camelCase API names and option keys.\n- Cell\u002Frange addressing: A1 notation (`sheet.getRange(\"A1:C10\")`).\n- Drawing anchors (`sheet.charts`, `sheet.shapes`, `sheet.images`): 0-based `{ row, col }`.\n- Drawing offsets\u002Fextents use pixels (`rowOffsetPx`, `colOffsetPx`, `widthPx`, `heightPx`).\n\n## API Discovery\n- Use this quick API surface first.\n- Use `workbook.help(...)` only when blocked by uncertainty.\n- For help queries, start with exact feature\u002Fpath lookups (`chart`, `worksheet.getRange`, `worksheet.freezePanes`, `range.dataValidation`, `chart.series.add`). If an exact path fails, one broader wildcard search is allowed.\n- Do not repeat semantically similar help queries.\n- If one help query returns 0 matches, reformulate once, then proceed best-effort.\n- `render` can be used to examine an existing workbook visually and for visual verifications.\n\n## Efficient Formula Lookup\n- If you know the function name, use exact lookup first: `workbook.help(\"fx.PMT\", { include: \"index,examples,notes\", maxChars: 3000 })`.\n- To browse a family, use `fx.*` with a category regex. Useful categories: `financial`, `math-trig`, `statistical`, `lookup-reference`, `logical`, `text`, `date-time`, `information`, `engineering`, `database`.\n- For intent-based lookup, use a short natural query plus a narrow `search` regex of likely functions.\n- Keep `maxChars` bounded; if results are noisy, narrow `search` rather than issuing many similar queries.\n\nUseful help calls:\n```js\nconsole.log(workbook.help(\"shape.add\", { include: \"examples,notes\" }).ndjson);\nconsole.log(\n  workbook.help(\"*\", {\n    search: \"fill|borders|autofit\",\n    include: \"index,examples,notes\",\n    maxChars: 6000,\n  }).ndjson,\n);\nconsole.log(workbook.help(\"fx.PMT\", { include: \"index,examples,notes\" }).ndjson);\nconsole.log(workbook.help(\"fx.*\", { search: \"financial\", include: \"index,examples\", maxChars: 4000 }).ndjson);\nconsole.log(workbook.help(\"fx.*\", { search: \"math-trig\", include: \"index,examples\", maxChars: 4000 }).ndjson);\nconsole.log(workbook.help(\"lookup with fallback\", { search: \"XLOOKUP|INDEX|MATCH|IFERROR\", include: \"index,examples,notes\", maxChars: 4000 }).ndjson);\n```\n\n## Reading existing\u002Fimported workbooks\n- On existing\u002Fimported workbooks, get a compact summary via `inspect` to understand what already exists and where.\n- Prefer `inspect(...)` for workbook understanding and discovery across broad areas.\n- Prefer direct getters like `range.formulas` when you already know the target range and need the exact rectangular formula matrix.\n- If formula locations are unknown, prefer `inspect({ kind: \"formula\", ... })` over reading `range.formulas` across a very large area.\n- Prefer to set `maxChars`, `tableMaxRows`, `tableMaxCols`, and\u002For `maxResults` to prevent large dumps of data.\n- For suspicious or high-impact outputs, use `workbook.trace(\"Sheet!A1\")` to audit the dependency tree from final output\u002Fcheck cell back to source cells. Trace output can be large, so summarize by depth\u002Fnode count before logging.\n\n### Inspect for workbook understanding\n- Compact summary:\n```js\nawait wb.inspect({\n  kind: \"workbook,sheet,table\",\n  maxChars: 6000,\n  tableMaxRows: 6,\n  tableMaxCols: 6,\n  tableMaxCellChars: 80,\n});\n```\n- Quick overview of sheet ids and names: `await wb.inspect({ kind: \"sheet\", include: \"id,name\" })`\n- Formula discovery in a targeted area: `await wb.inspect({ kind: \"formula\", sheetId: firstSheetName, range: \"A1:Z30\", maxChars: 2500, options: {maxResults:50} })`\n- Checking existing styles in a targeted area: `await wb.inspect({ kind: \"computedStyle\", sheetId: firstSheetName, range: \"A1:E10\", maxChars: 2500 })`\n- Common `kind` tokens: `workbook`, `sheet`, `table`, `region`, `match`, `formula`, `thread`, `computedStyle`, `definedName`, `drawing`\n- Inspects can also be used to zoom in on specific areas, especially for target edits:\n```js\nawait wb.inspect({\n  kind: \"region\",\n  sheetId: firstSheetName,\n  range: \"A1:Z30\",\n  maxChars: 2500,\n});\n```\n- Inspect output may include JSON records with `\"id\"` values (for example `\"ws\u002Fr5qsk5\"`), which you can resolve back to workbook objects with `wb.resolve(...)`:\n- `wb.resolve(\"ws\u002F...\")` -> worksheet\n- `wb.resolve(\"th\u002F...\")` -> comment thread\n\n## Additional feature-specific notes\n\n### Merging cells\n- Merging cells is useful for visual headers, title bands, note\u002Fsource blocks, and labels that span columns.\n- `range.merge()` merges the target range into one cell; `range.merge(true)` merges across each row in the target range.\n- `range.unmerge()` reverses a merge.\nFor example:\n```js\nconst range = sheet.getRange(\"I23:N24\");\nrange.merge();\nrange.values = [[\"Source note spanning the recommendation panel\"]];\n```\n\n## Common API Pitfalls\n- Do not set undocumented attributes on remote objects.\n- `Workbook.create()` starts with no sheets; add one before calling `getActiveWorksheet()`.\n- Use matrix sizes that match target ranges unless you intentionally spill.\n- Create every worksheet referenced by formulas before writing cross-sheet formulas.\n- Avoid full-column formula references such as `A:A`, `$A:$A`, or `Sheet!B:B`. Prefer bounded ranges sized to the editable table, e.g. `$A$6:$A$205`, especially inside `COUNTIFS`, `SUMIFS`, `INDEX`, and lookup formulas.\n- If export fails, checkpoint-export after major blocks to isolate the cause: base sheets, values\u002Fformulas, formatting, conditional formatting, tables, charts\u002Frendering.\n- If export fails after formatting or charts, simplify optional styling first: nested border configs, custom chart axis\u002Fseries mutations, broad autofit\u002Fformatting, then nonessential drawings.\n\n## Quick API Surface (High-Value + Common)\n\n### Core workbook\u002Ffile APIs\n- `import { FileBlob, SpreadsheetFile, Workbook } from \"@oai\u002Fartifact-tool\"`\n- `const workbook = Workbook.create(); const sheet = workbook.worksheets.add(\"Sheet1\")`\n- `const workbook = await SpreadsheetFile.importXlsx(arrayBufferOrFileBlob)`\n- `const xlsx = await SpreadsheetFile.exportXlsx(workbook); await xlsx.save(\"output.xlsx\")`\n- `const inspect = await workbook.inspect({ kind: \"sheet\", include: \"id,name\", sheetId, range: \"A1:C10\" })`\n- `const help = workbook.help(\"worksheet.getRange\", { include: \"index,examples\" })`\n- `const trace = workbook.trace(\"Checks!F2\")` \u002F\u002F summarize before logging\n- Preferred: `const blob = await workbook.render({ sheetName: \"Sheet1\", autoCrop: \"all\", scale: 1, format: \"png\" })`\n- To get the bytes and\u002For save the blob to file:\n```js\nconst previewBytes = new Uint8Array(await preview.arrayBuffer());\nawait fs.writeFile(`${outputDir}\u002Fpreview.png`, previewBytes);\n```\n- `const workbook = await Workbook.fromCSV(csvText, { sheetName: \"Sheet1\" })`\n- `await workbook.fromCSV(csvText, { sheetName: \"ImportedData\" })`\n\n### Worksheet selection\u002Fcreation\n- `workbook.worksheets.add(name)`\n- `workbook.worksheets.getItem(name)`\n- `workbook.worksheets.getOrAdd(name, { renameFirstIfOnlyNewSpreadsheet: true })`\n- `workbook.worksheets.getItemAt(index)`\n- `workbook.worksheets.getActiveWorksheet()` (only after at least one sheet exists)\n\n### Worksheet operations\n- `sheet.getRange(\"A1:C10\")`, `sheet.getRangeByIndexes(startRow, startCol, rowCount, colCount)`, `sheet.getCell(row, col)`\n- `sheet.getUsedRange(valuesOnly?)`\n- `sheet.mergeCells(\"A1:C1\")`, `sheet.unmergeCells(\"A1:C1\")`\n- `sheet.freezePanes.freezeRows(1)`, `sheet.freezePanes.freezeColumns(2)`, `sheet.freezePanes.unfreeze()`\n- `sheet.tables`, `sheet.charts`, `sheet.sparklineGroups` (`sheet.sparklines` alias), `sheet.shapes`, `sheet.images`\n- `sheet.showGridLines = false`\n- `sheet.dataTables`, `sheet.conditionalFormattings`, `sheet.dataValidations`\n- `sheet.deleteAllDrawings()` removes charts, shapes, and images before a dashboard rebuild.\n\n### Range values\u002Fformulas\n- `const range = sheet.getRange(\"A1:C10\")`\n- `range.values = [[...], ...]` (2D matrix of values)\n- `range.formulas = [[\"=...\"], ...]`\n- `range.formulasR1C1 = [[\"=RC[-1]*2\"]]`\n- To read: `range.values` \u002F `range.formulas` \u002F `range.displayFormulas` \u002F `range.formulaInfos` (for spill\u002Farray formulas)\n- `range.write(matrixOrPayload)` (auto-sizes\u002Fspills from anchor as needed)\n- `range.writeValues(matrixOrRows)`\n- `range.fillDown()`, `range.fillRight()`\n  - `sheet.getRange(\"D2\").formulas = [[\"=...\"]]`\n  - `sheet.getRange(\"D2:D200\").fillDown()`\n- `range.clear({ applyTo: \"contents\" | \"formats\" | \"all\" })`\n- `range.copyFrom(sourceRange, \"values\" | \"formulas\" | \"all\")` source and destination must have the same shape\n- `range.copyTo(destRange, \"values\" | \"formulas\" | \"all\")`\n- `range.offset(...)`, `range.resize(...)`, `range.getCurrentRegion()`, `range.getRow(i)`, `range.getColumn(j)`\n- `range.getRangeByIndexes(...)`, `range.getCell(...)`\n- `range.merge()`, `range.merge(true)` to merge across, `range.unmerge()`\n\n### Formatting\n- `range.format` supports `fill`, `font`, `numberFormat`, `borders`, alignments, `wrapText`\n- `range.format.autofitColumns()`, `range.format.autofitRows()`\n- Excel unit sizing:  `range.format.columnWidth = 18`, `range.format.rowHeight = 24`\n- Pixel sizing: `range.format.columnWidthPx = 120`, `range.format.rowHeightPx = 24`\n- `range.setNumberFormat(\"yyyy-mm-dd\")`\n- `range.format.numberFormat = [[\"0\"], [\"0.00\"], [\"@\"]]`\n\n### Data Validation\n- `range.dataValidation = { rule: { type: \"list\", formula1: \"Categories!$A$2:$A$4\" } }`\n- `range.dataValidation = { rule: { type: \"list\", values: [\"Not Started\", \"In Progress\"] } }`\n- `sheet.dataValidations.add({ range: \"B2:B100\", rule: { type: \"whole\", operator: \"between\", formula1: 1, formula2: 10 } })`\n\n### Conditional formatting\n- Use `range.conditionalFormats.add(ruleType, ConditionalFormatConfig);`.\n- Use `range.conditionalFormats.add(ruleType, {operator, formula, format});`. Choose ruleType, operator, color, and style strings from the inline types below.\n```\ntype ConditionalFormatRuleType =\n  | \"cellIs\" | \"CellValue\" | \"Custom\" | \"expression\"\n  | \"colorScale\" | \"dataBar\" | \"iconSet\"\n  | \"containsText\" | \"notContainsText\" | \"beginsWith\" | \"endsWith\"\n  | \"containsBlanks\" | \"notContainsBlanks\" | \"containsErrors\" | \"notContainsErrors\"\n  | \"duplicateValues\" | \"uniqueValues\" | \"timePeriod\" | \"top10\" | \"aboveAverage\";\n\ntype CellIsOperator =\n  | \"greaterThan\"\n  | \"greaterThanOrEqual\"\n  | \"lessThan\"\n  | \"lessThanOrEqual\"\n  | \"equal\"\n  | \"notEqual\"\n  | \"between\"\n  | \"notBetween\";\n\ntype ConditionalFormatConfig =\n  | { operator: CellIsOperator; formula: string | number | Array\u003Cstring | number>; format?: DifferentialFormatConfig }\n  | { formula: string | number; format?: DifferentialFormatConfig }\n  | { colors?: ColorConfig[]; thresholds?: CfvoInput[] }\n  | { color?: ColorConfig; thresholds?: CfvoInput[]; gradient?: boolean }\n  | { iconSet: string; showValue?: boolean; reverse?: boolean; thresholds?: CfvoInput[] }\n  | { text: string; format?: DifferentialFormatConfig }\n  | { timePeriod: \"yesterday\" | \"today\" | \"tomorrow\" | \"last7Days\" | \"lastWeek\" | \"thisWeek\" | \"nextWeek\" | \"lastMonth\" | \"thisMonth\" | \"nextMonth\"; format?: DifferentialFormatConfig }\n  | { rank?: number; percent?: boolean; bottom?: boolean; format?: DifferentialFormatConfig }\n  | { aboveAverage?: boolean; equalAverage?: boolean; stdDev?: number; format?: DifferentialFormatConfig };\n\ntype DifferentialFormatConfig = {\n  fill?: FillConfig;\n  font?: { bold?: boolean; italic?: boolean; color?: ColorConfig };\n  border?: RangeBordersConfig;\n  numberFormat?: string;\n};\n\ntype CfvoInput =\n  | \"min\"\n  | \"max\"\n  | number\n  | `${number}%`\n  | { type: \"min\" | \"max\" | \"num\" | \"percent\" | \"percentile\"; value?: string | number };\n```\n- Rule types (`ConditionalFormatRuleType`): \"cellIs\" | \"CellValue\" | \"Custom\" | \"expression\"\n  | \"colorScale\" | \"dataBar\" | \"iconSet\"\n  | \"containsText\" | \"notContainsText\" | \"beginsWith\" | \"endsWith\"\n  | \"containsBlanks\" | \"notContainsBlanks\" | \"containsErrors\" | \"notContainsErrors\"\n  | \"duplicateValues\" | \"uniqueValues\" | \"timePeriod\" | \"top10\" | \"aboveAverage\";\n- Built-in `iconSet` names: `3Arrows`, `3Triangles`, `4Arrows`, `5Arrows`, `3ArrowsGray`, `4ArrowsGray`, `5ArrowsGray`, `3TrafficLights1`, `3Signs`, `4RedToBlack`, `3TrafficLights2`, `4TrafficLights`, `3Symbols`, `3Flags`, `3Symbols2`, `3Stars`, `5Quarters`, `5Boxes`, `4Rating`, `5Rating`.\n- Custom conditional formatting: `range.conditionalFormats.addCustom(expression, {fill, font, border});`\n- `range.conditionalFormats.deleteAll()` \u002F `range.conditionalFormats.clear()`\n\n```js\nconst grid = sheet.getRange(\"B2:J10\");\ngrid.conditionalFormats.add(\"colorScale\", {\n  criteria: [\n    { type: \"lowestValue\", color: \"#2563EB\" },\n    { type: \"percentile\", value: 50, color: \"#FDE047\" },\n    { type: \"highestValue\", color: \"#DC2626\" },\n  ],\n});\n```\n\n### Tables\n- When adding new tables, set explicit unique names (`TasksTable`, `SummaryTable`).\n- You cannot have multiple tables over the same range. Before adding a table on an existing\u002Fimported workbook, confirm the target range does not already overlap an existing table. Prefer the initial compact `inspect` summary over a separate tables-only scan when available.\n- `const table = sheet.tables.add(\"A1:H200\", true, \"TasksTable\")`\n- `table.rows.add(null, [[...], ...])`, `table.getDataRows()`, `table.getHeaderRowRange()`\n- Read tables: `sheet.tables.items` -> `Table[]`\n- Set + Getters: `table.name`, `table.style`, `table.style`, `table.showHeaders`\n- Toggles for table utilities (set\u002Fget): `table.showTotals`, `table.showBandedColumns = true`, `table.showFilterButton`\n- `table.delete()`\n\n### Images\n- `sheet.images.add({dataUrl: \"data:image\u002Fpng;base64,...\", anchor: {from: { row: 1, col: 2 }, extent: { widthPx: 160, heightPx: 120 }}})`\n```\n\n### Threaded Comments\nFollow this exact API when adding a note or comment:\n- Required: First, always first call set_self to create an author `workbook.comments.setSelf({\"displayName\": \"ChatGPT\"})`\n- Create a new thread with a single comment: `const thread = workbook.comments.addThread({\"cell\": sheet.getRange(\"E2\")}, \"Source: \u003Cwebsite>\")`\n- To reply to a threaded comment: `thread.addReply(\"This is a reply to the comment\")`\n- To resolve\u002Fre-open a thread: `thread.resolve()`, `thread.reopen()`\n\n### Charts\n- When adding or moving charts, do not cover existing data. Put charts in a reserved rectangle with blank gutter columns\u002Frows around the chart area.\n- Fast chart path, no help lookup needed for common line\u002Fbar\u002Fscatter charts: write a compact helper range with text categories and one column per series, then chart that range.\n- If chart data comes from editable\u002Fsource data, make the helper range formula-backed instead of copying literal values.\n```js\nsheet.getRange(\"F4:H7\").values = [\n  [\"Month\", \"Revenue\", \"EBITDA\"],\n  [\"Jan\", 100, 10],\n  [\"Feb\", 120, 18],\n  [\"Mar\", 130, 22],\n];\nconst chart = sheet.charts.add(\"line\", sheet.getRange(\"F4:H7\"));\nchart.setPosition(\"J4\", \"Q20\");\nchart.title = \"Revenue and EBITDA Trend\";\nchart.hasLegend = true;\nchart.xAxis = { axisType: \"textAxis\" };\nchart.yAxis = { numberFormatCode: \"$#,##0\" };\n```\n- Fast chart path from range: `const chart = sheet.charts.add(\"line\", sourceRange)` when the source range already has headers and text x-axis labels.\n- Advanced fallback only: avoid manual `chart.series.add(...)` and `chart.legend = {...}` on the first pass unless source-range chart creation does not work (for example, non-continuous data). Use a helper range chart first, then add optional chart styling only if the basic chart renders and exports cleanly.\n- If you want to set specific chart props after the helper-range path is not enough: `const chart = sheet.charts.add(\"bar\", chartProps)`, then checkpoint export before adding optional styling.\n- If using compat positioning, always set position: `chart.setPosition(\"F2\", \"M20\")`.\n- `sheet.charts.getItemOrNullObject(\"Chart 1\")`, `sheet.charts.deleteAll()`\n- To update x\u002Fy-axis, prefer compact config assignments such as `chart.xAxis = { axisType: \"textAxis\", tickLabelInterval: 2 }` and `chart.yAxis = { numberFormatCode: \"$#,##0\" }`. These help legibility and visibility.\n- For month\u002Fdate x-axes, prefer a chart helper range with text labels such as `Jan 2025` or `2025-01`. Do not rely on date axis number formats alone; rendered previews can show Excel serial numbers.\n- Chart types: `\"bar\" | \"line\" | \"area\" | \"pie\" | \"doughnut\" | \"scatter\" | \"bubble\" | \"radar\" | \"stock\" | \"treemap\" | \"sunburst\" | \"histogram\" | \"boxWhisker\" | \"waterfall\" | \"funnel\" | \"map\"`.\n\n### Sparklines\n```\nconst group = sheet.sparklineGroups.add({\n  type,\n  targetRange,\n  sourceData,\n  dateAxisRange,\n  seriesColor,\n  negativeColor,\n  markers,\n  axis,\n  lineWeight,\n  displayEmptyCellsAs,\n  displayHidden,\n});\n```\n- Sparkline type is a string. Empty-cell display mode and axis min\u002Fmax modes are proto enum numbers on the current facade; inspect nearby tests before setting them directly.\n- Sparkline Inline Type:\n```\ntype SparklineConfig = {\n  type: \"line\" | \"column\" | \"stacked\";\n  targetRange: Range | string;\n  sourceData: Range | string;\n  dateAxisRange?: Range | string;\n  lineWeight?: number;\n  displayHidden?: boolean;\n  seriesColor?: ColorConfig;\n  negativeColor?: ColorConfig;\n  axisColor?: ColorConfig;\n  markersColor?: ColorConfig;\n  firstMarkerColor?: ColorConfig;\n  lastMarkerColor?: ColorConfig;\n  highMarkerColor?: ColorConfig;\n  lowMarkerColor?: ColorConfig;\n  markers?: SparklineMarkersOptions;\n  axis?: SparklineAxisOptions;\n};\n\ntype SparklineMarkersOptions = {\n  show?: boolean;\n  high?: boolean;\n  low?: boolean;\n  first?: boolean;\n  last?: boolean;\n  negative?: boolean;\n};\n\ntype SparklineAxisOptions = {\n  showAxis?: boolean;\n  manualMin?: number;\n  manualMax?: number;\n  rightToLeft?: boolean;\n};\n```\n- Range Alias: `const group = targetRange.sparklines.add(type, sourceRange, sparklineConfig);`\n- Edit And Delete\n```\ngroup.seriesColor = colorConfig;\ngroup.markers = markerConfig;\ngroup.axis = axisConfig;\ngroup.delete();\nsheet.sparklineGroups.deleteAll();\n```\n\n### Help \u002F Grep\nUse `workbook.help(...)` primarily for obscure\u002Fadvanced surfaces (for example deep chart axis settings, unusual drawing configs, pivot APIs, or uncommon option schemas).\n- `workbook.help(\"enum.ShapeGeometry\", { include: \"index,notes\" }).ndjson`\n- `workbook.help(\"enum.*\", { search: \"ShapeGeometry|LineStyle\", include: \"index\" }).ndjson`\n- `workbook.help(\"shape.add\", { include: \"examples,notes\" }).ndjson`\n- `workbook.help(\"fx.RATE\", { include: \"index,examples,notes\" }).ndjson`\n- `workbook.help(\"cash flow return rate\", { search: \"IRR|XIRR|NPV|XNPV\", include: \"index,examples,notes\", maxChars: 4000 }).ndjson`\n- `workbook.help(\"*\", { search: \"fill|borders|autofit\", include: \"index,examples,notes\", maxChars: 6000 }).ndjson`\n\n\n### JavaScript example snippet (runnable)\n\n```js\nimport fs from \"node:fs\u002Fpromises\";\nimport { SpreadsheetFile, Workbook } from \"@oai\u002Fartifact-tool\";\n\nconst outputDir = \"output\";\nawait fs.mkdir(outputDir, { recursive: true });\n\nconst workbook = Workbook.create();\nconst sheet = workbook.worksheets.add(\"Summary\");\n\nsheet.getRange(\"A1:C4\").values = [\n  [\"Month\", \"Revenue\", \"EBITDA\"],\n  [\"Jan\", 100, 10],\n  [\"Feb\", 120, 18],\n  [\"Mar\", 130, 22],\n];\nsheet.getRange(\"D1\").values = [[\"Margin\"]];\nsheet.getRange(\"D2\").formulas = [[\"=C2\u002FB2\"]];\nsheet.getRange(\"D2:D4\").fillDown();\n\nsheet.getRange(\"A1:D1\").format = {\n  fill: \"#0F766E\",\n  font: { bold: true, color: \"#FFFFFF\" },\n};\nsheet.getRange(\"B2:C4\").format.numberFormat = \"$#,##0\";\nsheet.getRange(\"D2:D4\").format.numberFormat = \"0.0%\";\n\n\u002F\u002F Helper range links to source cells so edits update the chart.\nsheet.getRange(\"F1:G1\").values = [[\"Month\", \"Revenue\"]];\nsheet.getRange(\"F2:G2\").formulas = [[\"=A2\", \"=B2\"]];\nsheet.getRange(\"F2:G4\").fillDown();\nconst chart = sheet.charts.add(\"line\", sheet.getRange(\"F1:G4\"));\nchart.title = \"Revenue Trend\";\nchart.hasLegend = false;\nchart.xAxis = { axisType: \"textAxis\" };\nchart.yAxis = { numberFormatCode: \"$#,##0\" };\nchart.setPosition(\"I1\", \"P15\");\n\nconst preview = await workbook.render({\n  sheetName: \"Summary\",\n  autoCrop: \"all\",\n  scale: 1,\n  format: \"png\",\n});\nawait fs.writeFile(`${outputDir}\u002Fsummary.png`, new Uint8Array(await preview.arrayBuffer()));\n\nconst xlsx = await SpreadsheetFile.exportXlsx(workbook);\nawait xlsx.save(`${outputDir}\u002Fsummary.xlsx`);\n```\n","# Spreadsheets skill\n\nThis skill includes requirements and guidance for producing a correct, polished spreadsheet artifact quickly that completes the user's request. When producing spreadsheets or workbooks, you will be judged on layout, readability, style, adherence to industry norms\u002Fconventions and correctness. Follow the requirements below for how to use the APIs effectively and how to verify your output before finalizing work for the user.\n\nFor complex, analytical, financial or research involved tasks, you are especially judged on correctness and quality. You need to be professional. For these, always make sure you have a plan for how you're organizing the spreadsheet, and the data or visualizations within each sheet. For business, finance, operations, dashboard, and data-analysis prompts, aim for an output that can compete with a strong analyst-built workbook, not just a functional grid. A good default shape is an executive summary or dashboard first, then source\u002Fassumptions, then model\u002Fdetail sheets. For simpler tasks like a creating template or tracker, or things that do not require research, prioritize doing the spreadsheet build and edits quickly, while ensuring the user's request is fulfilled.\n\nFor additional stylistic best practices, follow: `style_guidelines.md`\n\nRead `charts.md` when creating or editing substantive charts, dashboards, or chart-ready summaries.\n\n# Tools + Contract\n- Use Codex workspace dependencies for spreadsheet artifact work: resolve them through the workspace dependency loader or runtime skill, then treat the returned Node\u002FPython runtimes, package directory, and verification details as authoritative. Do not use system `node`, system `python`, global npm packages, or repo-local installs.\n- Use `@oai\u002Fartifact-tool` JS library, which exists in the default Codex workspace dependencies node_modules, for authoring, editing, inspecting, rendering, and exporting spreadsheet `.xlsx` workbooks.\n- Run builders from a writable conversation-specific temp or workspace directory, not from the managed dependency directory. Outputs and scratch files may live under the OS temp directory.\n- Start by setting up the work directory to work with normal Node module resolution: link or junction local `node_modules` to the workspace dependency node_modules so `import \"@oai\u002Fartifact-tool\"` resolves.\n- Prefer one executable `.mjs` builder; patch and rerun it when iterating. Do NOT use shell heredocs or keep extra builder copies.\n- If workspace dependencies or `@oai\u002Fartifact-tool` are unavailable, report a setup blocker; do not guess paths, install packages, use system deps, alter module resolution, copy\u002Fimport bundled internals, or do a broad file system search.\n- Do not search package internals or dump prototypes to discover APIs. Use the API reference below; if blocked, run at most one exact `workbook.help(\"\u003Capi_or_feature>\")` query before building.\n- Final response: include a short user-visible summary and standalone Markdown link(s) only to final `.xlsx` artifact(s), one per line: `[Revenue Model - MNST.xlsx](\u002Fabsolute\u002Fpath\u002Fto\u002Frevenue_model_mnst.xlsx)`.\n- Do not mention internal tooling or support artifacts such as builders, rendered previews, JSON\u002FCSV\u002Flog files, or scratch files unless explicitly requested.\n- Do not use alternate workbook creation\u002Fediting libraries such as `openpyxl`, `xlsxwriter`, or `pandas.ExcelWriter` unless the user explicitly asks for a non-artifact-tool fallback.\n- For analysis outside workbook authoring, use JS or spreadsheet formulas when sufficient. If Python is needed, use bundled Python libraries, save JSON\u002FCSV intermediates, and have the JS builder create the workbook. Keep auditable\u002Fuser-editable calculations as formulas.\n- For nontrivial work, use `update_plan`: build quickly, verify\u002Frender, repair meaningful issues, then finalize without long polish loops. Incrementally rendering your work and assessing overall aesthetics, formatting and correctness along the way is very important (rigorously inspect the output and be confident in quality), but do not get stuck in a long render-verify loop. As part of your plan, think about the best practices and conventions to follow for the specific type of spreadsheet you're creating and the best way to structure the workbook for readability and usability.\n\n# Domain Requirements\nRead these domain templates only when the request clearly relates to the domain:\n- Finance, accounting, valuation, forecasting, budgeting, investing, operations metrics, investment banking, DCF, multi-statement models, sensitivity\u002Fscenario models, or source-backed financial filing analysis: `templates\u002Ffinancial_models.md`\n- Healthcare, clinical, patient, medical, hospital, staffing, care delivery, or healthcare administration workbooks: `templates\u002Fhealthcare.md`\n- Marketing, advertising, campaign, funnel, lead, CRM, growth, attribution, ROI, or web\u002Fad performance workbooks: `templates\u002Fmarketing_advertising.md`\n- Scientific research, experiments, lab measurements, surveys, statistical analysis, reproducibility, protocol, or raw\u002Fprocessed research data workbooks: `templates\u002Fscientific_research.md`\n\nRead all templates that clearly apply. Do not load domain templates for unrelated routine, lightweight, or basic formatting\u002Fediting tasks unless the user explicitly asks.\n\nOnly add Checks sheets for models where correctness depends on linked calculations, source reconciliation, or financial statement\u002Fmodel integrity.\n\n# General Rules\n- Start meaningful edits quickly; avoid long upfront API exploration.\n- Core APIs are listed in the API reference section below. Use them.\n- If these skill instructions are already loaded in context, do not spend a shell turn re-reading this `SKILL.md` from disk. Move directly to the prompt, attachments, and workbook build.\n- For workbook with multiple tabs\u002Fsheets, create\u002Fpopulate non-formula inputs\u002Ftables and sheets prior to populating cross-sheet formulas.\n\n## Approach for quickly building a new spreadsheet\n1. Setup: import `@oai\u002Fartifact-tool`, create workbook\u002Fsheets for new files.\n2. Build quickly: bulk-write headers\u002Fdata\u002Fformulas; then formatting\u002Fvalidation\u002Fconditional formatting; add charts\u002Ftables only when needed.\n3. Use additional focused calls if helpful for streamed progress.\n4. Near completion: inspect key ranges, scan formula errors, render all the sheets and verify, run a validation pass\n5. Export `.xlsx`\n\n## Making edits on a spreadsheet\nIf a user asks to edit or add to an existing spreadsheet:\n- For visual fix requests, start with the smallest plausible local change rather than applying sheet-wide autofit, wrapping, or restyling.\n- When making edits, ensure existing formulas and patterns are consistent. For example, if asked to add another column or row to a table and there is conditional formatting applied to the whole table, it should extend to the new column or rows as well.\n- If specific cells\u002Frows\u002Fcolumns are specified in prompt, limit edits to those ranges unless a broader change is clearly necessary. The exceptions are when other parts of the spreadsheet depend on them, e.g. if there's a dynamic chart that is based on the range of values in a table and a new row is added, the chart should include that new row. Another example is if conditional formatting was already set for a table from A1:C5, and you add a new column D, the conditional formatting should be updated (or deleted and re-created) to cover A1:D5.\n- For column resizing, avoid autofitting by default: instead, inspect only relevant data range, measure the longest text entry in that range, and set columnWidthPx to an estimated width based on text length (with a reasonable min\u002Fmax cap). Use autofit only when the user explicitly asks for it.\n\n## Handling queries and questions\n- The user may ask questions about the sheet instead of requesting an edit or a change. Simply answer those questions about the spreadsheet based on the context available rather than making an edit the user didn't intend for. You can use inspect to learn more or directly read values\u002Fformulas\u002Ftables etc via accessor methods.\n\n# Error Recovery\nOn first error:\n1. Read error text.\n2. Run one targeted `workbook.help(\"\u003Cexact_api>\")` query only if needed.\n3. Retry with minimal patch (not full rewrite).\n4. Continue from existing workbook state.\n\nDo not loop indefinitely on similar failures.\n\n# Quality Guidelines\n- Keep layout readable and bounded, contents visible:\n  - avoid extreme width\u002Fheight from unconstrained autofit\n  - cap oversized widths\u002Fheights after `autofit` + `wrap_text`\n- Prefer formula-driven logic over manual painted cells when logic is expected.\n- Derived values must be formulas (not hardcoded) and legible.\n- Use absolute\u002Frelative references correctly for fill\u002Fcopy behavior.\n- Do not use magic numbers in formulas; reference cells (e.g. `=H6*(1+$B$3)`).\n- Blank editable templates must look blank\u002Fneutral before user data is entered. Count, ranking, best\u002Fworst, IRR\u002FRATE\u002FXIRR, variance, and status formulas should guard on required input cells and return `\"\"`, `0`, or a clear \"No entries yet\" state as appropriate. Alternatively, prefill with a few rows of example data.\n- Include at least one visual summary for tracker\u002Fplanning requests when appropriate (KPI block, chart, dashboard area).\n- For dashboard, visualization, chart-ready analysis, budget\u002Freporting, trend, schedule\u002Ftimeline, and KPI prompts with plottable data, include at least one native Excel chart unless a verified export failure remains after simplifying the chart. Do not silently replace all charts with styled tables.\n- For presentation-ready analytical workbooks, plain range formatting alone is usually not enough. Prefer real Excel structures where useful: tables, freeze panes, filters, data validation, conditional formats, and at least one chart\u002FKPI\u002Fdashboard visual when the prompt implies summary analysis.\n- In rendered previews of dashboards and summary sheets, check financial values and row labels at normal zoom. Widen columns, adjust row heights, or move chart panels until important numbers and text are not clipped, awkwardly wrapped, or hidden.\n\n# Completion Criteria\nComplete only when:\n- Workbook content is populated and formulas compute.\n- No obvious formula errors in key scanned ranges (no bad refs\u002Foff-by-one\u002Fcircular errors).\n- `.xlsx` saved to `outputs\u002F\u003Cunique_thread_id>\u002F`.\n- Layout is organized, legible, and aligned to request style (or default formatting baseline).\n\n# Verification Rules\nBefore final response, verify values\u002Fformulas and visual quality.\n\n1. Inspect key ranges:\n```js\nconst check = await workbook.inspect({\n  kind: \"table\",\n  range: \"Dashboard!A1:H20\",\n  include: \"values,formulas\",\n  tableMaxRows: 20,\n  tableMaxCols: 12,\n});\nconsole.log(check.ndjson);\n```\n\nInspect targeting:\n- Prefer sheet-qualified ranges (`\"Sheet!A1:H20\"`) or `sheetId`.\n\n2. Scan formula errors:\n```js\nconst errors = await workbook.inspect({\n  kind: \"match\",\n  searchTerm: \"#REF!|#DIV\u002F0!|#VALUE!|#NAME\\\\?|#N\u002FA\",\n  options: { useRegex: true, maxResults: 300 },\n  summary: \"final formula error scan\",\n});\nconsole.log(errors.ndjson);\n```\n\n3. Render sheets\u002Franges to verify visual output (skip if already verified and no style changes):\n```js\nconst blob = await workbook.render({ sheetName: \"Sheet1\", range: \"A1:H20\", scale: 2 });\n```\nMake sure you do at least one visual pass of all the sheets in the workbook before the final export.\n\nVisual requirements:\n- Fix severe defects before finalizing: blank\u002Fbroken charts, clipped key headers or numbers, unreadable colors, obvious formula errors, default blank sheets, or content outside the visible working area.\n- Ensure logical labels or titles appear once, texts are all clearly visible, and merged ranges exist where labels or content intentionally span multiple columns.\n- Do one focused visual repair pass after the initial render. Do not spend additional passes on minor polish once the workbook is correct, legible, and exported; note any minor limitation briefly and finalize.\n\n4. Keep verification compact:\n- Inspect key ranges.\n- Avoid huge NDJSON dumps.\n\n5. Export:\n```js\nawait fs.mkdir(outputDir, { recursive: true });\nconst output = await SpreadsheetFile.exportXlsx(workbook);\nawait output.save(`${outputDir}\u002Foutput.xlsx`);\n```\n\n6. Finalize immediately after successful export + compact verification.\n- Do not export extra `.xlsx` variants unless asked.\n- Do not keep iterating on alternate designs once requirements are met, unless asked.\n\n# Source, PDF, and Attachment Processing\n- Use bundled runtime libraries for source extraction. For PDF or 10-K\u002F10-Q style inputs, read PDF via bundled Python `pypdf` when available, then use one small structured extraction script to collect all required facts into a dict\u002FJSON object. Avoid many ad hoc `rg`\u002F`sed` passes over the same text.\n- Keep source notes compact: record file name, section\u002Ftable label, and enough context to audit the number. Do not paste large PDF excerpts into the workbook unless requested.\n- Bundled Python libraries available for extraction\u002Fanalysis include `pandas`, `numpy`, `pypdf`, `python-docx`, and `reportlab`.\n- Bundled JS libraries available for document\u002FPDF work include `docx`, `pdf-lib`, and `pdfjs-dist`.\n\n# Using artifact_tool APIs (JavaScript)\n\n## Imports + Startup\n\nImport existing workbook only when needed:\n```js\nimport { FileBlob, SpreadsheetFile } from \"@oai\u002Fartifact-tool\";\n\nconst input = await FileBlob.load(\"path\u002Fto\u002Finput.xlsx\");\nconst workbook = await SpreadsheetFile.importXlsx(input);\n```\n\nImport CSV text directly when the source or intermediate data is CSV:\n```js\nimport fs from \"node:fs\u002Fpromises\";\nimport { Workbook } from \"@oai\u002Fartifact-tool\";\n\nconst csvText = await fs.readFile(\"path\u002Fto\u002Finput.csv\", \"utf8\");\nconst workbook = await Workbook.fromCSV(csvText, { sheetName: \"Sheet1\" });\n```\nPrefer `Workbook.fromCSV(...)` over hand-parsing CSV rows; clean or analyze CSV with Python\u002FNode first only when needed.\n\nCreate new workbook:\n```js\nimport fs from \"node:fs\u002Fpromises\";\nimport { SpreadsheetFile, Workbook } from \"@oai\u002Fartifact-tool\";\n\nconst workbook = Workbook.create();\nconst sheet = workbook.worksheets.add(\"Inputs\");\n```\n\nFinal export:\n```js\nawait fs.mkdir(outputDir, { recursive: true });\nconst output = await SpreadsheetFile.exportXlsx(workbook);\nawait output.save(`${outputDir}\u002Foutput.xlsx`);\n```\n\n## Build Patterns\n- Prefer block writes (`range.values`, `range.formulas`) over per-cell loops. Matrix shape must match the target range (for example `\"D4:M4\"` should be a 1x10 matrix, row x col).\n- Seed scalar formulas once, then `fillDown()` \u002F `fillRight()`. For dynamic-array formulas (`SEQUENCE`, `UNIQUE`, `FILTER`, `SORT`, `VSTACK`, `HSTACK`), write only the anchor cell and let the result spill after.\n- Use `range.displayFormulas` plus `range.formulaInfos` when you need to understand a spill child or a data-table output cell.\n- You do not need to call recalculate; calculation automatically happens.\n- Date handling:\n  - Prefer real `Date` objects for sortable\u002Fcharted\u002Fformula date columns.\n  - Apply date formats explicitly (for example `yyyy-mm-dd`).\n- Use JSON-serializable values for non-Date cells: `string | number | boolean | null`.\n- If a cell is intended to display literal text that begins with `=`, write it as a value prefixed with a single quote (for example `'=B2*C2`). This includes formula descriptions, validation examples, and labels; do not write these cells through `range.formulas`.\n- Create every worksheet referenced by formulas before writing any cross-sheet formulas.\n- When rebuilding dashboards, delete drawings first with `sheet.deleteAllDrawings()`. `range.clear()` does not remove charts, shapes, or images.\n- Verify with `await workbook.inspect(...)`; use `workbook.help(...)` only when the quick surface below is insufficient.\n- For formula audits or tracing how a formula is calculated, use `workbook.trace(\"Sheet!A1\")` on the key output\u002Fcheck cells. It takes only a cell reference and returns the full tree, so print a capped summary. Do not dump raw traces.\n\n## Conventions\n- Use camelCase API names and option keys.\n- Cell\u002Frange addressing: A1 notation (`sheet.getRange(\"A1:C10\")`).\n- Drawing anchors (`sheet.charts`, `sheet.shapes`, `sheet.images`): 0-based `{ row, col }`.\n- Drawing offsets\u002Fextents use pixels (`rowOffsetPx`, `colOffsetPx`, `widthPx`, `heightPx`).\n\n## API Discovery\n- Use this quick API surface first.\n- Use `workbook.help(...)` only when blocked by uncertainty.\n- For help queries, start with exact feature\u002Fpath lookups (`chart`, `worksheet.getRange`, `worksheet.freezePanes`, `range.dataValidation`, `chart.series.add`). If an exact path fails, one broader wildcard search is allowed.\n- Do not repeat semantically similar help queries.\n- If one help query returns 0 matches, reformulate once, then proceed best-effort.\n- `render` can be used to examine an existing workbook visually and for visual verifications.\n\n## Efficient Formula Lookup\n- If you know the function name, use exact lookup first: `workbook.help(\"fx.PMT\", { include: \"index,examples,notes\", maxChars: 3000 })`.\n- To browse a family, use `fx.*` with a category regex. Useful categories: `financial`, `math-trig`, `statistical`, `lookup-reference`, `logical`, `text`, `date-time`, `information`, `engineering`, `database`.\n- For intent-based lookup, use a short natural query plus a narrow `search` regex of likely functions.\n- Keep `maxChars` bounded; if results are noisy, narrow `search` rather than issuing many similar queries.\n\nUseful help calls:\n```js\nconsole.log(workbook.help(\"shape.add\", { include: \"examples,notes\" }).ndjson);\nconsole.log(\n  workbook.help(\"*\", {\n    search: \"fill|borders|autofit\",\n    include: \"index,examples,notes\",\n    maxChars: 6000,\n  }).ndjson,\n);\nconsole.log(workbook.help(\"fx.PMT\", { include: \"index,examples,notes\" }).ndjson);\nconsole.log(workbook.help(\"fx.*\", { search: \"financial\", include: \"index,examples\", maxChars: 4000 }).ndjson);\nconsole.log(workbook.help(\"fx.*\", { search: \"math-trig\", include: \"index,examples\", maxChars: 4000 }).ndjson);\nconsole.log(workbook.help(\"lookup with fallback\", { search: \"XLOOKUP|INDEX|MATCH|IFERROR\", include: \"index,examples,notes\", maxChars: 4000 }).ndjson);\n```\n\n## Reading existing\u002Fimported workbooks\n- On existing\u002Fimported workbooks, get a compact summary via `inspect` to understand what already exists and where.\n- Prefer `inspect(...)` for workbook understanding and discovery across broad areas.\n- Prefer direct getters like `range.formulas` when you already know the target range and need the exact rectangular formula matrix.\n- If formula locations are unknown, prefer `inspect({ kind: \"formula\", ... })` over reading `range.formulas` across a very large area.\n- Prefer to set `maxChars`, `tableMaxRows`, `tableMaxCols`, and\u002For `maxResults` to prevent large dumps of data.\n- For suspicious or high-impact outputs, use `workbook.trace(\"Sheet!A1\")` to audit the dependency tree from final output\u002Fcheck cell back to source cells. Trace output can be large, so summarize by depth\u002Fnode count before logging.\n\n### Inspect for workbook understanding\n- Compact summary:\n```js\nawait wb.inspect({\n  kind: \"workbook,sheet,table\",\n  maxChars: 6000,\n  tableMaxRows: 6,\n  tableMaxCols: 6,\n  tableMaxCellChars: 80,\n});\n```\n- Quick overview of sheet ids and names: `await wb.inspect({ kind: \"sheet\", include: \"id,name\" })`\n- Formula discovery in a targeted area: `await wb.inspect({ kind: \"formula\", sheetId: firstSheetName, range: \"A1:Z30\", maxChars: 2500, options: {maxResults:50} })`\n- Checking existing styles in a targeted area: `await wb.inspect({ kind: \"computedStyle\", sheetId: firstSheetName, range: \"A1:E10\", maxChars: 2500 })`\n- Common `kind` tokens: `workbook`, `sheet`, `table`, `region`, `match`, `formula`, `thread`, `computedStyle`, `definedName`, `drawing`\n- Inspects can also be used to zoom in on specific areas, especially for target edits:\n```js\nawait wb.inspect({\n  kind: \"region\",\n  sheetId: firstSheetName,\n  range: \"A1:Z30\",\n  maxChars: 2500,\n});\n```\n- Inspect output may include JSON records with `\"id\"` values (for example `\"ws\u002Fr5qsk5\"`), which you can resolve back to workbook objects with `wb.resolve(...)`:\n- `wb.resolve(\"ws\u002F...\")` -> worksheet\n- `wb.resolve(\"th\u002F...\")` -> comment thread\n\n## Additional feature-specific notes\n\n### Merging cells\n- Merging cells is useful for visual headers, title bands, note\u002Fsource blocks, and labels that span columns.\n- `range.merge()` merges the target range into one cell; `range.merge(true)` merges across each row in the target range.\n- `range.unmerge()` reverses a merge.\nFor example:\n```js\nconst range = sheet.getRange(\"I23:N24\");\nrange.merge();\nrange.values = [[\"Source note spanning the recommendation panel\"]];\n```\n\n## Common API Pitfalls\n- Do not set undocumented attributes on remote objects.\n- `Workbook.create()` starts with no sheets; add one before calling `getActiveWorksheet()`.\n- Use matrix sizes that match target ranges unless you intentionally spill.\n- Create every worksheet referenced by formulas before writing cross-sheet formulas.\n- Avoid full-column formula references such as `A:A`, `$A:$A`, or `Sheet!B:B`. Prefer bounded ranges sized to the editable table, e.g. `$A$6:$A$205`, especially inside `COUNTIFS`, `SUMIFS`, `INDEX`, and lookup formulas.\n- If export fails, checkpoint-export after major blocks to isolate the cause: base sheets, values\u002Fformulas, formatting, conditional formatting, tables, charts\u002Frendering.\n- If export fails after formatting or charts, simplify optional styling first: nested border configs, custom chart axis\u002Fseries mutations, broad autofit\u002Fformatting, then nonessential drawings.\n\n## Quick API Surface (High-Value + Common)\n\n### Core workbook\u002Ffile APIs\n- `import { FileBlob, SpreadsheetFile, Workbook } from \"@oai\u002Fartifact-tool\"`\n- `const workbook = Workbook.create(); const sheet = workbook.worksheets.add(\"Sheet1\")`\n- `const workbook = await SpreadsheetFile.importXlsx(arrayBufferOrFileBlob)`\n- `const xlsx = await SpreadsheetFile.exportXlsx(workbook); await xlsx.save(\"output.xlsx\")`\n- `const inspect = await workbook.inspect({ kind: \"sheet\", include: \"id,name\", sheetId, range: \"A1:C10\" })`\n- `const help = workbook.help(\"worksheet.getRange\", { include: \"index,examples\" })`\n- `const trace = workbook.trace(\"Checks!F2\")` \u002F\u002F summarize before logging\n- Preferred: `const blob = await workbook.render({ sheetName: \"Sheet1\", autoCrop: \"all\", scale: 1, format: \"png\" })`\n- To get the bytes and\u002For save the blob to file:\n```js\nconst previewBytes = new Uint8Array(await preview.arrayBuffer());\nawait fs.writeFile(`${outputDir}\u002Fpreview.png`, previewBytes);\n```\n- `const workbook = await Workbook.fromCSV(csvText, { sheetName: \"Sheet1\" })`\n- `await workbook.fromCSV(csvText, { sheetName: \"ImportedData\" })`\n\n### Worksheet selection\u002Fcreation\n- `workbook.worksheets.add(name)`\n- `workbook.worksheets.getItem(name)`\n- `workbook.worksheets.getOrAdd(name, { renameFirstIfOnlyNewSpreadsheet: true })`\n- `workbook.worksheets.getItemAt(index)`\n- `workbook.worksheets.getActiveWorksheet()` (only after at least one sheet exists)\n\n### Worksheet operations\n- `sheet.getRange(\"A1:C10\")`, `sheet.getRangeByIndexes(startRow, startCol, rowCount, colCount)`, `sheet.getCell(row, col)`\n- `sheet.getUsedRange(valuesOnly?)`\n- `sheet.mergeCells(\"A1:C1\")`, `sheet.unmergeCells(\"A1:C1\")`\n- `sheet.freezePanes.freezeRows(1)`, `sheet.freezePanes.freezeColumns(2)`, `sheet.freezePanes.unfreeze()`\n- `sheet.tables`, `sheet.charts`, `sheet.sparklineGroups` (`sheet.sparklines` alias), `sheet.shapes`, `sheet.images`\n- `sheet.showGridLines = false`\n- `sheet.dataTables`, `sheet.conditionalFormattings`, `sheet.dataValidations`\n- `sheet.deleteAllDrawings()` removes charts, shapes, and images before a dashboard rebuild.\n\n### Range values\u002Fformulas\n- `const range = sheet.getRange(\"A1:C10\")`\n- `range.values = [[...], ...]` (2D matrix of values)\n- `range.formulas = [[\"=...\"], ...]`\n- `range.formulasR1C1 = [[\"=RC[-1]*2\"]]`\n- To read: `range.values` \u002F `range.formulas` \u002F `range.displayFormulas` \u002F `range.formulaInfos` (for spill\u002Farray formulas)\n- `range.write(matrixOrPayload)` (auto-sizes\u002Fspills from anchor as needed)\n- `range.writeValues(matrixOrRows)`\n- `range.fillDown()`, `range.fillRight()`\n  - `sheet.getRange(\"D2\").formulas = [[\"=...\"]]`\n  - `sheet.getRange(\"D2:D200\").fillDown()`\n- `range.clear({ applyTo: \"contents\" | \"formats\" | \"all\" })`\n- `range.copyFrom(sourceRange, \"values\" | \"formulas\" | \"all\")` source and destination must have the same shape\n- `range.copyTo(destRange, \"values\" | \"formulas\" | \"all\")`\n- `range.offset(...)`, `range.resize(...)`, `range.getCurrentRegion()`, `range.getRow(i)`, `range.getColumn(j)`\n- `range.getRangeByIndexes(...)`, `range.getCell(...)`\n- `range.merge()`, `range.merge(true)` to merge across, `range.unmerge()`\n\n### Formatting\n- `range.format` supports `fill`, `font`, `numberFormat`, `borders`, alignments, `wrapText`\n- `range.format.autofitColumns()`, `range.format.autofitRows()`\n- Excel unit sizing:  `range.format.columnWidth = 18`, `range.format.rowHeight = 24`\n- Pixel sizing: `range.format.columnWidthPx = 120`, `range.format.rowHeightPx = 24`\n- `range.setNumberFormat(\"yyyy-mm-dd\")`\n- `range.format.numberFormat = [[\"0\"], [\"0.00\"], [\"@\"]]`\n\n### Data Validation\n- `range.dataValidation = { rule: { type: \"list\", formula1: \"Categories!$A$2:$A$4\" } }`\n- `range.dataValidation = { rule: { type: \"list\", values: [\"Not Started\", \"In Progress\"] } }`\n- `sheet.dataValidations.add({ range: \"B2:B100\", rule: { type: \"whole\", operator: \"between\", formula1: 1, formula2: 10 } })`\n\n### Conditional formatting\n- Use `range.conditionalFormats.add(ruleType, ConditionalFormatConfig);`.\n- Use `range.conditionalFormats.add(ruleType, {operator, formula, format});`. Choose ruleType, operator, color, and style strings from the inline types below.\n```\ntype ConditionalFormatRuleType =\n  | \"cellIs\" | \"CellValue\" | \"Custom\" | \"expression\"\n  | \"colorScale\" | \"dataBar\" | \"iconSet\"\n  | \"containsText\" | \"notContainsText\" | \"beginsWith\" | \"endsWith\"\n  | \"containsBlanks\" | \"notContainsBlanks\" | \"containsErrors\" | \"notContainsErrors\"\n  | \"duplicateValues\" | \"uniqueValues\" | \"timePeriod\" | \"top10\" | \"aboveAverage\";\n\ntype CellIsOperator =\n  | \"greaterThan\"\n  | \"greaterThanOrEqual\"\n  | \"lessThan\"\n  | \"lessThanOrEqual\"\n  | \"equal\"\n  | \"notEqual\"\n  | \"between\"\n  | \"notBetween\";\n\ntype ConditionalFormatConfig =\n  | { operator: CellIsOperator; formula: string | number | Array\u003Cstring | number>; format?: DifferentialFormatConfig }\n  | { formula: string | number; format?: DifferentialFormatConfig }\n  | { colors?: ColorConfig[]; thresholds?: CfvoInput[] }\n  | { color?: ColorConfig; thresholds?: CfvoInput[]; gradient?: boolean }\n  | { iconSet: string; showValue?: boolean; reverse?: boolean; thresholds?: CfvoInput[] }\n  | { text: string; format?: DifferentialFormatConfig }\n  | { timePeriod: \"yesterday\" | \"today\" | \"tomorrow\" | \"last7Days\" | \"lastWeek\" | \"thisWeek\" | \"nextWeek\" | \"lastMonth\" | \"thisMonth\" | \"nextMonth\"; format?: DifferentialFormatConfig }\n  | { rank?: number; percent?: boolean; bottom?: boolean; format?: DifferentialFormatConfig }\n  | { aboveAverage?: boolean; equalAverage?: boolean; stdDev?: number; format?: DifferentialFormatConfig };\n\ntype DifferentialFormatConfig = {\n  fill?: FillConfig;\n  font?: { bold?: boolean; italic?: boolean; color?: ColorConfig };\n  border?: RangeBordersConfig;\n  numberFormat?: string;\n};\n\ntype CfvoInput =\n  | \"min\"\n  | \"max\"\n  | number\n  | `${number}%`\n  | { type: \"min\" | \"max\" | \"num\" | \"percent\" | \"percentile\"; value?: string | number };\n```\n- Rule types (`ConditionalFormatRuleType`): \"cellIs\" | \"CellValue\" | \"Custom\" | \"expression\"\n  | \"colorScale\" | \"dataBar\" | \"iconSet\"\n  | \"containsText\" | \"notContainsText\" | \"beginsWith\" | \"endsWith\"\n  | \"containsBlanks\" | \"notContainsBlanks\" | \"containsErrors\" | \"notContainsErrors\"\n  | \"duplicateValues\" | \"uniqueValues\" | \"timePeriod\" | \"top10\" | \"aboveAverage\";\n- Built-in `iconSet` names: `3Arrows`, `3Triangles`, `4Arrows`, `5Arrows`, `3ArrowsGray`, `4ArrowsGray`, `5ArrowsGray`, `3TrafficLights1`, `3Signs`, `4RedToBlack`, `3TrafficLights2`, `4TrafficLights`, `3Symbols`, `3Flags`, `3Symbols2`, `3Stars`, `5Quarters`, `5Boxes`, `4Rating`, `5Rating`.\n- Custom conditional formatting: `range.conditionalFormats.addCustom(expression, {fill, font, border});`\n- `range.conditionalFormats.deleteAll()` \u002F `range.conditionalFormats.clear()`\n\n```js\nconst grid = sheet.getRange(\"B2:J10\");\ngrid.conditionalFormats.add(\"colorScale\", {\n  criteria: [\n    { type: \"lowestValue\", color: \"#2563EB\" },\n    { type: \"percentile\", value: 50, color: \"#FDE047\" },\n    { type: \"highestValue\", color: \"#DC2626\" },\n  ],\n});\n```\n\n### Tables\n- When adding new tables, set explicit unique names (`TasksTable`, `SummaryTable`).\n- You cannot have multiple tables over the same range. Before adding a table on an existing\u002Fimported workbook, confirm the target range does not already overlap an existing table. Prefer the initial compact `inspect` summary over a separate tables-only scan when available.\n- `const table = sheet.tables.add(\"A1:H200\", true, \"TasksTable\")`\n- `table.rows.add(null, [[...], ...])`, `table.getDataRows()`, `table.getHeaderRowRange()`\n- Read tables: `sheet.tables.items` -> `Table[]`\n- Set + Getters: `table.name`, `table.style`, `table.style`, `table.showHeaders`\n- Toggles for table utilities (set\u002Fget): `table.showTotals`, `table.showBandedColumns = true`, `table.showFilterButton`\n- `table.delete()`\n\n### Images\n- `sheet.images.add({dataUrl: \"data:image\u002Fpng;base64,...\", anchor: {from: { row: 1, col: 2 }, extent: { widthPx: 160, heightPx: 120 }}})`\n```\n\n### Threaded Comments\nFollow this exact API when adding a note or comment:\n- Required: First, always first call set_self to create an author `workbook.comments.setSelf({\"displayName\": \"ChatGPT\"})`\n- Create a new thread with a single comment: `const thread = workbook.comments.addThread({\"cell\": sheet.getRange(\"E2\")}, \"Source: \u003Cwebsite>\")`\n- To reply to a threaded comment: `thread.addReply(\"This is a reply to the comment\")`\n- To resolve\u002Fre-open a thread: `thread.resolve()`, `thread.reopen()`\n\n### Charts\n- When adding or moving charts, do not cover existing data. Put charts in a reserved rectangle with blank gutter columns\u002Frows around the chart area.\n- Fast chart path, no help lookup needed for common line\u002Fbar\u002Fscatter charts: write a compact helper range with text categories and one column per series, then chart that range.\n- If chart data comes from editable\u002Fsource data, make the helper range formula-backed instead of copying literal values.\n```js\nsheet.getRange(\"F4:H7\").values = [\n  [\"Month\", \"Revenue\", \"EBITDA\"],\n  [\"Jan\", 100, 10],\n  [\"Feb\", 120, 18],\n  [\"Mar\", 130, 22],\n];\nconst chart = sheet.charts.add(\"line\", sheet.getRange(\"F4:H7\"));\nchart.setPosition(\"J4\", \"Q20\");\nchart.title = \"Revenue and EBITDA Trend\";\nchart.hasLegend = true;\nchart.xAxis = { axisType: \"textAxis\" };\nchart.yAxis = { numberFormatCode: \"$#,##0\" };\n```\n- Fast chart path from range: `const chart = sheet.charts.add(\"line\", sourceRange)` when the source range already has headers and text x-axis labels.\n- Advanced fallback only: avoid manual `chart.series.add(...)` and `chart.legend = {...}` on the first pass unless source-range chart creation does not work (for example, non-continuous data). Use a helper range chart first, then add optional chart styling only if the basic chart renders and exports cleanly.\n- If you want to set specific chart props after the helper-range path is not enough: `const chart = sheet.charts.add(\"bar\", chartProps)`, then checkpoint export before adding optional styling.\n- If using compat positioning, always set position: `chart.setPosition(\"F2\", \"M20\")`.\n- `sheet.charts.getItemOrNullObject(\"Chart 1\")`, `sheet.charts.deleteAll()`\n- To update x\u002Fy-axis, prefer compact config assignments such as `chart.xAxis = { axisType: \"textAxis\", tickLabelInterval: 2 }` and `chart.yAxis = { numberFormatCode: \"$#,##0\" }`. These help legibility and visibility.\n- For month\u002Fdate x-axes, prefer a chart helper range with text labels such as `Jan 2025` or `2025-01`. Do not rely on date axis number formats alone; rendered previews can show Excel serial numbers.\n- Chart types: `\"bar\" | \"line\" | \"area\" | \"pie\" | \"doughnut\" | \"scatter\" | \"bubble\" | \"radar\" | \"stock\" | \"treemap\" | \"sunburst\" | \"histogram\" | \"boxWhisker\" | \"waterfall\" | \"funnel\" | \"map\"`.\n\n### Sparklines\n```\nconst group = sheet.sparklineGroups.add({\n  type,\n  targetRange,\n  sourceData,\n  dateAxisRange,\n  seriesColor,\n  negativeColor,\n  markers,\n  axis,\n  lineWeight,\n  displayEmptyCellsAs,\n  displayHidden,\n});\n```\n- Sparkline type is a string. Empty-cell display mode and axis min\u002Fmax modes are proto enum numbers on the current facade; inspect nearby tests before setting them directly.\n- Sparkline Inline Type:\n```\ntype SparklineConfig = {\n  type: \"line\" | \"column\" | \"stacked\";\n  targetRange: Range | string;\n  sourceData: Range | string;\n  dateAxisRange?: Range | string;\n  lineWeight?: number;\n  displayHidden?: boolean;\n  seriesColor?: ColorConfig;\n  negativeColor?: ColorConfig;\n  axisColor?: ColorConfig;\n  markersColor?: ColorConfig;\n  firstMarkerColor?: ColorConfig;\n  lastMarkerColor?: ColorConfig;\n  highMarkerColor?: ColorConfig;\n  lowMarkerColor?: ColorConfig;\n  markers?: SparklineMarkersOptions;\n  axis?: SparklineAxisOptions;\n};\n\ntype SparklineMarkersOptions = {\n  show?: boolean;\n  high?: boolean;\n  low?: boolean;\n  first?: boolean;\n  last?: boolean;\n  negative?: boolean;\n};\n\ntype SparklineAxisOptions = {\n  showAxis?: boolean;\n  manualMin?: number;\n  manualMax?: number;\n  rightToLeft?: boolean;\n};\n```\n- Range Alias: `const group = targetRange.sparklines.add(type, sourceRange, sparklineConfig);`\n- Edit And Delete\n```\ngroup.seriesColor = colorConfig;\ngroup.markers = markerConfig;\ngroup.axis = axisConfig;\ngroup.delete();\nsheet.sparklineGroups.deleteAll();\n```\n\n### Help \u002F Grep\nUse `workbook.help(...)` primarily for obscure\u002Fadvanced surfaces (for example deep chart axis settings, unusual drawing configs, pivot APIs, or uncommon option schemas).\n- `workbook.help(\"enum.ShapeGeometry\", { include: \"index,notes\" }).ndjson`\n- `workbook.help(\"enum.*\", { search: \"ShapeGeometry|LineStyle\", include: \"index\" }).ndjson`\n- `workbook.help(\"shape.add\", { include: \"examples,notes\" }).ndjson`\n- `workbook.help(\"fx.RATE\", { include: \"index,examples,notes\" }).ndjson`\n- `workbook.help(\"cash flow return rate\", { search: \"IRR|XIRR|NPV|XNPV\", include: \"index,examples,notes\", maxChars: 4000 }).ndjson`\n- `workbook.help(\"*\", { search: \"fill|borders|autofit\", include: \"index,examples,notes\", maxChars: 6000 }).ndjson`\n\n\n### JavaScript example snippet (runnable)\n\n```js\nimport fs from \"node:fs\u002Fpromises\";\nimport { SpreadsheetFile, Workbook } from \"@oai\u002Fartifact-tool\";\n\nconst outputDir = \"output\";\nawait fs.mkdir(outputDir, { recursive: true });\n\nconst workbook = Workbook.create();\nconst sheet = workbook.worksheets.add(\"Summary\");\n\nsheet.getRange(\"A1:C4\").values = [\n  [\"Month\", \"Revenue\", \"EBITDA\"],\n  [\"Jan\", 100, 10],\n  [\"Feb\", 120, 18],\n  [\"Mar\", 130, 22],\n];\nsheet.getRange(\"D1\").values = [[\"Margin\"]];\nsheet.getRange(\"D2\").formulas = [[\"=C2\u002FB2\"]];\nsheet.getRange(\"D2:D4\").fillDown();\n\nsheet.getRange(\"A1:D1\").format = {\n  fill: \"#0F766E\",\n  font: { bold: true, color: \"#FFFFFF\" },\n};\nsheet.getRange(\"B2:C4\").format.numberFormat = \"$#,##0\";\nsheet.getRange(\"D2:D4\").format.numberFormat = \"0.0%\";\n\n\u002F\u002F Helper range links to source cells so edits update the chart.\nsheet.getRange(\"F1:G1\").values = [[\"Month\", \"Revenue\"]];\nsheet.getRange(\"F2:G2\").formulas = [[\"=A2\", \"=B2\"]];\nsheet.getRange(\"F2:G4\").fillDown();\nconst chart = sheet.charts.add(\"line\", sheet.getRange(\"F1:G4\"));\nchart.title = \"Revenue Trend\";\nchart.hasLegend = false;\nchart.xAxis = { axisType: \"textAxis\" };\nchart.yAxis = { numberFormatCode: \"$#,##0\" };\nchart.setPosition(\"I1\", \"P15\");\n\nconst preview = await workbook.render({\n  sheetName: \"Summary\",\n  autoCrop: \"all\",\n  scale: 1,\n  format: \"png\",\n});\nawait fs.writeFile(`${outputDir}\u002Fsummary.png`, new Uint8Array(await preview.arrayBuffer()));\n\nconst xlsx = await SpreadsheetFile.exportXlsx(workbook);\nawait xlsx.save(`${outputDir}\u002Fsummary.xlsx`);\n```\n",{"name":5,"description":7},"main","92c2f40ebfad0c0aa3cc1faa89ffd6b23f9e8d1b","official-openai\u002Fopenai-local-primary-spreadsheets-spreadsheets","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill","https:\u002F\u002Fsd-skill.vercel.app","https:\u002F\u002Fgithub.com\u002Frealsudarshan","sudarshandhakal.com.np","Innvotative","2026-11-12 23:03:50",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add realsudarshan\u002FSD-skill --skill Spreadsheets",{"tool":39,"command":40},"bunx","bunx skills add realsudarshan\u002FSD-skill --skill Spreadsheets",{"tool":42,"command":43},"pnpm","pnpm dlx skills add realsudarshan\u002FSD-skill --skill Spreadsheets","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-primary-spreadsheets-spreadsheets\u002FSKILL.md",true,[47,53,59,63,67,71,75,79],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"agents\u002Fopenai.yaml","REFERENCE","参考文档",350,"https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-primary-spreadsheets-spreadsheets\u002Fagents\u002Fopenai.yaml",{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"assets\u002Ffile-spreadsheet.png","ASSET","资产文件",21001,"https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-primary-spreadsheets-spreadsheets\u002Fassets\u002Ffile-spreadsheet.png",{"path":60,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":61,"sourceHtmlUrl":62},"charts.md",3812,"https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-primary-spreadsheets-spreadsheets\u002Fcharts.md",{"path":64,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":65,"sourceHtmlUrl":66},"style_guidelines.md",9300,"https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-primary-spreadsheets-spreadsheets\u002Fstyle_guidelines.md",{"path":68,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":69,"sourceHtmlUrl":70},"templates\u002Ffinancial_models.md",13963,"https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-primary-spreadsheets-spreadsheets\u002Ftemplates\u002Ffinancial_models.md",{"path":72,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":73,"sourceHtmlUrl":74},"templates\u002Fhealthcare.md",4073,"https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-primary-spreadsheets-spreadsheets\u002Ftemplates\u002Fhealthcare.md",{"path":76,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":77,"sourceHtmlUrl":78},"templates\u002Fmarketing_advertising.md",3675,"https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-primary-spreadsheets-spreadsheets\u002Ftemplates\u002Fmarketing_advertising.md",{"path":80,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":81,"sourceHtmlUrl":82},"templates\u002Fscientific_research.md",2528,"https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-primary-spreadsheets-spreadsheets\u002Ftemplates\u002Fscientific_research.md",[84,93,101,109,117,125],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7CW5Y6EPMPMNDWE4EN2GXRX","winui-app","Bootstrap, develop, and design modern WinUI 3 desktop applications with C# and the Windows App SDK using official Microsoft guidance, WinUI Gallery patterns, Windows App SDK samples, and CommunityToolkit components. Use when creating a brand new app, preparing a machine for WinUI, reviewing, refactoring, planning, troubleshooting, environment-checking, or setting up WinUI 3 XAML, controls, navigation, windowing, theming, accessibility, responsiveness, performance, deployment, or related Windows app design and development work.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fwinui-app\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fwinui-app\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":97,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7CW5RWFX7616ENEG573VFWG","vercel-deploy","Deploy applications and websites to Vercel. Use when the user requests deployment actions like \"deploy my app\", \"deploy and give me the link\", \"push this live\", or \"create a preview deployment\".","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fvercel-deploy\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fvercel-deploy\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":105,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":19},"01M7CW5M4VZHQPWG764X1W0S3B","security-best-practices","Perform language and framework specific security best-practice reviews and suggest improvements. Trigger only when the user explicitly requests security best practices guidance, a security review\u002Freport, or secure-by-default coding help. Trigger only for supported languages (python, javascript\u002Ftypescript, go). Do not trigger for general code review, debugging, or non-security tasks.","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fsecurity-best-practices\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fsecurity-best-practices\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":113,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":19},"01M7CW5EBTWA7PQ54HYFT1YW39","playwright","Use when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) via `playwright-cli` or the bundled wrapper script.","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fplaywright\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fplaywright\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":121,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M7CW4DA7SZ4D9JMR3P7VJVM0","openai-docs","Use when the user asks how to build with OpenAI products or APIs and needs up-to-date official documentation with citations, help choosing the latest model for a use case, or model upgrade and prompt-upgrade guidance; prioritize OpenAI docs MCP tools, use bundled references only as helper context, and restrict any fallback browsing to official OpenAI domains.","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fopenai-docs\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fopenai-docs\u002FSKILL.md",[],[],{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":129,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":19},"01M7CW3EHY7X60KB9SYEMRD3YR","netlify-deploy","Deploy web projects to Netlify using the Netlify CLI (`npx netlify`). Use when the user asks to deploy, host, publish, or link a site\u002Frepo on Netlify, including preview and production deploys.","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fnetlify-deploy\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fnetlify-deploy\u002FSKILL.md",[],[]]