google-sheets

Create, read, edit, and format Google Sheets through the gws CLI.

Updated Mar 29, 2024
One-click install
npx skills add https://github.com/petobens/ai-harness --skill google-sheets-petobens
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-sheets
Source: https://github.com/petobens/ai-harness/tree/main/skills/google-sheets
Command: npx skills add https://github.com/petobens/ai-harness --skill google-sheets-petobens

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gws, and includes references (resource) components.

What problem does it solve? Building and maintaining polished Google Sheets by hand is slow and error-prone, especially when formulas, formatting conventions, and structural edits must stay consistent across tabs. This Skill gives an AI agent the operational rules, formula standards, and gws command recipes needed to create, inspect, edit, and audit spreadsheets reliably. ## Core Features & Use Cases - Full spreadsheet lifecycle: Create, read, update, append, clear, and structurally edit sheets via gws, including batchUpdate operations for merges, named ranges, conditional formatting, and dimension changes. - Formula discipline: Enforces auditable formula practices such as native functions, SUBTOTAL for filterable totals, named ranges for parameters, LET for readability, and a single calculation engine per metric. - Formatting conventions: Applies a documented color palette, number formats, alignment, row hierarchy, workbook architecture, and README tab layout so output matches professional spreadsheet standards. - Use Case: Ask the agent to build a financial model workbook with a Params tab, source data, scenario comparisons, and a README, then have it verify totals, formulas, and formatting after every edit. ## Quick Start Ask the agent to create a Google Sheet with a revenue model including input parameters, monthly projections, and a formatted summary tab using gws.

Frequently Asked Questions about google-sheets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create and edit a Google Sheet from the command line?

Use the gws CLI to call the Sheets API directly: create files with gws drive files create, write values with spreadsheets values update, and apply formatting or structural changes through spreadsheets batchUpdate. The gws-recipes reference documents each command pattern.

How do I read both formulas and displayed values from a Google Sheet?

Use spreadsheets values batchGet with valueRenderOption set to FORMULA to see underlying formulas, and FORMATTED_VALUE to see displayed results. Batch multiple ranges into one call instead of running parallel reads, which can race on auth token refresh.

Can gws apply formatting like colors, merges, and named ranges?

Yes, formatting requires spreadsheets batchUpdate with requests such as updateCells, repeatCell, mergeCells, and addNamedRange. Value endpoints only write cell contents, so anything visual or structural must go through batchUpdate with narrow fields masks.

Why did my Google Sheets fill colors change slightly after a structural edit?

Operations like moveDimension, insertDimension, or sheet renames cause Sheets to re-quantize stored fills by up to one 8-bit step per channel, so #b7b7b7 may read back as #b6b6b6. Match colors to the nearest palette entry within a tolerance of about 2/255 per channel instead of rewriting them.

What should I check after making structural edits to a spreadsheet?

Re-read the edited ranges in both formula and displayed-value modes, then compare merges, named ranges, conditional formatting, data validation, hyperlinks, row heights, and column widths. Also inspect shifted dependents and blank cells across the full used extent for inherited-format issues.