Skip to content
Mobile
Skill

/relevancekit

Increase widget visibility on Apple Watch using RelevanceKit. Use when providing contextual relevance signals for watchOS widgets, declaring time-based or location-based relevance, combining multiple relevance providers, helping the system surface the right widget at the right

From plugin
swift-ios-skills
1.3k86 skills1 MCP

Claude Code

$ npx -y skills add dpearson2699/swift-ios-skills --skill relevancekit --agent claude-code

SKILL.md

relevancekit.SKILL.md
name: relevancekit
description: "Increase widget visibility on Apple Watch using RelevanceKit. Use when providing contextual relevance signals for watchOS widgets, declaring time-based or location-based relevance, combining multiple relevance providers, helping the system surface the right widget at the right time on watchOS 26, or routing mixed RelevanceKit/WidgetKit/HealthKit/MapKit Smart Stack scope."

RelevanceKit

Provide on-device contextual clues that increase a widget's visibility in the Apple Watch Smart Stack. RelevanceKit tells the system *when* a widget is relevant by time, location, fitness state, sleep schedule, or connected hardware. Targets Swift 6.3 / watchOS 26+.

> **Beta-sensitive.** Re-check Apple documentation before making strong RelevanceKit availability or behavior claims.

See [references/relevancekit-patterns.md](references/relevancekit-patterns.md) for complete relevant-widget, timeline provider, grouping, preview, and permission patterns.

Contents

  • [Overview](#overview)
  • [Setup](#setup)
  • [Relevance Providers](#relevance-providers)
  • [Boundary Routing](#boundary-routing)
  • [Time-Based Relevance](#time-based-relevance)
  • [Location-Based Relevance](#location-based-relevance)
  • [Fitness and Sleep Relevance](#fitness-and-sleep-relevance)
  • [Hardware Relevance](#hardware-relevance)
  • [Combining Signals](#combining-signals)
  • [Widget Integration](#widget-integration)
  • [Common Mistakes](#common-mistakes)
  • [Review Checklist](#review-checklist)
  • [References](#references)

Overview

watchOS uses two mechanisms to determine widget relevance in the Smart Stack:

1. **Timeline provider relevance** -- implement `relevance()` on an existing `AppIntentTimelineProvider` to attach `RelevantContext` clues to timeline entries. Available across platforms; only watchOS acts on the data. 2. **Relevant widget** -- use `RelevanceConfiguration` with a `RelevanceEntriesProvider` to build a widget driven entirely by relevance clues. The system creates individual Smart Stack cards per relevant entry. watchOS 26+ only.

Choose a timeline provider when the widget always has data to show and relevance is supplementary. Choose a relevant widget when the widget should *only* appear when conditions match, or when multiple cards should appear simultaneously (e.g., several upcoming calendar events).

Key Types

| Type | Module | Role | |---|---|---| | `RelevantContext` | RelevanceKit | A contextual clue (date, location, fitness, sleep, hardware) | | `WidgetRelevance` | WidgetKit | Collection of relevance attributes for a widget kind | | `WidgetRelevanceAttribute` | WidgetKit | Pairs a widget configuration with a `RelevantContext` | | `WidgetRelevanceGroup` | WidgetKit | Controls grouping behavior in the Smart Stack | | `RelevanceConfiguration` | WidgetKit | Widget configuration driven by relevance clues (watchOS 26+) | | `RelevanceEntriesProvider` | WidgetKit | Provides entries for a relevance-configured widget (watchOS 26+) | | `RelevanceEntry` | WidgetKit | Data needed to render one relevant widget card (watchOS 26+) |

`RelevanceConfiguration`, `RelevanceEntriesProvider`, and `RelevanceEntry` are WidgetKit APIs. Keep them in this skill's scope only when they are part of the watchOS relevant-widget workflow that exposes RelevanceKit clues.

Setup

Import

import RelevanceKit
import WidgetKit

Platform Availability

`RelevantContext` is declared across platforms (iOS 17+, watchOS 10+), but **RelevanceKit functionality only takes effect on watchOS**. Calling the API on other platforms has no effect. Timeline-provider `relevance()` is available on iOS 18+, macOS 15+, visionOS 26+, and watchOS 11+ for shared provider code. `RelevanceConfiguration`, `RelevanceEntriesProvider`, and `RelevanceEntry` are watchOS 26+ only.

Permissions

Certain relevance clues require authorization or target setup:

| Clue | Required Permission | |---|---| | `.location(inferred:)` | Containing app requests location access; widget extension declares `NSWidgetWantsLocation` | | `.location(_:)` (CLRegion) | Containing app requests location access; widget extension declares `NSWidgetWantsLocation` | | `.location(category:)` | Containing app requests location access; widget extension declares `NSWidgetWantsLocation` | | `.fitness(.workoutActive)` | HealthKit access to `HKWorkoutType` | | `.fitness(.activityRingsIncomplete)` | HealthKit access to `appleExerciseTime`, `appleMoveTime`, and `appleStandTime` | | `.sleep(_:)` | HealthKit `sleepAnalysis` permission | | `.hardware(headphones:)` | None | | `.date(...)` | None |

Add location purpose strings to the containing app's `Info.plist`, not only the widget extension. In widget code, check `CLLocationManager.isAuthorizedForWidgetUpdates` before relying on location clues. For fitness and sleep clues, enable HealthKit and request the exact read types in the app and widget extension target that provides relevance.

Relevance Providers

Option 1: Timeline Provider with Relevance

Add a `relevance()` method to an existing `AppIntentTimelineProvider`. This approach shares code across iOS and watchOS while adding watchOS Smart Stack intelligence.

struct MyProvider: AppIntentTimelineProvider {
    // ... snapshot, timeline, placeholder ...

    func relevance() async -> WidgetRelevance<MyWidgetIntent> {
        let attributes = events.map { event in
            let context = RelevantContext.date(
                from: event.startDate,
                to: event.endDate
            )
            return WidgetRelevanceAttribute(
                configuration: MyWidgetIntent(event: event),
                context: context
            )
        }
        return WidgetRelevance(attributes)
    }
}

Option 2: RelevanceEntriesProvider (watchOS 26+)

Build a widget that only appears when conditions match. The system calls `relevance()` to learn *when* the widget matters, then calls `entry()` with th

Read more
@dpearson2699
Ships withswift-ios-skills

86 agent skills optimized for iOS 26+ development with Swift 6.3 and modern Apple frameworks.

1.3k86 skills1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.3k
Star history of dpearson2699/swift-ios-skills on GitHub, a chart by star-history.com

Other skills on swift-ios-skills.

alarmkit

alarmkit

Implement AlarmKit alarms and countdown timers for iOS and iPadOS with Lock Screen, Dynamic Island, StandBy, and paired Apple…

app-clips

app-clips

Build iOS App Clips with invocation URLs, App Clip Codes, NFC, QR codes, Safari banners, Maps, Messages, target setup, App Store…

More skills from other plugins.

deep-code-review

deep-code-review

In-depth design-focused code review - understands codebase context before evaluating PR changes, posts structured feedback to…

expo1d53k
@expo@expoInstall Skill
modlens

modlens

Plug-in vision for text-only models. Hard rule: when a file path or URL with an image extension (.png, .jpg, .jpeg, .webp, .gif,…

modlens2w4.6k
@liustack@liustackInstall Skill
appllama-app-design-skill

appllama-app-design-sk…

Build native-feeling, benchmark-quality mobile app screens (Expo / React Native). Use when designing or implementing any mobile…

appllama2mo3.9k
@appllama@appllamaInstall Skill

Questions about relevancekit.

Which coding agents can use relevancekit?
relevancekit installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.