Spreadsheets

From lightspeedwp/.github · View interactive version

Spreadsheets is an AI agent skill from the GitHub repository lightspeedwp/.github. Use this skill when a user requests to create or modify or work with spreadsheets (.xlsx, .xls) to do any of the following: - Create a new workbook/sheet with proper formulas, cell/number formatting, and structured layout - Read or analyze tabular data (filter, aggregate, pivot, compute metrics) dir

How to use this skill

Skill file

Primary Goal

Tools + Contract

Required Imports + Startup

Assume artifact_tool exists and is installed. Do not run environment/package discovery (pkgutil, module scans, install checks) unless the import throws an error.

Import existing workbook only when needed (user-uploaded/edit-in-place or intentional reload):

from artifact_tool import Blob, SpreadsheetFile
wb = SpreadsheetFile.import_xlsx(Blob.load("/mnt/data/input.xlsx"))

Create new workbook:

from artifact_tool import Workbook, SpreadsheetFile
wb = Workbook.create()
sheet = wb.worksheets.add("Inputs")

Continuous Notebook Strategy

Latency Guardrails (High Priority)

Fast Path (Default)

  1. Setup: import artifact_tool, create workbook/sheets for new files.
  2. Build quickly: bulk-write headers/data/formulas; then formatting/validation/conditional formatting; add charts/tables only when needed.
  3. Use additional focused calls if helpful for streamed progress.
  4. Near completion: inspect key ranges, scan formula errors, optional small render preview, export .xlsx.

Error Recovery

On first error:

  1. Read error text.
  2. Run one targeted workbook.help("<exact_api>") query only if needed.
  3. Retry with minimal patch (not full rewrite).
  4. Continue from existing workbook state.

Do not loop indefinitely on similar failures.

Quality Floor (Do Not Skip)

Speed matters, but output quality must meet baseline.

Formatting Baseline

Citation Requirements

Cite sources inside the spreadsheet

Completion Criteria

Complete only when:

Verification Rules

Before final response, verify values/formulas and visual quality.

  1. Inspect key ranges:
check = wb.inspect({
  "kind": "table",
  "range": "Dashboard!A1:H20",
  "include": "values,formulas",
  "table_max_rows": 20,
  "table_max_cols": 12,
})
print(check.ndjson)

Inspect targeting:

  1. Scan formula errors:
errors = wb.inspect({
  "kind": "match",
  "search_term": "#REF!|#DIV/0!|#VALUE!|#NAME\\?|#N/A",
  "options": {"use_regex": True, "max_results": 300},
  "summary": "final formula error scan",
})
print(errors.ndjson)
  1. Render sheets/ranges to verify visual output (skip if already verified and no style changes):
blob = wb.render({"sheet_name": "Sheet1", "range": "A1:H20", "scale": 2})

If render is last line in Python call, image can be shown directly.

  1. Keep verification compact:
  1. Export:
SpreadsheetFile.export_xlsx(wb).save("/mnt/data/output.xlsx")
  1. Finalize immediately after successful export + compact verification.

Additional Instructions

Only when a request relates to any of the following, read the following templates instructions as well:

Have questions? Ping us on GitHub! 🐙 Made with 💚 by LightSpeedWP

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.