{
  "schemaVersion": "1.0",
  "item": {
    "slug": "zepto",
    "name": "Zepto",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/bewithgaurav/zepto",
    "canonicalUrl": "https://clawhub.ai/bewithgaurav/zepto",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/zepto",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=zepto",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "PARSER-USAGE.md",
      "PUBLISH_CHECKLIST.md",
      "README.md",
      "SECURITY.md",
      "SKILL.md",
      "ZEPTO_AUTH.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/zepto"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/zepto",
    "agentPageUrl": "https://openagent3.xyz/skills/zepto/agent",
    "manifestUrl": "https://openagent3.xyz/skills/zepto/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/zepto/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "zepto",
        "body": "Order groceries from Zepto in 30 seconds. From chat to checkout.\n\nTell your AI what you need. It shops, generates a payment link, sends it to WhatsApp. You pay on your phone. Groceries arrive in 10 minutes."
      },
      {
        "title": "💬 Examples",
        "body": "Quick orders:\n\n\"Order milk and bread from Zepto\"\n\"Add vegetables - tomatoes, onions, potatoes\"  \n\"Get me Amul butter and cheese\"\n\nYour usuals:\n\n\"Add my usual milk\" → AI picks the brand you always order\n\"Order the usual groceries\" → AI suggests your frequent items\n\nFull shopping list:\n\n\"Add milk, bread, eggs, coriander, ginger, and tea bags\"\n→ AI adds everything, shows total: ₹X\n→ Sends payment link to WhatsApp\n→ You pay, groceries arrive"
      },
      {
        "title": "🔒 Security & Privacy",
        "body": "What this skill does:\n\n✅ Browser automation on zepto.com (your local browser, your session)\n✅ Stores order history locally in ~/.openclaw/skills/zepto/order-history.json (local file, not shared)\n✅ Sends payment links via WhatsApp (requires your consent for each order)\n✅ All authentication happens through Zepto's official flow (Phone + OTP)\n\nWhat this skill does NOT do:\n\n❌ No automatic payments (you must click the link and pay manually)\n❌ No data sent to external servers (except Zepto.com and WhatsApp via your channels)\n❌ No persistent background jobs (optional one-time order status check only if you approve)\n❌ No storage of payment info or OTPs\n❌ No access to your banking/UPI apps\n\nData Storage:\n\nOrder history: ~/.openclaw/skills/zepto/order-history.json (local only, helps with \"usuals\" feature)\nBrowser session: Managed by OpenClaw's browser (standard Chrome/Chromium profile)\n\nUser Control:\n\nYou control when to order\nYou approve each payment link\nYou can delete order history file anytime\nAll browser actions happen in your profile with your visibility"
      },
      {
        "title": "🚨 CRITICAL WORKFLOW RULES",
        "body": "ALWAYS follow this order when building an order:"
      },
      {
        "title": "Rule 1: CHECK CART FIRST",
        "body": "# Before adding ANY items, ALWAYS check cart state\nnode zepto-agent.js get-cart\n\nWhy: Cart may have items from previous sessions. Adding duplicates is wasteful."
      },
      {
        "title": "Rule 2: Use smart-shop (RECOMMENDED)",
        "body": "# This handles everything: clears unwanted, checks duplicates, adds missing\nnode zepto-agent.js smart-shop \"milk, bread, eggs\"\n\nWhat it does:\n\nChecks current cart state\nClears existing items (if any)\nFor each item: checks if already in cart → skips if present → adds only if missing\nReturns: { added: [], skipped: [], failed: [] }"
      },
      {
        "title": "Rule 3: NEVER take screenshots unless snapshot data is insufficient",
        "body": "Snapshot shows all refs, buttons, text\nScreenshot is ONLY for visual debugging when snapshot is truncated or unclear\nIn 99% of cases, snapshot is enough"
      },
      {
        "title": "Rule 4: Detect \"already in cart\" signals",
        "body": "When you see in snapshot:\n\n\"Decrease quantity 1 Increase quantity\"  → Item is IN CART\nbutton \"Remove\" [ref=eXX]                 → Item is IN CART\n\nDO NOT click \"ADD\" when you see these signals!"
      },
      {
        "title": "Complete Flow",
        "body": "Authentication - Phone + OTP verification\nAddress Confirmation - Verify delivery location\nShopping - Search & add items (with YOUR usuals prioritized!)\nPayment Link - Generate & send Juspay link via WhatsApp"
      },
      {
        "title": "Step 0: Order History & Usuals",
        "body": "Your order history is tracked in: {SKILL_DIR}/order-history.json\n\n(Where {SKILL_DIR} is your skill directory, typically ~/.openclaw/skills/zepto/)\n\nSmart Selection Logic:\n\nWhen user requests an item (e.g., \"add milk\")\nCheck order-history.json for that category\nIf ordered 2+ times → Auto-add your most-ordered variant\nIf ordered 0-1 times → Show options and ask for selection"
      },
      {
        "title": "Automated Order History Scraper",
        "body": "When to run: User says \"update my zepto history\" or \"refresh order history\"\n\nProcess:\n\nNavigate to account page\nGet all delivered order URLs\nVisit each order sequentially\nExtract items using DOM scraping\nBuild frequency map\nSave to order-history.json\n\nImplementation:\n\n# Step 1: Navigate to account page\nbrowser navigate url=https://www.zepto.com/account profile=openclaw\n\n# Step 2: Extract order URLs\nbrowser act profile=openclaw request='{\"fn\":\"() => { const orders = []; document.querySelectorAll(\\\"a[href*=\\\\\\\"/order/\\\\\\\"]\\\").forEach(link => { if (link.href.includes(\\\"isArchived=false\\\") && link.textContent.includes(\\\"delivered\\\")) { orders.push(link.href); } }); return [...new Set(orders)]; }\", \"kind\":\"evaluate\"}'\n# Returns array of order URLs\n\n# Step 3: For each order URL:\nbrowser navigate url={order_url} profile=openclaw\n\n# Step 4: Extract items from order page\nbrowser act profile=openclaw request='{\"fn\":\"() => { const items = []; document.querySelectorAll(\\\"*\\\").forEach(el => { const text = el.textContent; if (text.match(/\\\\d+\\\\s*unit/i)) { const parent = el.closest(\\\"div\\\"); if (parent) { const lines = parent.textContent.split(\\\"\\\\n\\\").map(l => l.trim()).filter(l => l && l.length > 5 && l.length < 100); if (lines[0]) { const qtyMatch = text.match(/(\\\\d+)\\\\s*unit/i); items.push({ name: lines[0], quantity: qtyMatch ? parseInt(qtyMatch[1]) : 1 }); } } } }); const uniqueItems = {}; items.forEach(item => { if (!uniqueItems[item.name]) uniqueItems[item.name] = item; }); return Object.values(uniqueItems); }\", \"kind\":\"evaluate\"}'\n# Returns array of {name, quantity}\n\n# Step 5: Aggregate all items into frequency map\n# Build JSON structure with counts\n\n# Step 6: Write to file\nwrite path={SKILL_DIR}/order-history.json content={json_data}\n\nAutomated scraper advantages:\n\n✅ No manual screenshot review\n✅ Faster (visits all orders programmatically)\n✅ Always up-to-date\n✅ Can re-run anytime\n\nExample:\n\nUser: \"Update my Zepto order history\"\n\nResponse:\n\"🔍 Scanning your Zepto orders...\n📦 Found 6 delivered orders\n🔄 Extracting items...\n✅ Updated! Found:\n   - Coriander: 4 orders\n   - Milk: 3 orders\n   - Bread: 2 orders\n   - Potato: 2 orders\n   + 15 other items\n\nYour usuals are ready!\"\n\nSmart Selection Logic (Using History):\n\nExample:\n\nUser: \"Add milk\"\n\n[Check order-history.json]\n→ \"Amul Taaza Toned Fresh Milk | Pouch (500ml)\" ordered 3x\n\nResponse:\n\"🥛 Adding your usual milk!\nAmul Taaza Toned Fresh Milk (500ml) - ₹29\n📊 You've ordered this 3 times\n✅ Added to cart\"\n\nIf only ordered once or never:\n\nUser: \"Add milk\"\n\n[Check order-history.json]\n→ \"Amul Taaza\" ordered 1x only\n\nResponse:\n\"🥛 Found some milk options:\n1. Amul Taaza Toned (500ml) - ₹29 ⭐ 4.8 (100k) - You've ordered this once\n2. Amul Gold (1L) - ₹68 ⭐ 4.9 (80k) - Most popular\n3. Mother Dairy (500ml) - ₹30 ⭐ 4.7 (60k)\n\nWhich one? (or tell me a number)\"\n\nUpdate order history: After each successful order, update the JSON file with new items."
      },
      {
        "title": "Step 1: Authentication (First Time Only)",
        "body": "Check if already logged in:\n\nbrowser open url=https://www.zepto.com profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n# Look for \"login\" button vs \"profile\" link\n\nIf NOT logged in, start auth flow:"
      },
      {
        "title": "1.1: Get Phone Number",
        "body": "Ask user: \"What's your phone number for Zepto? (10 digits)\""
      },
      {
        "title": "1.2: Enter Phone & Request OTP",
        "body": "# Click login button\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{login_button_ref}\"}'\n\n# Type phone number\nbrowser act profile=openclaw request='{\"kind\":\"type\",\"ref\":\"{phone_input_ref}\",\"text\":\"{phone}\"}'\n\n# Click Continue\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{continue_button_ref}\"}'"
      },
      {
        "title": "1.3: Get OTP from User",
        "body": "Ask user: \"I've sent the OTP to {phone}. What's the OTP you received?\""
      },
      {
        "title": "1.4: Enter OTP",
        "body": "browser snapshot --interactive profile=openclaw  # Get OTP input refs\nbrowser act profile=openclaw request='{\"kind\":\"type\",\"ref\":\"{otp_input_ref}\",\"text\":\"{otp}\"}'\n# OTP auto-submits after 6 digits\n\nResult: User is now logged in! Session persists across browser restarts."
      },
      {
        "title": "Step 2: Address Confirmation",
        "body": "🚨 CRITICAL: ALWAYS CHECK ADDRESS BEFORE PROCEEDING WITH ANY SHOPPING!"
      },
      {
        "title": "Address Selection Rules",
        "body": "Default behavior:\n\nMost users have multiple saved addresses (Home, Office, etc.)\nALWAYS show current address and ASK for confirmation - never assume\nCheck what was used in the last order (if order history exists)\nWait for explicit user confirmation before proceeding\n\nOn homepage, address is visible in the header:\n\nbrowser snapshot --interactive profile=openclaw\n# Look for button with heading level=3 containing the address\n# Example ref: e16 with text like \"Home - [Address Details]...\"\n# Delivery time shown nearby (e.g., \"10 minutes\")\n\nALWAYS ask user to confirm before shopping:\n\n📍 I see your delivery address is set to:\n{Address Name} - {Full Address}\n⏱️ Delivery in ~{X} minutes\n\nIs this correct? Should I proceed with this address?"
      },
      {
        "title": "Programmatic Address Selection (NEW!)",
        "body": "Use the zepto-agent.js select-address command:\n\nnode zepto-agent.js select-address \"Home\"\nnode zepto-agent.js select-address \"sanskar\"     # Fuzzy matching works!\nnode zepto-agent.js select-address \"kundu blr\"\n\nHow it works:\n\nFuzzy matching - Case-insensitive, partial match supported\n\n\"sanskar\" → \"Sanskar Blr\" ✅\n\"home\" → \"New Home\" ✅\n\"kundu\" → \"Kundu Blr\" ✅\n\n\nAlready-selected detection - Skips if you're already at that address\nVerification - Confirms address change in header after click\n\nExample:\n\n# Current address: \"Kundu Blr\"\nnode zepto-agent.js select-address \"sanskar\"\n\n# Output:\n# ℹ️ Opening Zepto...\n# ✅ Zepto opened\n# ℹ️ 📍 Selecting address: \"sanskar\"\n# ℹ️ Current: Kundu Blr\n# ✅ Clicked: Sanskar BlrA-301, A, BLOCK-B...\n# 🎉 Address changed to: Sanskar blr\n\nWhen user says \"change address to X\" or \"deliver to X\":\n\n# Just call the command with their address name/query\nnode zepto-agent.js select-address \"{user_query}\"\n\nNo manual modal navigation needed! The script handles:\n\nOpening the address modal\nFinding the address (fuzzy match)\nClicking it\nVerifying the change\nClosing the modal\n\nManual Selection (Fallback):\nIf the programmatic method fails or address isn't found:\n\n# Click the address button (ref e16 or similar)\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"e16\"}'\n# This opens address selection modal with all saved addresses\n\nSelect address using JavaScript:\n\n# Replace {USER_ADDRESS_NAME} with the actual address name user selected\nbrowser act profile=openclaw request='{\"fn\":\"() => { const input = document.querySelector('input[placeholder*=\\\"address\\\"]'); if (!input) return { error: 'Modal not found' }; let modal = input; for (let i = 0; i < 15; i++) { if (!modal.parentElement) break; modal = modal.parentElement; if (window.getComputedStyle(modal).position === 'fixed') break; } const divs = Array.from(modal.querySelectorAll('div')); const match = divs.find(d => d.textContent && d.textContent.trim().startsWith('{USER_ADDRESS_NAME}')); if (!match) return { error: 'Address not found' }; let p = match; for (let i = 0; i < 10; i++) { if (!p) break; const s = window.getComputedStyle(p); if (p.onclick || p.getAttribute('onClick') || s.cursor === 'pointer') { p.scrollIntoView({ block: 'center' }); setTimeout(() => {}, 300); p.click(); return { clicked: true, text: match.textContent.substring(0, 100) }; } p = p.parentElement; } return { error: 'No clickable parent' }; }()\",\"kind\":\"evaluate\"}'\n\nAfter address confirmed by user:\n\n✅ Delivery address confirmed: {address_name}\n📍 {full_address}\n⏱️ ETA: {eta} mins\n\nReady to shop! What would you like to add to cart?\n\n⚠️ Address is CRITICAL - never skip this step!"
      },
      {
        "title": "3A: Discovery Mode (Browse & Explore)",
        "body": "When user asks to \"explore\", \"show me\", \"what's good\", \"find something\", or \"discover\":\n\nCommon Discovery Patterns:\n\n\"Show me healthy snacks under ₹50\"\n\"What's good in dairy products?\"\n\"Find me something for breakfast\"\n\"Any deals on fruits?\"\n\"Discover protein bars\"\n\nBrowse Categories:\n\n# Navigate to category pages\nbrowser navigate url=https://www.zepto.com profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n\n# Categories available on homepage:\n# - Fruits & Vegetables\n# - Dairy, Bread & Eggs\n# - Munchies (snacks)\n# - Cold Drinks & Juices\n# - Breakfast & Sauces\n# - Atta, Rice, Oil & Dals\n# - Cleaning Essentials\n# - Bath & Body\n# - Makeup & Beauty\n\nFilter & Sort:\n\n# Example: Browse \"Munchies\" category\nbrowser navigate url=https://www.zepto.com/pn/munchies profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n\n# Take screenshot to show user the options\nbrowser screenshot profile=openclaw\n\nDiscovery Response Format:\n\n🔍 Found some great options in {category}:\n\n1. **{Product Name}** - ₹{price} ({discount}% OFF)\n   ⭐ {rating} ({review_count} reviews)\n   📦 {size/quantity}\n   \n2. **{Product Name}** - ₹{price}\n   ⭐ {rating} ({review_count} reviews)\n   \n3. **{Product Name}** - ₹{price} ({discount}% OFF)\n   ⭐ {rating} ({review_count} reviews)\n\nWant me to add any of these? Just tell me the number(s)!\n\nSmart Filtering Tips:\n\nPrice range: Extract from query (\"under ₹50\", \"below 100\")\nDiscount focus: Look for items with ₹X OFF tags\nHigh ratings: Prioritize 4.5+ star products\nPopular items: Sort by review count (k = thousands)\nHealth focus: Keywords like \"protein\", \"sugar-free\", \"organic\", \"millet\"\n\nInteractive Discovery:\nAfter showing options, user can:\n\nAdd by number: \"Add 1 and 3\"\nAsk for more: \"Show me more\"\nRefine: \"Show cheaper options\" or \"What about chocolate flavors?\"\nBrowse different category: \"Now show me dairy products\""
      },
      {
        "title": "3B: Direct Search (Specific Items)",
        "body": "MANDATORY PRE-FLIGHT CHECK:\nBefore adding ANY items:\n\nClick cart button\nRead current cart contents\nIf cart has items: Ask user \"Keep existing items or clear cart first?\"\nIf empty: Proceed to shopping\n\nMulti-Item Shopping Flow:\nWhen user gives a list (e.g., \"add milk, butter, bread\"):\n\nAdd items ONE AT A TIME with verification:\n\nSearch for item\nClick ADD button\nWait 0.5s for page update\nVERIFY item shows quantity controls (means it's in cart)\nIf verification fails: Retry up to 3 times\n\n\nThen show final cart summary with all items and total\n\nCRITICAL: Never batch-add without verification! Page refs change after each add.\n\nItem Selection Logic:\n\nCheck order-history.json first\nIf item ordered 2+ times → auto-select that variant\nIf item ordered 0-1 times or multiple unclear variants → show options and ASK\nPick closest match to user's request (e.g., \"Yakult Light\" when they said \"light\")\nUse highest review count as tiebreaker\n\nWhen UNCLEAR about variant:\n\n🥛 Found multiple milk options:\n1. Amul Taaza (500ml) - ₹29 ⭐ 4.8 (100k)\n2. Amul Gold (1L) - ₹68 ⭐ 4.9 (80k)\n3. Mother Dairy (500ml) - ₹30 ⭐ 4.7 (60k)\n\nWhich one? (or tell me a number)\n\nSearch Process:\n\nbrowser navigate url=https://www.zepto.com/search?query={item} profile=openclaw\nbrowser snapshot --interactive profile=openclaw"
      },
      {
        "title": "Select Best Product",
        "body": "Rule: Pick product with highest review count (unless order history says otherwise).\n\nFormat: {rating} ({count}) where k=thousand, M=million.\n\nExample: \"4.8 (694.4k)\" = 694,400 reviews = most popular."
      },
      {
        "title": "Add to Cart",
        "body": "browser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{ADD_button_ref}\"}'"
      },
      {
        "title": "View Cart Summary (ALWAYS show after adding all items)",
        "body": "browser navigate url=https://www.zepto.com/?cart=open profile=openclaw\nbrowser snapshot profile=openclaw  # Get cart summary\n\nCart Summary Format:\n\n🛒 Added to cart:\n1. Item 1 - ₹XX\n2. Item 2 - ₹YY\n3. Item 3 - ₹ZZ\n\n💰 Total: ₹{total}\n\nReady to checkout? (say \"yes\" or \"checkout\" or \"lessgo\")\n\nCRITICAL - Quantity Mapping:\nWhen user provides a shopping list with quantities (e.g., \"3x jeera, 2x saffola oats\"):\n\nALWAYS create a mapping file FIRST before any cart operations\nMap each item name to its requested quantity\nBefore removing/modifying items, verify against this mapping\nNever assume which item has which quantity - CHECK THE MAPPING\n\nExample mapping:\n\n{\n  \"jeera\": 3,\n  \"saffola_oats\": 2,\n  \"milk\": 1\n}\n\nBefore removing duplicates or adjusting quantities:\n\nTake a cart snapshot\nMatch cart items to your mapping by name similarity\nVerify quantities match the original request\nIf unsure, ASK the user before making changes"
      },
      {
        "title": "Error Handling - Out of Stock",
        "body": "If item not found or out of stock:\n\n❌ {item} is currently unavailable.\n\n🔍 Suggestions:\n- {similar_item_1}\n- {similar_item_2}\n\nWhat would you like instead?\n\nDon't auto-add alternatives - wait for user's next item or choice."
      },
      {
        "title": "Step 4: Generate Payment Link",
        "body": "After all items added to cart and user confirms checkout:"
      },
      {
        "title": "4.1: Open Cart and Proceed to Payment",
        "body": "# Open cart modal\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{cart_button_ref}\"}'\n# Example ref from homepage: e44\n\n# Wait for cart to open, take snapshot\nbrowser snapshot --interactive profile=openclaw\n\n# Click \"Click to Pay ₹{amount}\" button\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{click_to_pay_button_ref}\"}'\n# Example ref: e3579"
      },
      {
        "title": "4.2: Extract Juspay Link",
        "body": "# Wait 2 seconds for navigation to complete\nbrowser act profile=openclaw request='{\"fn\":\"async () => { await new Promise(r => setTimeout(r, 2000)); return window.location.href; }\",\"kind\":\"evaluate\"}'\n\nURL Format:\n\nhttps://payments.juspay.in/payment-page/signature/zeptomarketplace-{order_id}\n\nExample:\n\nhttps://payments.juspay.in/payment-page/signature/zeptomarketplace-{ORDER_ID_EXAMPLE}"
      },
      {
        "title": "4.3: Send Link via WhatsApp",
        "body": "message action=send channel=whatsapp target={user_phone} message=\"🛒 *Your Zepto order is ready!*\n\n*Cart Summary ({item_count} items):*\n1. {item1} - ₹{price1}\n2. {item2} - ₹{price2}\n3. {item3} - ₹{price3}\n\n*💰 Total: ₹{total}*\n\n📍 Delivering to: {address_name} - {address}\n⏱️ ETA: {eta} minutes\n\n*🔗 Click here to pay:*\n{juspay_payment_link}\n\n⚠️ *IMPORTANT: After payment, message me \\\"DONE\\\" to confirm your order!*\n(Don't rely on the payment page - just tell me when you've paid and I'll verify it) 🚀\""
      },
      {
        "title": "4.4: Wait for User \"Done\" Message & Verify Order",
        "body": "After user says \"done\" or \"paid\":\n\nStep 1: Navigate to Zepto homepage to check order status\n\nbrowser navigate url=https://www.zepto.com profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n\nStep 2: Look for order confirmation\nCheck for text like:\n\n\"Your order is on the way\"\n\"Order confirmed\"\n\"Preparing your order\"\n\"Arriving in X mins\"\nTrack order button/link\n\nStep 3: Auto-clear cart (Post-Payment Behavior)\n\n🚨 CRITICAL: After payment, cart items persist because Zepto hasn't synced yet!\n\nAutomatically clear cart without asking (user expects cart to be empty after payment):\n\n# Open cart\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{cart_button_ref}\"}'\nbrowser snapshot --interactive profile=openclaw\n\n# Click Remove button for each item\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_button_ref_1}\"}'\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_button_ref_2}\"}'\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_button_ref_3}\"}'\n# ... repeat for all items\n\nStep 4: Confirm to user\n\nIf order confirmed:\n\n✅ *Payment confirmed!*\n🚚 Your order is on the way! Arriving in ~{X} mins.\n\nOrder details:\n- {item_count} items, ₹{total}\n- Delivery to: {address}\n\n✅ Cart cleared ({item_count} items removed from previous order)\n🛒 Ready for your next order! 🐺\n\nIf order NOT showing yet:\n\n⏳ Payment processed, but order confirmation is still loading on Zepto's end.\n\nLet me check again in 30 seconds...\n\nThen set up a background check to try again.\n\nStep 1: Navigate back to Zepto homepage\n\nbrowser navigate url=https://www.zepto.com profile=openclaw\n\nStep 2: Check order status on homepage\n\nbrowser snapshot --interactive profile=openclaw\n# Look for \"Your order is on the way\" or order tracking\n\nStep 3: Open cart and check items\n\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{cart_button_ref}\"}'\nbrowser snapshot --interactive profile=openclaw\n\n🚨 CRITICAL: Cart items may still be there because Zepto hasn't synced order confirmation yet!\n\nStep 4: Ask user about clearing cart\n\n✅ Payment confirmed! Your order is on the way.\n\n⚠️ I can see {X} items still in the cart (from the previous order that just went through).\n\nShould I:\n1. Clear the cart (recommended for fresh start)\n2. Keep the items (if you want to reorder them)\n\n*Default: I'll clear the cart unless you say \"keep it\"*\n\nStep 5: Clear cart if user approves (or by default)\n\n# For each item in cart, click Remove button\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_button_ref_1}\"}'\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_button_ref_2}\"}'\n# ... repeat for all items\n\n# Or use JavaScript to clear all at once:\nbrowser act profile=openclaw request='{\"fn\":\"() => { const removeButtons = document.querySelectorAll(\\\"button\\\"); let count = 0; for (let btn of removeButtons) { if (btn.textContent.trim() === \\\"Remove\\\") { btn.click(); count++; } } return `Removed ${count} items`; }\",\"kind\":\"evaluate\"}'\n\nConfirmation message:\n\n✅ Cart cleared! ({X} items removed)\n🛒 Ready for your next order!\n\nYour current order ({item_count} items, ₹{total}) will arrive in ~{eta} mins.\n\nIf user says \"keep it\":\n\n✅ Got it! Keeping {X} items in cart.\n🛒 Ready to add more items or proceed with these?\n\nGoing to cart manually and clicking \"Pay\"\nLet me know if you need me to try again\n\n**If delivery address becomes unserviceable:**\n\n⚠️ Your delivery address is currently unserviceable.\nShould I order it to a different address?\n\n(I can show you all your saved addresses)\n\n---\n\n## 🎯 Complete Order Flow Summary\n\n### Before Starting ANY New Order (Normal Flow - No Recent Payment):\n\n**1. Check Address (ALWAYS)**\n\n📍 Current address: {address}\nIs this correct?\n\n**2. Check Cart (if items exist)**\n```bash\n# Open cart\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{cart_button_ref}\"}'\nbrowser snapshot --interactive profile=openclaw\n\nIf items in cart from NORMAL browsing (not post-payment):\n\n⚠️ I see {X} items in your cart:\n1. {item1} - ₹{price1}\n2. {item2} - ₹{price2}\n\nShould I:\n1. Clear the cart\n2. Keep these items\n\nWhat would you like?\n\nWait for user response before proceeding."
      },
      {
        "title": "Post-Payment Behavior (After User Says \"Done\" or \"Paid\"):",
        "body": "This is DIFFERENT from normal flow - auto-clear expected!\n\n1. Navigate to zepto.com and check order status\n\nbrowser navigate url=https://www.zepto.com profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n\n2. Look for \"Your order is on the way\" or \"Arriving in X mins\"\n\n3. Open cart and AUTO-CLEAR without asking\n\n# Open cart\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{cart_button_ref}\"}'\n\n# Remove all items (they're from the order that just went through)\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_ref_1}\"}'\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_ref_2}\"}'\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_ref_3}\"}'\n\n4. Confirm to user\n\n✅ Payment confirmed! Your order is on the way! Arriving in ~{X} mins.\n\n✅ Cart cleared ({item_count} items removed from previous order)\n🛒 Ready for your next order!\n\nWhy auto-clear in post-payment?\n\nUser expects cart to be empty after successful order\nCart items are from the order they just paid for\nZepto hasn't synced yet, so items persist temporarily\nClearing prevents confusion and duplicate orders"
      },
      {
        "title": "Start Fresh Shopping (After Cart Cleared)",
        "body": "✅ Cart cleared!\n✅ Address confirmed: {address}\n\nWhat would you like to order? 🛒\n\nKey Difference:\n\nNormal flow: ASK before clearing cart (user might want those items)\nPost-payment flow: AUTO-CLEAR cart (user knows those items are ordered)"
      },
      {
        "title": "Safety & Best Practices",
        "body": "✅ DO:\n\nCheck auth status before every order\nConfirm address with user\nExtract payment link accurately\nSend link via WhatsApp\nLet user complete payment\n\n❌ DON'T:\n\nNever click \"Pay\" button\nNever store OTP\nNever auto-submit payment\nNever change address without user confirmation"
      },
      {
        "title": "Error Handling",
        "body": "Phone number invalid:\n\n\"Phone number should be 10 digits. Please try again.\"\n\nOTP verification failed:\n\n\"OTP verification failed. Let me resend the OTP.\nCheck your phone for the new code.\"\n\nLocation not serviceable:\n\n\"⚠️ Your location is currently not serviceable by Zepto.\nStore might be temporarily closed or location outside delivery zone.\nWant to try a different address?\"\n\nItem not found:\n\n\"Couldn't find {item} on Zepto. Try a different search term?\""
      },
      {
        "title": "Session Persistence",
        "body": "After successful authentication:\n\nBrowser cookies persist login\nNo need to re-authenticate for future orders\nAddress selection persists\nCan directly proceed to shopping\n\nTo check if authenticated:\n\nbrowser navigate url=https://www.zepto.com profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n# If \"profile\" link exists → logged in\n# If \"login\" button exists → need to auth"
      }
    ],
    "body": "zepto\n\nOrder groceries from Zepto in 30 seconds. From chat to checkout.\n\nTell your AI what you need. It shops, generates a payment link, sends it to WhatsApp. You pay on your phone. Groceries arrive in 10 minutes.\n\n💬 Examples\n\nQuick orders:\n\n\"Order milk and bread from Zepto\"\n\"Add vegetables - tomatoes, onions, potatoes\"  \n\"Get me Amul butter and cheese\"\n\n\nYour usuals:\n\n\"Add my usual milk\" → AI picks the brand you always order\n\"Order the usual groceries\" → AI suggests your frequent items\n\n\nFull shopping list:\n\n\"Add milk, bread, eggs, coriander, ginger, and tea bags\"\n→ AI adds everything, shows total: ₹X\n→ Sends payment link to WhatsApp\n→ You pay, groceries arrive\n\n🔒 Security & Privacy\n\nWhat this skill does:\n\n✅ Browser automation on zepto.com (your local browser, your session)\n✅ Stores order history locally in ~/.openclaw/skills/zepto/order-history.json (local file, not shared)\n✅ Sends payment links via WhatsApp (requires your consent for each order)\n✅ All authentication happens through Zepto's official flow (Phone + OTP)\n\nWhat this skill does NOT do:\n\n❌ No automatic payments (you must click the link and pay manually)\n❌ No data sent to external servers (except Zepto.com and WhatsApp via your channels)\n❌ No persistent background jobs (optional one-time order status check only if you approve)\n❌ No storage of payment info or OTPs\n❌ No access to your banking/UPI apps\n\nData Storage:\n\nOrder history: ~/.openclaw/skills/zepto/order-history.json (local only, helps with \"usuals\" feature)\nBrowser session: Managed by OpenClaw's browser (standard Chrome/Chromium profile)\n\nUser Control:\n\nYou control when to order\nYou approve each payment link\nYou can delete order history file anytime\nAll browser actions happen in your profile with your visibility\n🚨 CRITICAL WORKFLOW RULES\n\nALWAYS follow this order when building an order:\n\nRule 1: CHECK CART FIRST\n# Before adding ANY items, ALWAYS check cart state\nnode zepto-agent.js get-cart\n\n\nWhy: Cart may have items from previous sessions. Adding duplicates is wasteful.\n\nRule 2: Use smart-shop (RECOMMENDED)\n# This handles everything: clears unwanted, checks duplicates, adds missing\nnode zepto-agent.js smart-shop \"milk, bread, eggs\"\n\n\nWhat it does:\n\nChecks current cart state\nClears existing items (if any)\nFor each item: checks if already in cart → skips if present → adds only if missing\nReturns: { added: [], skipped: [], failed: [] }\nRule 3: NEVER take screenshots unless snapshot data is insufficient\nSnapshot shows all refs, buttons, text\nScreenshot is ONLY for visual debugging when snapshot is truncated or unclear\nIn 99% of cases, snapshot is enough\nRule 4: Detect \"already in cart\" signals\n\nWhen you see in snapshot:\n\n\"Decrease quantity 1 Increase quantity\"  → Item is IN CART\nbutton \"Remove\" [ref=eXX]                 → Item is IN CART\n\n\nDO NOT click \"ADD\" when you see these signals!\n\nComplete Flow\nAuthentication - Phone + OTP verification\nAddress Confirmation - Verify delivery location\nShopping - Search & add items (with YOUR usuals prioritized!)\nPayment Link - Generate & send Juspay link via WhatsApp\nStep 0: Order History & Usuals\n\nYour order history is tracked in: {SKILL_DIR}/order-history.json\n\n(Where {SKILL_DIR} is your skill directory, typically ~/.openclaw/skills/zepto/)\n\nSmart Selection Logic:\n\nWhen user requests an item (e.g., \"add milk\")\nCheck order-history.json for that category\nIf ordered 2+ times → Auto-add your most-ordered variant\nIf ordered 0-1 times → Show options and ask for selection\nAutomated Order History Scraper\n\nWhen to run: User says \"update my zepto history\" or \"refresh order history\"\n\nProcess:\n\nNavigate to account page\nGet all delivered order URLs\nVisit each order sequentially\nExtract items using DOM scraping\nBuild frequency map\nSave to order-history.json\n\nImplementation:\n\n# Step 1: Navigate to account page\nbrowser navigate url=https://www.zepto.com/account profile=openclaw\n\n# Step 2: Extract order URLs\nbrowser act profile=openclaw request='{\"fn\":\"() => { const orders = []; document.querySelectorAll(\\\"a[href*=\\\\\\\"/order/\\\\\\\"]\\\").forEach(link => { if (link.href.includes(\\\"isArchived=false\\\") && link.textContent.includes(\\\"delivered\\\")) { orders.push(link.href); } }); return [...new Set(orders)]; }\", \"kind\":\"evaluate\"}'\n# Returns array of order URLs\n\n# Step 3: For each order URL:\nbrowser navigate url={order_url} profile=openclaw\n\n# Step 4: Extract items from order page\nbrowser act profile=openclaw request='{\"fn\":\"() => { const items = []; document.querySelectorAll(\\\"*\\\").forEach(el => { const text = el.textContent; if (text.match(/\\\\d+\\\\s*unit/i)) { const parent = el.closest(\\\"div\\\"); if (parent) { const lines = parent.textContent.split(\\\"\\\\n\\\").map(l => l.trim()).filter(l => l && l.length > 5 && l.length < 100); if (lines[0]) { const qtyMatch = text.match(/(\\\\d+)\\\\s*unit/i); items.push({ name: lines[0], quantity: qtyMatch ? parseInt(qtyMatch[1]) : 1 }); } } } }); const uniqueItems = {}; items.forEach(item => { if (!uniqueItems[item.name]) uniqueItems[item.name] = item; }); return Object.values(uniqueItems); }\", \"kind\":\"evaluate\"}'\n# Returns array of {name, quantity}\n\n# Step 5: Aggregate all items into frequency map\n# Build JSON structure with counts\n\n# Step 6: Write to file\nwrite path={SKILL_DIR}/order-history.json content={json_data}\n\n\nAutomated scraper advantages:\n\n✅ No manual screenshot review\n✅ Faster (visits all orders programmatically)\n✅ Always up-to-date\n✅ Can re-run anytime\n\nExample:\n\nUser: \"Update my Zepto order history\"\n\nResponse:\n\"🔍 Scanning your Zepto orders...\n📦 Found 6 delivered orders\n🔄 Extracting items...\n✅ Updated! Found:\n   - Coriander: 4 orders\n   - Milk: 3 orders\n   - Bread: 2 orders\n   - Potato: 2 orders\n   + 15 other items\n\nYour usuals are ready!\"\n\n\nSmart Selection Logic (Using History):\n\nExample:\n\nUser: \"Add milk\"\n\n[Check order-history.json]\n→ \"Amul Taaza Toned Fresh Milk | Pouch (500ml)\" ordered 3x\n\nResponse:\n\"🥛 Adding your usual milk!\nAmul Taaza Toned Fresh Milk (500ml) - ₹29\n📊 You've ordered this 3 times\n✅ Added to cart\"\n\n\nIf only ordered once or never:\n\nUser: \"Add milk\"\n\n[Check order-history.json]\n→ \"Amul Taaza\" ordered 1x only\n\nResponse:\n\"🥛 Found some milk options:\n1. Amul Taaza Toned (500ml) - ₹29 ⭐ 4.8 (100k) - You've ordered this once\n2. Amul Gold (1L) - ₹68 ⭐ 4.9 (80k) - Most popular\n3. Mother Dairy (500ml) - ₹30 ⭐ 4.7 (60k)\n\nWhich one? (or tell me a number)\"\n\n\nUpdate order history: After each successful order, update the JSON file with new items.\n\nStep 1: Authentication (First Time Only)\n\nCheck if already logged in:\n\nbrowser open url=https://www.zepto.com profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n# Look for \"login\" button vs \"profile\" link\n\n\nIf NOT logged in, start auth flow:\n\n1.1: Get Phone Number\n\nAsk user: \"What's your phone number for Zepto? (10 digits)\"\n\n1.2: Enter Phone & Request OTP\n# Click login button\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{login_button_ref}\"}'\n\n# Type phone number\nbrowser act profile=openclaw request='{\"kind\":\"type\",\"ref\":\"{phone_input_ref}\",\"text\":\"{phone}\"}'\n\n# Click Continue\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{continue_button_ref}\"}'\n\n1.3: Get OTP from User\n\nAsk user: \"I've sent the OTP to {phone}. What's the OTP you received?\"\n\n1.4: Enter OTP\nbrowser snapshot --interactive profile=openclaw  # Get OTP input refs\nbrowser act profile=openclaw request='{\"kind\":\"type\",\"ref\":\"{otp_input_ref}\",\"text\":\"{otp}\"}'\n# OTP auto-submits after 6 digits\n\n\nResult: User is now logged in! Session persists across browser restarts.\n\nStep 2: Address Confirmation\n\n🚨 CRITICAL: ALWAYS CHECK ADDRESS BEFORE PROCEEDING WITH ANY SHOPPING!\n\nAddress Selection Rules\n\nDefault behavior:\n\nMost users have multiple saved addresses (Home, Office, etc.)\nALWAYS show current address and ASK for confirmation - never assume\nCheck what was used in the last order (if order history exists)\nWait for explicit user confirmation before proceeding\n\nOn homepage, address is visible in the header:\n\nbrowser snapshot --interactive profile=openclaw\n# Look for button with heading level=3 containing the address\n# Example ref: e16 with text like \"Home - [Address Details]...\"\n# Delivery time shown nearby (e.g., \"10 minutes\")\n\n\nALWAYS ask user to confirm before shopping:\n\n📍 I see your delivery address is set to:\n{Address Name} - {Full Address}\n⏱️ Delivery in ~{X} minutes\n\nIs this correct? Should I proceed with this address?\n\nProgrammatic Address Selection (NEW!)\n\nUse the zepto-agent.js select-address command:\n\nnode zepto-agent.js select-address \"Home\"\nnode zepto-agent.js select-address \"sanskar\"     # Fuzzy matching works!\nnode zepto-agent.js select-address \"kundu blr\"\n\n\nHow it works:\n\nFuzzy matching - Case-insensitive, partial match supported\n\"sanskar\" → \"Sanskar Blr\" ✅\n\"home\" → \"New Home\" ✅\n\"kundu\" → \"Kundu Blr\" ✅\nAlready-selected detection - Skips if you're already at that address\nVerification - Confirms address change in header after click\n\nExample:\n\n# Current address: \"Kundu Blr\"\nnode zepto-agent.js select-address \"sanskar\"\n\n# Output:\n# ℹ️ Opening Zepto...\n# ✅ Zepto opened\n# ℹ️ 📍 Selecting address: \"sanskar\"\n# ℹ️ Current: Kundu Blr\n# ✅ Clicked: Sanskar BlrA-301, A, BLOCK-B...\n# 🎉 Address changed to: Sanskar blr\n\n\nWhen user says \"change address to X\" or \"deliver to X\":\n\n# Just call the command with their address name/query\nnode zepto-agent.js select-address \"{user_query}\"\n\n\nNo manual modal navigation needed! The script handles:\n\nOpening the address modal\nFinding the address (fuzzy match)\nClicking it\nVerifying the change\nClosing the modal\n\nManual Selection (Fallback): If the programmatic method fails or address isn't found:\n\n# Click the address button (ref e16 or similar)\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"e16\"}'\n# This opens address selection modal with all saved addresses\n\n\nSelect address using JavaScript:\n\n# Replace {USER_ADDRESS_NAME} with the actual address name user selected\nbrowser act profile=openclaw request='{\"fn\":\"() => { const input = document.querySelector('input[placeholder*=\\\"address\\\"]'); if (!input) return { error: 'Modal not found' }; let modal = input; for (let i = 0; i < 15; i++) { if (!modal.parentElement) break; modal = modal.parentElement; if (window.getComputedStyle(modal).position === 'fixed') break; } const divs = Array.from(modal.querySelectorAll('div')); const match = divs.find(d => d.textContent && d.textContent.trim().startsWith('{USER_ADDRESS_NAME}')); if (!match) return { error: 'Address not found' }; let p = match; for (let i = 0; i < 10; i++) { if (!p) break; const s = window.getComputedStyle(p); if (p.onclick || p.getAttribute('onClick') || s.cursor === 'pointer') { p.scrollIntoView({ block: 'center' }); setTimeout(() => {}, 300); p.click(); return { clicked: true, text: match.textContent.substring(0, 100) }; } p = p.parentElement; } return { error: 'No clickable parent' }; }()\",\"kind\":\"evaluate\"}'\n\n\nAfter address confirmed by user:\n\n✅ Delivery address confirmed: {address_name}\n📍 {full_address}\n⏱️ ETA: {eta} mins\n\nReady to shop! What would you like to add to cart?\n\n\n⚠️ Address is CRITICAL - never skip this step!\n\nStep 3: Shopping\n3A: Discovery Mode (Browse & Explore)\n\nWhen user asks to \"explore\", \"show me\", \"what's good\", \"find something\", or \"discover\":\n\nCommon Discovery Patterns:\n\n\"Show me healthy snacks under ₹50\"\n\"What's good in dairy products?\"\n\"Find me something for breakfast\"\n\"Any deals on fruits?\"\n\"Discover protein bars\"\n\nBrowse Categories:\n\n# Navigate to category pages\nbrowser navigate url=https://www.zepto.com profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n\n# Categories available on homepage:\n# - Fruits & Vegetables\n# - Dairy, Bread & Eggs\n# - Munchies (snacks)\n# - Cold Drinks & Juices\n# - Breakfast & Sauces\n# - Atta, Rice, Oil & Dals\n# - Cleaning Essentials\n# - Bath & Body\n# - Makeup & Beauty\n\n\nFilter & Sort:\n\n# Example: Browse \"Munchies\" category\nbrowser navigate url=https://www.zepto.com/pn/munchies profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n\n# Take screenshot to show user the options\nbrowser screenshot profile=openclaw\n\n\nDiscovery Response Format:\n\n🔍 Found some great options in {category}:\n\n1. **{Product Name}** - ₹{price} ({discount}% OFF)\n   ⭐ {rating} ({review_count} reviews)\n   📦 {size/quantity}\n   \n2. **{Product Name}** - ₹{price}\n   ⭐ {rating} ({review_count} reviews)\n   \n3. **{Product Name}** - ₹{price} ({discount}% OFF)\n   ⭐ {rating} ({review_count} reviews)\n\nWant me to add any of these? Just tell me the number(s)!\n\n\nSmart Filtering Tips:\n\nPrice range: Extract from query (\"under ₹50\", \"below 100\")\nDiscount focus: Look for items with ₹X OFF tags\nHigh ratings: Prioritize 4.5+ star products\nPopular items: Sort by review count (k = thousands)\nHealth focus: Keywords like \"protein\", \"sugar-free\", \"organic\", \"millet\"\n\nInteractive Discovery: After showing options, user can:\n\nAdd by number: \"Add 1 and 3\"\nAsk for more: \"Show me more\"\nRefine: \"Show cheaper options\" or \"What about chocolate flavors?\"\nBrowse different category: \"Now show me dairy products\"\n3B: Direct Search (Specific Items)\n\nMANDATORY PRE-FLIGHT CHECK: Before adding ANY items:\n\nClick cart button\nRead current cart contents\nIf cart has items: Ask user \"Keep existing items or clear cart first?\"\nIf empty: Proceed to shopping\n\nMulti-Item Shopping Flow: When user gives a list (e.g., \"add milk, butter, bread\"):\n\nAdd items ONE AT A TIME with verification:\nSearch for item\nClick ADD button\nWait 0.5s for page update\nVERIFY item shows quantity controls (means it's in cart)\nIf verification fails: Retry up to 3 times\nThen show final cart summary with all items and total\n\nCRITICAL: Never batch-add without verification! Page refs change after each add.\n\nItem Selection Logic:\n\nCheck order-history.json first\nIf item ordered 2+ times → auto-select that variant\nIf item ordered 0-1 times or multiple unclear variants → show options and ASK\nPick closest match to user's request (e.g., \"Yakult Light\" when they said \"light\")\nUse highest review count as tiebreaker\n\nWhen UNCLEAR about variant:\n\n🥛 Found multiple milk options:\n1. Amul Taaza (500ml) - ₹29 ⭐ 4.8 (100k)\n2. Amul Gold (1L) - ₹68 ⭐ 4.9 (80k)\n3. Mother Dairy (500ml) - ₹30 ⭐ 4.7 (60k)\n\nWhich one? (or tell me a number)\n\n\nSearch Process:\n\nbrowser navigate url=https://www.zepto.com/search?query={item} profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n\nSelect Best Product\n\nRule: Pick product with highest review count (unless order history says otherwise).\n\nFormat: {rating} ({count}) where k=thousand, M=million.\n\nExample: \"4.8 (694.4k)\" = 694,400 reviews = most popular.\n\nAdd to Cart\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{ADD_button_ref}\"}'\n\nView Cart Summary (ALWAYS show after adding all items)\nbrowser navigate url=https://www.zepto.com/?cart=open profile=openclaw\nbrowser snapshot profile=openclaw  # Get cart summary\n\n\nCart Summary Format:\n\n🛒 Added to cart:\n1. Item 1 - ₹XX\n2. Item 2 - ₹YY\n3. Item 3 - ₹ZZ\n\n💰 Total: ₹{total}\n\nReady to checkout? (say \"yes\" or \"checkout\" or \"lessgo\")\n\n\nCRITICAL - Quantity Mapping: When user provides a shopping list with quantities (e.g., \"3x jeera, 2x saffola oats\"):\n\nALWAYS create a mapping file FIRST before any cart operations\nMap each item name to its requested quantity\nBefore removing/modifying items, verify against this mapping\nNever assume which item has which quantity - CHECK THE MAPPING\n\nExample mapping:\n\n{\n  \"jeera\": 3,\n  \"saffola_oats\": 2,\n  \"milk\": 1\n}\n\n\nBefore removing duplicates or adjusting quantities:\n\nTake a cart snapshot\nMatch cart items to your mapping by name similarity\nVerify quantities match the original request\nIf unsure, ASK the user before making changes\nError Handling - Out of Stock\n\nIf item not found or out of stock:\n\n❌ {item} is currently unavailable.\n\n🔍 Suggestions:\n- {similar_item_1}\n- {similar_item_2}\n\nWhat would you like instead?\n\n\nDon't auto-add alternatives - wait for user's next item or choice.\n\nStep 4: Generate Payment Link\n\nAfter all items added to cart and user confirms checkout:\n\n4.1: Open Cart and Proceed to Payment\n# Open cart modal\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{cart_button_ref}\"}'\n# Example ref from homepage: e44\n\n# Wait for cart to open, take snapshot\nbrowser snapshot --interactive profile=openclaw\n\n# Click \"Click to Pay ₹{amount}\" button\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{click_to_pay_button_ref}\"}'\n# Example ref: e3579\n\n4.2: Extract Juspay Link\n# Wait 2 seconds for navigation to complete\nbrowser act profile=openclaw request='{\"fn\":\"async () => { await new Promise(r => setTimeout(r, 2000)); return window.location.href; }\",\"kind\":\"evaluate\"}'\n\n\nURL Format:\n\nhttps://payments.juspay.in/payment-page/signature/zeptomarketplace-{order_id}\n\n\nExample:\n\nhttps://payments.juspay.in/payment-page/signature/zeptomarketplace-{ORDER_ID_EXAMPLE}\n\n4.3: Send Link via WhatsApp\nmessage action=send channel=whatsapp target={user_phone} message=\"🛒 *Your Zepto order is ready!*\n\n*Cart Summary ({item_count} items):*\n1. {item1} - ₹{price1}\n2. {item2} - ₹{price2}\n3. {item3} - ₹{price3}\n\n*💰 Total: ₹{total}*\n\n📍 Delivering to: {address_name} - {address}\n⏱️ ETA: {eta} minutes\n\n*🔗 Click here to pay:*\n{juspay_payment_link}\n\n⚠️ *IMPORTANT: After payment, message me \\\"DONE\\\" to confirm your order!*\n(Don't rely on the payment page - just tell me when you've paid and I'll verify it) 🚀\"\n\n4.4: Wait for User \"Done\" Message & Verify Order\n\nAfter user says \"done\" or \"paid\":\n\nStep 1: Navigate to Zepto homepage to check order status\n\nbrowser navigate url=https://www.zepto.com profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n\n\nStep 2: Look for order confirmation Check for text like:\n\n\"Your order is on the way\"\n\"Order confirmed\"\n\"Preparing your order\"\n\"Arriving in X mins\"\nTrack order button/link\n\nStep 3: Auto-clear cart (Post-Payment Behavior)\n\n🚨 CRITICAL: After payment, cart items persist because Zepto hasn't synced yet!\n\nAutomatically clear cart without asking (user expects cart to be empty after payment):\n\n# Open cart\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{cart_button_ref}\"}'\nbrowser snapshot --interactive profile=openclaw\n\n# Click Remove button for each item\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_button_ref_1}\"}'\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_button_ref_2}\"}'\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_button_ref_3}\"}'\n# ... repeat for all items\n\n\nStep 4: Confirm to user\n\nIf order confirmed:\n\n✅ *Payment confirmed!*\n🚚 Your order is on the way! Arriving in ~{X} mins.\n\nOrder details:\n- {item_count} items, ₹{total}\n- Delivery to: {address}\n\n✅ Cart cleared ({item_count} items removed from previous order)\n🛒 Ready for your next order! 🐺\n\n\nIf order NOT showing yet:\n\n⏳ Payment processed, but order confirmation is still loading on Zepto's end.\n\nLet me check again in 30 seconds...\n\n\nThen set up a background check to try again.\n\nStep 1: Navigate back to Zepto homepage\n\nbrowser navigate url=https://www.zepto.com profile=openclaw\n\n\nStep 2: Check order status on homepage\n\nbrowser snapshot --interactive profile=openclaw\n# Look for \"Your order is on the way\" or order tracking\n\n\nStep 3: Open cart and check items\n\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{cart_button_ref}\"}'\nbrowser snapshot --interactive profile=openclaw\n\n\n🚨 CRITICAL: Cart items may still be there because Zepto hasn't synced order confirmation yet!\n\nStep 4: Ask user about clearing cart\n\n✅ Payment confirmed! Your order is on the way.\n\n⚠️ I can see {X} items still in the cart (from the previous order that just went through).\n\nShould I:\n1. Clear the cart (recommended for fresh start)\n2. Keep the items (if you want to reorder them)\n\n*Default: I'll clear the cart unless you say \"keep it\"*\n\n\nStep 5: Clear cart if user approves (or by default)\n\n# For each item in cart, click Remove button\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_button_ref_1}\"}'\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_button_ref_2}\"}'\n# ... repeat for all items\n\n# Or use JavaScript to clear all at once:\nbrowser act profile=openclaw request='{\"fn\":\"() => { const removeButtons = document.querySelectorAll(\\\"button\\\"); let count = 0; for (let btn of removeButtons) { if (btn.textContent.trim() === \\\"Remove\\\") { btn.click(); count++; } } return `Removed ${count} items`; }\",\"kind\":\"evaluate\"}'\n\n\nConfirmation message:\n\n✅ Cart cleared! ({X} items removed)\n🛒 Ready for your next order!\n\nYour current order ({item_count} items, ₹{total}) will arrive in ~{eta} mins.\n\n\nIf user says \"keep it\":\n\n✅ Got it! Keeping {X} items in cart.\n🛒 Ready to add more items or proceed with these?\n\nGoing to cart manually and clicking \"Pay\"\nLet me know if you need me to try again\n\n**If delivery address becomes unserviceable:**\n\n\n⚠️ Your delivery address is currently unserviceable. Should I order it to a different address?\n\n(I can show you all your saved addresses)\n\n\n---\n\n## 🎯 Complete Order Flow Summary\n\n### Before Starting ANY New Order (Normal Flow - No Recent Payment):\n\n**1. Check Address (ALWAYS)**\n\n\n📍 Current address: {address} Is this correct?\n\n\n**2. Check Cart (if items exist)**\n```bash\n# Open cart\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{cart_button_ref}\"}'\nbrowser snapshot --interactive profile=openclaw\n\n\nIf items in cart from NORMAL browsing (not post-payment):\n\n⚠️ I see {X} items in your cart:\n1. {item1} - ₹{price1}\n2. {item2} - ₹{price2}\n\nShould I:\n1. Clear the cart\n2. Keep these items\n\nWhat would you like?\n\n\nWait for user response before proceeding.\n\nPost-Payment Behavior (After User Says \"Done\" or \"Paid\"):\n\nThis is DIFFERENT from normal flow - auto-clear expected!\n\n1. Navigate to zepto.com and check order status\n\nbrowser navigate url=https://www.zepto.com profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n\n\n2. Look for \"Your order is on the way\" or \"Arriving in X mins\"\n\n3. Open cart and AUTO-CLEAR without asking\n\n# Open cart\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{cart_button_ref}\"}'\n\n# Remove all items (they're from the order that just went through)\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_ref_1}\"}'\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_ref_2}\"}'\nbrowser act profile=openclaw request='{\"kind\":\"click\",\"ref\":\"{remove_ref_3}\"}'\n\n\n4. Confirm to user\n\n✅ Payment confirmed! Your order is on the way! Arriving in ~{X} mins.\n\n✅ Cart cleared ({item_count} items removed from previous order)\n🛒 Ready for your next order!\n\n\nWhy auto-clear in post-payment?\n\nUser expects cart to be empty after successful order\nCart items are from the order they just paid for\nZepto hasn't synced yet, so items persist temporarily\nClearing prevents confusion and duplicate orders\nStart Fresh Shopping (After Cart Cleared)\n✅ Cart cleared!\n✅ Address confirmed: {address}\n\nWhat would you like to order? 🛒\n\n\nKey Difference:\n\nNormal flow: ASK before clearing cart (user might want those items)\nPost-payment flow: AUTO-CLEAR cart (user knows those items are ordered)\nSafety & Best Practices\n\n✅ DO:\n\nCheck auth status before every order\nConfirm address with user\nExtract payment link accurately\nSend link via WhatsApp\nLet user complete payment\n\n❌ DON'T:\n\nNever click \"Pay\" button\nNever store OTP\nNever auto-submit payment\nNever change address without user confirmation\nError Handling\n\nPhone number invalid:\n\n\"Phone number should be 10 digits. Please try again.\"\n\n\nOTP verification failed:\n\n\"OTP verification failed. Let me resend the OTP.\nCheck your phone for the new code.\"\n\n\nLocation not serviceable:\n\n\"⚠️ Your location is currently not serviceable by Zepto.\nStore might be temporarily closed or location outside delivery zone.\nWant to try a different address?\"\n\n\nItem not found:\n\n\"Couldn't find {item} on Zepto. Try a different search term?\"\n\nSession Persistence\n\nAfter successful authentication:\n\nBrowser cookies persist login\nNo need to re-authenticate for future orders\nAddress selection persists\nCan directly proceed to shopping\n\nTo check if authenticated:\n\nbrowser navigate url=https://www.zepto.com profile=openclaw\nbrowser snapshot --interactive profile=openclaw\n# If \"profile\" link exists → logged in\n# If \"login\" button exists → need to auth"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/bewithgaurav/zepto",
    "publisherUrl": "https://clawhub.ai/bewithgaurav/zepto",
    "owner": "bewithgaurav",
    "version": "1.0.6",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/zepto",
    "downloadUrl": "https://openagent3.xyz/downloads/zepto",
    "agentUrl": "https://openagent3.xyz/skills/zepto/agent",
    "manifestUrl": "https://openagent3.xyz/skills/zepto/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/zepto/agent.md"
  }
}