coffee-shop-ops

v1.0.0 MIT food-drink updated 2026-09-27

Cost and margin math for coffee shop drinks, plus labor-scheduling ratios by daypart. Enter a drink recipe with ingredient costs and a menu price to get per-drink cost, cost percentage, margin, and the price that hits your target margin. Use the daypart labor guide to schedule baristas for morning rush, midday, and evenings without blowing a labor budget. Use when pricing a new drink, re-checking menu margins, or building a weekly barista schedule.

$ skillbank install coffee-shop-ops@1.0.0
# pins exactly 1.0.0 · README + changelog included

Coffee Shop Ops

Overview

Two tools most café owners do on napkins and get slightly wrong: drink costing and labor scheduling. scripts/drinkcost.py takes a drink recipe — each ingredient's unit cost and the quantity in one drink — plus the menu price, and returns the per-drink cost (including a waste allowance for spilled milk and dial-in shots), cost percentage, margin percentage, and the price that would hit your target margin. references/labor-scheduling.md is a plain playbook: target labor ratios by daypart and how to convert them into barista-hours.

The numbers it prints are starting points, not gospel. It does not know your rent, your milk supplier's mood, or that oat milk costs double. Update the unit costs when suppliers change them.

Installation

1. Copy the coffee-shop-ops/ directory anywhere convenient. 2. Make the script executable (Unix):


   chmod +x scripts/drinkcost.py

3. (Optional) Copy references/sample-latte.json and edit it into your own recipe.

No pip install needed — standard library only. All data stays local; nothing is uploaded.

Configuration

No config file. Inputs come from a recipe JSON file and command-line flags. The recipe file format:


[
  {"name": "espresso (shots)", "qty": 2, "unit_cost": 0.18},
  {"name": "whole milk (oz)",  "qty": 8, "unit_cost": 0.045},
  {"name": "12oz cup + lid + sleeve", "qty": 1, "unit_cost": 0.22}
]

| Field | Required | Description | |-------------|----------|------------------------------------------| | name | yes | Ingredient label (any text). | | qty | yes | Units that go into one drink (> 0). | | unit_cost | yes | Cost of one unit in dollars (>= 0). |

Inputs


drinkcost.py recipe.json --price PRICE [--waste FRAC] [--target-margin FRAC]

| Argument | Default | Description | |-------------------|---------|-----------------------------------------------------------| | --price | — | Menu price in dollars (required, > 0). | | --waste | 0.05 | Waste fraction for spills/remakes (0 up to, not incl., 1).| | --target-margin | 0.80 | Target margin fraction (between 0 and 1). |

Output: per-ingredient cost lines, drink cost (recipe + waste), cost percentage, margin percentage, and the suggested price at the target margin. A FLAG line appears when the current margin is below target.

Worked example


$ ./scripts/drinkcost.py references/sample-latte.json --price 5.50
INGREDIENTS
  espresso (shots)                2 x   $0.18 = $0.36
  whole milk (oz)                 8 x   $0.04 = $0.36
  12oz cup + lid + sleeve         1 x   $0.22 = $0.22

Drink cost:              $0.99  (recipe $0.94 + 5% waste)
Menu price:              $5.50
Cost percentage:         17.9%
Margin:                  82.1%
Target margin:           80%
Suggested price:         $4.94

OK: margin meets the 80% target.

The latte costs about a dollar to make and sells for $5.50 — healthy. Now check the labor side: open references/labor-scheduling.md and compare your weekly barista hours against the daypart ratios before you assume the whole shop is as healthy as this one drink.

Version history

Changelog

1.0.0 — 2026-09-27

  • Initial release: scripts/drinkcost.py drink-cost calculator (per-drink
  • cost with waste allowance, cost %, margin %, suggested price at target margin with below-target flag).

  • Playbook: references/labor-scheduling.md — labor % targets by daypart
  • and converting them into barista-hours.

  • Sample input: references/sample-latte.json.

← back to catalog