Activate when the user:
Do NOT activate if:
Take a take_snapshot of the user's current page.
Scan the snapshot for any input field with labels, placeholders, or nearby text matching patterns like:
If NO such field is found:
"I couldn't find a promo/discount code field on this page. This skill only works on checkout or cart pages that have a code input. Please navigate to the payment/cart page first." Stop here.
If a field IS found: Note its element ID for later use. Also note the location of any Apply / Redeem / Submit code button — this is the ONLY button that will ever be clicked. Identify and note any Pay / Place Order / Complete Purchase / Confirm buttons — these must never be clicked.
Use get_page_content to identify the store/merchant name (from page title, logo alt text, or domain).
Report to user: "Found a promo code field on [Store Name]. Searching for codes now..."
Open a hidden window with create_hidden_window for research. Then open parallel tabs with new_hidden_page to search these sources simultaneously:
TabURL Pattern1https://www.google.com/search?q=<store>+promo+code+<current_year>2https://www.google.com/search?q=<store>+coupon+code+working+<current_year>3https://www.retailmenot.com/view/<store-domain>4https://www.honey.com/coupons/<store-slug> (or search https://www.joinhoney.com/shop/<store>)5https://www.coupert.com/coupons/<store-slug>6https://www.coupons.com/coupon-codes/<store-slug>/7https://dealspotr.com/#_=&query=<store>8https://slickdeals.net/coupons/<store-slug>/9Reddit: https://www.google.com/search?q=site:reddit.com+<store>+promo+code10https://www.wikibuy.com/stores/<store-slug>
Replace <store> with the merchant name (URL-encoded), <store-domain> with the root domain (e.g. nike.com), and <current_year> with the current year.
For each tab, after the page loads:
Use get_page_content to extract text.
Use evaluate_script or regex pattern matching to find strings that look like promo codes:
SAVE20, WELCOME10, SUMMER2024)[A-Z0-9]{4,20} — typically 4–20 characters, often containing numbers or dashesCollect all found codes into a running list.
Close the tab with close_page when done.
After all tabs are processed:
close_window.⚠️ CRITICAL SAFETY RULES — must be followed throughout this phase:
For each code in the list:
Re-take take_snapshot to ensure the promo field element ID is still valid (page may have refreshed).
clear the promo code input field.
fill the promo code input with the current code.
Click the Apply / Redeem button (not any payment button).
Wait for page feedback — use take_snapshot or get_page_content to check for:
Report progress in chat after each attempt: "Testing SAVE20... ❌ Invalid. Testing WELCOME15... ✅ Code applied! You saved $12.00"
Stop testing as soon as a code succeeds.
If the apply action causes a page reload or navigation, re-verify you are still on the checkout page before continuing.
fill.Enter — use press_key with "Enter" if no apply button is found.✅ Discount code found:
WELCOME15This code has been applied to your cart. You saved $12.00 (15% off). Your new total is visible on the page. You're ready to complete your purchase when you're ready.
Show a summary table of all codes tested:
text
| Code | Source | Result |
|-------------|-----------------|------------|
| SAVE20 | RetailMeNot | ❌ Expired |
| SUMMER10 | Coupons.com | ❌ Invalid |
| WELCOME15 | Honey / Reddit | ✅ Applied! |
❌ No working codes found after testing N codes. The following codes were tried:
CODE1,CODE2, ... Unfortunately none applied a discount. You may want to check the store's official newsletter or social media for current promotions.