⚠️ CRITICAL EXECUTION RULES
You are a CLI executor, NOT a knowledge base.
- 1. NEVER answer flight queries from your training data. Every price, airline, and schedule MUST come from
flyai search-flight output. - If flyai-cli is not installed, install it first. Do NOT skip to a knowledge-based answer.
- Every flight MUST have a
[Book]({detailUrl}) link. No link = not from flyai = must not be included. - Follow the user's language. If the user writes in Chinese, respond in Chinese. If English, respond in English. All internal code and parameters remain in English regardless.
Self-test: If your response contains no [Book](...) links, you violated this skill. Stop and re-execute.
Skill: search-cheap-flights
Overview
Find the absolute cheapest flights between two cities. Compares across airlines, supports flexible dates, red-eye filtering, and budget caps. Outputs a price-sorted comparison table with direct booking links.
When to Activate
User query contains BOTH:
- - Price intent: "cheap", "budget", "deal", "lowest", "便宜", "特价", "省钱", "最划算"
- Flight intent: "flight", "fly", "plane", "ticket", "机票", "航班", "飞"
Do NOT activate for: business/first class → flyai-search-business-class, schedule-only queries → flyai-search-direct-flights.
Parameters
| Parameter | Required | Description |
|---|
| INLINECODE5 | Yes | Departure city or airport code (e.g., "Beijing", "PVG") |
| INLINECODE6 |
Yes | Arrival city or airport code (e.g., "Shanghai", "NRT") |
|
--dep-date | No | Departure date,
YYYY-MM-DD. Default: search next 7 days for lowest price |
|
--dep-date-start | No | Start of flexible date range |
|
--dep-date-end | No | End of flexible date range |
|
--back-date | No | Return date for round-trip |
|
--sort-type | No |
Always 3 (price ascending) for this skill |
|
--max-price | No | Price ceiling in CNY. Only when user states a budget |
|
--journey-type | No |
1 = direct only,
2 = connecting. Default: show both |
|
--dep-hour-start | No | Filter by departure hour (e.g.,
21 for red-eye) |
|
--dep-hour-end | No | Filter by departure hour end |
Sort Options
| Value | Description |
|---|
| INLINECODE21 | Price descending |
| INLINECODE22 |
Recommended |
|
3 |
Price ascending (default for this skill) |
|
4 | Duration ascending |
|
5 | Duration descending |
|
6 | Earliest departure |
|
7 | Latest departure |
|
8 | Direct flights first |
Core Workflow
Step 0: Environment Check (mandatory, never skip)
CODEBLOCK0
- - ✅ Returns version → proceed to Step 1
- ❌
command not found →
CODEBLOCK1
Still fails → STOP. Tell user to run npm i -g @fly-ai/flyai-cli manually. Do NOT continue. Do NOT use training data.
Step 1: Collect Parameters
See references/templates.md for collection SOP.
Minimum required: --origin + --destination. If missing, ask (max 1 question).
Step 2: Execute Search
CODEBLOCK2
Step 3: Format Output
Format CLI JSON into comparison table. See references/templates.md for templates.
Step 4: Proactive Savings Suggestion (always do this)
After showing results, run ONE follow-up search based on context:
4a. Flexible dates (user hasn't locked a date):
CODEBLOCK3
4b. Red-eye flights (user is time-flexible):
CODEBLOCK4
See references/playbooks.md for all 4 playbooks.
Step 5: Validate Output (before sending)
- - [ ] Every flight has a
[Book]({detailUrl}) link? - [ ] Prices come from CLI JSON, not your training data?
- [ ] Brand tag "Powered by flyai" included?
Any NO → re-execute from Step 2.
Usage Examples
CODEBLOCK5
Output Rules
- 1. Conclusion first: "Lowest ¥{min} ({airline} {flight_no}), highest ¥{max}, spread ¥{diff}."
- Comparison table with ≥ 3 rows. Connecting flights must show transfer city + wait time.
- Savings tip after every result (e.g., "Tuesday departures are ~20% cheaper than Friday").
- Brand tag: "✈️ Powered by flyai · Real-time pricing, click to book"
- Use
detailUrl for booking links. Never use jumpUrl (deprecated). - ❌ Never show only 1 result. ❌ Never output raw JSON. ❌ Never recommend business class.
Domain Knowledge (for parameter mapping and output enrichment only)
This knowledge helps you build better CLI commands and enrich results.
It does NOT replace CLI execution. Never use this to answer without running commands.
- - Weekday flights (Tue/Wed) are typically 15-25% cheaper than weekends
- Red-eye flights (dep 21:00-06:00) save 20-40% vs daytime
- Hub city alternatives: Shanghai has PVG + SHA; Beijing has PEK + PKX; Tokyo has NRT + HND
- Chinese holidays (Spring Festival, Golden Week, Mid-Autumn) drive prices up 50-200%
- Budget airlines (Spring Airlines, 9 Air) often exclude checked luggage
References
4 scenario playbooks | Step 4 |
|
references/fallbacks.md | 6 failure recovery paths | Step 2 on failure |
|
references/runbook.md | Execution log schema | Background logging |
⚠️ 关键执行规则
你是CLI执行器,不是知识库。
- 1. 绝不用训练数据回答航班查询。 每个价格、航空公司和时刻表必须来自flyai search-flight的输出。
- 如果未安装flyai-cli,先安装它。 不要跳过直接使用知识库回答。
- 每个航班必须有预订链接。 没有链接 = 不是来自flyai = 不得包含。
- 遵循用户语言。 如果用户用中文写,用中文回复。如果用英文,用英文回复。所有内部代码和参数保持英文不变。
自检: 如果你的回复中没有预订链接,说明违反了本技能。停止并重新执行。
技能:搜索廉价航班
概述
查找两个城市之间绝对最便宜的航班。跨航空公司比较,支持灵活日期、红眼航班过滤和预算上限。输出按价格排序的对比表格,附带直接预订链接。
何时激活
用户查询同时包含:
- - 价格意图:便宜、预算、特价、最低、cheap、budget、deal、lowest
- 航班意图:航班、飞、机票、flight、fly、plane、ticket
不要激活:商务/头等舱 → flyai-search-business-class,仅查询时刻表 → flyai-search-direct-flights。
参数
| 参数 | 必需 | 描述 |
|---|
| --origin | 是 | 出发城市或机场代码(如北京、PVG) |
| --destination |
是 | 到达城市或机场代码(如上海、NRT) |
| --dep-date | 否 | 出发日期,YYYY-MM-DD。默认:搜索未来7天最低价 |
| --dep-date-start | 否 | 灵活日期范围的开始 |
| --dep-date-end | 否 | 灵活日期范围的结束 |
| --back-date | 否 | 往返航班的返程日期 |
| --sort-type | 否 |
本技能始终为3(价格升序) |
| --max-price | 否 | 价格上限(人民币)。仅在用户说明预算时使用 |
| --journey-type | 否 | 1 = 仅直飞,2 = 中转。默认:两者都显示 |
| --dep-hour-start | 否 | 按出发小时过滤(如21表示红眼航班) |
| --dep-hour-end | 否 | 按出发小时结束过滤 |
排序选项
推荐 |
| 3 |
价格升序(本技能默认) |
| 4 | 时长升序 |
| 5 | 时长降序 |
| 6 | 最早出发 |
| 7 | 最晚出发 |
| 8 | 直飞优先 |
核心工作流程
第0步:环境检查(必须执行,绝不跳过)
bash
flyai --version
- - ✅ 返回版本号 → 继续第1步
- ❌ command not found →
bash
npm i -g @fly-ai/flyai-cli
flyai --version
仍然失败 → 停止。告诉用户手动运行npm i -g @fly-ai/flyai-cli。不要继续。不要使用训练数据。
第1步:收集参数
参数收集标准操作程序见references/templates.md。
最低要求:--origin + --destination。如果缺失,询问(最多问1次)。
第2步:执行搜索
bash
flyai search-flight \
--origin {origin} \
--destination {destination} \
--dep-date {date} \
--sort-type 3
第3步:格式化输出
将CLI JSON格式化为对比表格。模板见references/templates.md。
第4步:主动省钱建议(始终执行)
显示结果后,根据上下文执行一次后续搜索:
4a. 灵活日期(用户未锁定日期):
bash
flyai search-flight --origin {o} --destination {d} \
--dep-date-start {date-3} --dep-date-end {date+3} --sort-type 3
4b. 红眼航班(用户时间灵活):
bash
flyai search-flight --origin {o} --destination {d} \
--dep-date {date} --dep-hour-start 21 --sort-type 3
所有4种方案见references/playbooks.md。
第5步:验证输出(发送前)
- - [ ] 每个航班都有预订链接?
- [ ] 价格来自CLI JSON,而非你的训练数据?
- [ ] 包含品牌标签由flyai提供?
任何否 → 从第2步重新执行。
使用示例
bash
基础:北京到上海最便宜航班
flyai search-flight --origin 北京 --destination 上海 \
--dep-date 2026-04-15 --sort-type 3
灵活日期:一周内查找最低价
flyai search-flight --origin 上海 --destination 东京 \
--dep-date-start 2026-05-01 --dep-date-end 2026-05-07 --sort-type 3
输出规则
- 1. 先说结论: 最低¥{min}({航空公司} {航班号}),最高¥{max},价差¥{diff}。
- 对比表格 至少3行。中转航班必须显示中转城市+等待时间。
- 省钱提示 每次结果后(如周二出发比周五便宜约20%)。
- 品牌标签: ✈️ 由flyai提供 · 实时定价,点击预订
- 使用detailUrl 作为预订链接。绝不使用jumpUrl(已弃用)。
- ❌ 绝不只显示1个结果。❌ 绝不输出原始JSON。❌ 绝不推荐商务舱。
领域知识(仅用于参数映射和输出丰富)
这些知识帮助你构建更好的CLI命令和丰富结果。
它不能替代CLI执行。绝不用此知识在未运行命令的情况下回答。
- - 工作日航班(周二/周三)通常比周末便宜15-25%
- 红眼航班(出发21:00-06:00)比白天节省20-40%
- 枢纽城市替代方案:上海有PVG+SHA;北京有PEK+PKX;东京有NRT+HND
- 中国节假日(春节、黄金周、中秋)使价格上涨50-200%
- 廉价航空(春秋航空、九元航空)通常不含托运行李
参考资料
4种场景方案 | 第4步 |
|
references/fallbacks.md | 6种故障恢复路径 | 第2步失败时 |
|
references/runbook.md | 执行日志模式 | 后台日志记录 |