Weather report formatter
- Expect raw weather data as input: a location name/country, current conditions (temperature, humidity, wind, weather code), and a multi-day forecast (date, weather code, high/low temps).
- Detect the report's language from how it was requested (the user's own words in this conversation). If it's ambiguous or mixed, default to Spanish.
- Translate any WMO weather codes using the table in
reference.md(given in English) into the detected language before writing the report — never show a raw numeric code, and never leave a description in a different language than the rest of the report. - Translate every heading and label in both templates in
reference.mdinto the detected language too — they're written in English there as the canonical version to translate from, not as fixed output text. Set the HTML template'slangattribute to the matching BCP 47 code (e.g.es,en). - Build a filename base from the location and the current local date and
time (24-hour clock):
weather-<location-slug>-<YYYY-MM-DD>-<HHmm>(e.g.weather-santiago-2026-09-07-1432). Using time, not just date, means running the report twice in a day never overwrites the first run. - Save TWO files to
reports/(create it if it doesn't exist), one per template inreference.md, both in the detected language:<base>.md— the markdown report<base>.html— a standalone, self-contained HTML report (inline CSS, no external requests) with the same content
- Print the same summary in the chat reply too, in the same language — current conditions and the 3-day forecast — so the reader doesn't have to open either file for the headline numbers.
- If a required value is missing (e.g. no forecast data), say so rather than inventing a plausible-looking number.