预算与支出追踪器:AI智能体财务指挥中心 - Openclaw技能

作者:互联网

2026-03-29

AI教程

什么是 预算与支出追踪器?

预算与支出追踪器是一款先进的个人财务集成工具,旨在将您的AI智能体转变为私人财务顾问。通过利用自然语言处理技术,此技能允许用户记录支出、追踪收入并监控储蓄目标,无需手动输入电子表格。它维持严格的本地数据架构,确保您的敏感财务信息永远不会离开您的机器。

此技能非常适合希望以高性能、自动化方式管理资金的开发者和高级用户。它不仅仅是记录数据,还提供主动智能服务。从在您超支时发出提醒,到根据您当前的消费速度预测月底余额,它使您能够做出数据驱动的决策。作为最实用的Openclaw技能之一,它弥补了原始交易数据与可操作的财富增长洞察之间的鸿沟。

下载入口:https://github.com/openclaw/skills/tree/main/skills/1kalin/afrexai-budget-tracker

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install afrexai-budget-tracker

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 afrexai-budget-tracker。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

预算与支出追踪器 应用场景

  • 通过简单的自然语言提示追踪日常开支,例如“午餐花了15美元”。
  • 实时监控每月预算遵守情况,并在接近限额时发出警报。
  • 审计定期订阅,以识别并取消使用频率较低的服务。
  • 计算财务健康评分,基准化长期财富目标的进展情况。
  • 自动生成每周或每月的财务智能报告。
预算与支出追踪器 工作原理
  1. 用户提供关于财务事件(如支出、收入或退款)的自然语言输入。
  2. AI智能体根据Openclaw技能框架将输入解析为结构化的交易格式。
  3. 交易被追加到本地JSON账本中,并带有生成的唯一ID和元数据标签。
  4. 预算执行引擎自动计算当前支出速度,并将其与您个人资料中定义的限额进行比较。
  5. 智能体提供即时反馈,包括预算警告、异常支出警报或记录条目的确认。

预算与支出追踪器 配置指南

要开始在您的Openclaw技能中使用此财务指挥中心,请使用配置文件初始化您的工作区。

# 创建您的财务配置文件
touch budget-profile.json

budget-profile.json中定义您的货币、月收入和支出类别。该技能将在您第一次交易或目标设置时自动生成budget-ledger.jsonbudget-goals.jsonbudget-recurring.json文件。

预算与支出追踪器 数据架构与分类体系

该技能将数据组织在四个主要的JSON文件中,以保持关注点的清晰分离并确保数据的便携性。

文件 描述
budget-profile.json 存储核心设置、货币、类别和警报阈值。
budget-ledger.json 包含带有元数据和标签的所有交易的完整历史记录。
budget-goals.json 追踪长期储蓄目标、截止日期和贡献历史。
budget-recurring.json 管理房租或Netflix等自动每月或每周支出的规则。

Budget & Expense Tracker — AI Agent Financial Command Center

Track every dollar, enforce budgets, spot spending patterns, and build wealth — all through natural conversation with your AI agent.

How It Works

You talk to your agent naturally: "I spent $45 on groceries" or "How much did I spend on food this month?" The agent maintains a local JSON ledger, enforces your budgets, and gives you weekly/monthly financial intelligence.


1. Setup — Your Financial Profile

On first use, create budget-profile.json in your workspace:

{
  "currency": "USD",
  "monthlyIncome": 5000,
  "payDays": [1, 15],
  "fiscalMonthStart": 1,
  "categories": {
    "housing": { "budget": 1500, "essential": true },
    "food": { "budget": 600, "essential": true, "subcategories": ["groceries", "dining", "delivery", "coffee"] },
    "transport": { "budget": 300, "essential": true, "subcategories": ["fuel", "public", "rideshare", "parking"] },
    "utilities": { "budget": 200, "essential": true, "subcategories": ["electric", "water", "internet", "phone"] },
    "health": { "budget": 200, "essential": true, "subcategories": ["gym", "medical", "supplements"] },
    "entertainment": { "budget": 200, "essential": false, "subcategories": ["streaming", "games", "events", "hobbies"] },
    "shopping": { "budget": 300, "essential": false, "subcategories": ["clothes", "electronics", "home", "gifts"] },
    "education": { "budget": 100, "essential": false, "subcategories": ["books", "courses", "subscriptions"] },
    "savings": { "budget": 500, "essential": true, "target": "emergency-fund" },
    "misc": { "budget": 100, "essential": false }
  },
  "alerts": {
    "budgetWarning": 0.75,
    "budgetCritical": 0.90,
    "unusualSpend": 2.0,
    "dailyMax": 200
  },
  "goals": []
}

Customize categories, budgets, and subcategories to your life. The agent adapts to whatever structure you define.


2. The Ledger — Transaction Format

All transactions live in budget-ledger.json:

{
  "transactions": [
    {
      "id": "tx_20260213_001",
      "date": "2026-02-13",
      "type": "expense",
      "amount": 45.67,
      "category": "food",
      "subcategory": "groceries",
      "description": "Weekly shop at Aldi",
      "merchant": "Aldi",
      "paymentMethod": "debit",
      "tags": ["weekly", "essentials"],
      "recurring": false,
      "note": ""
    }
  ],
  "recurringRules": [],
  "metadata": {
    "lastUpdated": "2026-02-13T10:30:00Z",
    "transactionCount": 1,
    "ledgerVersion": "1.0"
  }
}

Transaction ID Convention

tx_YYYYMMDD_NNN — date + sequential number. Never reuse IDs.


3. Natural Language Parsing

When a user says something about money, parse it into a transaction:

Parsing Rules

User says Extracted
"spent $45 on groceries" expense, $45, food/groceries
"paid rent $1500" expense, $1500, housing
"got paid $2500" income, $2500, salary
"uber $12" expense, $12, transport/rideshare
"Netflix $15.99 monthly" expense, $15.99, entertainment/streaming, recurring
"coffee $5" expense, $5, food/coffee
"sent mom $200" expense, $200, misc (ask: gift or loan?)
"returned shoes got $80 back" refund, $80, shopping/clothes

Ambiguity Resolution

  • If category is unclear, make your best guess AND confirm: "Logged $45 under food/groceries — correct?"
  • If amount is missing, ask: "How much was that?"
  • If "monthly" or "every week" mentioned, create a recurring rule
  • "Returned" or "refund" = negative expense (credit)
  • "Lent" vs "borrowed" — always clarify direction

Recurring Transactions

When a user mentions recurring expenses, create a rule:

{
  "id": "rec_001",
  "description": "Netflix subscription",
  "amount": 15.99,
  "category": "entertainment",
  "subcategory": "streaming",
  "frequency": "monthly",
  "dayOfMonth": 15,
  "active": true,
  "lastApplied": "2026-02-15"
}

On each budget check, auto-apply any recurring transactions that are due.


4. Budget Enforcement Engine

Real-Time Budget Checks

After EVERY expense logged, run this check:

1. Calculate total spent in category this month
2. Compare to budget limit
3. Calculate percentage used
4. Check days remaining in month
5. Calculate daily budget remaining
6. Trigger alerts if needed

Alert Levels

Level Trigger Response
?? On track < 75% budget, proportional to month progress Silent (log only)
?? Warning 75-90% budget used "Heads up — you've used 78% of your $600 food budget with 18 days left. That's $3.67/day remaining."
?? Critical > 90% budget used "?? Food budget is at 92% ($552/$600) with 12 days left. Only $4/day remaining. Consider cooking at home this week."
?? Over budget > 100% "?? You're $47 over your $600 food budget. Total: $647. This eats into your savings target."
? Unusual Single transaction > 2x average for category "That $89 coffee purchase seems unusual — your average is $5.20. Correct amount?"

Pace Tracking (Smart Budget Intelligence)

Don't just track totals — track spending PACE:

Days elapsed this month: 13
Days remaining: 15
Budget: $600
Spent so far: $380
Daily pace: $29.23/day (spending)
Sustainable pace: $21.43/day (budget / total days)
Remaining pace: $14.67/day (remaining budget / remaining days)

Verdict: Spending 37% faster than sustainable. Will exceed budget by ~$160 at current pace.

This is MORE useful than just "you spent X of Y" because it predicts the future.


5. Savings Goals

Goal Structure

{
  "id": "goal_001",
  "name": "Emergency Fund",
  "targetAmount": 10000,
  "currentAmount": 3500,
  "deadline": "2026-12-31",
  "priority": "high",
  "contributions": [
    { "date": "2026-02-01", "amount": 500, "note": "Monthly auto-save" }
  ],
  "autoContribute": {
    "enabled": true,
    "amount": 500,
    "frequency": "monthly",
    "dayOfMonth": 1
  }
}

Goal Intelligence

When checking goals, calculate:

  • On track? Compare current savings rate to required rate
  • Projected completion: At current rate, when will goal be hit?
  • Acceleration options: "If you save $100 more/month, you'll hit your goal 2 months early"
  • Surplus allocation: If under budget this month, suggest putting surplus toward goals

6. Reports & Intelligence

Weekly Summary (run every Sunday or on demand)

?? Week of Feb 7-13, 2026

?? Spent: $487.23
?? Income: $2,500.00
?? Net: +$2,012.77

Top categories:
  ?? Housing: $375 (rent proration)
  ?? Food: $112.23 (18.7% of budget used, on track)

? Unusual: $0 flagged
?? Goals: Emergency Fund 35% → 40% (+$500)
?? Insight: Food spending down 12% vs last week. Nice work.

Monthly Report (run on 1st of each month)

?? January 2026 — Full Report

INCOME:         $5,000.00
EXPENSES:       $3,847.23
NET SAVINGS:    $1,152.77 (23.1% savings rate)

BUDGET PERFORMANCE:
  ? Housing:      $1,500 / $1,500 (100%) — on budget
  ? Food:         $534 / $600 (89%) — $66 under
  ? Transport:    $187 / $300 (62%) — $113 under
  ?? Shopping:     $342 / $300 (114%) — $42 OVER
  ? Entertainment: $156 / $200 (78%) — $44 under

CATEGORY TRENDS (vs last month):
  ?? Food: +8% ($534 vs $495)
  ?? Transport: -23% ($187 vs $243) — nice!
  ?? Shopping: +37% ($342 vs $250) — watch this

SAVINGS GOALS:
  ?? Emergency Fund: $4,000 / $10,000 (40%) — on track for Aug completion
  ?? Vacation: $800 / $2,000 (40%) — on track

TOP MERCHANTS:
  1. Aldi — $178 (12 visits)
  2. Amazon — $156 (8 orders)
  3. Shell — $89 (6 fills)

?? INSIGHTS:
  ? Shopping was 14% over budget — 3 Amazon orders on Feb 8 totaled $120
  ? You saved $113 on transport (worked from home more?)
  ? At current savings rate ($1,153/mo), emergency fund complete by August
  ? Consider moving $66 food surplus → vacation goal

Year-to-Date Dashboard (on demand)

?? 2026 YTD (Jan-Feb)

Total Income:    $10,000
Total Expenses:  $7,694
Total Saved:     $2,306 (23.1% rate)
Goal Progress:   Emergency Fund 40%, Vacation 40%

Best month: January (24.2% savings rate)
Worst category: Shopping (avg 107% of budget)
Most improved: Transport (-15% trend)

7. Smart Insights Engine

Beyond basic tracking, provide ACTIONABLE intelligence:

Spending Patterns

  • Day-of-week analysis: "You spend 40% more on weekends. Saturday average: $67 vs weekday $23"
  • Merchant loyalty: "You've been to Starbucks 18 times this month. A home coffee setup pays for itself in 3 weeks."
  • Category creep: "Shopping has increased 15% each of the last 3 months. Projected: $450 next month."

Optimization Suggestions

  • Subscription audit: "You have 6 streaming services ($78/mo). Used Netflix 20 times, Disney+ once. Consider canceling Disney+."
  • Budget rebalancing: "You've been under transport budget for 3 months. Consider reducing to $200 and moving $100 to savings."
  • Cash flow timing: "Your biggest expenses hit on the 1st-5th. Consider moving some to the 15th paycheck cycle."

Financial Health Score (0-100)

Calculate monthly:

Factor Weight Scoring
Savings rate 30% 20%+ = 100, 10-20% = 70, 5-10% = 40, <5% = 10
Budget adherence 25% All under = 100, 1 over = 80, 2-3 over = 50, 4+ = 20
Goal progress 20% On track = 100, slightly behind = 60, way behind = 20
Expense stability 15% Low variance = 100, moderate = 60, volatile = 20
Debt-free spending 10% No credit used = 100, some = 50, heavy = 10

Score interpretation:

  • 90-100: ?? Excellent — wealth building mode
  • 70-89: ?? Good — minor optimizations possible
  • 50-69: ?? Fair — specific areas need attention
  • Below 50: ?? Needs work — create an action plan

8. Commands Reference

Command What it does
"I spent $X on Y" Log expense
"Got paid $X" Log income
"Budget check" Show all budgets vs actuals with pace
"Weekly summary" This week's report
"Monthly report" Full month analysis
"How much on food?" Category deep-dive
"Set food budget to $500" Update budget
"Add goal: Vacation $2000 by June" Create savings goal
"Save $200 toward vacation" Log goal contribution
"Financial health" Calculate health score
"Unusual spending?" Flag outliers
"Subscription audit" List recurring + usage
"Compare to last month" Month-over-month trends
"Export CSV" Export ledger for spreadsheets
"Undo last" Remove last transaction

9. Data Management

File Locations

  • budget-profile.json — Your financial profile and budgets
  • budget-ledger.json — All transactions
  • budget-goals.json — Savings goals and contributions
  • budget-recurring.json — Recurring transaction rules

CSV Export Format

When user asks to export:

Date,Type,Amount,Category,Subcategory,Description,Merchant,Tags
2026-02-13,expense,45.67,food,groceries,Weekly shop,Aldi,"weekly,essentials"

Backup

Periodically remind users to back up their ledger. Offer to commit to git if workspace is a repo.

Privacy

All data stays local. No external APIs. No cloud sync. Your money data never leaves your machine.


10. Edge Cases

  • Split transactions: "Dinner $80, split with friend" → Log $40 as your share
  • Foreign currency: "Spent €50 in Paris" → Convert at current rate, note original currency
  • Cash back / rewards: Track as income subcategory "cashback"
  • Transfers between accounts: Don't count as expense or income — log as "transfer" type
  • Shared expenses: Tag with "shared" and note who owes what
  • Tax deductible: Tag with "tax-deductible" for year-end filtering
  • Returns within same month: Net against the category. Cross-month: log as refund income.
  • Variable income: If income varies, use 3-month rolling average for budget calculations