docs: enhance weather-forecasts SKILL.md with time-range queries

Add tomorrow, day after tomorrow, and 7-day weekly forecast examples.
Expand Open-Meteo section with daily and hourly forecast endpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
朱潮 2026-04-04 08:00:47 +08:00
parent 85a2b50798
commit f3165944d2
2 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,93 @@
---
name: weather-forecasts
description: Get current weather and forecasts (no API key required).
homepage: https://wttr.in/:help
metadata: {"clawdbot":{"emoji":"🌤️","requires":{"bins":["curl"]}}}
---
# Weather
Two free services, no API keys needed.
## wttr.in (primary)
Quick one-liner:
```bash
curl -s "wttr.in/London?format=3"
# Output: London: ⛅️ +8°C
```
Compact format:
```bash
curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w"
# Output: London: ⛅️ +8°C 71% ↙5km/h
```
Full forecast (3 days):
```bash
curl -s "wttr.in/London?T"
```
### Querying by time range
Current weather only:
```bash
curl -s "wttr.in/London?0&format=3"
```
Today's forecast:
```bash
curl -s "wttr.in/London?1&T"
```
Tomorrow's forecast:
```bash
curl -s "wttr.in/London?2&T"
# Shows today + tomorrow; extract the second day
```
Day after tomorrow:
```bash
curl -s "wttr.in/London?T"
# Default output shows 3 days (today, tomorrow, day after tomorrow)
```
Next 7 days (weekly forecast) — use Open-Meteo:
```bash
curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&daily=temperature_2m_max,temperature_2m_min,weathercode&timezone=auto&forecast_days=7"
```
### Format codes
`%c` condition · `%t` temp · `%h` humidity · `%w` wind · `%l` location · `%m` moon
### Tips
- URL-encode spaces: `wttr.in/New+York`
- Airport codes: `wttr.in/JFK`
- Units: `?m` (metric) `?u` (USCS)
- Language: `?lang=ja` (Japanese), `?lang=zh` (Chinese), etc.
- PNG: `curl -s "wttr.in/Berlin.png" -o /tmp/weather.png`
## Open-Meteo (fallback / extended forecasts, JSON)
Free, no key, good for programmatic use and longer-range forecasts.
Current weather:
```bash
curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&current_weather=true"
```
7-day daily forecast (min/max temp, weather code):
```bash
curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&daily=temperature_2m_max,temperature_2m_min,weathercode,precipitation_sum&timezone=auto&forecast_days=7"
```
Hourly forecast for the next 2 days:
```bash
curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&hourly=temperature_2m,weathercode,precipitation&timezone=auto&forecast_days=2"
```
Find coordinates for a city, then query. Returns JSON with temp, windspeed, weathercode.
Docs: https://open-meteo.com/en/docs

View File

@ -0,0 +1,6 @@
{
"ownerId": "kn70pywhg0fyz996kpa8xj89s57yhv26",
"slug": "weather",
"version": "1.0.0",
"publishedAt": 1767545394459
}