weather-hint-tw
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese天氣提醒
Weather Reminder
查詢天氣
Query Weather
bash
uv run "$(dirname -- "${BASH_SOURCE[0]:-$0}")/scripts/fetch_weather.py"如果上面的相對路徑不行,用 skill 安裝路徑:
bash
uv run <skill-directory>/scripts/fetch_weather.py支援 環境變數或傳參數覆蓋位置(如 )。
支援多城市查詢(如 或 )。
純 Python(只用標準庫),零暫存檔,並行 API 呼叫,輸出一行 JSON。
WEATHER_CITYuv run ... Tokyouv run ... 台北 高雄WEATHER_CITY="台北,高雄"bash
uv run "$(dirname -- "${BASH_SOURCE[0]:-$0}")/scripts/fetch_weather.py"If the relative path above doesn't work, use the skill installation path:
bash
uv run <skill-directory>/scripts/fetch_weather.pySupports overriding the location via the environment variable or by passing parameters (e.g., ).
Supports multi-city queries (e.g., or ).
Pure Python (uses only standard libraries), no temporary files, parallel API calls, outputs a single line of JSON.
WEATHER_CITYuv run ... Tokyouv run ... Taipei KaohsiungWEATHER_CITY="Taipei,Kaohsiung"怎麼回應
How to Respond
- 跑腳本取得 JSON
- 讀 (語氣、時段、台灣用語)
references/prompt-guide.md - 用 的值組成 code block 卡片(每個欄位一行)
card - 根據 + prompt-guide 寫 3-5 句友善聊天
data - 穿搭:參考 ,自然融入聊天
references/outfit-guide.md - 多天預報:只在連假/天氣劇變時帶出(不要每次都報)
- 卡片 + 聊天一起輸出
如果腳本失敗(網路斷、API 掛、timeout):不要假裝有資料。直接跟使用者說「抱歉,天氣資料暫時抓不到,等一下再試試。」
- Run the script to get JSON data
- Read (tone, time period, Taiwanese terminology)
references/prompt-guide.md - Compose a code block card using the value (one field per line)
card - Write 3-5 friendly chat messages based on + prompt-guide
data - Outfit suggestions: Refer to and naturally integrate them into the chat
references/outfit-guide.md - Multi-day forecast: Only include it during consecutive holidays or when there's a drastic weather change (don't include it every time)
- Output the card and chat messages together
If the script fails (network outage, API down, timeout): Do not pretend to have data. Directly tell the user, "Sorry, I can't retrieve the weather data temporarily. Please try again later."
參考文件
Reference Documents
| 文件 | 內容 | 何時讀 |
|---|---|---|
| 語氣、時段關心、台灣用語、數字規則 | 每次都讀 |
| JSON 欄位說明、活用時機 | 不確定欄位意思時讀 |
| 穿搭建議對照表 | 需要穿搭建議時讀 |
| 12 種情境範例 | 想看範例時讀 |
| File | Content | When to Read |
|---|---|---|
| Tone, time-based care, Taiwanese terminology, number rules | Read every time |
| JSON field explanations, usage scenarios | Read when unsure about field meanings |
| Outfit suggestion comparison table | Read when outfit suggestions are needed |
| 12 scenario examples | Read when you want to see examples |