Explain my variance

From gethouston/houston · View interactive version

Explain my variance is an AI agent skill from the GitHub repository gethouston/houston. Tell me why a P&L line moved. I compare actuals against budget (if you have one), prior period, and same period prior year, decompose every material swing into price / volume / mix / one-time drivers tied to specific journal entries and vendors, and write a 3–5 paragraph narrative on the biggest mov

How to use this skill

Skill file

Explain My Variance

Actuals vs. budget vs. prior period vs. same-period prior year. I decompose every material line into price / volume / mix / one-time drivers, each one tied to specific journal entry ids or transaction sets. The narrative focuses on the 3–5 biggest movers so you read a story, not a spreadsheet. Anything I can't explain, I label as residual rather than make up a cause.

When to use

Connections I need

I run external work through Composio. Before this skill runs I check that the categories below are linked. Missing → I name the category, ask you to connect it from the Integrations tab, stop.

This skill never blocks on a missing connection.

Information I need

I read your bookkeeping context first. For every required field that's missing I ask ONE plain-language question (best modality: connected app > file drop > URL > paste) and wait.

Steps

<!-- houston-workflow:v1 -->

  1. Read context. Load context/bookkeeping-context.md, config/context-ledger.json (for domains.budget - cadence + path), config/chart-of-accounts.json. Read config/budget.json if exists ([{period, glCode, amount, note?}]).
  1. Pick comparison baselines. For requested period (YYYY-MM or YYYY-QN), assemble up to three baselines:
  1. Load actuals for period. Read period P&L from financials/{YYYY-MM}/pnl.md (generated by prepare-my-financials). If missing, recompute from journal-entries.json on fly + note canonical P&L not yet written.
  1. Compute variances per account code line. For each account code line in any of: actuals, budget, prior period, prior year, compute:
  1. Apply materiality threshold. Default: abs(variance) > 5% AND abs(variance) > $1000. Configurable per run via arg. Only material variances get driver decomposition. Non-material summarized in single table at bottom.
  1. Decompose each material variance into drivers. Ground each driver in specific journal entries or transactions:

Each driver has: {driver, amount, jeRefs: [id…], transactionRefs?: [ids…], narrative}. amount must sum to total variance within $1.00. Unexplained residual logged explicitly - never silently absorbed.

  1. Write plain-English narrative on 3-5 biggest movers. Narrative names each mover, dollar impact, primary driver, specific evidence (journal entry id or vendor or transaction set). No invented causes. Thin evidence → say so. "no obvious driver, recommend user review" acceptable. Speculation padding not.
  1. Write variance artifact. Path: variance-analyses/{YYYY-MM}.md. Atomic write: .tmp → rename. Structure:
  1. Append to outputs.json. Read-merge-write. Row: {id, type: "variance-analysis", title: "Variance - {YYYY-MM}", summary: "<the headline>", path: "variance-analyses/{YYYY-MM}.md", status: "draft", domain: "reporting"}.
  1. Summarize to user. One paragraph: headline + 3-5 biggest movers with dollar impact + primary driver, plus unexplained residuals needing review. Point at written file.

Outputs

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.