AgentSkillsCN

weather-query

查询 OpenWeather 当前天气及未来 5 天的预报数据,并为特定地点概括天气状况。当用户询问某座城市或特定坐标点的当前天气、短期预报、多日气温范围、降水概率、风力、气压或湿度时使用——尤其是在需要实时外部天气数据的情况下。

SKILL.md
--- frontmatter
name: weather-query
description: Query OpenWeather current weather and 5-day forecast data and summarize conditions for a location. Use when users ask for current weather, near-term forecast, multi-day temperature ranges, precipitation probability, wind, pressure, or humidity for a city or coordinates, especially when live external weather data is required.

Weather Query

Use the bundled script to fetch and summarize weather from OpenWeather 2.5/weather and 2.5/forecast.

Sandbox Constraints

This script runs inside a sandboxed environment with strict rules:

  • Only .venv/bin/python is allowed. Do not use bare python, python3, or any other interpreter.
  • No shell operators. Do not use &&, ||, ;, |, >, <, $(...), or backticks.
  • No cd. Always use the relative path from the project root.
  • No --api-key or --city. The API key is injected by the sandbox proxy. Geocoding is not available inside the sandbox.
  • Always use --lat and --lon. Look up coordinates with WebSearch first.
  • The exact command prefix must be: .venv/bin/python plugins/weather-plugin/skills/weather-query/scripts/get_weather.py

Any command that does not match this format will be rejected.

Run Workflow

  1. Look up coordinates. Use WebSearch to find the latitude and longitude for the requested location. Example query: "Chicago Illinois latitude longitude".

  2. Run the script with --lat and --lon. Do not use --city (geocoding requires an API call that is not available inside the sandbox).

  3. Summarize the result for the user.

    • Highlight current conditions first.
    • Mention precipitation chance, wind, and temperature range.
    • Note that severe alerts are not included by these endpoints.

Command Format

The only allowed Bash command format:

bash
.venv/bin/python plugins/weather-plugin/skills/weather-query/scripts/get_weather.py --lat <LAT> --lon <LON>

Optional flags (append after coordinates):

bash
.venv/bin/python plugins/weather-plugin/skills/weather-query/scripts/get_weather.py \
  --lat 41.8781 \
  --lon -87.6298 \
  --units metric \
  --lang en \
  --hours 12 \
  --days 5

Output Expectations

  • Current section: temperature, feels-like, humidity, pressure, wind, condition text.
  • Forecast section: timestamp (3-hour steps), temperature, precipitation probability, condition.
  • Daily section: date, min/max temperatures, precipitation probability, condition.
  • Alerts note: endpoint limitation message.

Troubleshooting

  • Command rejected: verify you are using .venv/bin/python with the relative path, --lat/--lon, and no shell operators.
  • 401 Unauthorized: the proxy may not be running. It must be started separately.
  • Missing fields: OpenWeather omits fields when not applicable for that location/time.

Reference

  • OpenWeather API details and field mapping: references/openweather-current-forecast.md