返回顶部
w

weather-outfit-advisor天气穿搭建议

Query weather and provide outfit recommendations. When information is insufficient, ask about destination, date, and clothing preferences. Uses free weather APIs.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
80
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

weather-outfit-advisor

天气穿搭顾问

概述

根据目的地的实时天气数据和个人穿衣偏好,提供个性化的穿搭建议。

工作流程

第一步:检查信息完整性

在提供建议之前,必须确认以下三项关键信息:

  1. 1. 目的地(城市名称)
  2. 日期(具体日期或日期范围)
  3. 穿衣偏好(风格偏好、对温度的敏感程度、特殊需求等)

信息提取策略

  • - 从用户输入中提取明确的目的地、日期和偏好
  • 识别相对日期术语(明天、后天、下周一等)并转换为具体日期
  • 如果缺少任何一项,必须先询问用户

相对日期转换规则

  • - 明天 → 当前日期 + 1天
  • 后天 → 当前日期 + 2天
  • 三天后 → 当前日期 + 3天
  • 下周一 → 下一个周一的日期
  • 这周末 → 本周六或周日(需要确认)

示例

用户:我明天要去杭州
→ 提取:目的地 = 杭州,日期 = 明天
→ 转换:获取当前日期(例如 2026-04-01),计算明天 = 2026-04-02
→ 缺失:穿衣偏好
→ 操作:询问穿衣偏好

第二步:收集必要信息

根据缺失信息的数量采取不同的询问策略:

策略A:仅缺失1项(针对性提问)

仅询问缺失项

如果仅缺失穿衣偏好:

好的,我来帮您查询[城市]在[日期]的天气。

为了让推荐更适合您,请告诉我您的穿衣偏好:

  • - 您平时怕冷还是怕热?
  • 喜欢什么风格?(休闲/商务/运动等)
  • 有什么特殊需求吗?(如正式场合、户外活动等)

如果仅缺失日期:

您计划什么时候出行?(请提供具体日期,或说明天、后天等)

如果仅缺失目的地:

您的出行目的地是哪里?(请提供城市名称)

策略B:缺失2-3项(一次性询问)

当多项信息缺失时,一次性列出所有问题:

为了给您提供最合适的穿搭建议,我需要了解一些信息:

  1. 1. 您的出行目的地是哪里?
  2. 具体什么时间出行?(可以说明天、4月5日等)
  3. 您平时的穿衣习惯是怎样的?(比如怕冷/怕热、偏好的风格等)

相对日期处理

当用户使用相对日期时:

识别关键词

  • - 明天、后天、三天后
  • 下周一、下周二……下周日
  • 这周末、下周末
  • 下周、下个月

转换逻辑

  1. 1. 获取当前系统日期
  2. 根据相对术语计算具体日期
  3. 在回复中确认转换后的日期

示例

用户:我明天要去杭州
→ 系统获取当前日期:2026-04-01
→ 计算:明天 = 2026-04-02
→ 回复确认:好的,我来查询杭州明天(4月2日)的天气……

第三步:查询天气数据

使用提供的Python脚本(推荐):

bash

基本用法


python scripts/get_weather.py <城市> [日期]

示例

python scripts/get_weather.py 杭州 2026-04-02 python scripts/get_weather.py 北京 明天 python scripts/get_weather.py 上海 明天

脚本特性

  • - ✅ 自动解析相对日期(明天、后天、下周一等)
  • ✅ 城市名称规范化(支持中英文及常见别名)
  • ✅ 调用wttr.in API获取天气数据
  • ✅ 返回结构化JSON数据
  • ✅ 包含当前天气和预报信息

输出示例(JSON格式):
json
{
success: true,
city: Hangzhou,
query_date: 2026-04-01,
target_date: 2026-04-02,
current: {
temp_c: 19,
feelslikec: 19,
humidity: 56,
weather_desc: 附近有零星小雨,
windspeedkmph: 6,
uv_index: 5
},
forecast: {
maxtempc: 21,
mintempc: 11,
avg_humidity: 60,
dailychanceof_rain: 70,
weather_desc: 小毛毛雨
}
}

从输出中提取关键信息
python
import json

假设weather_data是脚本返回的JSON数据

current = weather_data[current] forecast = weather_data[forecast]

temperaturerange = f{forecast[mintempc]}-{forecast[maxtemp_c]}°C
weathercondition = forecast[weatherdesc]
humidity = current[humidity]
rainchance = forecast[dailychanceofrain]

备选方案:直接调用API(如果脚本不可用):

当前天气API

https://wttr.in/{城市}?format=j1

示例
bash
curl https://wttr.in/Hangzhou?format=j1

解析JSON响应获取关键信息
python
import json

当前天气

current = data[current_condition][0] temperature = current[temp_C] # 摄氏度 feels_like = current[FeelsLikeC] # 体感温度 humidity = current[humidity] # 湿度 weather_desc = current[weatherDesc][0][value] # 天气描述 wind_speed = current[windspeedKmph] # 风速

天气预报

forecast = data[weather][0] max_temp = forecast[maxtempC] # 最高温度 min_temp = forecast[mintempC] # 最低温度

备选方案:OpenWeatherMap API(需要免费API密钥):

如果wttr.in不可用,可以使用OpenWeatherMap:

API端点

https://api.openweathermap.org/data/2.5/weather?q={城市}&appid={APIKEY}&units=metric&lang=zhcn

预报API

https://api.openweathermap.org/data/2.5/forecast?q={城市}&appid={APIKEY}&units=metric&lang=zhcn

注意

  • - {APIKEY} 需要从 https://openweathermap.org/api 申请(免费版即可)
  • units=metric 使用摄氏度
  • lang=zhcn 返回中文描述

第四步:分析天气数据

从API响应中提取关键信息:

json
{
main: {
temp: 25, // 当前温度
feels_like: 27, // 体感温度
humidity: 60 // 湿度
},
weather: [
{
description: 晴, // 天气状况
main: Clear
}
],
wind: {
speed: 3.5 // 风速
}
}

第五步:生成穿搭建议

根据天气数据和用户偏好生成建议:

温度范围参考

温度范围穿搭建议
< 5°C厚羽绒服、保暖内衣、毛衣、围巾、手套、帽子
5-10°C
厚外套、棉服、针织衫、薄毛衣 | | 10-15°C | 风衣、夹克、连帽衫、长袖T恤 | | 15-20°C | 薄外套、牛仔外套、长袖衬衫、T恤+开衫 | | 20-25°C | 长袖T恤、薄衬衫、单层衣物 | | 25-30°C | 短袖T恤、衬衫、裙子、短裤 | | > 30°C | 透气短袖、背心、防晒衣、遮阳帽 |

考虑其他因素

雨天

  • - 携带雨伞或雨衣
  • 选择防水鞋
  • 避免浅色衣物

大风天

  • - 避免裙子或选择防走光款式
  • 穿防风外套
  • 帽子要固定好

高湿度

  • - 选择透气快干面料
  • 避免厚重衣物

强紫外线

  • - 涂抹防晒霜
  • 佩戴太阳镜
  • 穿防晒衣或长袖

添加图片参考(可选但推荐)

在提供穿搭建议后,调用图片搜索脚本提供视觉参考:

bash

搜索城市街拍风格


python scripts/search_images.py {城市} 街拍时尚 5

搜索季节性穿搭

python scripts/search_images.py {城市} {季节} 穿搭 5

搜索特定场合穿搭

python scripts/search_images.py {城市

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 weather-outfit-advisor-1775888056 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 weather-outfit-advisor-1775888056 技能

通过命令行安装

skillhub install weather-outfit-advisor-1775888056

下载

⬇ 下载 weather-outfit-advisor v1.0.1(免费)

文件大小: 19.24 KB | 发布时间: 2026-4-12 11:55

v1.0.1 最新 2026-4-12 11:55
No functional or code changes detected. The following update improves language accessibility and clarity:

- Documentation and interface fully translated from Chinese to English for international usability.
- Descriptions, workflow, UI prompts, and output formats updated to standardized, concise English.
- No logic or feature modifications; all recommendations and technical details remain the same.
- Skill continues to extract travel info, call weather APIs, and provide tailored outfit advice as before.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部