Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Weatherkit

ASecurity

Fetch WeatherKit current, minute, hourly, and daily forecasts; weather alerts; iOS 18+ changes, historical comparisons, summaries, and statistics; and required Apple Weather attribution. Use when integrating weather data, showing forecasts or alerts, caching WeatherKit responses, displaying attribution, or reviewing WeatherKit query limits in iOS apps.

3 stars
0 votes
0 copies
0 views
Added 9/28/2026
developmentgoswiftapidocumentation

Works with

cliapi

Security Analysis

A100/100

Scanned 9/28/2026

Install to Claude Code

$npx -y skills add thiennc-tesoglobal/ios-skills --skill weatherkit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Weatherkit?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Weatherkit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/thiennc-tesoglobal-weatherkit/badge)](https://www.skillsdirectory.com/skills/thiennc-tesoglobal-weatherkit)

More formats (shields.io, HTML) on the badges page.

Files
SKILL.md
---
name: weatherkit
description: "Fetch WeatherKit current, minute, hourly, and daily forecasts; weather alerts; iOS 18+ changes, historical comparisons, summaries, and statistics; and required Apple Weather attribution. Use when integrating weather data, showing forecasts or alerts, caching WeatherKit responses, displaying attribution, or reviewing WeatherKit query limits in iOS apps."
---

# WeatherKit

Fetch current conditions, hourly and daily forecasts, weather alerts, and historical statistics using `WeatherService`. Displays mandatory Apple Weather attribution.

## Contents

- [Setup & Permissions](#setup--permissions)
- [Fetching Weather Data](#fetching-weather-data)
- [Selective Queries](#selective-queries)
- [Context & Historical Queries (iOS 18+)](#context--historical-queries-ios-18)
- [Attribution Requirements](#attribution-requirements)
- [Caching & Rate Limits](#caching--rate-limits)
- [Common Mistakes](#common-mistakes)
- [Review Checklist](#review-checklist)
- [References](#references)

## Setup & Permissions

1. Enable the **WeatherKit** capability in Xcode.
2. Enable WeatherKit for your App ID in the Apple Developer portal.
3. Add `NSLocationWhenInUseUsageDescription` to Info.plist if requesting coordinates via CoreLocation.
4. Use `WeatherService.shared` across the app.

## Fetching Weather Data

Fetch complete weather datasets for a target `CLLocation`:

```swift
import WeatherKit
import CoreLocation

let weather = try await WeatherService.shared.weather(for: location)

// Current conditions
let current = weather.currentWeather
print("Temperature: \(current.temperature.formatted())")
print("Condition: \(current.condition.description), SF Symbol: \(current.symbolName)")

// Hourly and Daily forecasts
for hour in weather.hourlyForecast.prefix(12) {
    print("\(hour.date.formatted(date: .omitted, time: .shortened)): \(hour.temperature.formatted())")
}
```

Format `Measurement<UnitTemperature>` values with `.formatted()` to honor user locale conventions.

## Selective Queries

Reduce bandwidth and processing by requesting only necessary datasets:

```swift
let (current, hourly) = try await WeatherService.shared.weather(
    for: location,
    including: .current, .hourly
)
```

Available query types include `.current`, `.hourly`, `.daily`, `.minute`, and `.alerts`.

## Context & Historical Queries (iOS 18+)

Access climate context, historical comparisons, and weather summaries:

```swift
// Query weather changes (e.g. temperature shift since yesterday)
let changes = try await WeatherService.shared.weather(for: location, including: .changes)

// Historical comparison
let historical = try await WeatherService.shared.weather(for: location, including: .historicalComparisons)
```

## Attribution Requirements

Apple requires visible attribution whenever WeatherKit data is displayed:

```swift
let attribution = try await WeatherService.shared.attribution
// Display attribution.combinedMark (light/dark Apple Weather logo)
// Provide tappable link to attribution.legalPageURL
```

In SwiftUI, display attribution using `Link` and the official logo asset.

## Caching & Rate Limits

- Respect `metadata.expirationDate` returned with forecasts; avoid refetching unexpired data.
- Batch requests by coordinates and debounce location updates to stay within API tier allowances.

## Common Mistakes

- **Omitting mandatory Apple Weather attribution**: App Store review rejects apps displaying WeatherKit data without legal attribution and logo.
- **Ignoring forecast expiration dates**: Calling `weather(for:)` on every view appearance causes rate-limiting errors. Respect `metadata.expirationDate`.
- **Hardcoding temperature unit conversion**: Manually calculating Fahrenheit/Celsius ignores system locale. Use `temperature.formatted()`.
- **Requesting all datasets when only current weather is needed**: Increases network latency. Use selective `including:` queries.
- **Missing Apple Developer WeatherKit entitlement**: WeatherKit calls fail if the capability is not enabled in the developer portal.

## Review Checklist

- [ ] WeatherKit capability enabled in Xcode and Developer Portal
- [ ] Required Apple Weather attribution logo and legal link displayed
- [ ] Temperatures formatted via `Measurement.formatted()`
- [ ] Selective queries (`including:`) used to minimize network payload
- [ ] Forecasts cached and refreshed according to `metadata.expirationDate`

## References

- Extended patterns (SwiftUI dashboard, charts integration, historical statistics): [references/weatherkit-patterns.md](references/weatherkit-patterns.md)
- [WeatherKit framework](https://sosumi.ai/documentation/weatherkit)
- [WeatherService](https://sosumi.ai/documentation/weatherkit/weatherservice)
- [WeatherAttribution](https://sosumi.ai/documentation/weatherkit/weatherattribution)
- [WeatherQuery](https://sosumi.ai/documentation/weatherkit/weatherquery)
- [WeatherQuery.daily(startDate:endDate:)](https://sosumi.ai/documentation/weatherkit/weatherquery/daily(startdate:enddate:))
- [WeatherQuery.hourly(startDate:endDate:)](https://sosumi.ai/documentation/weatherkit/weatherquery/hourly(startdate:enddate:))
- [CurrentWeather](https://sosumi.ai/documentation/weatherkit/currentweather)
- [CurrentWeather.temperature](https://sosumi.ai/documentation/weatherkit/currentweather/temperature)
- [Measurement.formatted()](https://sosumi.ai/documentation/foundation/measurement/formatted())
- [Forecast](https://sosumi.ai/documentation/weatherkit/forecast)
- [HourWeather](https://sosumi.ai/documentation/weatherkit/hourweather)
- [DayWeather](https://sosumi.ai/documentation/weatherkit/dayweather)
- [WeatherAlert](https://sosumi.ai/documentation/weatherkit/weatheralert)
- [WeatherAvailability](https://sosumi.ai/documentation/weatherkit/weatheravailability)
- [WeatherMetadata.expirationDate](https://sosumi.ai/documentation/weatherkit/weathermetadata/expirationdate)
- [WeatherQuery.changes](https://sosumi.ai/documentation/weatherkit/weatherquery/changes)
- [WeatherQuery.historicalComparisons](https://sosumi.ai/documentation/weatherkit/weatherquery/historicalcomparisons)
- [WeatherKit updates](https://sosumi.ai/documentation/updates/weatherkit)
- [Bring context to today's weather](https://sosumi.ai/videos/play/wwdc2024/10067)
- [WeatherService.weather(for:)](https://sosumi.ai/documentation/weatherkit/weatherservice/weather(for:))

Attribution

thiennc-tesoglobalthiennc-tesoglobal
View sourceMore from thiennc-tesoglobal →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

284972 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

10311 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →