Find the budget lines running over in your Google Sheets budget, every month

On the 8th: last month's actual spend against the budget in your Google Sheet, line by line, with the lines that ran over and by how much.

Runs
8th of the month at 9:00
Posts
Stat tile

From your apps to your board

How the skill works: your agent reads both tabs from Google Sheets; spreadsheet id from What you tell it, 8th of the month at 9:00, and gives you spent vs budget and the report in the chat.

Reads

  • Google SheetsBoth tabs
  • What you tell itSpreadsheet ID
reads
Your agentClaude Code, Codex, Cursor or Gemini8th of the month at 9:00
posts

You get

  • Spent vs budgetA stat tile on your board, with its trend
  • The report in the chatEvery run, with or without Briefkin

What you get

  • Spent vs budget for last month, as a percent and in dollars.
  • Lines over budget by more than 10% and $1,000, largest first.
  • Big underspends that may only be timing.
  • Lines found on one tab but not the other.

The card on the right is a sample. Yours shows your own numbers and updates in place every run.

What lands on your board

AcmeSpent vs budget104%+1% vs previous period, worsevs last report
Budget$182,000
Actual$189,280
Over by$7,280
An example with made-up numbers. Your agent posts your real ones.

What it does

The budget lives in a spreadsheet because that is where budgets get built, and the actuals land in the next tab once the bookkeeper closes the month. Comparing the two is ten minutes of lookups that somebody postpones until the quarterly review, by which point three months of overspend are baked in.

On the 8th the agent lines up the two tabs by line name, works out the variance for last month, and posts total spend against budget with the lines that ran over. If the actuals column is still empty, it says so and stops.

How it works

  1. 1Read both tabs

    Call spreadsheets.values.batchGet with ranges Budget!A1:M60 and Actuals!A1:M60 and valueRenderOption=UNFORMATTED_VALUE. Column A holds the line names and row 1 the months.

  2. 2

    2Check the month is in

    Find last month's column. If more than two lines have no actual yet, stop and report that the actuals aren't complete instead of computing a misleading variance.

  3. 3

    3Match the lines

    Join Budget and Actuals on the line name, trimmed and case-insensitive. List any line that exists on one tab only, since that is usually a renamed or new category.

  4. 4

    4Compute variances

    For each line and the total: actual minus budget, and actual as a percent of budget. Flag lines more than 10% and $1,000 over, and underspends of 30% or more that may only be timing.

  5. 5

    5Write the report

    Total actual against budget, the lines over with their amounts, the big underspends, and any unmatched lines.

  6. Post it to the board

    With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.

Install and run it

Pick your agent, where the data comes from and how to schedule it; the commands below follow.

Agent
Data
Schedule
  1. Install the skill

    One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.

    shellcurl -fsSL https://briefkin.dev/skills/google-sheets-budget-vs-actual/install | sh
  2. Run it

    Ask Claude Code:

    promptRun the google-sheets-budget-vs-actual skill

    Or paste the prompt instead of installing:

    promptRead the Budget and Actuals tabs of my Google Sheet (ID below) with unformatted values; line names are in column A and months across row 1. Use last month's column. If more than two lines have no actual yet, tell me the actuals aren't complete and stop. Otherwise match lines by name, and for each line and the total give budget, actual, the variance in dollars and actual as a percent of budget. Flag lines more than 10% and $1,000 over, and underspends of 30% or more. List any line that appears on only one tab. Start with total spend as a percent of budget.
  3. Put it on a schedule

    8th of the month at 9:00, from cron on any machine where Claude Code is signed in:

    crontab0 9 8 * * claude -p "Run the google-sheets-budget-vs-actual skill"

    Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.

  4. Send it to your board

    Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a stat tile. How setup works

View the SKILL.mdRaw file
SKILL.md---
name: google-sheets-budget-vs-actual
description: "On the 8th: last month's actual spend against the budget in your Google Sheet, line by line, with the lines that ran over and by how much. Use when the user asks for this, or when it runs on a schedule."
---

# Google Sheets budget vs actual

On the 8th: last month's actual spend against the budget in your Google Sheet, line by line, with the lines that ran over and by how much.

The budget lives in a spreadsheet because that is where budgets get built, and the actuals land in the next tab once the bookkeeper closes the month. Comparing the two is ten minutes of lookups that somebody postpones until the quarterly review, by which point three months of overspend are baked in.

On the 8th the agent lines up the two tabs by line name, works out the variance for last month, and posts total spend against budget with the lines that ran over. If the actuals column is still empty, it says so and stops.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- Viewer access to the budget spreadsheet for the agent's Google account or service account, through a Google Sheets connector, an MCP server or the Sheets API.
- An Actuals tab that someone fills in each month, for example a QuickBooks P&L export pasted by month.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **Read both tabs** (Google Sheets): Call `spreadsheets.values.batchGet` with ranges `Budget!A1:M60` and `Actuals!A1:M60` and `valueRenderOption=UNFORMATTED_VALUE`. Column A holds the line names and row 1 the months.
2. **Check the month is in**: Find last month's column. If more than two lines have no actual yet, stop and report that the actuals aren't complete instead of computing a misleading variance.
3. **Match the lines**: Join Budget and Actuals on the line name, trimmed and case-insensitive. List any line that exists on one tab only, since that is usually a renamed or new category.
4. **Compute variances**: For each line and the total: actual minus budget, and actual as a percent of budget. Flag lines more than 10% and $1,000 over, and underspends of 30% or more that may only be timing.
5. **Write the report**: Total actual against budget, the lines over with their amounts, the big underspends, and any unmatched lines.

## Route B: the browser

### What you need

- Signed in to Google with an account that has at least Viewer access to the budget spreadsheet.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://docs.google.com/spreadsheets/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Open both tabs**: Open `https://docs.google.com/spreadsheets/`, open the budget spreadsheet and click the **Budget** tab. Line names are in column A and months across row 1; find last month's column and read rows 1 to 60. Then do the same on the **Actuals** tab.
2. **Check the month is in**: If more than two lines on Actuals have no value in last month's column, stop and report that the actuals are not complete yet rather than computing a misleading variance.
3. **Match the lines**: Join the two tabs on the line name, ignoring case and extra spaces. Note any line that exists on one tab only; it is usually a renamed or new category.
4. **Compute the variances**: For each line and the total: actual minus budget, and actual as a percent of budget. Flag lines more than 10% and $1,000 over, and underspends of 30% or more that may only be timing. Selecting a column shows its sum in the bottom-right corner, which is a quick check on the totals.
5. **Write the report**: Total spend against budget as a percent and in dollars, the lines over with their amounts, the big underspends, and the unmatched lines. Do not edit the sheet.

## The report

- **Spent vs budget** for last month, as a percent and in dollars.
- Lines over budget by more than 10% and $1,000, largest first.
- Big underspends that may only be timing.
- Lines found on one tab but not the other.

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "google-sheets-budget-vs-actual/<date of this run, e.g. 2026-10-16>",
  "item_key": "google-sheets-budget-vs-actual",
  "project": "Acme",
  "source": "Google Sheets budget vs actual skill",
  "kind": "metric",
  "title": "September spend 4% over budget",
  "metric": {
    "label": "Spent vs budget",
    "value": 104,
    "unit": "%",
    "better": "lower",
    "period_start": "<start of the period, ISO 8601>",
    "period_end": "<end of the period, ISO 8601>"
  },
  "glance": [
    {
      "type": "Grid",
      "props": {
        "columns": 3
      },
      "children": [
        {
          "type": "Stat",
          "props": {
            "label": "Budget",
            "value": 182000,
            "prefix": "$"
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Actual",
            "value": 189280,
            "prefix": "$"
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Over by",
            "value": 7280,
            "prefix": "$",
            "tone": "warn"
          }
        }
      ]
    }
  ],
  "widget": [
    {
      "type": "Table",
      "props": {
        "columns": [
          "Line",
          "Budget",
          "Actual",
          "Variance"
        ],
        "align": [
          "left",
          "right",
          "right",
          "right"
        ],
        "rows": [
          [
            "Contractors",
            "$18,000",
            "$22,400",
            "+$4,400 (24%)"
          ],
          [
            "Advertising",
            "$24,000",
            "$26,900",
            "+$2,900 (12%)"
          ],
          [
            "Software",
            "$9,500",
            "$11,180",
            "+$1,680 (18%)"
          ],
          [
            "Other",
            "$5,000",
            "$5,440",
            "+$440 (9%)"
          ],
          [
            "Payroll",
            "$112,000",
            "$112,000",
            "$0"
          ],
          [
            "Rent",
            "$8,500",
            "$8,500",
            "$0"
          ],
          [
            "Travel",
            "$5,000",
            "$2,860",
            "-$2,140 (43%)"
          ],
          [
            "Total",
            "$182,000",
            "$189,280",
            "+$7,280 (4%)"
          ]
        ]
      }
    },
    {
      "type": "Callout",
      "props": {
        "text": "Contractors ran $4,400 over for the September design sprint, which isn't in the budget. Travel is 43% under, likely timing: the offsite moved to November.",
        "tone": "warn"
      }
    }
  ],
  "size": "md"
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

Set `period_start` and `period_end` to the window the number covers: the tile names it from them ("Last 7 days", "Today", "This month"). For a count right now (open items, a balance), send `"period_label": ""` so no period shows; for another name, send it as `period_label` (at most 24 characters).

## Run it on a schedule

Suggested: 8th of the month at 9:00 (`0 9 8 * *`). From cron, with the agent signed in on that machine:

```bash
0 9 8 * * claude -p "Run the google-sheets-budget-vs-actual skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/google-sheets-budget-vs-actual#schedule

Source: https://briefkin.dev/skills/google-sheets-budget-vs-actual

What your agent needs

  • Viewer access to the budget spreadsheet for the agent's Google account or service account, through a Google Sheets connector, an MCP server or the Sheets API.

  • An Actuals tab that someone fills in each month, for example a QuickBooks P&L export pasted by month.

Connecting Google Sheets

  1. Google Sheets MCP server, Google's remote server at https://sheetsmcp.googleapis.com/mcp/v1, part of the Google Workspace MCP servers in developer preview, with read-only spreadsheets.readonly and drive.readonly scopes available (setup).
  2. Claude's Google Drive connector searches and opens files in your Drive, which is enough to find a sheet and read it in a chat.
  3. Sheets API with a service account. Enable the Google Sheets API, create a service account, share the spreadsheet with its email, and set GOOGLE_APPLICATION_CREDENTIALS and SHEET_ID (the long ID in the sheet's URL). Use the spreadsheets.readonly scope unless the skill appends rows.

Share the sheet with the service account as Viewer unless the skill writes; it can only open files someone shared with it, so the rest of your Drive stays out of reach.

Questions

Where do the actuals come from?

From whatever fills the Actuals tab, usually a monthly profit and loss export from QuickBooks or Xero pasted in by month. The skill only reads the sheet. To pull actuals from QuickBooks directly, the QuickBooks P&L summary skill reads the report itself.

My budget is by quarter, not by month. Does that work?

Yes. Say so and the agent compares quarter to date: the budget for the quarter against the sum of the actual months so far, with the share of the quarter that has passed for context.

Do I need Briefkin to use the Google Sheets budget vs actual skill?

No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a stat tile, so you can glance at it instead of asking again.

Which agents can run it?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.

Can it work without an API or MCP server, from my browser?

Yes. Switch the data source to "Your browser" and the steps change to the Google Sheets pages themselves: the agent opens docs.google.com/spreadsheets in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.

Watch spent vs budget on your board, run after run

Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.

Free during the open beta. No card.