Debt management

From JoelLewis/finance_skills · View interactive version

Debt management is an AI agent skill from the GitHub repository JoelLewis/finance_skills. Provide frameworks for managing and paying off personal debt effectively. Use when the user asks about debt payoff strategies (avalanche vs snowball), refinancing decisions, debt consolidation, debt-to-income ratios, or the opportunity cost of paying off debt vs investing. Also trigger when users me

How to use this skill

Skill file

Debt Management

Core Concepts

Debt Avalanche

Pay minimum payments on all debts, then direct all extra payment to the debt with the highest interest rate first:

Debt Snowball

Pay minimum payments on all debts, then direct all extra payment to the debt with the smallest balance first:

Debt-to-Income Ratio (DTI)

Total monthly debt payments expressed as a percentage of gross monthly income:

Refinancing Analysis

Compare the total cost of the existing loan vs the new loan, accounting for closing costs:

Debt Consolidation

Combine multiple debts into a single loan, ideally at a lower interest rate:

Good Debt vs Bad Debt

Opportunity Cost Analysis

When debt carries a low interest rate, paying it off aggressively may not be optimal:

Debt Payoff Timeline

Amortization calculation with extra payments:

Key Formulas

| Formula | Expression | Use Case |

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

| Front-end DTI | Housing payments / gross monthly income | Mortgage qualification |

| Back-end DTI | All debt payments / gross monthly income | Overall debt health |

| Refinance breakeven | Closing costs / monthly savings | Months to recoup refi costs |

| Months to payoff | n = -ln(1 - Pr/PMT) / ln(1+r) | Debt payoff timeline |

| Total interest paid | (n × PMT) - Principal | Cost of borrowing |

| Effective rate (after tax) | r × (1 - marginal_tax_rate) | Tax-deductible debt comparison |

Worked Examples

Example 1: Avalanche vs snowball comparison

Given: Three debts with $500/month available for extra payments (above minimums):

Calculate: Order of payoff, total months, and total interest for each strategy (month-by-month simulation; see scripts/debt_management.py).

Solution — Avalanche (highest rate first: 22% → 15% → 6%):

  1. Pay minimums on all ($375/mo). Extra $500 goes to credit card ($600/mo total to CC).
  2. Credit card ($5K at 22%, $600/mo): paid off in month 10, ~$476 interest.
  3. Freed payment rolls to the personal loan ($75 + $600 = $675/mo to PL): paid off in month 14, ~$408 interest.
  4. All payments roll to the student loan ($200 + $675 = $875/mo): paid off in month 26, ~$1,062 interest (the 6% loan accrues interest on its full $12K balance throughout the earlier phases, not just at the end).
  5. Total: 26 months, ~$1,946 total interest.

Solution — Snowball (smallest balance first: $3K → $5K → $12K):

  1. Extra $500 goes to personal loan ($575/mo total to PL).
  2. Personal loan ($3K at 15%, $575/mo): paid off in month 6, ~$123 interest.
  3. Freed payment rolls to the credit card ($100 + $575 = $675/mo): paid off in month 14, ~$911 interest.
  4. All payments roll to the student loan: paid off in month 26, ~$1,071 interest.
  5. Total: 26 months, ~$2,104 total interest.

Comparison: Avalanche saves ~$158 in interest; both finish in 26 months. The difference is modest because the highest-rate debt is not the largest. Snowball gives a quicker first win (month 6 vs month 10 to first payoff) — for many people that motivational difference is worth $158.

Example 2: Refinance breakeven

Given: Current mortgage: $300K remaining, 6.5%, 25 years left, payment $2,028/mo. New offer: 5.5%, 25 years, closing costs $6,000, payment $1,838/mo.

Calculate: Breakeven period and total interest savings.

Solution:

  1. Monthly savings: $2,028 - $1,838 = $190/month.
  2. Breakeven: $6,000 / $190 = 31.6 months ≈ 32 months (2 years 8 months).
  3. If staying in the home beyond 32 months, refinancing saves money.
  4. Total payments (old): 25 × 12 × $2,028 = $608,400 → total interest = $608,400 - $300,000 = $308,400.
  5. Total payments (new): 25 × 12 × $1,838 + $6,000 = $557,400 → total interest = $557,400 - $300,000 = $257,400.
  6. Total interest savings: $308,400 - $257,400 = $51,000.

Common Pitfalls

Cross-References

Running the Script

uv run scripts/debt_management.py            # run the demo (uses PEP 723 inline deps)
uv run scripts/debt_management.py --verify   # check demo outputs against the worked examples (exit 1 on mismatch)
python3 scripts/debt_management.py            # alternative (requires: pip install numpy)

The demo prints the calculations covered above; its values match the worked examples in this skill. Run --help for a list of the classes and functions. For programmatic use, import the module rather than running it — the demo only executes under python debt_management.py.

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.