swiggy-cart
Installation
SKILL.md
swiggy-cart
Carts live on Swiggy's side, keyed to the account. Food and Instamart carts are separate. Everything here except clearing is safe to re-run; retrying the same add-to-cart does not double-add.
Rules
- Read the cart at the start of every turn that touches it, and again before any checkout. The user may have edited it in the Swiggy app; prices and stock change between turns. Never trust what you remember.
- Food: one restaurant per cart. Adding from a second restaurant flushes the first. Before doing that, tell the user what they will lose and get a yes.
- Instamart: upstream
update_cartreplaces the whole cart. Useswiggy instamart add(it reads the cart and merges) for "add X"; useset-cartonly when the user wants exactly that list. Sending only the new item throughset-cartsilently deletes the rest. - Use the ids the search gave you, verbatim. Food needs
menu_item_id(fromsearch-menu/menu); Instamart needs the variation'sspinId(+skuId). Names andproductIdare not accepted. - A coupon counts as applied only when the cart shows a positive discount. Swiggy auto-suggests coupons with
coupon_discount: 0; do not tell the user they saved money unless the number is > 0. - Quantity changes on customised Food items need a decision. If the item has variants/addons, ask whether the extra unit gets the same add-ons before sending the update; do not silently replicate them.
Read
swiggy food cart --json --no-interactive # data.data.items[], pricing.to_pay, offers, availablePaymentMethods
swiggy instamart cart --json --no-interactive # data.items[], billBreakdown.toPay, unserviceableItems, paymentOptions