Skill: jiajiaoy/travelhound (version 1.1.2)

# TravelHound > Flight and hotel price comparison with booking timing analysis, OTA coupon stacking, and destination intelligence — all in one skill. TravelHound combines real-time price data from Google Flights, Skyscanner, Kayak, Booking.com, Agoda, and Trip.com with coupon stacking via CouponClaw and destination news via NewsToday. It tells you not just the cheapest option, but whether now is the right time to book. ## What TravelHound does - **Flight comparison**: Google Flights + Skyscanner + Kayak + Trip.com, with Kayak's "Buy now vs Wait" forecast - **Hotel comparison**: Booking.com + Agoda + Hotels.com + Trip.com, with OTA coupon stacking - **Full trip planner**: Flights + hotels in one output with total budget estimate - **Destination intelligence**: Visa requirements, exchange rate trend, safety advisories, latest news - **Booking timing**: Price history analysis to decide whether to book now or wait ## Trigger phrases - "cheap flights to..." - "flights from X to Y" - "机票" - "查机票" - "hotel in..." - "酒店" - "查酒店" - "trip to..." - "travel to..." - "旅行计划" - "全程规划" - "去X旅游" - "订酒店" - "best time to book" - "should I book now" ## Scripts | Script | Command | Description | |---|---|---| | `flights.js` | `node scripts/flights.js <from> <to> [--date YYYY-MM-DD] [--return YYYY-MM-DD] [--class economy\|business] [--passengers N] [--lang zh\|en]` | Flight price comparison across 4 platforms with booking timing advice | | `hotels.js` | `node scripts/hotels.js <destination> [--checkin YYYY-MM-DD] [--checkout YYYY-MM-DD] [--guests N] [--budget budget\|mid\|luxury] [--lang zh\|en]` | Hotel price comparison with OTA coupon stacking | | `trip.js` | `node scripts/trip.js <destination> [--from city] [--date YYYY-MM-DD] [--nights N] [--budget budget\|mid\|luxury] [--lang zh\|en]` | Full trip planner: flights + hotels + destination intel in one report | ## Data sources | Platform | Type | Strength | |---|---|---| | Google Flights | Flights | Best aggregator; date flexibility view; price insights | | Skyscanner | Flights | Lowest fares including budget carriers; "Everywhere" flexible origin | | Kayak | Flights + Hotels | Price Forecast (Buy now / Wait); price history chart | | Trip.com / 携程 | Flights + Hotels | Often cheapest for Asian routes; Chinese carrier coverage | | Booking.com | Hotels | Widest inventory globally; Genius member discounts | | Agoda | Hotels | Best rates for Southeast and East Asia | | Hotels.com | Hotels | 10-night loyalty program | ## Ecosystem integration TravelHound calls: - **CouponClaw** — finds promo codes for Booking.com, Agoda, Trip.com, and Skyscanner on top of platform prices - **NewsToday** — pulls destination-relevant news (political situation, weather events, local festivals) ## No API required TravelHound uses browser navigation to read live pricing from each platform. No API keys or subscriptions needed.

path: README.md
content: # TravelHound — Find Cheap Flights & Hotels Before You Book

> Compare Google Flights, Skyscanner, Kayak, Booking.com, Agoda, Trip.com side by side. Get a Buy/Wait verdict. Stack OTA coupon codes.

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

## What it does

TravelHound is an [OpenClaw](https://openclaw.ai) skill that does for flights and hotels what [BuyWise](https://github.com/jiajiaoy/BuyWise) does for products: compares real prices across platforms, checks whether now is the right time to book, finds promo codes, and gives you a clear verdict.

**Flight comparison** — Google Flights + Skyscanner + Kayak + Trip.com, with Kayak's *Buy now / Wait* forecast  
**Hotel comparison** — Booking.com + Agoda + Hotels.com + Trip.com, with OTA coupon stacking  
**Full trip planner** — flights + hotels in one report with total budget estimate  
**Destination intelligence** — visa requirements, exchange rate trend, safety advisories, latest news  
**OTA coupon stacking** — calls [CouponClaw](https://github.com/jiajiaoy/CouponClaw) to find promo codes for Booking.com, Agoda, Trip.com  
**News check** — calls [NewsToday](https://github.com/jiajiaoy/NewsToday) for destination-relevant headlines (political situation, weather, local events)

## Data sources

| Platform | Type | Strength |
|---|---|---|
| Google Flights | Flights | Best aggregator; price insights; date flexibility view |
| Skyscanner | Flights | Lowest fares incl. budget carriers; flexible origin |
| Kayak | Flights + Hotels | Price Forecast (Buy / Wait) + price history chart |
| Trip.com / 携程 | Flights + Hotels | Best rates for Asian routes; Chinese carrier coverage |
| Booking.com | Hotels | Widest global inventory; Genius discounts |
| Agoda | Hotels | Best rates for Southeast and East Asia |
| Hotels.com | Hotels | 10-night loyalty reward |

## Installation

```bash
openclaw install travelhound
```

## Usage

```bash
# Full trip planner: flights + hotels + destination intel
openclaw run travelhound trip "Tokyo" --from "London" --date 2026-08-01 --nights 7 --budget mid

# Flights only
openclaw run travelhound flights "London" "Tokyo" --date 2026-08-01 --return 2026-08-08

# Hotels only
openclaw run travelhound hotels "Tokyo" --checkin 2026-08-01 --checkout 2026-08-08 --budget mid

# Budget options
# --budget budget | mid | luxury
# --class economy | business | first
# --lang zh | en
```

## Ecosystem

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

```
NewsToday ←→ TravelHound → CouponClaw
                 ↑
            TrendRadar (trending destinations)
```

| Skill | How it connects |
|---|---|
| **TravelHound** | Travel pricing ← you are here |
| [CouponClaw](https://github.com/jiajiaoy/CouponClaw) | OTA promo codes stacked on top of platform prices |
| [NewsToday](https://github.com/jiajiaoy/NewsToday) | Destination news (visa changes, safety, events) |
| [BuyWise](https://github.com/jiajiaoy/BuyWise) | Same buy/wait decision logic, applied to products |

## Keywords

cheap flights · flight comparison · best time to book flights · flight price prediction · Google Flights · Skyscanner · Kayak · cheap hotels · hotel comparison · Booking.com · Agoda · budget travel · travel hacks · OTA coupon · visa requirements · exchange rate · 机票 · 酒店 · 旅行攻略 · 特价机票 · 穷游 · 自由行

---

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


path: package.json
content: {
  "name": "travelhound",
  "version": "1.1.2",
  "description": "Find cheap flights & hotels before you book — compare Google Flights, Skyscanner, Booking.com, Agoda side-by-side. Fare Buy/Wait forecast + OTA coupon stacking.",
  "keywords": [
    "flights",
    "cheap flights",
    "flight deals",
    "flight comparison",
    "airfare",
    "best time to book flights",
    "flight price prediction",
    "flight price tracker",
    "Google Flights",
    "Skyscanner",
    "Kayak",
    "Trip.com",
    "携程",
    "hotels",
    "cheap hotels",
    "hotel deals",
    "hotel comparison",
    "accommodation",
    "Booking.com",
    "Agoda",
    "Hotels.com",
    "travel",
    "travel planning",
    "travel deals",
    "travel savings",
    "travel hacks",
    "budget travel",
    "backpacking",
    "vacation",
    "vacation planning",
    "holiday",
    "holiday deals",
    "holiday planning",
    "trip planner",
    "itinerary",
    "OTA",
    "OTA coupon",
    "OTA promo code",
    "travel coupon",
    "visa requirements",
    "exchange rate",
    "travel safety",
    "destination guide",
    "low cost flights",
    "budget airline",
    "flight hack",
    "travel budget",
    "机票",
    "廉价机票",
    "特价机票",
    "机票比价",
    "机票攻略",
    "酒店",
    "特价酒店",
    "低价酒店",
    "酒店比价",
    "酒店攻略",
    "旅行",
    "旅游",
    "旅行计划",
    "旅行省钱",
    "旅游攻略",
    "自由行",
    "穷游",
    "出境游",
    "签证",
    "汇率",
    "订机票",
    "订酒店",
    "机酒套餐",
    "旅游优惠"
  ],
  "main": "scripts/trip.js",
  "scripts": {
    "flights": "node scripts/flights.js",
    "hotels": "node scripts/hotels.js",
    "trip": "node scripts/trip.js"
  },
  "openclaw": {
    "triggers": [
      "flights",
      "cheap flights",
      "flight deals",
      "hotels",
      "hotel",
      "travel",
      "trip to",
      "vacation",
      "holiday",
      "机票",
      "酒店",
      "旅行",
      "旅游",
      "订机票",
      "订酒店",
      "出行",
      "去哪玩"
    ],
    "entrypoint": "scripts/trip.js"
  },
  "dependencies": {}
}

path: scripts/flights.js
content: #!/usr/bin/env node
'use strict';
/**
 * TravelHound — 机票比价 + 最佳订票时机
 * 用法: node scripts/flights.js <出发地> <目的地> [--date YYYY-MM-DD] [--return YYYY-MM-DD] [--class economy|business] [--passengers N] [--lang zh|en]
 */

const ALLOWED_CLASSES = new Set(['economy', 'business', 'first']);

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

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

const returnIdx = args.indexOf('--return');
const returnDate = returnIdx !== -1 ? args[returnIdx + 1] : null;

const classIdx = args.indexOf('--class');
const rawClass = classIdx !== -1 ? args[classIdx + 1] : 'economy';
const cabinClass = ALLOWED_CLASSES.has(rawClass) ? rawClass : 'economy';

const passIdx = args.indexOf('--passengers');
const passengers = passIdx !== -1 ? parseInt(args[passIdx + 1], 10) || 1 : 1;

const locationArgs = args.filter((a, i) => {
  const flags = ['--lang', '--date', '--return', '--class', '--passengers'];
  if (flags.includes(a)) return false;
  if (flags.includes(args[i - 1])) return false;
  return true;
});

const [from = '', to = ''] = locationArgs;

if (!from || !to) {
  console.error(lang === 'zh'
    ? '用法: node scripts/flights.js <出发地> <目的地> [--date YYYY-MM-DD] [--return YYYY-MM-DD]'
    : 'Usage: node scripts/flights.js <from> <to> [--date YYYY-MM-DD] [--return YYYY-MM-DD]');
  process.exit(1);
}

const encFrom = encodeURIComponent(from);
const encTo = encodeURIComponent(to);
const encQuery = encodeURIComponent(`${from} to ${to}`);
const encQueryZH = encodeURIComponent(`${from}到${to}机票`);

const dateNote = date ? (lang === 'zh' ? `出发日期：${date}` : `Departure: ${date}`) : (lang === 'zh' ? '出发日期：未指定（请查询近期最低价区间）' : 'Departure: not specified — look for lowest fare window');
const returnNote = returnDate ? (lang === 'zh' ? `返程日期：${returnDate}` : `Return: ${returnDate}`) : '';
const tripType = returnDate ? (lang === 'zh' ? '往返' : 'Round trip') : (lang === 'zh' ? '单程' : 'One way');
const classNote = lang === 'zh'
  ? ({ economy: '经济舱', business: '商务舱', first: '头等舱' }[cabinClass])
  : ({ economy: 'Economy', business: 'Business', first: 'First' }[cabinClass]);

if (lang === 'zh') {
  console.log(`请为以下行程查询机票价格并分析最佳订票时机。

行程：${from} → ${to}（${tripType} · ${classNote} · ${passengers}人）
${dateNote}${returnNote ? '\n' + returnNote : ''}

使用 browser 工具依次导航以下页面，提取真实票价：

1. 打开 https://www.google.com/travel/flights?q=${encQueryZH}
   → Google Flights：提取各航空公司价格、最便宜日期（日历视图），以及页面底部的"价格走势"和"订票建议"（Buy now / Wait）

2. 打开 https://www.skyscanner.com/transport/flights/${encFrom}/${encTo}/${date || ''}
   → Skyscanner：提取最低价航班（含中转）、价格预警提示（当月最低 / 偏高），记录前3条推荐

3. 打开 https://www.kayak.com/flights/${encFrom}-${encTo}/${date || 'flexible'}
   → Kayak：重点查看 "Price Forecast" 模块（显示 Buy / Wait 建议和理由），以及 Price History 图表

4. 打开 https://flights.trip.com/flights/list?depCityName=${encFrom}&arrCityName=${encTo}${date ? `&flightDate=${date}` : ''}
   → 携程/Trip.com：提取含中文航司的价格，尤其是国内航线和亚洲航线通常比国际平台便宜

5. web_search「${from} ${to} 机票 ${date || '近期'} 最低价 航班」
   → 补充获取近期促销航班信息

【历史价格核查】
6. 在步骤1 Google Flights 中查看"价格图表"，判断当前价格是否处于历史低位
7. web_search「${from} to ${to} flights cheap months best time to fly」→ 了解该航线的淡旺季规律

【判断标准】
- 🟢 立即订：当前价格 ≤ 近3个月均价的 90%，或 Google Flights/Kayak 明确显示 "Buy now"
- 🟡 再等等：价格高于均价但有下降趋势，或距出发超过6周仍有降价空间
- 🔴 贵，考虑替代：旺季/节假日价格，建议改签日期或换出发城市

输出格式：
✈️ TravelHound · ${from} → ${to}
━━━━━━━━━━━━━━━━━━━━━━━
📋 行程：${tripType} · ${classNote} · ${passengers}人 · ${date || '日期灵活'}${returnDate ? ' ~ ' + returnDate : ''}

💰 各平台票价对比
平台            | 最低价  | 航班号/航司 | 飞行时长 | 中转
Google Flights  | ¥/$ XXX |             |          |
Skyscanner      | ¥/$ XXX |             |          |
Kayak           | ¥/$ XXX |             |          |
携程/Trip.com   | ¥/$ XXX |             |          |

📊 价格分析
当前价格位置：历史低位 / 正常 / 偏高
Kayak 预测：Buy now / Wait（原因）
最便宜出发日：± X天调整可省 ¥/$ XXX

✅ 订票建议
[🟢/🟡/🔴 + 1-2句理由 + 推荐平台]

🎟️ 订票优惠码（运行 CouponClaw 查询）：
  openclaw run couponclaw find "Trip.com" --region all
  openclaw run couponclaw find "Skyscanner" --region all
━━━━━━━━━━━━━━━━━━━━━━━
💡 回复"查酒店"继续规划住宿 · 回复"全程规划"一站搞定`);

} else {
  console.log(`Please research flight prices for the following itinerary and advise on the best time to book.

Route: ${from} → ${to} (${tripType} · ${classNote} · ${passengers} pax)
${dateNote}${returnNote ? '\n' + returnNote : ''}

Use the browser tool to navigate each page and extract real fares:

1. Open https://www.google.com/travel/flights?q=${encQuery}
   → Google Flights: extract prices per airline, cheapest date calendar, and the "Price insights" / "Buy now vs Wait" recommendation at the bottom

2. Open https://www.skyscanner.com/transport/flights/${encFrom}/${encTo}/${date || ''}
   → Skyscanner: extract lowest fares (incl. connections), price alert badge (lowest this month / high), top 3 results

3. Open https://www.kayak.com/flights/${encFrom}-${encTo}/${date || 'flexible'}
   → Kayak: focus on the "Price Forecast" module (Buy / Wait + reason) and Price History chart

4. Open https://uk.trip.com/flights/list?depCityName=${encFrom}&arrCityName=${encTo}${date ? `&flightDate=${date}` : ''}
   → Trip.com: often has lower fares for Asian routes and Chinese carriers

5. web_search "cheap flights ${from} to ${to} ${date || 'next month'} deals"
   → Supplement with any current fare sales

[Price history check]
6. In Google Flights from step 1, check the price chart — is the current price at/near a low?
7. web_search "${from} to ${to} cheapest months best time to fly" → understand seasonal pricing patterns

[Verdict criteria]
- 🟢 Book now: current price ≤ 90% of 3-month average, or Google Flights/Kayak says "Buy now"
- 🟡 Wait: price above average but trending down, or 6+ weeks out with room to drop
- 🔴 Expensive — consider alternatives: peak season/holiday pricing; suggest date shift or alternate origin

Output format:
✈️ TravelHound · ${from} → ${to}
━━━━━━━━━━━━━━━━━━━━━━━
📋 Trip: ${tripType} · ${classNote} · ${passengers} pax · ${date || 'flexible dates'}${returnDate ? ' ~ ' + returnDate : ''}

💰 Price comparison
Platform        | Lowest fare | Airline     | Duration | Stops
Google Flights  | $XXX        |             |          |
Skyscanner      | $XXX        |             |          |
Kayak           | $XXX        |             |          |
Trip.com        | $XXX        |             |          |

📊 Price analysis
Current price position: near low / average / high
Kayak forecast: Buy now / Wait (reason)
Cheapest nearby date: ±X days saves $XXX

✅ Booking recommendation
[🟢/🟡/🔴 + 1-2 sentence rationale + recommended platform]

🎟️ OTA promo codes (run CouponClaw):
  openclaw run couponclaw find "Trip.com" --region all
  openclaw run couponclaw find "Skyscanner" --region all
━━━━━━━━━━━━━━━━━━━━━━━
💡 Reply "find hotels" to continue planning · Reply "full trip" for combined itinerary`);
}


path: scripts/hotels.js
content: #!/usr/bin/env node
'use strict';
/**
 * TravelHound — 酒店比价 + OTA优惠码叠加
 * 用法: node scripts/hotels.js <目的地> [--checkin YYYY-MM-DD] [--checkout YYYY-MM-DD] [--guests N] [--budget budget|mid|luxury] [--lang zh|en]
 */

const ALLOWED_BUDGETS = new Set(['budget', 'mid', 'luxury']);

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

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

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

const guestsIdx = args.indexOf('--guests');
const guests = guestsIdx !== -1 ? parseInt(args[guestsIdx + 1], 10) || 1 : 1;

const budgetIdx = args.indexOf('--budget');
const rawBudget = budgetIdx !== -1 ? args[budgetIdx + 1] : 'mid';
const budget = ALLOWED_BUDGETS.has(rawBudget) ? rawBudget : 'mid';

const destArgs = args.filter((a, i) => {
  const flags = ['--lang', '--checkin', '--checkout', '--guests', '--budget'];
  if (flags.includes(a)) return false;
  if (flags.includes(args[i - 1])) return false;
  return true;
});
const destination = destArgs.join(' ').trim();

if (!destination) {
  console.error(lang === 'zh'
    ? '用法: node scripts/hotels.js <目的地> [--checkin YYYY-MM-DD] [--checkout YYYY-MM-DD] [--guests N] [--budget budget|mid|luxury]'
    : 'Usage: node scripts/hotels.js <destination> [--checkin YYYY-MM-DD] [--checkout YYYY-MM-DD] [--guests N] [--budget budget|mid|luxury]');
  process.exit(1);
}

const encoded = encodeURIComponent(destination);
const nights = (checkin && checkout)
  ? Math.round((new Date(checkout) - new Date(checkin)) / 86400000)
  : null;

const budgetLabelZH = { budget: '经济型（¥300以下/晚）', mid: '中档（¥300-800/晚）', luxury: '高档（¥800+/晚）' }[budget];
const budgetLabelEN = { budget: 'Budget (under $50/night)', mid: 'Mid-range ($50-150/night)', luxury: 'Luxury ($150+/night)' }[budget];

if (lang === 'zh') {
  const dateNote = checkin ? `入住：${checkin}${checkout ? ` → 退房：${checkout}（共${nights}晚）` : ''}` : '日期：未指定';

  console.log(`请为以下住宿需求查询酒店价格，并找到最优 OTA 优惠。

目的地：${destination}
${dateNote}
人数：${guests}人 · 预算档位：${budgetLabelZH}

使用 browser 工具依次导航以下页面，提取真实酒店价格：

1. 打开 https://www.booking.com/searchresults.html?ss=${encoded}${checkin ? `&checkin=${checkin}` : ''}${checkout ? `&checkout=${checkout}` : ''}&group_adults=${guests}
   → Booking.com：提取该档位前5家酒店（名称、价格/晚、评分、距市中心距离）
   → 查看是否有"天才会员折扣"或"限时特惠"标签

2. 打开 https://www.agoda.com/search?q=${encoded}${checkin ? `&checkIn=${checkin}` : ''}${checkout ? `&checkOut=${checkout}` : ''}&numberOfGuest=${guests}
   → Agoda：同样提取前5家，Agoda 在亚洲目的地通常有独家低价
   → 注意查看"银行卡专属折扣"（特定信用卡额外减）

3. 打开 https://www.hotels.com/search.do?q-destination=${encoded}${checkin ? `&q-check-in=${checkin}` : ''}${checkout ? `&q-check-out=${checkout}` : ''}
   → Hotels.com：集满10晚送1晚，查询是否有额外促销

4. 打开 https://hotels.trip.com/hotels/list?city=${encoded}${checkin ? `&startDate=${checkin}` : ''}${checkout ? `&endDate=${checkout}` : ''}
   → 携程酒店：国内及亚洲目的地必查，会员价通常比国际平台低 10-20%

5. web_search「${destination} 酒店 ${checkin || '近期'} 优惠 团购」
   → 补充：美团、飞猪等国内平台是否有团购价

【价格对比规则】
- 仅记录实际从页面读取的价格（标注含税/不含税）
- 标注每个平台是否需要会员登录才能看到最低价
- 同一家酒店跨平台比价，找出实际最低平台

【OTA 优惠码叠加】
查询各平台专属优惠码（在价格基础上再减）：
- web_search「Booking.com promo code ${new Date().getFullYear()}」
- web_search「Agoda coupon code ${new Date().getFullYear()}」
或直接运行：openclaw run couponclaw find "Booking.com" --region all
           openclaw run couponclaw find "Agoda" --region all

输出格式：
🏨 TravelHound · ${destination} 酒店
━━━━━━━━━━━━━━━━━━━━━━━
📋 ${dateNote}${nights ? `（${nights}晚）` : ''} · ${guests}人 · ${budgetLabelZH}

💰 各平台价格对比（${budgetLabelZH}）
酒店名         | Booking | Agoda | Hotels.com | 携程 | 最低
[酒店A]        | ¥XXX    | ¥XXX  | ¥XXX       | ¥XXX | [平台] ¥XXX
[酒店B]        | ...
（列出3-5家同档位酒店）

🏷️ 平台优惠
[平台] 优惠码/活动：[描述] | 额外节省：¥XXX

🔢 最优方案
[酒店名] × ${nights || 'X'}晚 = ¥XXX（通过 [平台] + [优惠码] 到手价 ¥XXX/晚）

📌 注意事项
[取消政策 / 含不含早餐 / 需不需提前付款]
━━━━━━━━━━━━━━━━━━━━━━━
💡 回复"查机票"继续规划 · 回复"全程规划"一站搞定`);

} else {
  const dateNote = checkin ? `Check-in: ${checkin}${checkout ? ` → Check-out: ${checkout} (${nights} nights)` : ''}` : 'Dates: not specified';

  console.log(`Please search for hotels at the destination below and find the best OTA deal with coupon stacking.

Destination: ${destination}
${dateNote}
Guests: ${guests} · Budget: ${budgetLabelEN}

Use the browser tool to navigate each page and extract real hotel prices:

1. Open https://www.booking.com/searchresults.html?ss=${encoded}${checkin ? `&checkin=${checkin}` : ''}${checkout ? `&checkout=${checkout}` : ''}&group_adults=${guests}
   → Booking.com: extract top 5 hotels in this budget tier (name, price/night, rating, distance from center)
   → Check for "Genius" member discounts or "Limited-time deal" labels

2. Open https://www.agoda.com/search?q=${encoded}${checkin ? `&checkIn=${checkin}` : ''}${checkout ? `&checkOut=${checkout}` : ''}&numberOfGuest=${guests}
   → Agoda: often has exclusive lower rates for Asian destinations
   → Look for "Bank card exclusive discount" offers

3. Open https://www.hotels.com/search.do?q-destination=${encoded}${checkin ? `&q-check-in=${checkin}` : ''}${checkout ? `&q-check-out=${checkout}` : ''}
   → Hotels.com: earn 1 free night per 10 booked; check for additional promos

4. Open https://uk.trip.com/hotels/list?city=${encoded}${checkin ? `&startDate=${checkin}` : ''}${checkout ? `&endDate=${checkout}` : ''}
   → Trip.com: member rates often 10-20% cheaper for Asian destinations

5. web_search "${destination} hotel deals ${checkin || 'this month'} discount"
   → Supplement with any flash sales or coupon sites

[Comparison rules]
- Only record prices actually read from the page (note if tax-inclusive or not)
- Flag any platform requiring login to see lowest price
- Cross-compare the same hotel across platforms to find true best price

[OTA coupon stacking]
  openclaw run couponclaw find "Booking.com" --region all
  openclaw run couponclaw find "Agoda" --region all

Output format:
🏨 TravelHound · ${destination} Hotels
━━━━━━━━━━━━━━━━━━━━━━━
📋 ${dateNote}${nights ? ` (${nights} nights)` : ''} · ${guests} guest(s) · ${budgetLabelEN}

💰 Price comparison (${budgetLabelEN})
Hotel          | Booking | Agoda | Hotels.com | Trip.com | Best
[Hotel A]      | $XXX    | $XXX  | $XXX       | $XXX     | [platform] $XXX
[Hotel B]      | ...
(list 3-5 hotels in this tier)

🏷️ Platform deals
[Platform] Code/promotion: [description] | Extra saving: $XXX

🔢 Best deal
[Hotel name] × ${nights || 'X'} nights = $XXX (via [platform] + [code] → $XXX/night effective)

📌 Watch out for
[Cancellation policy / breakfast included / prepayment required]
━━━━━━━━━━━━━━━━━━━━━━━
💡 Reply "find flights" to continue · Reply "full trip" for combined planning`);
}


path: scripts/trip.js
content: #!/usr/bin/env node
'use strict';
/**
 * TravelHound — 全程行程规划（机票+酒店+目的地情报）
 * 用法: node scripts/trip.js <目的地> [--from 出发城市] [--date YYYY-MM-DD] [--nights N] [--budget budget|mid|luxury] [--lang zh|en]
 */

const ALLOWED_BUDGETS = new Set(['budget', 'mid', 'luxury']);

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

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

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

const nightsIdx = args.indexOf('--nights');
const nights = nightsIdx !== -1 ? parseInt(args[nightsIdx + 1], 10) || null : null;

const budgetIdx = args.indexOf('--budget');
const rawBudget = budgetIdx !== -1 ? args[budgetIdx + 1] : 'mid';
const budget = ALLOWED_BUDGETS.has(rawBudget) ? rawBudget : 'mid';

const destArgs = args.filter((a, i) => {
  const flags = ['--lang', '--from', '--date', '--nights', '--budget'];
  if (flags.includes(a)) return false;
  if (flags.includes(args[i - 1])) return false;
  return true;
});
const destination = destArgs.join(' ').trim();

if (!destination) {
  console.error(lang === 'zh'
    ? '用法: node scripts/trip.js <目的地> [--from 出发城市] [--date YYYY-MM-DD] [--nights N] [--budget budget|mid|luxury]'
    : 'Usage: node scripts/trip.js <destination> [--from city] [--date YYYY-MM-DD] [--nights N] [--budget budget|mid|luxury]');
  process.exit(1);
}

const encoded = encodeURIComponent(destination);
const encodedFrom = from ? encodeURIComponent(from) : null;
const returnDate = (date && nights)
  ? new Date(new Date(date).getTime() + nights * 86400000).toISOString().slice(0, 10)
  : null;

const budgetLabelZH = { budget: '经济型', mid: '中档', luxury: '高档' }[budget];
const budgetLabelEN = { budget: 'Budget', mid: 'Mid-range', luxury: 'Luxury' }[budget];
const now = new Date();
const year = now.getFullYear();

if (lang === 'zh') {
  console.log(`请为以下旅行规划完整的行程方案，包括机票、酒店和目的地情报。

目的地：${destination}
${from ? `出发城市：${from}` : '出发城市：未指定（请询问或按最近主要机场）'}
${date ? `出发日期：${date}` : '出发日期：未指定（请查询灵活日期最低价）'}
${nights ? `住宿天数：${nights}晚${returnDate ? `（返程：${returnDate}）` : ''}` : '行程天数：未指定'}
预算档位：${budgetLabelZH}

═══ 第一步：目的地情报 ═══

1. web_search「${destination} 旅游 签证要求 ${year}」
   → 中国护照/目标护照是否需要签证，办理周期和费用

2. web_search「${destination} 汇率 人民币 ${year}」
   → 当前汇率，近期走势（是否适合换汇）

3. web_search「${destination} 旅游安全 ${year} 最新」
   → 目前是否有安全警告或特别注意事项

4. openclaw run newstoday morning "${destination}" --lang zh
   → 获取目的地相关最新新闻（政治/天气/活动）

═══ 第二步：机票比价 ═══

${from ? `5. 打开 https://www.google.com/travel/flights?q=${encodeURIComponent(from + ' to ' + destination)}${date ? `+${date}` : ''}
   → Google Flights：提取最低价、最便宜日期和"订票建议"` : `5. 打开 https://www.google.com/travel/flights?q=${encodeURIComponent('flights to ' + destination)}
   → Google Flights：提取各出发城市到${destination}的最低价`}

6. 打开 https://www.skyscanner.com/transport/flights/${encodedFrom || 'anywhere'}/${encoded}/${date || ''}
   → Skyscanner：提取最低价航班，查看 "Everywhere" 视图找最便宜出发地

7. 打开 https://www.kayak.com/flights/${encodedFrom || 'anywhere'}-${encoded}/${date || 'flexible'}
   → Kayak：查看 Price Forecast（Buy now / Wait）

═══ 第三步：酒店比价 ═══

8. 打开 https://www.booking.com/searchresults.html?ss=${encoded}${date ? `&checkin=${date}` : ''}${returnDate ? `&checkout=${returnDate}` : ''}
   → Booking.com：提取${budgetLabelZH}档位前3家酒店（价格/评分/位置）

9. 打开 https://www.agoda.com/search?q=${encoded}${date ? `&checkIn=${date}` : ''}${returnDate ? `&checkOut=${returnDate}` : ''}
   → Agoda：对比价格，亚洲目的地通常更优惠

═══ 第四步：OTA优惠码 ═══

10. openclaw run couponclaw find "Booking.com" --region all
11. openclaw run couponclaw find "Agoda" --region all
12. openclaw run couponclaw find "Trip.com" --region all
    → 在以上平台价格基础上叠加券码，计算实际到手价

═══ 整合输出 ═══

输出格式：
🌍 TravelHound · ${from ? from + ' → ' : ''}${destination}
━━━━━━━━━━━━━━━━━━━━━━━
📋 ${date || '日期灵活'} · ${nights ? nights + '晚' : '天数待定'} · ${budgetLabelZH}

🛂 目的地情报
签证：[需要/免签/落地签 + 费用]
汇率：1 CNY = X.XX [当地货币]（近期走势：升/贬/稳）
安全：[安全/注意事项/警告]
近期新闻：[1-2条相关资讯]

✈️ 最优机票
[航班] | ¥/$ XXX | [订票建议：立即订/等待]
最便宜日期：± X天调整可省 ¥/$ XXX

🏨 最优酒店（${budgetLabelZH}）
[酒店名] | ¥/$ XXX/晚 | 评分 X.X | [平台]
叠加优惠码后：¥/$ XXX/晚

💰 全程预算估算（${nights || 'X'}晚）
机票：¥/$ XXX（${from || '出发城市'} 往返）
住宿：¥/$ XXX × ${nights || 'X'}晚 = ¥/$ XXX
合计：¥/$ XXX（含已知优惠）

✅ 综合建议
[🟢/🟡/🔴 + 是否是好时机出行 + 1-2句核心理由]
━━━━━━━━━━━━━━━━━━━━━━━
💡 回复"机票详情"或"酒店详情"深入查询`);

} else {
  console.log(`Please plan a complete trip to ${destination}, covering flights, hotels, and destination intelligence.

Destination: ${destination}
${from ? `From: ${from}` : 'From: not specified — use nearest major airport or ask'}
${date ? `Departure: ${date}` : 'Departure: not specified — check flexible date lowest fares'}
${nights ? `Duration: ${nights} nights${returnDate ? ` (return: ${returnDate})` : ''}` : 'Duration: not specified'}
Budget tier: ${budgetLabelEN}

═══ Step 1: Destination intelligence ═══

1. web_search "${destination} visa requirements ${year} passport"
   → Check if visa required, processing time, and cost

2. web_search "${destination} exchange rate USD EUR ${year}"
   → Current rate and recent trend (good time to exchange?)

3. web_search "${destination} travel safety advisory ${year}"
   → Active warnings or special precautions

4. openclaw run newstoday morning "${destination}" --lang en
   → Latest news relevant to the destination (political/weather/events)

═══ Step 2: Flight comparison ═══

${from ? `5. Open https://www.google.com/travel/flights?q=${encodeURIComponent(from + ' to ' + destination)}${date ? `+${date}` : ''}
   → Google Flights: lowest fares, cheapest date calendar, booking recommendation` : `5. Open https://www.google.com/travel/flights?q=${encodeURIComponent('flights to ' + destination)}
   → Google Flights: fares from multiple origins to ${destination}`}

6. Open https://www.skyscanner.com/transport/flights/${encodedFrom || 'anywhere'}/${encoded}/${date || ''}
   → Skyscanner: lowest fares including connections; check "Everywhere" view if origin flexible

7. Open https://www.kayak.com/flights/${encodedFrom || 'anywhere'}-${encoded}/${date || 'flexible'}
   → Kayak: Price Forecast (Buy now / Wait) and price history chart

═══ Step 3: Hotel comparison ═══

8. Open https://www.booking.com/searchresults.html?ss=${encoded}${date ? `&checkin=${date}` : ''}${returnDate ? `&checkout=${returnDate}` : ''}
   → Booking.com: top 3 ${budgetLabelEN} hotels (price/rating/location)

9. Open https://www.agoda.com/search?q=${encoded}${date ? `&checkIn=${date}` : ''}${returnDate ? `&checkOut=${returnDate}` : ''}
   → Agoda: compare prices — often cheaper for Asian destinations

═══ Step 4: OTA promo codes ═══

10. openclaw run couponclaw find "Booking.com" --region all
11. openclaw run couponclaw find "Agoda" --region all
12. openclaw run couponclaw find "Trip.com" --region all
    → Stack coupon codes on top of platform prices; calculate effective final price

═══ Output ═══

Output format:
🌍 TravelHound · ${from ? from + ' → ' : ''}${destination}
━━━━━━━━━━━━━━━━━━━━━━━
📋 ${date || 'Flexible dates'} · ${nights ? nights + ' nights' : 'duration TBD'} · ${budgetLabelEN}

🛂 Destination intelligence
Visa: [required / visa-free / on-arrival + fee]
Exchange rate: 1 USD = X.XX [local currency] (trend: rising/falling/stable)
Safety: [safe / advisory / warning]
Latest news: [1-2 relevant headlines]

✈️ Best flight
[Flight] | $XXX | [Booking advice: buy now / wait]
Cheapest nearby date: ±X days saves $XXX

🏨 Best hotel (${budgetLabelEN})
[Hotel name] | $XXX/night | Rating X.X | [Platform]
After coupon code: $XXX/night effective

💰 Total trip budget estimate (${nights || 'X'} nights)
Flights: $XXX (${from || 'origin'} round trip)
Hotels: $XXX × ${nights || 'X'} nights = $XXX
Total: $XXX (after known savings)

✅ Overall verdict
[🟢/🟡/🔴 + is this a good time to go + 1-2 key reasons]
━━━━━━━━━━━━━━━━━━━━━━━
💡 Reply "flight details" or "hotel details" to dig deeper`);
}


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