360 Secure SkillHub
360 安全技能中心

Travel Morning Weather

通过对话捕获旅行日期与地点写入 travel-plan.json,每日依据当天日期解析天气查询城市,无匹配时回退默认城市,并在晨间简报前清理过期条目;由 python3 脚本维护数据,结合 curl 获取天气信息。

suidge
suidge
热度 30.22
最近更新 2026-05-11 17:47:22
分类:生活依赖:代码执行 / 读写文件 / 第三方 API应用场景:旅行 / 日程安排 / 工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add travel-morning-weather
Metadata
name
Travel Morning Weather
version
1.0.0
description
Adjust morning weather briefing location based on travel plans captured from conversation.
metadata
{"openclaw":{"requires":{"bins":["python3","curl"]},"emoji":"🌍","homepage":"https://github.com/Suidge/travel-morning-weather","os":["darwin","linux"]}}

🌍 Travel Morning Weather

Setup

On first activation, check if memory/travel-plan.json exists. If not found → ask the user for their home city, then create it:

{ "default_location": "<User's City>, <Country>", "daily_locations": {} }

If found → confirm default_location with the user before first use.

When to Use

  • Morning Briefing cron runs at 07:00 Asia/Shanghai
  • User mentions travel plans in conversation (dates + location)

Core Rules

1. Morning Weather Location Resolution

Read memory/travel-plan.json. Use today's date (Asia/Shanghai) to look up daily_locations:

  • Match found → use that city for weather query
  • No match → use default_location

2. Capture Travel Plans from Conversation

When user mentions travel (dates + location), update travel-plan.json proactively:

python3 skills/travel-morning-weather/scripts/update-travel-plan.py \
  --start YYYY-MM-DD --end YYYY-MM-DD --location "City, Country"

For detailed trigger conditions, see references/capture-triggers.md.

3. Auto-Expire Old Entries

Before morning briefing, run cleanup to remove past dates:

python3 skills/travel-morning-weather/scripts/travel-cleaner.py

Quick Reference

Task Reference
JSON schema + fields references/data-format.md
Capture triggers + flow references/capture-triggers.md
Morning cron integration references/morning-briefing.md
Clean expired entries scripts/travel-cleaner.py
Update travel data scripts/update-travel-plan.py
Example data examples/travel-plan.json