Skill: jiajiaoy/buywise (version 1.5.4)

--- name: BuyWise description: | BuyWise is your personal shopping advisor — it helps you decide whether to buy, where to buy, and when to buy, across all major global and Chinese platforms. Instead of manually checking Amazon, eBay, AliExpress, Temu, JD, Taobao, and Tmall one by one, BuyWise aggregates prices from all platforms into a single comparison table with clear best-pick recommendations. It goes beyond simple price lookup: BuyWise analyzes historical price trends to detect fake promotions (the inflate-then-discount trick common in Double 11 / 618 sales), distills thousands of user reviews into a concise strengths/complaints/red-flags summary, recommends better alternatives at lower prices, and tells you whether to buy now or wait for the next major sale event. Just tell BuyWise what you want to buy — it handles the rest. keywords: shopping assistant, price comparison, buy or wait, deal checker, is it worth buying, fake discount, fake sale, discount detection, product review, review analysis, review summary, alternatives, best deal, best price, lowest price, price tracker, price history, Amazon price history, buy timing, pre-purchase research, save money, shopping decision, shopping guide, consumer guide, product research, shopping advisor, Amazon, eBay, AliExpress, Temu, JD, Taobao, Tmall, Pinduoduo, CamelCamelCamel, smzdm, Double 11, 11.11, 618 sale, Black Friday, Cyber Monday, cross-border shopping, budget alternative, all-time low metadata: openclaw: runtime: node: ">=18" --- # BuyWise — Global Shopping Decision Assistant > Price comparison · Fake discount detection · Review analysis · Alternative recommendations · Buy timing ## When to use - User asks "is this worth buying?" or "what do you think of this?" - User asks "compare prices", "where is the cheapest?", "best price for X" - User asks "is this Double 11 deal real?", "should I wait for 618?", "is now a good time to buy?" - User asks "summarize the reviews" or "any known issues with this?" - User asks "any cheaper alternatives?" or "anything better for the price?" - User shares a product link and asks whether it's worth purchasing --- ## 🌐 Language rules - Default to the user's language - Display prices in the user's local currency (¥ for China, $ for international) - Keep platform names in their original form (Amazon, JD, Temu, etc.) --- ## 🛒 Platform coverage | Market | Platforms | |--------|-----------| | China | JD, Taobao, Tmall, Pinduoduo (100B subsidy), Xianyu (used) | | International | Amazon, eBay, AliExpress, Temu | --- ## 🔌 Data sources BuyWise navigates **real product pages via the browser tool** — no guesswork from web_search alone: | Data type | Source | Platforms covered | |-----------|--------|-------------------| | China market prices | **smzdm.com** | JD, Taobao, Tmall, Pinduoduo | | Amazon price history | **CamelCamelCamel** | Amazon global | | Amazon current price | amazon.com search | Amazon | | eBay prices | ebay.com search | eBay | | AliExpress prices | aliexpress.com search | AliExpress | | Temu / Xianyu | web_search supplement | Temu, Xianyu | | Reviews | web_search + Zhihu / Xiaohongshu / Reddit | Multi-platform | > BuyWise navigates real data pages directly — no extra skill dependency required. --- ## 📋 Features ### Full buying decision (main) Triggered when user asks to evaluate a product: 1. **Multi-platform price comparison** — browser navigates smzdm / Amazon / eBay / AliExpress for real prices, compiled into one table 2. **Fake discount detection** — browser checks CamelCamelCamel + smzdm price history to expose inflate-then-discount tactics 3. **Review analysis** — extracts top 3 strengths / 3 complaints / who it's for / red flags from JD, Zhihu, Xiaohongshu, Reddit 4. **Alternative recommendations** — finds 2–3 better-value options in the same category 5. **Buy timing** — 🟢 Buy now / 🟡 Wait / 🔴 Skip verdict based on price history, sale calendar, current price ### Price comparison only Triggered when user only asks "how much is X" or "cheapest place to buy X" — returns comparison table, skips full analysis. ### Discount authenticity check Triggered when user asks "is this Double 11 price real?" or "is this discount genuine?" — focused analysis of price history. ### Deep review scan Triggered when user asks "tell me more about the reviews" or "what's the reputation like?" — deep search across review platforms, forums, and complaint records. --- ## 🔧 Scripts ```bash # Full buying decision (main entry) node scripts/advise.js <product> [--lang zh|en] # Examples: node scripts/advise.js "Dyson V15" node scripts/advise.js "Sony WH-1000XM5" --lang en # Price comparison only node scripts/compare.js <product> [--lang zh|en] node scripts/compare.js "AirPods Pro 2" # Fake discount check node scripts/deal-check.js <product> [--price current] [--was listed] [--lang zh|en] node scripts/deal-check.js "iPhone 16" --price 5999 --was 7999 # Review analysis node scripts/review-scan.js <product> [--lang zh|en] node scripts/review-scan.js "Xiaomi Router BE7000" ``` --- ## ⚠️ Notes 1. Prices are based on real-time search and may have slight delays — confirm on the platform before purchasing 2. Price history analysis relies on public data; if a platform does not publish history, search results are used as reference 3. Review summaries are based on public sources and do not represent all user experiences 4. Sale event timing (Double 11 / 618) follows the Chinese e-commerce calendar; international sales reference Black Friday / Prime Day 5. Alternative recommendations contain no ads or sponsorships — based solely on value-for-money analysis

path: README.md
content: # BuyWise — Global Shopping Decision Assistant

> Should you buy it? Compare prices on 8+ platforms, detect fake discounts, analyze reviews, and get a clear Buy / Wait / Skip verdict.

[![clawhub](https://img.shields.io/badge/clawhub-buywise-blue)](https://clawhub.ai/skills/buywise)
[![version](https://img.shields.io/badge/version-1.5.0-green)](https://clawhub.ai/skills/buywise)
[![license](https://img.shields.io/badge/license-MIT--0-lightgrey)](LICENSE)

## What it does

BuyWise is an [OpenClaw](https://openclaw.ai) skill that answers the question you ask before every purchase: *is this actually a good deal?*

It navigates real product pages using your AI's browser tool — no fabricated prices — and returns a verdict with evidence.

**Price comparison** — Amazon, eBay, AliExpress, Temu, JD, Taobao, Tmall, smzdm in one report  
**Fake discount detection** — checks CamelCamelCamel and smzdm price history to expose "inflate then discount" tactics  
**Review analysis** — extracts top strengths, complaints, who it's for, and red flags  
**Alternatives** — recommends 2-3 better-value options with price ranges  
**Buy timing** — 🟢 Buy now / 🟡 Wait / 🔴 Skip verdict with reasoning  
**Coupon stacking** — hands off to [CouponClaw](https://github.com/jiajiaoy/CouponClaw) to stack promo codes + cashback on confirmed buys

## Price sources

| Platform | Region | Notes |
|---|---|---|
| Google Shopping (`?tbm=shop`) | Global | Aggregates Amazon, eBay, Walmart, Best Buy and dozens more |
| smzdm | China | Aggregates JD / Taobao / Tmall / Pinduoduo in one page |
| Amazon | US/Global | Cross-verified with Google Shopping |
| AliExpress | Global | Budget / wholesale reference |
| Temu | Global | Via web_search (no standard search URL) |
| CamelCamelCamel | Amazon history | All-time low, 90-day average, pre-sale spike detection |
| JD | China | Self-operated listings |

## Installation

```bash
openclaw install buywise
```

## Usage

```bash
# Full buying decision
openclaw run buywise advise "Sony WH-1000XM5"

# Price comparison only
openclaw run buywise compare "iPhone 16 Pro"

# Check if a sale is genuine
openclaw run buywise deal "Dyson V15 --price 399 --was 649"

# Review deep-dive
openclaw run buywise review "Kindle Paperwhite"
```

## Ecosystem

Part of the **OpenClaw Smart Consumer** skill suite:

| Skill | Description |
|---|---|
| [TrendRadar](https://github.com/jiajiaoy/TrendRadar) | Detect trending products → feed into BuyWise |
| **BuyWise** | Shopping decision ← you are here |
| [CouponClaw](https://github.com/jiajiaoy/CouponClaw) | Stack coupons + cashback after BuyWise confirms it's worth buying |
| [TravelHound](https://github.com/jiajiaoy/TravelHound) | Same logic applied to flights and hotels |
| [NewsToday](https://github.com/jiajiaoy/NewsToday) | Daily news including consumer/market trends |

## Keywords

price comparison · buy or wait · fake discount · Amazon price history · CamelCamelCamel · shopping assistant · deal checker · product review · is it worth buying · save money · buy timing · cross-border shopping · Black Friday · Cyber Monday

---

Built for [OpenClaw](https://openclaw.ai) · Published on [clawhub.ai/skills/buywise](https://clawhub.ai/skills/buywise)


path: package.json
content: {
  "name": "buywise",
  "version": "1.5.3",
  "description": "Should you buy it? Price-compare across Amazon, JD, AliExpress, Temu, eBay — detect fake discounts, analyze reviews, and get a clear Buy / Wait / Skip verdict.",
  "keywords": [
    "should I buy",
    "is it worth buying",
    "buy or wait",
    "worth it",
    "price comparison",
    "compare prices",
    "best price",
    "lowest price",
    "price tracker",
    "Amazon price history",
    "price history",
    "price drop",
    "price alert",
    "fake discount",
    "fake sale",
    "discount checker",
    "deal checker",
    "deal authenticator",
    "Black Friday",
    "Cyber Monday",
    "11.11",
    "618 deals",
    "double 11",
    "product review",
    "review summary",
    "review analysis",
    "product research",
    "shopping assistant",
    "shopping guide",
    "shopping tips",
    "consumer guide",
    "alternatives",
    "product alternatives",
    "better alternative",
    "Amazon",
    "eBay",
    "AliExpress",
    "Temu",
    "JD",
    "Taobao",
    "Tmall",
    "CamelCamelCamel",
    "Google Shopping",
    "smzdm",
    "save money",
    "cross-border shopping",
    "overseas shopping",
    "buy timing",
    "all-time low",
    "pre-purchase checklist",
    "shopping decision",
    "product recommendations",
    "budget alternative",
    "Pinduoduo",
    "Double 11",
    "618 sale",
    "Prime Day"
  ],
  "author": "jiajiaoy",
  "license": "MIT-0",
  "scripts": {
    "advise": "node scripts/advise.js",
    "compare": "node scripts/compare.js",
    "review": "node scripts/review-scan.js",
    "deal": "node scripts/deal-check.js"
  },
  "openclaw": {
    "triggers": [
      "should I buy",
      "is it worth buying",
      "buy or wait",
      "price comparison",
      "compare prices",
      "fake discount",
      "product review",
      "worth buying",
      "deal checker",
      "review analysis",
      "buy timing",
      "shopping decision"
    ],
    "entrypoint": "scripts/advise.js"
  }
}

path: scripts/advise.js
content: #!/usr/bin/env node
'use strict';
/**
 * BuyWise — 综合购物决策主入口
 * 输入商品名或链接，输出完整的"买不买、在哪买、等不等"分析报告
 * 用法: node scripts/advise.js <商品名或URL> [--lang zh|en]
 */

const args = process.argv.slice(2);
const langIdx = args.indexOf('--lang');
const lang = langIdx !== -1 && args[langIdx + 1] === 'en' ? 'en' : 'zh';
const productArgs = args.filter((a, i) => a !== '--lang' && args[i - 1] !== '--lang');
const product = productArgs.join(' ').trim();

if (!product) {
  console.error(lang === 'zh' ? '用法: node scripts/advise.js <商品名或链接>' : 'Usage: node scripts/advise.js <product name or URL>');
  process.exit(1);
}

const now = new Date();
const dateISO = `${now.getFullYear()}-${String(now.getMonth()+1).padStart(2,'0')}-${String(now.getDate()).padStart(2,'0')}`;

// 判断是否临近大促节点
function nearPromo() {
  const m = now.getMonth() + 1, d = now.getDate();
  if ((m === 11 && d >= 1) || (m === 6 && d >= 1 && d <= 20)) return true;
  if ((m === 3 && d >= 8 && d <= 15) || (m === 12 && d >= 12 && d <= 13)) return true;
  return false;
}
const promoHint = nearPromo()
  ? (lang === 'zh' ? '\n⚠️ 当前临近大促节点，请重点分析是否值得等待促销，并核查价格是否真实优惠。' : '\n⚠️ Near a major sale event — prioritize analyzing whether waiting is worthwhile and verify if the discount is genuine.')
  : '';

const encoded = encodeURIComponent(product);

if (lang === 'zh') {
  console.log(`请对以下商品进行全面的购物决策分析：「${product}」
当前日期：${dateISO}${promoHint}

## 第一步：多平台比价（用 browser 导航，不要用 web_search 猜价格）
按顺序打开以下 URL，从页面直接提取价格：
1. https://search.smzdm.com/?c=home&s=${encoded}&v=b → 一站获取京东/淘宝/天猫/拼多多聚合价格
2. https://search.jd.com/Search?keyword=${encoded}&enc=utf-8 → 京东直查，取自营商品价格
3. https://www.google.com/search?q=${encoded}&tbm=shop → Google 购物：一站聚合 Amazon/eBay/Walmart 等几十家零售商真实价格，取价格区间和最低价
4. 如 Google 购物无法访问 → 备用 https://www.bing.com/shop?q=${encoded}
5. https://www.amazon.com/s?k=${encoded} → 与 Google Shopping 交叉验证 Amazon 价格
6. https://www.aliexpress.com/wholesale?SearchText=${encoded} → AliExpress 前3条价格
7. web_search「${product} Temu price」→ Temu 补充（无标准搜索 URL）
8. web_search「${product} 闲鱼 价格」→ 二手参考

⚠️ 规则：只记录从页面实际读取到的价格；某平台无法访问则标"无法获取"，不得编造数字。

## 第二步：促销真实性核查（用 browser 查历史价格）
1. https://camelcamelcamel.com/search?search=${encoded} → Amazon 历史最低/均价/是否促销前涨价
2. 在步骤1的 smzdm 商品详情页查看"价格走势图"和"历史低价"
判断：当前价 vs 近90天均价，是否真实低位，是否有先涨后降迹象

## 第三步：评价提炼
- 搜索「${product} 评价」「${product} 使用体验」「${product} 踩坑」
- 从真实用户反馈中提炼：
  ✅ 3个核心优点
  ❌ 3个主要槽点或质量问题
  👤 适合人群 vs 不适合人群
  🚩 红旗警告（若有质量投诉、虚假宣传等）

## 第四步：替代品推荐
- 搜索「${product} 平替」「比 ${product} 更好的」「${product} 竞品」
- 推荐 2-3 个性价比更高或功能更好的替代品，含价格区间

## 第五步：购买时机建议
综合以上信息，给出明确结论：
- 🟢 立即购买：价格处于低位 + 评价良好 + 无更好替代
- 🟡 再等等：临近大促 / 价格有下降空间
- 🔴 不建议：质量问题多 / 有更好替代品 / 性价比低

---

## 输出格式

🛒 BuyWise · ${product}
━━━━━━━━━━━━━━━━━━━━━━━
📊 各平台比价
[价格对比表，含平台、价格、差价]

🔍 促销真实性
[历史价格分析，真优惠 or 假折扣]

⭐ 评价摘要
✅ 优点 | ❌ 槽点 | 👤 适合人群

🔄 替代品推荐
[2-3个替代选项，含价格]

✅ 购买建议
[🟢/🟡/🔴 + 1-2句理由 + 最推荐购买渠道]

🎟️ 优惠券 & 返利
在确认购买前，运行 CouponClaw 查找可用券码和返利叠加方案：
  openclaw run couponclaw find "${product}" --region all
可额外节省的金额请补充到"实际到手价"中。
━━━━━━━━━━━━━━━━━━━━━━━
💡 回复"详细评价"深度分析口碑 · 回复"比价 XX"单独查某平台 · 回复"找券"调用 CouponClaw`);

} else {
  console.log(`Please provide a comprehensive buying decision analysis for: "${product}"
Date: ${dateISO}${promoHint}

## Step 1: Cross-Platform Price Comparison (use browser — do NOT guess prices via web_search)
Open each URL with the browser tool and extract prices directly from the page:
1. https://search.smzdm.com/?c=home&s=${encoded}&v=b → aggregated JD/Taobao/Tmall/Pinduoduo prices in one page
2. https://search.jd.com/Search?keyword=${encoded}&enc=utf-8 → JD direct, first self-operated listing
3. https://www.google.com/search?q=${encoded}&tbm=shop → Google Shopping: aggregates Amazon, eBay, Walmart, Best Buy and dozens more — extract price range and lowest retailer
4. If Google Shopping unavailable → fallback https://www.bing.com/shop?q=${encoded}
5. https://www.amazon.com/s?k=${encoded} → cross-verify Amazon price against Google Shopping
6. https://www.aliexpress.com/wholesale?SearchText=${encoded} → AliExpress top 3 prices
7. web_search "${product} Temu price" → Temu supplement (no standard search URL)
8. web_search "${product} used price" → second-hand reference

⚠️ Rule: only record prices actually read from the page. Mark "unavailable" if a page fails — never invent prices.

## Step 2: Deal Authenticity Check (use browser for real price history)
1. https://camelcamelcamel.com/search?search=${encoded} → Amazon all-time low, 90-day average, pre-sale spike detection
2. In the smzdm product detail page from Step 1, check the price history chart and lowest-ever price
Assess: current price vs 90-day average; genuine low or inflate-then-discount pattern?

## Step 3: Review Analysis
- Search "${product} reviews" "${product} problems" "${product} honest review"
- Extract from real user feedback:
  ✅ 3 core strengths
  ❌ 3 main complaints or quality issues
  👤 Who it's great for vs. who should avoid it
  🚩 Red flags (quality complaints, misleading claims, etc.)

## Step 4: Alternatives
- Search "alternatives to ${product}" "${product} competitors" "better than ${product}"
- Recommend 2-3 alternatives with better value or features, including price range

## Step 5: Buy Timing Recommendation
Synthesize everything into a clear verdict:
- 🟢 Buy now: price is at/near low + good reviews + no better alternative
- 🟡 Wait: near a major sale / price likely to drop
- 🔴 Skip: quality issues / better alternatives exist / poor value

---

## Output Format

🛒 BuyWise · ${product}
━━━━━━━━━━━━━━━━━━━━━━━
📊 Price Comparison
[Table: platform, price, price gap, shipping]

🔍 Deal Authenticity
[Historical price analysis: genuine deal or fake discount]

⭐ Review Summary
✅ Strengths | ❌ Complaints | 👤 Who it's for

🔄 Alternatives
[2-3 alternatives with prices]

✅ Buying Recommendation
[🟢/🟡/🔴 + 1-2 sentence rationale + best platform to buy]

🎟️ Coupons & Cashback
Before finalizing, run CouponClaw to find available promo codes and cashback stacking:
  openclaw run couponclaw find "${product}" --region all
Add any additional savings to the final "effective price" above.
━━━━━━━━━━━━━━━━━━━━━━━
💡 Reply "deep reviews" for in-depth reputation analysis · Reply "find coupons" to run CouponClaw`);
}


path: scripts/compare.js
content: #!/usr/bin/env node
'use strict';
/**
 * BuyWise — 多平台比价
 * 使用 browser 工具导航到真实比价页，不依赖 web_search 盲猜价格
 * 用法: node scripts/compare.js <商品名> [--lang zh|en]
 */

const args = process.argv.slice(2);
const langIdx = args.indexOf('--lang');
const lang = langIdx !== -1 && args[langIdx + 1] === 'en' ? 'en' : 'zh';
const productArgs = args.filter((a, i) => a !== '--lang' && args[i - 1] !== '--lang');
const product = productArgs.join(' ').trim();

if (!product) {
  console.error(lang === 'zh' ? '用法: node scripts/compare.js <商品名>' : 'Usage: node scripts/compare.js <product>');
  process.exit(1);
}

const encoded = encodeURIComponent(product);

if (lang === 'zh') {
  console.log(`请对「${product}」进行真实价格比对。使用 browser 工具依次导航以下 URL，从页面直接提取价格，不要用 web_search 猜测价格。

【中国市场 — 一站聚合】
1. 打开 https://search.smzdm.com/?c=home&s=${encoded}&v=b
   → 什么值得买已聚合京东/淘宝/天猫/拼多多价格，直接从页面提取各平台最低价和商品标题。

【中国市场 — 补充直查】
2. 打开 https://search.jd.com/Search?keyword=${encoded}&enc=utf-8
   → 从京东搜索结果提取价格（第一屏自营商品优先）。
3. 如商品在京东有自营链接，可进入商品详情页获取精确价格。

【国际市场 — Google Shopping 一站聚合】
4. 打开 https://www.google.com/search?q=${encoded}&tbm=shop
   → Google 购物页面聚合 Amazon、eBay、Walmart、Best Buy 等几十家零售商真实价格，
   → 从结果列表提取：商品名、各零售商价格、是否包邮。这是国际市场最高效的单一来源。
5. 如 Google 购物无法访问，备用：打开 https://www.bing.com/shop?q=${encoded}
   → Bing 购物同样聚合多家零售商，效果类似。

【国际市场 — 专项直查】
6. 打开 https://www.amazon.com/s?k=${encoded}
   → 从 Amazon 搜索结果提取前3条价格（含 Prime 标识），与 Google Shopping 数据交叉验证。
7. 打开 https://www.aliexpress.com/wholesale?SearchText=${encoded}
   → 从 AliExpress 提取前3条价格（美元），AliExpress 通常比 Amazon/eBay 便宜。
8. web_search「${product} Temu price」— Temu 无标准搜索 URL，用搜索补充。

【二手】
9. web_search「${product} 闲鱼 成色好 价格」— 获取二手参考价。

提取规则：
- 只取有明确数字的价格，不要写"价格不详"或编造数字
- 如某平台页面无法访问或加载失败，标注"无法获取"而非填假数据
- 价格含税含运费（若可判断）
- Google Shopping 结果中同一商品多家零售商报价，取最低价和最高价区间

输出格式：
🛒 ${product} · 全平台比价
━━━━━━━━━━━━━━━━━━━━━━━
平台          | 价格         | 包邮 | 来源
京东(自营)    | ¥XXX        | ✓   | smzdm / 京东直查
淘宝/天猫     | ¥XXX        | -   | smzdm
拼多多        | ¥XXX        | ✓   | smzdm
──────────────────────────────────
Google Shopping| $XXX~$XXX  | -   | 多家零售商区间
Amazon        | $XXX        | -   | Google Shopping / 直查
eBay          | $XXX        | -   | Google Shopping
Walmart/其他  | $XXX        | -   | Google Shopping
AliExpress    | $XXX        | -   | 直查
Temu          | $XXX        | -   | 搜索
──────────────────────────────────
闲鱼(二手)    | ¥XXX        | 协议 | 搜索
━━━━━━━━━━━━━━━━━━━━━━━
💰 全球最低价：[平台] ¥/$ XXX
💰 国内最低价：[平台] ¥XXX
💡 综合推荐：[综合价格+配送+保障的最佳选择]
📌 数据来源：browser 直取（smzdm / Google Shopping / Amazon / AliExpress）+ 搜索补充（Temu / 闲鱼）`);

} else {
  console.log(`Please compare real prices for "${product}" across all major platforms. Use the browser tool to navigate to actual pricing pages — do NOT use web_search to guess prices.

[China market — aggregated]
1. Open https://search.smzdm.com/?c=home&s=${encoded}&v=b
   → smzdm.com already aggregates JD / Taobao / Tmall / Pinduoduo prices. Extract prices and product titles directly from the page.

[China market — direct check]
2. Open https://search.jd.com/Search?keyword=${encoded}&enc=utf-8
   → Extract price from the first JD official/self-operated listing.

[International — Google Shopping (single best source)]
3. Open https://www.google.com/search?q=${encoded}&tbm=shop
   → Google Shopping aggregates real prices from Amazon, eBay, Walmart, Best Buy, and dozens more.
   → Extract: retailer names, prices, shipping status. This covers most international retailers in one page.
4. If Google Shopping is inaccessible, fallback: open https://www.bing.com/shop?q=${encoded}
   → Bing Shopping provides similar multi-retailer aggregation.

[International — direct spot-check]
5. Open https://www.amazon.com/s?k=${encoded}
   → Verify Amazon price against Google Shopping data; note Prime eligibility.
6. Open https://www.aliexpress.com/wholesale?SearchText=${encoded}
   → AliExpress is typically cheapest for unbranded/generic items; extract top 3 prices.
7. web_search "${product} Temu price" — Temu has no standard search URL.

[Second-hand]
8. web_search "${product} used price good condition" — reference only.

Extraction rules:
- Only record prices actually read from the page; mark "unavailable" if a page fails — never invent prices
- For Google Shopping, note the price range (lowest to highest) across retailers
- Note whether price includes tax/shipping when determinable

Output format:
🛒 ${product} · Price Comparison
━━━━━━━━━━━━━━━━━━━━━━━
Platform        | Price      | Shipping | Source
JD (official)   | ¥XXX      | Free     | smzdm / direct
Taobao/Tmall    | ¥XXX      | -        | smzdm
Pinduoduo       | ¥XXX      | Free     | smzdm
────────────────────────────────────
Google Shopping | $XXX~$XXX | -        | multi-retailer range
Amazon          | $XXX      | -        | G.Shopping / direct
eBay            | $XXX      | -        | G.Shopping
Walmart/others  | $XXX      | -        | G.Shopping
AliExpress      | $XXX      | -        | direct
Temu            | $XXX      | -        | search
────────────────────────────────────
Used            | $XXX      | Varies   | search
━━━━━━━━━━━━━━━━━━━━━━━
💰 Global best price: [retailer] $XXX
💰 China best price: [platform] ¥XXX
💡 Best overall: [price + delivery + buyer protection]
📌 Sources: browser-direct (smzdm / Google Shopping / Amazon / AliExpress) + search (Temu / used)`);
}


path: scripts/deal-check.js
content: #!/usr/bin/env node
'use strict';
/**
 * BuyWise — 促销真实性核查
 * 用 browser 导航到历史价格追踪站点，获取真实历史价格数据
 * 用法: node scripts/deal-check.js <商品名> [--price 当前价格] [--was 标称原价] [--lang zh|en]
 */

const args = process.argv.slice(2);
const langIdx = args.indexOf('--lang');
const lang = langIdx !== -1 && args[langIdx + 1] === 'en' ? 'en' : 'zh';

const priceIdx = args.indexOf('--price');
const price = priceIdx !== -1 ? args[priceIdx + 1] : null;

const wasIdx = args.indexOf('--was');
const was = wasIdx !== -1 ? args[wasIdx + 1] : null;

const productArgs = args.filter((a, i) => {
  if (['--lang','--price','--was'].includes(a)) return false;
  if (['--lang','--price','--was'].includes(args[i - 1])) return false;
  return true;
});
const product = productArgs.join(' ').trim();

if (!product) {
  console.error(lang === 'zh' ? '用法: node scripts/deal-check.js <商品名> [--price 299] [--was 599]' : 'Usage: node scripts/deal-check.js <product> [--price 299] [--was 599]');
  process.exit(1);
}

const encoded = encodeURIComponent(product);
const now = new Date();
const dateISO = `${now.getFullYear()}-${String(now.getMonth()+1).padStart(2,'0')}-${String(now.getDate()).padStart(2,'0')}`;
const priceContext = price
  ? (lang === 'zh' ? `当前促销价：¥${price}${was ? `，标称原价：¥${was}，折扣幅度：${Math.round((1 - price/was)*100)}%` : ''}` : `Current price: $${price}${was ? `, claimed was: $${was}, discount: ${Math.round((1 - price/was)*100)}%` : ''}`)
  : '';

if (lang === 'zh') {
  console.log(`请核查「${product}」的促销是否真实。${priceContext ? '\n' + priceContext : ''}
当前日期：${dateISO}

使用 browser 工具导航以下页面，获取真实历史价格数据：

【中国市场 — 历史价格】
1. 打开 https://search.smzdm.com/?c=home&s=${encoded}&v=b
   → 从什么值得买搜索结果中找到该商品，点击商品进入详情，查看"历史低价""价格走势图"
   → 记录：当前价格、历史最低价、近30/90天价格趋势
2. web_search「${product} 历史最低价 site:smzdm.com OR site:camelcamelcamel.com」
   → 补充获取价格区间参考

【Amazon 历史价格（若适用）】
3. 打开 https://camelcamelcamel.com/search?search=${encoded}
   → CamelCamelCamel 是 Amazon 专业价格追踪站，从页面提取：
     - Amazon 历史最低价 / 最高价 / 当前价
     - 90天价格走势
     - 是否"先涨后降"（图表中促销前有明显价格抬高）

【判断标准】
根据获取的历史数据判断：
- ✅ 真实优惠：当前价格 ≤ 近90天均价的 90%，且无促销前涨价迹象
- ⚠️ 轻微注水：当前价格比均价低 0-10%，折扣幅度被夸大
- ❌ 假折扣：促销前1-4周内有明显涨价，实际折扣 < 标称折扣的 50%

【大促节点参考】
- 双11：每年11月1-11日（预售10月）
- 618：每年6月1-18日（预售5月）
- 38女王节：3月8-15日
- 双12：12月12日

输出格式：
🔍 促销核查 · ${product}
━━━━━━━━━━━━━━━━━━━━━━━
${priceContext || '当前价格：请提供以便分析'}
历史最低价：¥XXX（XXXX-XX，来源: smzdm/CamelCamelCamel）
近90天均价：¥XXX
当前价格位置：历史低位 / 中等 / 偏高
促销真实性：✅ 真实优惠 / ⚠️ 轻微注水 / ❌ 假折扣
判断依据：[1-2句说明，引用具体历史价格数据]

📅 购买时机建议：
- 立即：[是/否，理由]
- 下次大促：预计 XXXX年XX月，届时预计 ¥XXX

🎟️ 如果决定立即购买，运行 CouponClaw 叠加优惠券和返利：
  openclaw run couponclaw find "${product}" --region all
━━━━━━━━━━━━━━━━━━━━━━━`);

} else {
  console.log(`Please verify whether the deal on "${product}" is genuine.${priceContext ? '\n' + priceContext : ''}
Date: ${dateISO}

Use the browser tool to navigate to these pages for real historical price data — do not guess:

[Amazon price history]
1. Open https://camelcamelcamel.com/search?search=${encoded}
   → CamelCamelCamel tracks Amazon prices. Extract:
     - All-time low / high / current price on Amazon
     - 90-day price trend
     - Whether there was a pre-sale price spike (visible in the chart)

[International shopping trends]
2. Open https://www.amazon.com/s?k=${encoded}
   → Check current Amazon price and compare to CamelCamelCamel data.
3. web_search "${product} price history Black Friday Prime Day discount"
   → Supplement with seasonal pricing context.

[Verdict criteria]
Based on the historical data:
- ✅ Genuine deal: current price ≤ 90% of 90-day average, no pre-sale price spike
- ⚠️ Slightly inflated: marginal discount (0-10% below average), overstated savings claim
- ❌ Fake discount: price was raised 1-4 weeks before sale; real discount < 50% of claimed

Output format:
🔍 Deal Check · ${product}
━━━━━━━━━━━━━━━━━━━━━━━
${priceContext || 'Current price: please provide for analysis'}
All-time low: $XXX (XXXX-XX, source: CamelCamelCamel)
90-day average: $XXX
Current price position: near low / mid / high
Verdict: ✅ Genuine deal / ⚠️ Slightly inflated / ❌ Fake discount
Evidence: [1-2 sentences citing actual historical price data]

📅 Buy timing:
- Now: [yes/no, reason]
- Next major sale: approx. XXXX-XX, expected price $XXX

🎟️ If buying now, run CouponClaw to stack coupons and cashback:
  openclaw run couponclaw find "${product}" --region all
━━━━━━━━━━━━━━━━━━━━━━━`);
}


path: scripts/review-scan.js
content: #!/usr/bin/env node
'use strict';
/**
 * BuyWise — 评价提炼
 * 用法: node scripts/review-scan.js <商品名> [--lang zh|en]
 */

const args = process.argv.slice(2);
const langIdx = args.indexOf('--lang');
const lang = langIdx !== -1 && args[langIdx + 1] === 'en' ? 'en' : 'zh';
const productArgs = args.filter((a, i) => a !== '--lang' && args[i - 1] !== '--lang');
const product = productArgs.join(' ').trim();

if (!product) {
  console.error(lang === 'zh' ? '用法: node scripts/review-scan.js <商品名>' : 'Usage: node scripts/review-scan.js <product>');
  process.exit(1);
}

if (lang === 'zh') {
  console.log(`请深度分析「${product}」的用户评价口碑。

搜索以下多个来源：
1. 搜索「${product} 评测 真实体验」
2. 搜索「${product} 差评 问题」「${product} 踩坑 注意」
3. 搜索「${product} 值得买 知乎」或「${product} 小红书 使用感受」
4. 搜索「${product} reddit review」或「${product} honest review」（国际口碑）
5. 若有重大质量投诉，搜索「${product} 质量问题 投诉」

分析维度：
- 综合评分感知（用户整体满意度）
- 高频好评关键词（反复出现的优点）
- 高频差评关键词（反复出现的问题）
- 严重问题（安全隐患、致命缺陷、虚假宣传）
- 适合场景 vs 不适合场景

输出格式：
⭐ 评价分析 · ${product}
━━━━━━━━━━━━━━━━━━━━━━━
综合口碑：[好评如潮 / 褒贬不一 / 差评较多]

✅ 核心优点
1. [优点一]
2. [优点二]
3. [优点三]

❌ 主要槽点
1. [问题一]
2. [问题二]
3. [问题三]

🚩 红旗警告（若有）
[严重质量问题 / 虚假宣传 / 安全投诉]

👤 适合人群
适合：[具体场景/人群]
不适合：[具体场景/人群]
━━━━━━━━━━━━━━━━━━━━━━━
💡 回复"比价"查看最低购买渠道`);
} else {
  console.log(`Please deeply analyze user reviews and reputation for "${product}".

Search multiple sources:
1. Search "${product} review honest experience"
2. Search "${product} problems complaints" "${product} issues to know"
3. Search "${product} reddit review" "${product} forum"
4. Search "${product} 1 star review" "${product} worst problems"
5. If quality issues suspected, search "${product} recall" "${product} safety issue"

Analysis dimensions:
- Overall sentiment (user satisfaction level)
- Frequently praised features
- Frequently complained issues
- Serious problems (safety hazards, fatal flaws, misleading claims)
- Best use cases vs. situations to avoid

Output format:
⭐ Review Analysis · ${product}
━━━━━━━━━━━━━━━━━━━━━━━
Overall reputation: [Highly rated / Mixed / Poorly rated]

✅ Core strengths
1. [Strength 1]
2. [Strength 2]
3. [Strength 3]

❌ Main complaints
1. [Issue 1]
2. [Issue 2]
3. [Issue 3]

🚩 Red flags (if any)
[Quality defects / misleading claims / safety complaints]

👤 Best for
Good fit: [specific use case / user type]
Not for: [specific use case / user type]
━━━━━━━━━━━━━━━━━━━━━━━
💡 Reply "compare" to find the best price`);
}


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (HIGH)