跳到正文
Skillpedia
任务与项目30k · #9359

weather

它能做什么

这项技能无需 API 密钥即可获取某座城市当前的天气和预报。它会仔细核对地点,避免把名称相近的城市混淆。

适用场景

  • ✓当你想立即知道某座城市的天气怎么样时。
  • ✓当你想了解某次出行或未来一天的天气预报时。
  • ✓当你询问的城市名称存在多个匹配结果时。

技能链接

https://github.com/sipeed/picoclaw/blob/main/workspace/skills/weather/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sipeed/picoclaw/blob/main/workspace/skills/weather/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“今天成都的天气怎么样?周末的天气预报呢?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会查找该城市,核对国家和地区以确认匹配无误,然后获取当前天气状况和预报。它会在回答中重述匹配到的地点和观测时间。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Weather

Use the most reliable location match first. For Chinese city names or other non-Latin input, prefer wttr.in with the original query because it resolves native names directly. Use Open-Meteo for structured current conditions and forecasts only after you have confirmed the exact city.

Accuracy Rules

  • Always restate the matched location, region/country, and observation time in the final answer.
  • Do not trust the first geocoding hit blindly. Check country, admin1, admin2, and population.
  • For Chinese city queries, do not send Hanzi directly to Open-Meteo geocoding unless the top result is obviously correct. Prefer wttr.in with the original Chinese name, or geocode the English/pinyin city name instead.
  • If multiple plausible matches remain, ask a follow-up question or state the assumption clearly.
  • Use timezone=auto when calling Open-Meteo so the reported time matches the location.

wttr.in (best for direct city-name queries)

Quick current conditions:

curl -s "https://wttr.in/London?format=%l:+%c+%t+%h+%w"

Chinese city example:

curl -s "https://wttr.in/%E6%88%90%E9%83%BD?format=%l:+%c+%t+%h+%w"
curl -s "https://wttr.in/%E4%B8%8A%E6%B5%B7?format=%l:+%c+%t+%h+%w"

JSON output if you need more detail:

curl -s "https://wttr.in/Chengdu?format=j1"

Tips:

  • URL-encode spaces: New York -> New+York
  • URL-encode non-ASCII text before sending the request
  • Use ?m for metric units and ?u for US units

Open-Meteo (best for structured forecasts)

  1. Geocode the city and verify the returned location metadata:
curl -s "https://geocoding-api.open-meteo.com/v1/search?name=Chengdu&count=3&language=en&format=json"
  1. Query current weather and today's forecast with the verified coordinates:
curl -s "https://api.open-meteo.com/v1/forecast?latitude=30.66667&longitude=104.06667&current=temperature_2m,relative_humidity_2m,weather_code,wind_speed_10m&daily=weather_code,temperature_2m_max,temperature_2m_min&forecast_days=1&timezone=auto"

Important:

  • For Chinese inputs like 成都, geocoding name=%E6%88%90%E9%83%BD may return smaller homonym locations first. Prefer Chengdu after verifying it matches Sichuan, China.
  • If geocoding looks suspicious, fall back to wttr.in for the original city name instead of presenting a likely wrong result.

Docs: https://open-meteo.com/en/docs

常见问题

我需要 API 密钥吗?

不需要。技能使用无需密钥的公共天气服务。

如果城市名称有歧义怎么办?

智能体会向你追问,或说明它所做的假设。

它能处理其他语言的城市名称吗?

能。例如中文城市名称,会通过直接查询来处理。

详情

作者的原始描述

Get current weather and forecasts with verified location matching (no API key required).

repo: sipeed/picoclaw

热度

GitHub 星标
30k
排名
#9359
许可证
MIT
更新时间
2026/10/30

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能