trip-planner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTrip Planner
Trip Planner
A skill that turns natural language into flight recommendations — preferring assumptions over questions.
Assume first. Show your work. Book the flight.
一款将自然语言转换为航班推荐的技能 —— 优先采用假设而非提问的方式。
先假设,再展示,即可预订航班。
Core Design Principle
核心设计原则
Assume everything, show everything. The user corrects what's wrong, not fills in what's missing. The only hard requirement is a destination — everything else has a sensible default.
所有信息先假设,全部假设要展示。 用户只需修正错误信息,无需补充缺失内容。唯一硬性要求是目的地——其他所有信息都有合理的默认值。
Two Flows
两种流程
| Condition | Flow |
|---|---|
No | Onboarding Flow — instant search, then quick setup |
| Regular Flow — FAST: parse, assume, search, recommend |
| 触发条件 | 流程 |
|---|---|
不存在 | 首次使用引导流程 —— 即时搜索,随后快速设置 |
存在 | 常规使用流程 —— 快速:解析、假设、搜索、推荐 |
Onboarding Flow (First Run Only)
首次使用引导流程(仅首次运行)
Detection: Check if exists. If no config exists, run this flow. Otherwise skip to Regular Flow.
.claude/trip-planner.mdGoal: Deliver flight recommendations immediately, then calibrate preferences.
检测机制: 检查是否存在文件。若不存在配置文件,则运行此流程;否则跳至常规使用流程。
.claude/trip-planner.md目标: 立即提供航班推荐,随后校准用户偏好。
Step 1: Welcome (skip if user already described a trip)
步骤1:欢迎语(若用户已描述行程则跳过)
Read and display verbatim:
references/branding.md- Logo
- Origin quote
- Workflow diagram
- Key concepts
Then check: did the user already describe a trip in their message?
- Yes → Skip straight to Step 2 with their input
- No → Display:
Where are you headed? Just describe your trip naturally:
"I need to fly to Tokyo next month for a week"
"London to Paris, March 15-18, 2 adults"
"Cheapest flights to Barcelona in April"Wait for user input.
读取文件并原样展示以下内容:
references/branding.md- Logo
- 起源引言
- 工作流示意图
- 核心概念
随后检查:用户是否已在消息中描述了行程?
- 是 → 直接使用用户输入跳至步骤2
- 否 → 展示:
你要去哪里?只需自然描述你的行程即可:
"我下个月要去东京待一周"
"伦敦到巴黎,3月15日-18日,2位成人"
"4月去巴塞罗那的最便宜航班"等待用户输入。
Step 2: Parse & Assume
步骤2:解析与假设
Extract what the user said, then fill everything else with defaults.
Run the Assumption Engine (see below) against the user's input with these fallback defaults for onboarding (no config yet):
- Origin: LHR
- Class: Economy
- Passengers: 1 adult
- Budget: Flexible
- Stops: Any
- Currency: GBP
Show the Assumption Card:
undefined提取用户输入的信息,随后用默认值补全所有缺失内容。
针对用户输入运行假设引擎(详情见下文),首次使用时采用以下默认值作为 fallback(尚无配置文件):
- 出发地:LHR
- 舱位:经济舱
- 乘客:1位成人
- 预算:灵活
- 经停:不限
- 货币:GBP
展示假设信息卡片:
undefinedAssumptions
假设信息
| Field | Value | Source |
|---|---|---|
| Destination | Tokyo (NRT/HND) | You said |
| Origin | London (LHR) | Default |
| Dates | Mar 10 - Mar 17, 2026 | "next month" + 7 days |
| Passengers | 1 adult | Default |
| Class | Economy | Default |
| Budget | Flexible | Default |
| Stops | Any | Default |
Anything wrong? Say so and I'll re-search. Otherwise I'll find flights.
**Wait for corrections or confirmation.**
If user corrects → update assumptions → re-show card → wait again.
If user confirms (or says nothing wrong) → proceed to Step 3.| 字段 | 取值 | 来源 |
|---|---|---|
| 目的地 | 东京(NRT/HND) | 用户输入 |
| 出发地 | 伦敦(LHR) | 默认值 |
| 日期 | 2026年3月10日-3月17日 | "下个月" + 7天 |
| 乘客 | 1位成人 | 默认值 |
| 舱位 | 经济舱 | 默认值 |
| 预算 | 灵活 | 默认值 |
| 经停 | 不限 | 默认值 |
有错误吗?请告知,我会重新搜索。若无错误,我将开始查找航班。
**等待用户修正或确认。**
若用户修正信息 → 更新假设 → 重新展示卡片 → 再次等待。
若用户确认(或表示无错误) → 进入步骤3。Step 3: Search & Present
步骤3:搜索与展示
Run the Search Strategy (see below) with confirmed assumptions.
Present recommendations using the output format from .
assets/templates/trip-recommendation.mdThen offer corrections:
Want to adjust anything? Change dates, class, budget — I'll re-search.Corrections loop: User adjusts → re-search → re-present. Repeat until satisfied.
使用已确认的假设信息运行搜索策略(详情见下文)。
采用中的输出格式展示推荐结果。
assets/templates/trip-recommendation.md随后提供修正选项:
需要调整什么吗?更改日期、舱位、预算均可 —— 我会重新搜索。修正循环: 用户调整 → 重新搜索 → 重新展示。重复直至用户满意。
Step 4: Quick Setup
步骤4:快速设置
Once the user is happy with results:
Nice — that's your first search done.
Want to save your preferences so next time is faster? Quick 5 questions:
1. What's your home airport? (e.g. LHR, JFK, LAX)
2. Any preferred airlines? (comma-separated, or "none")
3. Default budget range per person? (e.g. "under 500", "flexible", "100-300")
4. Preferred class? (economy / premium economy / business / first)
5. Preferred booking platform? (skyscanner / google-flights / kayak)Parse response and use sensible defaults for skipped fields:
- home_airport: "LHR"
- preferred_airlines: []
- budget: "flexible"
- class: "economy"
- platform: "skyscanner"
Write config (see Config Structure below).
.claude/trip-planner.mdSaved to .claude/trip-planner.md
Run /trip-planner anytime — just describe where you want to go.Exit after onboarding.
当用户对结果满意后:
很好 —— 你的首次搜索已完成。
想要保存你的偏好以便下次更快使用吗?只需回答5个快速问题:
1. 你的常用出发机场是哪个?(例如:LHR、JFK、LAX)
2. 有无偏好的航空公司?(用逗号分隔,或回答“无”)
3. 每人的默认预算范围是多少?(例如:"500以下"、"灵活"、"100-300")
4. 偏好舱位?(经济舱 / 超级经济舱 / 商务舱 / 头等舱)
5. 偏好的预订平台?(skyscanner / google-flights / kayak)解析用户回复,对跳过的字段采用合理默认值:
- home_airport: "LHR"
- preferred_airlines: []
- budget: "flexible"
- class: "economy"
- platform: "skyscanner"
将配置写入文件(配置结构见下文)。
.claude/trip-planner.md已保存至.claude/trip-planner.md
随时运行/trip-planner —— 只需描述你的目的地即可。首次引导流程结束。
Regular Flow (Every Subsequent Run)
常规使用流程(后续每次运行)
FAST approach — no questions, just recommend:
- Parse intent from natural language
- Load config for defaults
- Run Assumption Engine (fill all gaps)
- Search for flights
- Present recommendations with booking links
快速模式 —— 无需提问,直接推荐:
- 从自然语言中解析用户意图
- 加载配置文件获取默认值
- 运行假设引擎(补全所有缺失信息)
- 搜索航班
- 展示带有预订链接的推荐结果
Step 1: Parse Intent
步骤1:解析意图
Extract from the user's message:
- Destination(s) — city names, airport codes, or countries
- Dates — explicit dates, relative dates ("next month"), or vague ("in April")
- Budget — explicit amounts or qualifiers ("cheap", "under 300")
- Class — economy, premium economy, business, first
- Passengers — number and type (adults, children, infants)
- Preferences — direct flights, specific airlines, time of day, layover preferences
- Multi-city — detect "A → B → C → A" or "then" patterns
If the user just names a destination with no other details, that's fine — the Assumption Engine handles the rest.
从用户消息中提取以下信息:
- 目的地 —— 城市名称、机场代码或国家
- 日期 —— 明确日期、相对日期(如“下个月”)或模糊日期(如“4月”)
- 预算 —— 明确金额或限定词(如“便宜”、“300以下”)
- 舱位 —— 经济舱、超级经济舱、商务舱、头等舱
- 乘客 —— 数量及类型(成人、儿童、婴儿)
- 偏好 —— 直飞、特定航空公司、时段、经停偏好
- 多城行程 —— 检测“A→B→C→A”或“然后”等模式
若用户仅提及目的地未提供其他细节也无妨 —— 假设引擎会处理剩余内容。
Step 2: Load Config
步骤2:加载配置
Read for user defaults.
.claude/trip-planner.mdSee for configuration options.
references/config-guide.mdFallback defaults (if config missing or incomplete):
- name: ""
- home_airport: "LHR"
- class: "economy"
- budget: "flexible"
- currency: "GBP"
- stops: "any"
- preferred_airlines: []
- platform: "skyscanner"
读取文件获取用户默认偏好。
.claude/trip-planner.md配置选项详情请见。
references/config-guide.mdFallback默认值(若配置文件缺失或不完整):
- name: ""
- home_airport: "LHR"
- class: "economy"
- budget: "flexible"
- currency: "GBP"
- stops: "any"
- preferred_airlines: []
- platform: "skyscanner"
Step 3: Assumption Engine
步骤3:假设引擎
Fill missing fields using this priority order:
- Explicit user input — what they said in this message
- Config file defaults — from
.claude/trip-planner.md - Contextual inference — smart guesses based on trip type:
- City break (European short-haul) → 3-4 days
- Intercontinental → 7-10 days
- Weekend trip → Friday-Sunday
- "Holiday" / "vacation" → 7 days
- Month mentioned but no dates → middle of month, flexible
- Smart defaults — final fallback:
- 1 adult
- Economy
- Flexible budget
- Any stops
- Home airport from config (or LHR)
- Dates: 4 weeks from today, 7 days duration
Get current date: Run command — do not rely on system date.
dateShow the Assumption Card (always — every assumption must be visible):
undefined按以下优先级补全缺失字段:
- 用户明确输入 —— 本次消息中用户提及的内容
- 配置文件默认值 —— 来自
.claude/trip-planner.md - 上下文推断 —— 根据行程类型做出智能猜测:
- 欧洲短途城市游 → 3-4天
- 洲际旅行 →7-10天
- 周末旅行 → 周五至周日
- “度假” →7天
- 仅提及月份未指定日期 → 月中,标记为灵活
- 智能默认值 —— 最终 fallback:
- 1位成人
- 经济舱
- 灵活预算
- 不限经停
- 配置文件中的常用出发机场(或LHR)
- 日期:从今日起4周后,行程时长7天
获取当前日期: 运行命令 —— 请勿依赖系统日期。
date展示假设信息卡片(每次必展示 —— 所有假设必须可见):
undefinedAssumptions
假设信息
| Field | Value | Source |
|---|---|---|
| Destination | {dest} | You said |
| Origin | {origin} | Config / Default |
| Dates | {dates} | {source} |
| Passengers | {pax} | {source} |
| Class | {class} | {source} |
| Budget | {budget} | {source} |
| Stops | {stops} | {source} |
Anything wrong? Otherwise I'll search.
**Wait for corrections or confirmation** before searching.
If user corrects → update → re-show card → wait.| 字段 | 取值 | 来源 |
|---|---|---|
| 目的地 | {dest} | 用户输入 |
| 出发地 | {origin} | 配置文件 / 默认值 |
| 日期 | {dates} | {source} |
| 乘客 | {pax} | {source} |
| 舱位 | {class} | {source} |
| 预算 | {budget} | {source} |
| 经停 | {stops} | {source} |
有错误吗?若无错误我将开始搜索。
**搜索前等待用户修正或确认。**
若用户修正信息 → 更新 → 重新展示卡片 → 等待。Step 4: Search
步骤4:搜索
Run the Search Strategy (see below) with confirmed assumptions.
使用已确认的假设信息运行搜索策略(详情见下文)。
Step 5: Present
步骤5:展示
Use the output format from .
assets/templates/trip-recommendation.mdPresent 3-5 flight options across three categories:
- Best Value — best balance of price, duration, and convenience
- Cheapest — lowest price regardless of convenience
- Fastest — shortest total travel time
Include direct booking links for each option.
Then offer corrections:
Want to adjust anything? I can re-search with different dates, budget, or preferences.Corrections loop: User adjusts → re-run from Step 3 with updates → re-present.
采用中的输出格式。
assets/templates/trip-recommendation.md展示3-5个航班选项,分为三类:
- 高性价比 —— 价格、时长与便利性的最佳平衡
- 最便宜 —— 价格最低,不考虑便利性
- 最快 —— 总行程时间最短
每个选项均包含直接预订链接。
随后提供修正选项:
需要调整什么吗?我可以根据不同的日期、预算或偏好重新搜索。修正循环: 用户调整 → 从步骤3开始重新运行并更新信息 → 重新展示。
Assumption Engine — Detail
假设引擎 —— 详情
The engine runs on every search. It produces a complete set of flight parameters from partial input.
每次搜索都会运行该引擎。它可从部分输入生成完整的航班参数集。
Priority Order
优先级顺序
User Input > Config > Context Inference > Smart Defaults用户输入 > 配置文件 > 上下文推断 > 智能默认值Context Inference Rules
上下文推断规则
| Signal | Inference |
|---|---|
| European city + no dates | City break: 3-4 days |
| Intercontinental + no dates | 7-10 days |
| "Weekend" mentioned | Friday evening → Sunday evening |
| "Holiday" / "vacation" | 7 days |
| Month only, no specific dates | Middle of month, flag as flexible |
| "Christmas" / "Easter" / "New Year" | Standard holiday date ranges |
| "Summer" / "Winter" | Peak month of that season |
| Return to origin in multi-city | Round trip, proportional days per city |
| "Cheap" / "budget" mentioned | Sort by price, flag budget airlines |
| "Direct" / "non-stop" mentioned | Filter to direct flights only |
| No class mentioned + business destination | Still assume economy (don't upsell) |
| 信号 | 推断结果 |
|---|---|
| 欧洲城市 + 未指定日期 | 城市短途游:3-4天 |
| 洲际旅行 + 未指定日期 | 7-10天 |
| 提及“周末” | 周五晚 → 周日晚 |
| 提及“度假” | 7天 |
| 仅提及月份未指定具体日期 | 月中,标记为灵活 |
| 提及“圣诞节”/“复活节”/“新年” | 标准假期日期范围 |
| 提及“夏季”/“冬季” | 该季节的旺季月份 |
| 多城行程中返回出发地 | 往返行程,各城市停留天数按比例分配 |
| 提及“便宜”/“预算” | 按价格排序,标记廉航 |
| 提及“直飞”/“无经停” | 仅过滤直飞航班 |
| 未提及舱位 + 商务出行目的地 | 仍默认经济舱(不推销升级) |
Destination Resolution
目的地解析
When user gives a city name:
- Map to primary airport code(s)
- For cities with multiple airports, include all (e.g. London → LHR/LGW/STN, Tokyo → NRT/HND, New York → JFK/EWR/LGA)
- For countries or regions, map to capital or most common tourist airport
当用户提供城市名称时:
- 映射至主要机场代码
- 对于有多个机场的城市,包含所有机场(例如:伦敦→LHR/LGW/STN,东京→NRT/HND,纽约→JFK/EWR/LGA)
- 对于国家或地区,映射至首都或最热门的旅游机场
Date Handling
日期处理
- Always use command for current date
date - "Next month" → 1st of next month + duration
- "In March" → March 15 (mid-month) + duration, flag as flexible
- "March 15" → exact date + duration
- "March 15-18" → exact range
- "Next weekend" → upcoming Friday-Sunday
- No dates at all → 4 weeks from today + duration based on trip type
- 始终使用命令获取当前日期
date - “下个月” → 下月1日 + 行程时长
- “3月” →3月15日(月中)+ 行程时长,标记为灵活
- “3月15日” → 精确日期 + 行程时长
- “3月15日-18日” → 精确日期范围
- “下周末” → 即将到来的周五至周日
- 未指定任何日期 → 从今日起4周后,根据行程类型确定时长
Search Strategy
搜索策略
Step A: Construct Booking URL
步骤A:构建预订URL
Build a Skyscanner URL (or platform from config) from parameters:
https://www.skyscanner.net/transport/flights/{origin}/{dest}/{depart_date}/{return_date}/?adults={n}&cabinclass={class}¤cy={currency}Skyscanner URL format:
- Dates: (e.g.
YYMMDDfor March 15, 2026)260315 - Origin/dest: airport codes lowercase (e.g. ,
lhr)nrt - Cabin class: ,
economy,premiumeconomy,businessfirst
For multi-city, construct per-leg URLs.
Google Flights URL (if configured):
https://www.google.com/travel/flights?q=flights+from+{origin}+to+{dest}+on+{date}根据参数构建Skyscanner URL(或配置文件中指定的平台):
https://www.skyscanner.net/transport/flights/{origin}/{dest}/{depart_date}/{return_date}/?adults={n}&cabinclass={class}¤cy={currency}Skyscanner URL格式:
- 日期:(例如:
YYMMDD代表2026年3月15日)260315 - 出发地/目的地:小写机场代码(例如:、
lhr)nrt - 舱位:、
economy、premiumeconomy、businessfirst
对于多城行程,构建各航段的独立URL。
Google Flights URL(若配置为该平台):
https://www.google.com/travel/flights?q=flights+from+{origin}+to+{dest}+on+{date}Step B: WebSearch for Pricing
步骤B:网页搜索获取价格信息
Run 2-3 WebSearch queries per leg to gather current pricing intelligence:
Query templates:
"flights {origin} to {dest} {month} {year} price""cheap flights {origin} to {dest} {month} {year}"- (if preferred airline set)
"{airline} {origin} {dest} {month} {year} fare"
Parse results for:
- Airlines operating the route
- Approximate price ranges
- Flight duration and stop information
- Any deals or sales mentioned
每个航段运行2-3次网页搜索查询以收集当前价格情报:
查询模板:
"flights {origin} to {dest} {month} {year} price""cheap flights {origin} to {dest} {month} {year}"- (若设置了偏好航空公司)
"{airline} {origin} {dest} {month} {year} fare"
从结果中解析以下信息:
- 运营该航线的航空公司
- 大致价格范围
- 航班时长与经停信息
- 提及的任何优惠或促销活动
Step C: WebFetch Booking Page (optional)
步骤C:网页抓取预订页面(可选)
Attempt on the constructed Skyscanner URL to get live pricing.
WebFetch- If successful: Extract specific flight options with prices
- If blocked/failed: Gracefully fall back to WebSearch data. Do not retry or error — just note that prices are approximate
尝试对构建好的Skyscanner URL运行以获取实时价格。
WebFetch- 成功: 提取带有价格的具体航班选项
- 失败/被拦截: 优雅降级为网页搜索数据。请勿重试或报错 —— 只需注明价格为近似值
Step D: Compile Results
步骤D:编译结果
Merge data from WebSearch and WebFetch (if available):
- Deduplicate by airline + route + approximate time
- Sort into three categories: Best Value, Cheapest, Fastest
- Include direct booking URL for each option
- Flag any data as "approximate" if from WebSearch only vs live pricing
合并网页搜索与网页抓取(若可用)的数据:
- 按航空公司+航线+大致时间去重
- 分为三类:高性价比、最便宜、最快
- 每个选项均包含直接预订URL
- 若仅来自网页搜索,标记数据为“近似值”,若为实时价格则无需标记
Multi-City Search
多城行程搜索
For multi-city trips (e.g. "London → Paris → Rome → London"):
- Decompose into individual legs
- Search each leg independently (can run WebSearch queries in parallel)
- Present combined itinerary overview + per-leg options
- Calculate total cost across all legs
- Provide individual booking links per leg AND a combined multi-city search link
对于多城行程(例如:“伦敦→巴黎→罗马→伦敦”):
- 分解为独立航段
- 独立搜索每个航段(可并行运行网页搜索查询)
- 展示合并后的行程概览 + 各航段选项
- 计算所有航段的总费用
- 提供各航段的独立预订链接以及合并的多城搜索链接
Config Structure
配置结构
Stored as in user's working directory.
.claude/trip-planner.mdyaml
name: "Foluso"
home_airport: "LHR"
preferences:
class: "economy"
budget: "flexible"
currency: "GBP"
stops: "any"
preferred_airlines: []
time_preference: "any" # morning / afternoon / evening / any
platform:
primary: "skyscanner" # skyscanner / google-flights / kayakSee for full field documentation.
references/config-guide.md存储在用户工作目录下的文件中。
.claude/trip-planner.mdyaml
name: "Foluso"
home_airport: "LHR"
preferences:
class: "economy"
budget: "flexible"
currency: "GBP"
stops: "any"
preferred_airlines: []
time_preference: "any" # morning / afternoon / evening / any
platform:
primary: "skyscanner" # skyscanner / google-flights / kayak完整字段文档请见。
references/config-guide.mdKey Principles
核心原则
- Assume everything, show everything. Never ask a question when you can make a reasonable assumption. Always show what you assumed so the user can correct.
- One hard requirement: destination. Everything else has a default. A user saying "flights to Tokyo" is enough to produce a full recommendation.
- Value first, setup later. Search before asking for configuration. Onboarding creates value immediately.
- Corrections over questions. Present assumptions, let user fix what's wrong. Faster than asking upfront.
- Show your sources. Every assumption in the card has a "Source" column. Every price has a booking link.
- Graceful degradation. If WebFetch fails, fall back to WebSearch. If WebSearch is sparse, still show what you have with booking links.
- Always get current date. Run command — do not rely on system date or knowledge cutoff.
date - Multi-city is first-class. Not an afterthought. Decompose, search per-leg, present combined.
- 所有信息先假设,全部假设要展示。 能做出合理假设时绝不提问。始终展示所有假设,以便用户修正。
- 唯一硬性要求:目的地。 其他所有信息都有默认值。用户只需说“去东京的航班”即可生成完整推荐。
- 先创造价值,再引导设置。 先搜索再请求配置。首次引导流程先创造即时价值。
- 修正优先于提问。 展示假设信息,让用户修正错误。比提前提问更高效。
- 展示信息来源。 假设卡片中的每个条目都有“来源”列。每个价格都带有预订链接。
- 优雅降级。 若网页抓取失败,降级为网页搜索。若网页搜索结果稀少,仍展示现有内容并附带预订链接。
- 始终获取当前日期。 运行命令 —— 请勿依赖系统日期或知识截止日期。
date - 多城行程为一等公民。 不是附加功能。分解航段、独立搜索、展示合并结果。
File Paths
文件路径
| Type | Path |
|---|---|
| Config | |
| Skill | |
| Branding | |
| Config Reference | |
| Future Enhancements | |
| Output Template | |
| 类型 | 路径 |
|---|---|
| 配置 | |
| 技能 | |
| 品牌素材 | |
| 配置指南 | |
| 未来增强功能 | |
| 输出模板 | |