Weather Query Skill
This skill enables AI agents to fetch real-time weather information and forecasts for locations in China using the provided shell scripts.
When to Use This Skill
Use this skill when users:
- Ask about current weather conditions
- Want weather forecasts
- Need temperature, humidity, wind information
- Request air quality data
- Plan outdoor activities and need weather info
How to Use
Get Real-time Weather
Use the realtime.sh script to get current conditions, air quality, daily life indices, and weather alerts.
./scripts/realtime.sh <query> [--encoding <text|json|markdown>]
Get Weather Forecast
Use the forecast.sh script to get hourly and daily forecast data, along with sunrise/sunset times.
./scripts/forecast.sh <query> [--encoding <text|json|markdown>] [--days <0-8>]
query (Required): The name of the city, district, or area in Chinese (e.g., 雨花台, 北京). Can be provided as a positional argument or with --query.
encoding (Optional): Used to specify the returned data format. Can be text, json, or markdown.
days (Optional, forecast only): Used to specify the weather forecast date range. An integer between 0 and 8.
Response Format
To balance information depth with token consumption, you MUST use the following rules for the encoding parameter:
Default Strategy (--encoding markdown)
- When to use: By default for standard weather inquiries.
- Why: Provides well-structured, easy-to-read information with moderate token usage.
Brief Information (--encoding text)
- When to use: When the user explicitly requests brief or summarized weather information.
- Why: Returns only essential details in plain text, saving maximum tokens.
Complete Information (--encoding json)
- When to use: Only when the user explicitly asks for raw data, detailed fields, or comprehensive data (all indices, timestamps).
- Why: Returns the complete API payload, which is highly token-heavy.
Best Practices
Location Names: Always use Chinese characters for location names
Error Handling: Check if the location is valid before displaying results
Context: Provide relevant context based on weather conditions
- Rain: Suggest bringing umbrella
- Hot: Recommend staying hydrated
- Cold: Advise wearing warm clothes
- Poor AQI: Suggest wearing mask
Fallbacks: If a specific district doesn't work, try the city name
Troubleshooting
Issue: Location not found
- Solution: Try using the main city name instead of district
- Example: Use "北京" instead of "朝阳区"
Issue: No forecast data
- Solution: Verify the location name is correct
- Try standard city names: 北京, 上海, 广州, 深圳, etc.
Issue: Data seems outdated
- Solution: The API updates regularly, but weather can change quickly
- Check the
updated timestamp in the response
Supported Locations
The weather API supports most cities and districts in China, including:
- Provincial capitals: 北京, 上海, 广州, 深圳, 成都, 杭州, 南京, 武汉, etc.
- Major cities: 苏州, 青岛, 大连, 厦门, etc.
- Districts: 海淀区, 朝阳区, 浦东新区, etc.
1---2name: weather-query-23description: Use when users ask about weather conditions, forecasts, or climate information for locations in China.4---5
6# Weather Query Skill
7
8This skill enables AI agents to fetch real-time weather information and forecasts for locations in China using the provided shell scripts.
9
10## When to Use This Skill
11
12Use this skill when users:
13- Ask about current weather conditions
14- Want weather forecasts
15- Need temperature, humidity, wind information
16- Request air quality data
17- Plan outdoor activities and need weather info
18
19## How to Use
20
21### Get Real-time Weather
22Use the `realtime.sh` script to get current conditions, air quality, daily life indices, and weather alerts.
23```bash
24./scripts/realtime.sh <query> [--encoding <text|json|markdown>]
25```
26
27### Get Weather Forecast
28Use the `forecast.sh` script to get hourly and daily forecast data, along with sunrise/sunset times.
29```bash
30./scripts/forecast.sh <query> [--encoding <text|json|markdown>] [--days <0-8>]
31```
32- `query` (Required): The name of the city, district, or area in Chinese (e.g., `雨花台`, `北京`). Can be provided as a positional argument or with `--query`.
33- `encoding` (Optional): Used to specify the returned data format. Can be `text`, `json`, or `markdown`.
34- `days` (Optional, forecast only): Used to specify the weather forecast date range. An integer between 0 and 8.
35
36## Response Format
37
38To balance information depth with token consumption, you **MUST** use the following rules for the `encoding` parameter:
39
401. **Default Strategy (`--encoding markdown`)**
41 - **When to use:** By default for standard weather inquiries.
42 - **Why:** Provides well-structured, easy-to-read information with moderate token usage.
43
442. **Brief Information (`--encoding text`)**
45 - **When to use:** When the user explicitly requests brief or summarized weather information.
46 - **Why:** Returns only essential details in plain text, saving maximum tokens.
47
483. **Complete Information (`--encoding json`)**
49 - **When to use:** Only when the user explicitly asks for raw data, detailed fields, or comprehensive data (all indices, timestamps).
50 - **Why:** Returns the complete API payload, which is highly token-heavy.
51
52## Best Practices
53
541. **Location Names**: Always use Chinese characters for location names
552. **Error Handling**: Check if the location is valid before displaying results
563. **Context**: Provide relevant context based on weather conditions
57 - Rain: Suggest bringing umbrella
58 - Hot: Recommend staying hydrated
59 - Cold: Advise wearing warm clothes
60 - Poor AQI: Suggest wearing mask
61
624. **Fallbacks**: If a specific district doesn't work, try the city name
63
64## Troubleshooting
65
66### Issue: Location not found
67- **Solution**: Try using the main city name instead of district
68- Example: Use "北京" instead of "朝阳区"
69
70### Issue: No forecast data
71- **Solution**: Verify the location name is correct
72- Try standard city names: 北京, 上海, 广州, 深圳, etc.
73
74### Issue: Data seems outdated
75- **Solution**: The API updates regularly, but weather can change quickly
76- Check the `updated` timestamp in the response
77
78## Supported Locations
79
80The weather API supports most cities and districts in China, including:
81- Provincial capitals: 北京, 上海, 广州, 深圳, 成都, 杭州, 南京, 武汉, etc.
82- Major cities: 苏州, 青岛, 大连, 厦门, etc.
83- Districts: 海淀区, 朝阳区, 浦东新区, etc.