Savings goals

From JoelLewis/finance_skills · View interactive version

Savings goals is an AI agent skill from the GitHub repository JoelLewis/finance_skills. Plan and track savings for specific financial goals including retirement, education, and home purchase. Use when the user asks about required savings rates, 529 plans, retirement accumulation targets, down payment planning, or goal prioritization. Also trigger when users mention 'how much do I need

How to use this skill

Skill file

Savings Goals

Core Concepts

Required Monthly Savings

To accumulate a future value FV in n periods at rate r per period:

PMT = FV × r / [(1+r)^n - 1]

This is the sinking fund formula (future value of annuity solved for PMT).

Inflation-Adjusted Targets

Always compute goals in future (nominal) dollars:

FV_nominal = FV_today × (1 + inflation)^years

Then solve for the required savings using the nominal return, or use the real return with today's dollars.

Education Funding

Retirement Accumulation

Down Payment Saving

Goal Priority Framework

Recommended priority order:

  1. Emergency fund (3-6 months expenses)
  2. Employer 401(k) match (free money)
  3. High-interest debt payoff (>6-8% rate)
  4. HSA (triple tax advantage if eligible)
  5. Max retirement accounts (401k, IRA, Roth)
  6. Education funding (529)
  7. Other goals (home, vacation, etc.)

Multiple Goal Balancing

Savings Rate Benchmarks

Key Formulas

| Formula | Expression | Use Case |

|---------|-----------|----------|

| Required savings (PMT) | PMT = FV × r / [(1+r)^n - 1] | Monthly savings for a goal |

| Future value with savings | FV = PV(1+r)^n + PMT×[(1+r)^n - 1]/r | Project goal balance |

| Inflation adjustment | FV_real = FV_today × (1+π)^t | Convert today's dollars to future |

| Retirement target | Nest egg = annual spend / SWR | Size the retirement goal |

| Years to goal | n = ln(FV×r/PMT + 1) / ln(1+r) | How long until goal is funded |

| Savings rate | SR = total savings / gross income | Track savings discipline |

Worked Examples

Example 1: College Savings (529)

Given: Need $200,000 in 18 years, expect 7% annual return, starting from $0

Calculate: Required monthly savings

Solution:

Example 2: Retirement Accumulation

Given: Age 30, $50,000 currently saved, wants $2,000,000 by age 65, expects 8% annual return

Calculate: Required monthly savings

Solution:

Common Pitfalls

Cross-References

Running the script

Run the reference implementation directly:

uv run scripts/savings_goals.py      # PEP 723 header resolves dependencies automatically
python3 scripts/savings_goals.py     # standard library only — no installs needed

A bare run prints a demo covering required monthly savings, retirement accumulation, time-to-goal, inflation adjustment, shortfall analysis, education funding, savings rate, and real returns. Use --verify to recompute the demo figures and assert they match this skill's worked examples (prints PASS/FAIL, exits nonzero on mismatch), and --help to list the available classes and functions. The file is primarily meant to be imported as a module (from savings_goals import SavingsGoals) rather than run standalone.

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.