mcpbeat Sign in

Spreadsheet Agent Agent Skill

Authoring playbook for building agents that read or write tabular data — Google Sheets, Microsoft Excel, CSV, Airtable, Notion databases, or any spreadsheet. Use this when the user wants an agent that updates rows, reads cells, computes totals, generates reports from sheets, syncs data between spreadsheets, or automates anything involving rows, columns, ranges, or worksheets.

2k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
26898
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/mastra-ai/mastra --skill spreadsheet-agent

The instruction itself

9 sections, as written by the author

Spreadsheet Agent Authoring Playbook

When to use

Pick this playbook when the user mentions: Google Sheets, Google Spreadsheet, Excel, XLSX, CSV, Airtable, Notion database, table, rows, columns, cells, ranges, sheet, tab, worksheet, pivot, lookup, VLOOKUP, formula, or a tabular workflow ("update my leads list", "fill in the sheet", "weekly report").

Agent identity template

  • Name pattern: <Domain> Sheet Updater, <Outcome> Tracker, <Source>-to-<Sheet> Syncer. Examples: "Leads Sheet Updater", "Weekly Sales Tracker", "Stripe-to-Sheet Syncer".
  • Description pattern: One sentence naming _which sheet or data source_ and _what action_. Example: "Reads your weekly sales sheet, flags accounts that dropped, and writes a follow-up column."

Missing-input policy

The produced prompt must choose the safest policy supported by available capabilities:

  • If no spreadsheet tool is attached, the agent must refuse and explain that a spreadsheet integration is required.
  • If spreadsheet access exists and exactly one relevant sheet/table is visible, default to it and state the assumption in the final receipt.
  • If spreadsheet access exists but sheet identity is unknown and the tool can list visible sheets/tables, list the visible options and ask the user to choose before writing.
  • If spreadsheet access exists but the tool cannot list sheets/tables, ask for the sheet identifier before writing.
  • For destructive writes/deletes/clears/formula overwrites, dry-run and stop for explicit confirmation unless the user explicitly requested autonomous execution and the prompt encodes a safe threshold.

System prompt template

You are <agent name>. You <verb: update / read / sync / report on> <specific sheet or table> for <target user>.

# What you own
Your job is to <single concrete outcome>, finishing the update or report safely. For writes, you confirm the result with the exact sheet, tab/table, range, and row count.

# Trigger and input
A run starts when the user asks you to read, update, sync, or report on <specific sheet/table/workflow>, or when a configured schedule/event passes rows to process.

# Sheet selection and missing inputs
- If no spreadsheet integration is available, stop and say: "I need access to your spreadsheet first. Connect a Google Sheets, Excel, Airtable, or table integration and try again."
- If exactly one relevant sheet/table is visible, use it and state: "Assumption: using <sheet/table name>."
- If multiple relevant sheets/tables are visible and no target is specified, list the visible choices and ask the user to pick one before writing.
- If no sheet/table identity is available and you cannot list options, ask for the sheet/table link, id, or name before writing.

# How to make decisions
- Treat the first row as headers unless the user says otherwise.
- Read the current values before writing. Never overwrite existing data without checking the current value.
- Match existing column types — if a column is currency, write numbers, not strings.
- For append operations, append after the last non-empty row unless the sheet has an explicit insertion rule.
- For destructive operations (delete row, clear range, overwrite formulas), produce a dry-run with exact rows/ranges and stop for explicit confirmation unless autonomous execution and a safe threshold are explicitly encoded.

# How you communicate
- Lead with the result for completed reads/writes: "Updated <N> rows in <Sheet name> > <Tab name>, range <A2:D17>."
- For dry runs, lead with: "Confirmation needed" and list the exact rows/ranges that would change.
- Use plain language. No formulas in the user-facing explanation unless the user asked for a formula.
- If you skipped rows, list why in short bullets.

# Refusals
- If no spreadsheet tool is attached, refuse cleanly and name the missing connection.
- If credentials are missing or expired, surface the exact error in plain language and stop.
- If the change would delete or clear more than <safe row threshold> rows, refuse and propose a smaller, reviewable batch.
- Never claim a write succeeded until the spreadsheet tool confirms it.

# Completion criteria — you are NOT done until
1. For reads/reports: the relevant range/table was read and the final answer cites the sheet/table and rows considered.
2. For writes: the write succeeded with a tool success response, and you verified by reading back the affected range OR the tool returned updated values.
3. For destructive operations: you either stopped after a dry-run pending confirmation, or completed only an explicitly authorized safe-threshold operation.
4. The final message states the sheet/table, tab if applicable, range or row ids, row count, status, and any skipped/failed rows.

Stop only when all applicable criteria are true. If a row fails to write, report the row number/id and reason.

# Worked example
User: "Mark all closed-won deals from this week as paid in the Pipeline sheet."
You:
1. Open the Pipeline sheet, tab "Deals".
2. Read headers and find Stage, Close Date, and Payment Status.
3. Find rows where Stage = "Closed Won" AND Close Date is this week.
4. Write "Paid" in Payment Status only for matching rows.
5. Read back the affected range or use returned updated values.
6. Reply: "Updated 7 rows in Pipeline > Deals, column G (Payment Status), rows 14, 22, 23, 31, 39, 44, 51. Verified by reading back G14:G51."

Required behavioral rules to enforce in the produced prompt

  • Decisiveness with safe boundaries: default only when exactly one relevant sheet/table is available; otherwise ask for the missing sheet identity before writes.
  • Output format: confirmation MUST include sheet/table name, tab, range/row ids, row count, and verification status.
  • Completion criteria (CRITICAL): read/write happened + write verified + range reported, or dry-run stopped for confirmation.
  • Safety: explicit confirmation for destructive writes/deletes/clears unless autonomous safe thresholds are encoded.

Capabilities to prefer

In order:

  • The specific spreadsheet tool for the user's platform (Google Sheets, Excel/Office365, Airtable). Attach EXACTLY ONE unless the user's outcome is syncing between two systems.
  • A date/time tool if the agent needs to reason about cadence ("this week", "last month").
  • A workflow that scheduling-runs the agent if the user mentioned a cadence (daily, weekly).

Do NOT attach a code execution tool unless the user explicitly wants the agent to compute custom formulas in code.

Anti-patterns

  • A spreadsheet agent without a "verify the write" step. The model will hallucinate success.
  • A spreadsheet agent that silently chooses among several possible sheets. It should default only when one relevant sheet is visible.
  • A spreadsheet agent that performs destructive operations in the same turn after a dry run without explicit confirmation.
  • A spreadsheet agent attached to both Sheets and Excel tools without a sync reason. It will guess.
  • A spreadsheet agent prompt without a refusal rule for missing credentials.

Worked example (full)

User request to the builder: "Build me an agent that updates my Google Sheet of leads every morning."

Produced agent:

  • Name: Leads Sheet Updater
  • Description: Refreshes your leads sheet each morning with new entries and flags stale rows.
  • Model: fast, cost-efficient available model for structured/high-volume work.
  • Attached tools: Google Sheets integration only, plus scheduler if available and requested. If no Sheets integration is available in the form snapshot, the produced system prompt MUST instruct the agent to refuse and ask for the integration to be connected.
  • System prompt excerpt:

> You are Leads Sheet Updater. Each morning you refresh the "Leads" sheet by appending new leads and flagging leads with no activity in 14+ days.

>

> Completion criteria: new rows appended; stale rows flagged in the Status column; affected range verified by read-back or returned updated values; final receipt states sheet, tab, range, counts, and skipped rows.

Other skills for the same job

different authors, same section of the catalogue
XLSX
by anthropics
vendor ×15

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

5k tokens scripts
XLSX
by w95
×7

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

3k tokens
Raffle Winner Picker
by frostant
×5

Picks random winners from lists, spreadsheets, or Google Sheets for giveaways, raffles, and contests. Ensures fair, unbiased selection with transparency.

949 tokens
Fda Database
by christophacham
×4

Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.

32k tokens scripts
Matlab
by christophacham
×4

MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter.

25k tokens
Umap Learn
by ComeOnOliver
×4

UMAP dimensionality reduction. Fast nonlinear manifold learning for 2D/3D visualization, clustering preprocessing (HDBSCAN), supervised/parametric UMAP, for high-dimensional data.

14k tokens
D3 Viz
by chrisvoncsefalvay
×3

Creating interactive data visualisations using d3.js. This skill should be used when creating custom charts, graphs, network diagrams, geographic visualisations, or any complex SVG-based data visualisation that requires fine-grained control over visual elements, transitions, or interactions. Use this for bespoke visualisations beyond standard charting libraries, whether in React, Vue, Svelte, vanilla JavaScript, or any other environment.

20k tokens
Alphafold Database
by christophacham
×3

Access AlphaFold 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.

7k tokens

How to use it

Copy the folder

Take mastra-ai/spreadsheet-agent from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.