# Inventory Snapshot Questions

Prompts for getting answers out of an inventory export without letting the AI do arithmetic. From lesson 04-02 of Distru's No Bullshit AI Course. Version 1.0, tested 2026-09-17 with a frontier chat model and a coding agent on the sample file in `inventory-snapshot/`. CC0 1.0.

The rule behind every prompt here: **the AI writes the script, the script does the counting.** A language model reading 800 rows and telling you the total is guessing with confidence. A twelve-line script is not. Paste your header row and five sample rows, never the whole file and never customer names.

Before pasting anything, run `csv-cleanup-checklist.md` on the export. Strip customer columns. Metrc tags are fine; they identify packages, not people.

---

## 1. Write me the summary script

```
You write small Python scripts for a licensed cannabis operator. Standard library only, no installs.
Here is the header row and five rows of my inventory export:
[paste header + 5 rows]
Write a script that prints: total quantity per room, per category, and per product. Never add grams to eaches; print each unit on its own line. Zero-quantity rows still count as products.
Then list every package received 90 or more days ago, oldest first, with its tag, product, quantity and room.
Then list every product whose total on hand is 10 units or fewer.
Print the command to run it. Do not compute any numbers yourself; the script computes them.
```

## 2. Change the question, keep the script

```
Here is a script you wrote earlier: [paste script]
Add an option --expiring DAYS that lists packages whose expiration date is within DAYS days. The column is called [Exp Date] and looks like [2026-11-30]. Keep everything else the same. Show me only the lines you changed.
```

## 3. Compare two days

```
I have two inventory snapshots, one from [date A] and one from [date B], same columns:
[paste header row]
Write a Python script that matches rows by the tag column and prints: tags only in the earlier file, tags only in the later file, and tags in both whose quantity changed, with before, after and the difference. Sort changed rows by the size of the difference. Never match on product name.
```

## 4. Explain a result I do not understand

```
This script output says [paste 3 to 10 lines]. The snapshot is from [date]. Give me the three most likely operational reasons this looks the way it does (sales, transfers, adjustments, a package finished on one side, a unit mix-up). Use only what is in the lines. Say which reason I should check first and what to look at in Metrc or my inventory system.
```

## 5. The "packages in Metrc I have not imported" list

```
I have two exports. metrc.csv is every active package in Metrc with a column [Tag]. erp.csv is every package in my inventory system with a column [Metrc Tag]. Write a Python script that prints the tags that appear in metrc.csv and not in erp.csv, with the product name and quantity from the Metrc row, as a CSV I can open in a spreadsheet. Compare tags case-insensitively and strip spaces. No other output.
```

## 6. Make it run every night (hand this to your tech person)

```
I want a copy of my inventory saved every night at 11:55 pm as a CSV named YYYY-MM-DD.csv in a folder called snapshots/. The export comes from [describe: a report I download / GET /public/v1/inventory with an API key in an environment variable]. Write the fetch script and the cron line (or n8n schedule) for it. Never print the API key. If the fetch fails, write a file named YYYY-MM-DD.FAILED instead of an empty CSV.
```

---

**What a good result looks like.** The script runs on the first try or after one error you paste back. Totals per room add up to the file total, unit by unit. The aging list is sorted oldest first. If the AI answers with numbers instead of a script, say "do not compute, write the script" and try again.

**What goes wrong.** The AI guesses column names you did not paste; paste the real header. It sums grams and eaches into one number; the prompt forbids it, check anyway. It reads a date as MM/DD when yours is DD/MM; find a row with a day over 12 and test.
