Add a new product to the shop. Creates the product page, adds it to Stripe, and wires up the buy button.
You are helping add a new product to the uberniche.co.uk Caterham parts shop. Follow these steps in order, checking in with the user at each stage before proceeding.
Ask the user for the following if not already provided via $ARGUMENTS:
fuel-neck-shim) — becomes <slug>.md in the repo rootimg/ directory. Ask what it's called, then verify the file exists with Glob at img/<filename>Do not proceed until you have all of the above.
Create <slug>.md in the repo root. Follow the exact pattern used by existing product pages:
# Product Name as the H1 for the imagePRICE_ID_PLACEHOLDER for now (real IDs come in Step 4){% include_relative delivery.md %}Single price button pattern:
<button onclick="addToBasket('PRICE_ID_PLACEHOLDER', 'Product Name', XX)">Add to basket – £XX + £4 P&P</button>
Multiple price buttons (variants, e.g. sizes or options):
<button onclick="addToBasket('PRICE_ID_PLACEHOLDER', 'Product Name', XX, 'Variant A')">Add to basket – Variant A – £XX + £4 P&P</button>
<button onclick="addToBasket('PRICE_ID_PLACEHOLDER', 'Product Name', XX, 'Variant B')">Add to basket – Variant B – £XX + £4 P&P</button>
addToBasket(priceId, name, priceInPounds, optionalLabel) is defined in assets/basket.js and is available on all pages. Do not add a <script> block — it is already loaded globally via _includes/basket.html.
Show the user the draft page and ask them to confirm before continuing.
Read scripts/products.json. Append a new entry for this product following the existing format:
{ "name": "...", "description": "...", "amount": <pence>, "currency": "gbp" }"prices": [{ "label": "...", "amount": <pence> }, ...] formatAmounts are in pence (£1.00 = 100). Write the updated file.
Run the create script. It reads the key from macOS Keychain automatically:
python3 scripts/stripe-create-products.py scripts/products.json
Parse the output carefully. Find the lines for the new product and extract the price ID(s) — they look like price_1Xxxxx....
Note: the script is idempotent so existing products will not be duplicated.
Replace each PRICE_ID_PLACEHOLDER in the new product page with the real price ID(s) from Step 4. Update the button text to match the exact Stripe amount if it differs from what was written.
Show the user:
index.md if it should appear in the shop listingAsk if they want you to add it to the index page.