agentleFS
srinandansrinandan/portfolio-copilot/skills/spending-analysis/SKILL.md

spending-analysis

Skill0 starsChanged 4 months agoApache-2.0View on GitHub

Synthesizes spending insights, savings rate, and reserve estimates from preloaded account transaction facts (e.g. checking_transactions). Use when the user asks about spending patterns, budget categories, or when Goals & Onboarding needs a savings rate or reserve estimate.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. pollinations/pollinations★ 5.3ksame name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository8 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do NOT restate total_income_usd, total_outflow_usd, savings_rate, reserve_months, category_breakdown, or the numeric fields of any anomaly.

    line 87

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

spending-analysis

Purpose

Analyzes bank transaction data (from checking_transactions): categorizes spend into a fixed taxonomy, flags anomalies against trailing history, and synthesizes natural language budgeting insights, savings rate metrics, and reserve months estimates.

Produces typed narrative fields for the orchestrator to merge into the final SpendingReport.

When this skill runs

  • User asks a direct spending question ("how much did I spend on dining last month", "why did X category jump")
  • Goals & Onboarding invokes it during interview to estimate savings rate and inform the liquidity-needs discussion
  • Root planner invokes it ad hoc when a proposed action's rationale would benefit from spending context (rare; most paths don't need this)

Inputs

FieldSourceRequired
user_idOrchestratorYes
query_intentOrchestrator — either a specific NL question, or a mode (categorize, anomaly_check, savings_rate)Yes
preloadedOrchestrator — pre-computed BigQuery facts, category totals, savings rate, reserve months, and anomaly checksYes

Category taxonomy

Transaction category strings from statements are normalized into a fixed internal taxonomy:

housing, utilities, groceries, dining, transportation, entertainment, subscriptions, healthcare, travel, shopping, income, transfers, fees, other

Unmapped raw categories fall into other.

Deterministic calculations (orchestrator-precomputed)

The orchestrator deterministically computes math and aggregates before dispatching to the Managed Agent:

  1. Anomaly detection rule:
    current_month_spend > (trailing_3_month_average * 1.4)
      AND
    current_month_spend > (trailing_3_month_average + 100)
  2. Savings rate: savings_rate = (total_income - total_outflow) / total_income over trailing 3 months
  3. Reserve months: reserve_months = HoldingsSnapshot.cash_usd / average_monthly_expenses

Output

Return only the natural-language synthesis fields:

  • narrative_summary — 2–5 sentences. Directly answer the user's query_intent using the preloaded numeric facts. If anomalies were flagged by the preloader, name them and give a plausible cause. If reserve_months is under 3 or savings_rate is under 0 (spending more than earning), call it out. Do not invent numbers; every figure you cite must appear in input.preloaded. If input.preloaded contains zero income/outflow and empty categories, state clearly that no transaction history is available.
  • anomaly_commentary — optional list, at most one entry per anomaly in input.preloaded.anomalies, in the same order. Each string replaces the preloader's canned "surged from average" description with a more specific explanation (e.g. "one-time medical bill", "annual insurance premium"). Leave empty if you have no better explanation — the preloader's description is a valid default.

Do NOT restate total_income_usd, total_outflow_usd, savings_rate, reserve_months, category_breakdown, or the numeric fields of any anomaly. Those come from input.preloaded and are authoritative. The orchestrator merges your two fields onto the preloaded facts and persists the resulting SpendingReport.

Tools / permissions required

  • Managed Agent sandbox: conversational reasoning over preloaded context
  • Orchestrator (outside sandbox):
    • BigQuery: read checking_transactions (aggregate/SELECT only, user-scoped via Native SDK and BigQuery Remote MCP Server https://bigquery.googleapis.com/mcp)
    • Firestore: read holdings (cash balance only, for reserve estimate via Firestore Remote MCP Server)
  • No direct database execution tools inside the Managed Agent sandbox.

Registry metadata

  • Registered as: projects/{project}/locations/{location}/skills/private-spending-analysis
  • Skill revision: 0.2.0 (draft — not yet registered)
  • Approval scope: read:spending,read:holdings

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.