← Back to Skills Marketplace
fy39913

cn-weather

by fy39913 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
311
Downloads
0
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install cn-weather-skill
Description
查询中国城市实时天气信息。当用户询问某个城市的天气、气温、湿度、风力、天气预报,或者说"今天天气怎么样"、"XX天气"、"帮我查天气"等时,必须使用此skill。支持全国所有城市,数据来自中国气象局官方接口,实时准确。即使用户只是提到某地天气或想了解出行穿衣建议,也应优先触发此skill获取实时数据。
README (SKILL.md)

天气查询 Skill

通过中国气象局官方接口,分两步查询城市实时天气信息。


工作流程

第一步:获取气象站点编号

调用站点查询接口,将城市名转为气象站点 ID:

curl --location 'https://data.cma.cn/kbweb/home/getStationID' \
  --header 'Content-Type: application/json' \
  --data '{"city":"\x3C城市名>"}'

说明:

  • \x3C城市名> 替换为用户输入的城市,例如 张家港北京上海
  • 响应中提取站点编号字段(如 stationID 或类似字段)
  • 若返回多个站点,优先取第一个或与城市名最匹配的站点

示例请求:

curl --location 'https://data.cma.cn/kbweb/home/getStationID' \
  --header 'Content-Type: application/json' \
  --data '{"city":"张家港"}'

第二步:查询实时天气

使用上一步获取的站点编号,查询当前天气数据:

curl --location 'https://weather.cma.cn/api/now/\x3C站点编号>' \
  --header 'Accept: application/json, text/javascript, */*; q=0.01'

说明:

  • \x3C站点编号> 替换为第一步返回的站点 ID,例如 58349
  • 响应包含温度、湿度、风向、风速、天气现象等字段

示例请求:

curl --location 'https://weather.cma.cn/api/now/58349' \
  --header 'Accept: application/json, text/javascript, */*; q=0.01'

结果展示规范

获取天气数据后,按以下格式整理并回复用户:

📍 \x3C城市名> 实时天气
━━━━━━━━━━━━━━━━━━
🌡️  温度:XX°C
🤔 体感温度:XX°C
💧 湿度:XX%
🌬️  风向:XX风
💨 风速:X级(XX m/s)
☁️  天气:XX(晴/多云/小雨等)
👁️  能见度:XX km
⏱️  更新时间:XXXX-XX-XX XX:XX
  • 若接口返回字段名为英文,对照常见字段进行中文映射(temperature→温度,humidity→湿度,windDirection→风向,windSpeed→风速,weather→天气现象等)
  • 若某字段缺失,跳过该行,不显示"未知"或空值
  • 结尾可根据天气数据给出简短的出行或穿衣建议(1~2句话)

错误处理

情况 处理方式
城市名无法识别 / 站点 ID 为空 告知用户未找到该城市的气象站点,建议尝试更换城市全称或相邻城市
第二步接口请求失败 告知用户天气数据暂时无法获取,建议稍后重试
返回数据字段异常 展示能解析的字段,忽略异常字段,不中断回复

注意事项

  • 两步接口必须按顺序执行,第一步成功后才能执行第二步
  • 城市名建议使用中文全称,如"张家港市"效果与"张家港"相同
  • 本接口为中国气象局数据,仅支持中国大陆城市;若用户询问港澳台或境外城市,提示暂不支持并建议使用其他渠道
Usage Guidance
This skill appears coherent and low-risk, but verify these practical points before installing: (1) the skill makes outbound requests to data.cma.cn and weather.cma.cn — confirm your environment permits these network calls and that you trust those endpoints; (2) no credentials are required, but user-supplied city names will be sent to the external API (privacy consideration); (3) SKILL.md examples use curl — ensure the runtime has an HTTP capability or the platform will need to implement the calls; (4) the SKILL.md claims 'official' CMA APIs — consider validating the endpoints and whether an API key or rate limits apply in your deployment. If any of these are unacceptable, do not enable the skill.
Capability Analysis
Type: OpenClaw Skill Name: cn-weather-skill Version: 1.0.1 The skill is a legitimate weather query tool for Chinese cities using official China Meteorological Administration (CMA) APIs (data.cma.cn and weather.cma.cn). The SKILL.md file outlines a standard two-step process to retrieve a station ID and then fetch real-time weather data via curl, with no evidence of data exfiltration, malicious execution, or prompt injection.
Capability Assessment
Purpose & Capability
Name/description (Chinese weather lookup) match the instructions: two-step queries to CMA endpoints to resolve station ID and fetch current weather. Nothing requested is out-of-scope for a weather skill.
Instruction Scope
SKILL.md only instructs two specific HTTP calls (to data.cma.cn and weather.cma.cn) and how to format results; it does not access files, env vars, or other system state. Note: it assumes the agent can make outbound HTTP requests (examples use curl) and will transmit user-supplied city names to external endpoints (privacy consideration).
Install Mechanism
Instruction-only skill with no install spec and no code files. No packages or downloads are requested, so there is no installation risk.
Credentials
No environment variables, credentials, or config paths are required. The lack of secrets or broad credential access is proportionate to a public-weather lookup skill.
Persistence & Privilege
always is false and the skill is user-invocable with normal autonomous invocation allowed; this is expected for a service integration and does not request elevated persistent privileges.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cn-weather-skill
  3. After installation, invoke the skill by name or use /cn-weather-skill
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Skill 名称由 "weather" 更名为 "cn-weather" - 其余功能与描述保持不变
v1.0.0
Initial release of cn-weather-skill: - Provides real-time weather info for all mainland Chinese cities via the China Meteorological Administration official API. - Supports user queries about weather, temperature, humidity, wind, and forecasts by city name. - Uses a two-step process: first fetch the weather station ID for a city, then retrieve live weather data with that ID. - Returns results in a clear, standardized format with optional clothing/travel suggestions. - Handles errors such as unrecognized cities or failed data fetch gracefully. - Only supports cities in mainland China; prompts users accordingly for unsupported locations.
Metadata
Slug cn-weather-skill
Version 1.0.1
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is cn-weather?

查询中国城市实时天气信息。当用户询问某个城市的天气、气温、湿度、风力、天气预报,或者说"今天天气怎么样"、"XX天气"、"帮我查天气"等时,必须使用此skill。支持全国所有城市,数据来自中国气象局官方接口,实时准确。即使用户只是提到某地天气或想了解出行穿衣建议,也应优先触发此skill获取实时数据。 It is an AI Agent Skill for Claude Code / OpenClaw, with 311 downloads so far.

How do I install cn-weather?

Run "/install cn-weather-skill" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is cn-weather free?

Yes, cn-weather is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does cn-weather support?

cn-weather is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created cn-weather?

It is built and maintained by fy39913 (@fy39913); the current version is v1.0.1.

💬 Comments