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
支援
WEATHER_CITY
環境變數或傳參數覆蓋位置(如
uv run ... Tokyo
)。 支援多城市查詢(如
uv run ... 台北 高雄
WEATHER_CITY="台北,高雄"
)。 純 Python(只用標準庫),零暫存檔,並行 API 呼叫,輸出一行 JSON。
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.py
Supports overriding the location via the
WEATHER_CITY
environment variable or by passing parameters (e.g.,
uv run ... Tokyo
). Supports multi-city queries (e.g.,
uv run ... Taipei Kaohsiung
or
WEATHER_CITY="Taipei,Kaohsiung"
). Pure Python (uses only standard libraries), no temporary files, parallel API calls, outputs a single line of JSON.

怎麼回應

How to Respond

  1. 跑腳本取得 JSON
  2. references/prompt-guide.md
    (語氣、時段、台灣用語)
  3. card
    的值組成 code block 卡片(每個欄位一行)
  4. 根據
    data
    + prompt-guide 寫 3-5 句友善聊天
  5. 穿搭:參考
    references/outfit-guide.md
    ,自然融入聊天
  6. 多天預報:只在連假/天氣劇變時帶出(不要每次都報)
  7. 卡片 + 聊天一起輸出
如果腳本失敗(網路斷、API 掛、timeout):不要假裝有資料。直接跟使用者說「抱歉,天氣資料暫時抓不到,等一下再試試。」
  1. Run the script to get JSON data
  2. Read
    references/prompt-guide.md
    (tone, time period, Taiwanese terminology)
  3. Compose a code block card using the
    card
    value (one field per line)
  4. Write 3-5 friendly chat messages based on
    data
    + prompt-guide
  5. Outfit suggestions: Refer to
    references/outfit-guide.md
    and naturally integrate them into the chat
  6. Multi-day forecast: Only include it during consecutive holidays or when there's a drastic weather change (don't include it every time)
  7. 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

文件內容何時讀
references/prompt-guide.md
語氣、時段關心、台灣用語、數字規則每次都讀
references/data-fields.md
JSON 欄位說明、活用時機不確定欄位意思時讀
references/outfit-guide.md
穿搭建議對照表需要穿搭建議時讀
assets/examples.md
12 種情境範例想看範例時讀
FileContentWhen to Read
references/prompt-guide.md
Tone, time-based care, Taiwanese terminology, number rulesRead every time
references/data-fields.md
JSON field explanations, usage scenariosRead when unsure about field meanings
references/outfit-guide.md
Outfit suggestion comparison tableRead when outfit suggestions are needed
assets/examples.md
12 scenario examplesRead when you want to see examples