关于 travel-planner
travel-planner 是面向 Claude 的旅行规划技能,可记录旅行偏好并生成个性化行程、预算、行李清单和文化指南。它还支持行程中的费用跟踪及旅行后的目的地记录。
主要功能
- 01保存旅行偏好与行程
- 02生成逐日行程安排
- 03拆分旅行预算
- 04制作行李及出发准备清单
- 05提供目的地文化指南
- 06跟踪费用并更新过往行程
适用场景
- 01按偏好规划多日旅行
- 02估算预算并追踪旅途开支
- 03准备行李清单和出发时间表
- 04查询目的地礼仪与实用信息
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ ailabs-393/ ai-labs-claude-skills --skill travel-planner安装后在 Claude Code 中输入/travel-planner确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
index.jspackage.jsonreferences/cultural_etiquette.mdtravel_guidelines.mdscripts/plan_generator.pytravel_db.py详细介绍
旅行规划师
概述
此技能可将 Claude 打造成全面的旅行规划助手,记住你的旅行偏好,并为任何目的地生成详细、个性化的旅行计划,包括行程安排、预算明细、行李清单和文化指南。
何时使用此技能
在处理旅行相关任务时调用此技能:
- 规划旅行并制定行程
- 规划预算并追踪支出
- 调研目的地并获取推荐
- 制作行李清单
- 了解文化礼仪和注意事项
- 制定出行前准备时间表
- 管理旅行偏好
工作流
第 1 步:检查是否已有偏好
检查是否已保存旅行偏好:
python3 scripts/travel_db.py is_initialized
如果为 “false”,请继续第 2 步(设置)。如果为 “true”,请继续第 3 步(旅行规划)。
第 2 步:首次收集偏好
如果尚无偏好,请全面收集旅行信息:
旅行风格与预算:
- 预算水平:经济型、中档、豪华型
- 旅行节奏:轻松、适中、紧凑
- 住宿偏好:青年旅舍、酒店、Airbnb、度假村
- 同行人员:独自、情侣、家庭、团体
兴趣与活动:
- 观光与地标
- 美食与烹饪体验
- 冒险与户外活动
- 文化与历史
- 海滩与休闲
- 夜生活与娱乐
- 购物
- 自然与野生动物
- 摄影
- 养生与水疗
饮食与健康:
- 饮食限制(素食、纯素、过敏)
- 无障碍需求
- 健康状况
- 体能水平
语言与技能:
- 会说的语言
- 旅行经验水平
- 对冒险活动的接受程度
过往旅行:
- 去过的国家/城市
- 喜爱的目的地
- 愿望清单上的目的地
保存偏好:
import sys
sys.path.append('[SKILL_DIR]/scripts')
from travel_db import save_preferences
preferences = {
"travel_style": "adventurous",
"budget_level": "mid-range",
"accommodation_preference": ["boutique hotels", "Airbnb"],
"interests": ["culture", "food", "hiking", "photography"],
"dietary_restrictions": ["vegetarian"],
"pace_preference": "moderate",
"travel_companions": "couple",
"language_skills": ["English", "Spanish"],
"previous_destinations": ["Paris", "Tokyo", "Barcelona"],
"bucket_list": [
{"destination": "New Zealand", "notes": "Lord of the Rings locations"},
{"destination": "Peru", "notes": "Machu Picchu"}
]
}
save_preferences(preferences)
将 [SKILL_DIR] 替换为实际的技能路径。
第 3 步:创建新行程
当用户想要规划旅行时,收集以下信息:
必要信息:
- 目的地:城市/国家
- 日期:出发和返程日期(或灵活的日期范围)
- 时长:天数
- 预算:总预算或每日预算
- 目的:度假、商务、特殊场合
- 必看/必做:指定的景点或活动
创建行程:
from travel_db import add_trip
trip = {
"destination": {
"city": "Barcelona",
"country": "Spain",
"region": "Catalonia"
},
"departure_date": "2025-06-15",
"return_date": "2025-06-22",
"duration_days": 7,
"budget": {
"total": 2500,
"currency": "USD"
},
"purpose": "vacation",
"travelers": 2,
"climate": "warm Mediterranean",
"activities": ["sightseeing", "food tours", "beach", "architecture"],
"accommodation": {
"type": "boutique hotel",
"location": "Gothic Quarter"
}
}
trip_id = add_trip(trip, status="current")
第 4 步:调研目的地
使用网络搜索收集最新信息:
必要调研内容:
- 入境要求 - 签证、护照、疫苗接种
- 最佳旅游时间 - 天气、季节、节庆
- 安全信息 - 旅行警示、安全区域、常见骗局
- 文化习俗 - 注意事项(以
references/cultural_etiquette.md为指南) - 当地交通 - 地铁、公交、出租车、应用
- 热门景点 - 必看景点及开放时间和价格
- 美食推荐 - 当地特色菜、热门餐厅
- 街区 - 住宿和游览区域
- 一日游选择 - 附近景点
- 实用信息 - 货币、小费、电源插座、语言
需要涵盖的搜索主题:
- “[Destination] [nationality] 的签证要求”
- “[Destination] 最佳旅游时间和天气”
- “[Destination] 文化注意事项”
- “[Destination] 热门景点和活动”
- “[Destination] 当地交通指南”
- “[Destination] 住宿街区推荐”
- “[Destination] 美食和餐厅”
- “[Destination] 需要避免的骗局”
- “[Destination] 预算指南”
- “[Destination] 7 天游玩行程”
步骤 5:生成详细旅行计划
创建包含所有组成部分的完整计划:
A. 每日行程
根据用户的节奏偏好和研究结果安排每天的行程:
Day 1: Arrival & Gothic Quarter
- Morning (9:00 AM): Arrive Barcelona, hotel check-in
- Late Morning (11:00 AM): Walking tour of Gothic Quarter
- Barcelona Cathedral
- Plaça Reial
- Las Ramblas (brief walk)
- Afternoon (2:00 PM): Lunch at Cal Pep (tapas)
- Afternoon (4:00 PM): Picasso Museum
- Evening (7:00 PM): Dinner in El Born neighborhood
- Evening (9:00 PM): Stroll along waterfront
Transportation: Metro from airport (30 min, €5)
Estimated Cost: €120/person (meals, museum, transport)
Notes: Book Picasso Museum tickets online in advance
为每一天重复此步骤,并确保:
- 按地理位置合理分组
- 时间安排切合实际,并留出缓冲时间
- 活动类型丰富多样
- 提供用餐建议
- 说明交通详情
- 估算费用
- 提供预订说明
B. 预算明细
使用 plan_generator.py 或手动创建:
from plan_generator import calculate_budget_breakdown
budget = calculate_budget_breakdown(
total_budget=2500,
num_days=7,
accommodation_level="mid-range"
)
按以下格式呈现:
Total Budget: $2,500 (7 days)
Daily Average: $357
Breakdown:
- Accommodation: $875 (35%) - $125/night
* Boutique hotel in Gothic Quarter
* Includes breakfast
- Food: $625 (25%) - $89/day
* Breakfast: Included
* Lunch: $25-30/person
* Dinner: $40-50/person
* Snacks/drinks: $15/day
- Activities: $625 (25%) - $89/day
* Sagrada Familia: $35
* Park Güell: $13
* Picasso Museum: $15
* Food tour: $95
* Day trip to Montserrat: $50
* Other attractions: ~$100
- Transportation: $250 (10%) - $36/day
* Airport transfers: $35 each way
* Metro pass (7-day): $40
* Taxis: ~$100 total
- Miscellaneous: $125 (5%)
* Tips, emergencies, souvenirs
C. 行李清单
使用 plan_generator.py,或根据目的地气候和活动生成清单:
from plan_generator import generate_packing_checklist
checklist = generate_packing_checklist(
destination_climate="warm Mediterranean",
duration_days=7,
trip_activities=["sightseeing", "beach", "dining"]
)
根据实际情况调整并呈现:
ESSENTIALS:
- [ ] Passport (check 6-month validity)
- [ ] Visa (if required)
- [ ] Travel insurance documents
- [ ] Hotel confirmations
- [ ] Flight tickets
- [ ] Credit cards (notify bank)
- [ ] Euros cash (€200-300)
- [ ] Phone & charger
- [ ] European plug adapter
- [ ] Medications
CLOTHING (June weather: 70-80°F, sunny):
- [ ] 3 pairs shorts
- [ ] 2 pairs long pants
- [ ] 5-7 t-shirts/tops
- [ ] 1-2 dresses/nice shirts for dinner
- [ ] Light jacket for evenings
- [ ] Swimsuit
- [ ] Comfortable walking shoes
- [ ] Sandals
- [ ] Sun hat
- [ ] Sunglasses
ACTIVITIES:
- [ ] Day backpack
- [ ] Reusable water bottle
- [ ] Camera
- [ ] Beach towel (compact)
- [ ] Sunscreen SPF 50
- [ ] Walking tour comfortable shoes
D. 文化礼仪指南
研究并介绍目的地国家的具体规范(使用 references/cultural_etiquette.md 作为模板):
SPAIN / BARCELONA - Cultural Etiquette
DO'S:
✓ Greet with "Hola" and a kiss on each cheek (friends)
✓ Learn basic Spanish/Catalan phrases
✓ Eat dinner late (9-10 PM is normal)
✓ Take your time with meals
✓ Dress stylishly (locals dress well)
✓ Respect siesta time (2-5 PM, some shops close)
✓ Say "Bon profit" before meals
✓ Tip 5-10% for good service
DON'TS:
✗ Don't expect early dinner (restaurants open at 8 PM)
✗ Don't wear beach clothes in city center
✗ Don't assume everyone speaks English
✗ Don't call it Spain - it's Catalunya to locals
✗ Don't rush through meals
✗ Don't yell or be loud in public
✗ Don't take photos in churches during mass
DINING ETIQUETTE:
- Lunch: 2-4 PM
- Dinner: 9-11 PM
- Service charge sometimes included (check bill)
- Say "La cuenta, por favor" for bill
- It's okay to share tapas
- Bread is not free at all restaurants
SAFETY TIPS:
- Watch for pickpockets on Las Ramblas and metro
- Keep bag in front in crowded areas
- Don't leave valuables on beach
- Be cautious accepting help from strangers
- Use official taxis or Uber/Cabify
E. 行前准备时间表
使用 plan_generator.py,或根据出发日期制定:
from plan_generator import generate_pre_trip_checklist
prep_checklist = generate_pre_trip_checklist(
destination_country="Spain",
departure_date="2025-06-15"
)
按时间表呈现:
PRE-TRIP CHECKLIST
2 MONTHS BEFORE (April 15):
- [ ] Book flights
- [ ] Book hotel
- [ ] Purchase travel insurance
- [ ] Check passport expiration
- [ ] Research visa requirements
- [ ] Start researching activities
1 MONTH BEFORE (May 15):
- [ ] Book Sagrada Familia tickets (sell out!)
- [ ] Book food tour
- [ ] Book any other popular activities
- [ ] Notify bank of travel dates
- [ ] Set up international phone plan
- [ ] Download offline maps (Google Maps, Citymapper)
- [ ] Make dinner reservations (popular restaurants)
2 WEEKS BEFORE (June 1):
- [ ] Confirm all reservations
- [ ] Print/save all confirmations offline
- [ ] Exchange some currency (~€200)
- [ ] Check weather forecast
- [ ] Create packing list
- [ ] Arrange pet/plant care
- [ ] Hold mail delivery
1 WEEK BEFORE (June 8):
- [ ] Check in for flights (24 hours before)
- [ ] Pack luggage
- [ ] Charge all electronics
- [ ] Download language apps (Google Translate, Duolingo)
- [ ] Save emergency numbers
- [ ] Make copies of passport
- [ ] Clean out fridge
DAY BEFORE (June 14):
- [ ] Re-check flight time
- [ ] Prepare carry-on
- [ ] Take out trash
- [ ] Adjust thermostat
- [ ] Unplug electronics
- [ ] Set multiple alarms for departure
步骤 6:跟踪行程和预算
旅行期间,记录开支:
from travel_db import add_expense
expense = {
"category": "food",
"amount": 45.00,
"description": "Dinner at Cervecería Catalana",
"date": "2025-06-16"
}
add_expense(trip_id, expense)
查看预算状态:
from travel_db import get_budget_summary
summary = get_budget_summary(trip_id)
# Shows: total_budget, spent, remaining, percentage_used, by_category
步骤 7:行后更新
旅行结束后,将行程移至过往行程并更新:
from travel_db import move_trip_to_past, add_previous_destination
move_trip_to_past(trip_id)
add_previous_destination("Barcelona, Spain")
最佳实践
- 充分调研 - 使用网页搜索获取准确的最新信息
- 切合实际 - 不要把日程排得太满;留出休息和即兴安排的时间
- 提前预订 - 热门景点的名额很快会售罄,旺季尤其如此
- 预留预算 - 额外预留 10-20%,以应对意外开支
- 尊重文化 - 了解并遵守当地习俗
- 安全第一 - 查看旅行安全提示,并向使馆登记
- 保持灵活 - 天气和实际情况都可能变化
- 记录所有信息 - 保存确认信息和重要资料的离线副本
交互示例
User: "I want to plan a 7-day trip to Barcelona in June"
Claude: [Checks preferences - finds initialized]
Great! I'll create a detailed travel plan for Barcelona. Based on your preferences,
I know you enjoy culture, food, and moderate-paced travel with a mid-range budget.
First, a few questions:
1. What are your exact travel dates?
2. What's your total budget?
3. Any specific must-see attractions?
4. Traveling solo or with someone?
User: "June 15-22, $2500 budget, want to see Gaudí architecture, traveling with partner"
Claude: [Creates trip in database, performs web research]
Perfect! I've created your Barcelona trip plan. Let me present the complete itinerary:
[Generates detailed 7-day itinerary with Sagrada Familia, Park Güell, Casa Batlló, etc.]
[Creates budget breakdown: $2500 over 7 days]
[Generates packing checklist for June Mediterranean weather]
[Provides Spanish cultural do's and don'ts]
[Creates timeline of pre-trip tasks]
Key highlights:
✓ Day 2: Sagrada Familia (book tickets NOW - they sell out)
✓ Day 4: Food tour in El Born (€95/person, worth it!)
✓ Day 6: Day trip to Montserrat
✓ Budget: $357/day average (€325)
✓ Accommodation: €125/night in Gothic Quarter
Important notes:
- Book Sagrada Familia tickets immediately
- Dinner reservations needed for Tickets Bar, Cervecería Catalana
- Pickpocket awareness on Las Ramblas
- Bring European plug adapter (Type C/F)
Would you like me to adjust anything in the itinerary?
技术说明
数据存储:
- 偏好设置:
~/.claude/travel_planner/preferences.json - 行程:
~/.claude/travel_planner/trips.json
CLI 命令:
# Check initialization
python3 scripts/travel_db.py is_initialized
# View data
python3 scripts/travel_db.py get_preferences
python3 scripts/travel_db.py get_trips current
python3 scripts/travel_db.py stats
# Generate plan
python3 scripts/plan_generator.py --trip-id <id> --output plan.json
# Export backup
python3 scripts/travel_db.py export > backup.json
资源
scripts/travel_db.py
用于管理偏好设置、行程、预算跟踪、每日安排和旅行统计信息。
scripts/plan_generator.py
用于生成每日行程、预算明细、行李清单和行前准备时间表。
references/travel_guidelines.md
关于目的地调研、预算规划、行程制定、行李准备策略和安全提示的综合指南。
references/cultural_etiquette.md
用于调研各国具体习俗、着装规范、用餐礼仪、宗教注意事项及常见禁忌的模板和指南。