# Count My Stack: setup instructions for AI agents

You are helping a person set up Count My Stack, a private personal finance dashboard that is a single HTML file. Everything happens on their computer. Never upload their files or numbers anywhere, and only read files inside the folder they gave you unless they say otherwise.

## What you will make

- `countmystack-template.xlsx` (or `my-stack.sqlite`): the person's numbers, which is the source of truth.
- `my-stack.html`: their dashboard, a copy of the Count My Stack dashboard with its sample data replaced by their numbers.

## 1. Get the files

Download these into the working folder:

- Dashboard: https://countmystack.com/countmystack-dashboard.html
- Excel template: https://countmystack.com/countmystack-template.xlsx
- SQLite schema (only if the person prefers SQLite): https://countmystack.com/countmystack-schema.sql. Create the database with `sqlite3 my-stack.sqlite < countmystack-schema.sql`.

## 2. Ask a few questions first

Ask before you start, and keep it short:

1. Excel or SQLite? Default to Excel.
2. Which files in this folder are bank, card, brokerage or loan exports? CSV, OFX, QFX, XLSX and PDF statements are all fine.
3. What 12-month period should the dashboard cover? Default to the last 12 full months.
4. Any properties, private investments or taxes paid outside these exports that should be added by hand?
5. A Fat FIRE goal: yearly spending, safe withdrawal rate (default 3.5%) and expected real return (default 5%).

## 3. Fill the template

Follow the template's Read me sheet. The rules:

- Keep every header row exactly as it is. One sheet or table per kind of thing.
- Money in is positive and money out is negative. Dates are `YYYY-MM-DD`. Rates are decimals (4.5% is `0.045`).
- Delete the grey sample rows before adding real ones.
- Use the person's own categories. Map every transaction to one category. List anything you could not place and ask, rather than guessing.
- Skip duplicates. Transfers between the person's own accounts use kind `transfer`, so they are not counted as spending.

The tables are `accounts`, `balances`, `transactions`, `categories`, `holdings`, `private_investments`, `properties`, `taxes`, `income_years`, `subscriptions` and `goals`.

## 4. Build my-stack.html

Copy `countmystack-dashboard.html` to `my-stack.html`. The sample data is a set of constants near the top of its main `<script>`. Replace their values with the person's numbers, and keep each constant's name and shape so every page keeps working:

| Constant | What it holds | Comes from |
|---|---|---|
| `M`, `MY`, `MK` | The 12 month labels and keys of the period | Step 2, question 3 |
| `INC` | Income by source, one array of 12 monthly totals per source | `transactions` where kind is income |
| `EXP` | Spending by category, 12 monthly totals per category | `transactions` where kind is spend |
| `BUD` | Monthly budget and month-to-date spend per category | `categories` and the current month |
| `ACCTS` | Accounts with balance, institution and rate | `accounts` and the latest `balances` |
| `NW` | Net worth at each month end | Sum of `balances` per month |
| `HOLD` | Investment holdings with value and cost | `holdings` |
| `PRIV` | Private investments | `private_investments` |
| `PROPS`, `PL` | Properties and their monthly costs | `properties` and property transactions |
| `TAX`, `GROSS`, `WHLD` | Tax payments, gross income and tax withheld by year | `taxes` and `income_years` |
| `SUBS` | Subscriptions with price history and last use | `subscriptions` |
| `TXN` | The most recent transactions | Latest `transactions` |
| `FD` | Fat FIRE settings | `goals` |

Also update dates that describe the period, such as the "as of" date and the default date range, so labels match the person's data. Leave the layout, styles and logic alone.

## 5. Check your work

- Open `my-stack.html` in a browser and visit every page. There should be no console errors.
- Check that net worth equals assets minus debts, and that monthly income and spending match the template totals.
- Tell the person what you could not fill and anything that looks unusual, such as duplicate charges, big one-offs or balances that don't match statements.

## Monthly refresh

Add the new month's exports to the template the same way, skipping rows already there. Then shift the 12-month window forward by one month in `my-stack.html` and update every constant. Finish with a short summary of what changed: net worth, spending against budget, new or unused subscriptions, and anything to reconcile.

## Privacy

Keep all files on the person's computer. Do not paste their numbers into web searches or other services. Suggest they keep the folder on an encrypted drive and back it up somewhere private.
