# AI Stack Spend & Build-vs-Rent Auditor

## PURPOSE
A Click + Pandas command-line tool that audits a business's AI subscription and usage ledger, then recommends what to consolidate. It is grounded in the video's core money idea: after cutting tools he "used to pay for" — Gamma for slides, Poppy for content, a Loom rental — Nateherk replaced them with things he built himself. This CLI quantifies that trade with per-tool monthly cost, real feature utilization, and a keep-or-replace verdict.

## WHY THIS MATTERS
The transcript lists concrete pain: managing "separate keys, billing, passwords," wanting everything "on one credit card," and using OpenRouter analytics to see "exactly which one is costing me how much money." Students learn to turn raw usage rows into a decision: keep, downgrade, or replace with a deterministic script (the trigger.dev pattern) or an in-house build.

## HOW TO BUILD
1. `pip install click pandas rich`.
2. Create a `@click.group()` with `audit` and `verdict` subcommands.
3. `audit` reads a CSV (`tool,seat_cost,usage_pct,category`) with pandas.
4. Flag tools billed monthly but whose `usage_pct` is low as replacement candidates.
5. Emit a Rich table plus a deterministic recommendation string standing in for an LLM advisor.

Key snippet:
```python
df["waste"] = df["seat_cost"] * (1 - df["usage_pct"] / 100)
df["action"] = df["usage_pct"].apply(lambda u: "replace" if u < 30 else "keep")
```

## WHEN TO USE IN PRODUCTION
Run it monthly before renewals, during a stack-consolidation push, or when scoping a new client's tooling. Do NOT use it for seat-based collaboration tools with network effects, or when switching and migration costs outweigh the savings it flags.

## HOW IT HELPS STUDENTS
Teaches Click command design, pandas aggregation and joins, cost modeling, and the build-vs-rent reasoning that separates a hobbyist from someone who can actually run an AI budget.

## STARTER CODE
`starter/main.py` ships a runnable CLI, an embedded sample ledger, and `# TODO` markers for real CSV input, per-key cost joins, and LLM-written recommendations.
