$npx -y skills add joeynyc/skillscore --skill test-skillFetches current weather data for any city using OpenWeatherMap API.
| 1 | # Weather Information Fetcher |
| 2 | |
| 3 | Fetches current weather data for any city using OpenWeatherMap API. |
| 4 | |
| 5 | ## Dependencies |
| 6 | |
| 7 | - curl or wget for HTTP requests |
| 8 | - OpenWeatherMap API key (free registration at openweathermap.org) |
| 9 | - Environment variable: OPENWEATHER_API_KEY |
| 10 | |
| 11 | ## Installation |
| 12 | |
| 13 | 1. Sign up for API key at https://openweathermap.org/api |
| 14 | 2. Set environment variable: `export OPENWEATHER_API_KEY=your_api_key` |
| 15 | 3. Ensure curl is installed: `which curl` |
| 16 | |
| 17 | ## Usage |
| 18 | |
| 19 | 1. When user asks for weather information for a specific city |
| 20 | 2. Extract the city name from the request |
| 21 | 3. Make API call: `curl "http://api.openweathermap.org/data/2.5/weather?q=CITY&appid=$OPENWEATHER_API_KEY&units=metric"` |
| 22 | 4. Parse the JSON response and format for user |
| 23 | 5. Handle errors gracefully if city not found or API unavailable |
| 24 | |
| 25 | ## Examples |
| 26 | |
| 27 | ```bash |
| 28 | # Example API call |
| 29 | curl "http://api.openweathermap.org/data/2.5/weather?q=London&appid=your_api_key&units=metric" |
| 30 | ``` |
| 31 | |
| 32 | Expected response includes temperature, description, humidity, and pressure. |
| 33 | |
| 34 | ## Error Handling |
| 35 | |
| 36 | - **No API key**: Prompt user to set OPENWEATHER_API_KEY environment variable |
| 37 | - **City not found**: Return "City not found, please check spelling" |
| 38 | - **API down**: Fallback to generic message "Weather service temporarily unavailable" |
| 39 | - **Network error**: Retry once, then inform user of connection issue |
| 40 | |
| 41 | ## Limitations |
| 42 | |
| 43 | - Requires internet connection |
| 44 | - API has rate limits (1000 calls/day for free tier) |
| 45 | - Only supports current weather (not forecasts) |
| 46 | - City names must be in English |
| 47 | |
| 48 | ## Troubleshooting |
| 49 | |
| 50 | If you get "unauthorized" error: |
| 51 | 1. Verify API key is correct |
| 52 | 2. Check if key is activated (can take up to 10 minutes) |
| 53 | 3. Ensure environment variable is set properly |