WidgetKit and Live Activities with AI agents: timelines, Dynamic Island and ActivityKit
Install a dedicated WidgetKit skill so the agent builds a widget extension with a TimelineProvider, correct families and rendering modes, then add ActivityKit Live Activities for short-lived events and a background-execution skill when silent push or BGAppRefresh must refresh timelines — do not treat widgets like full app screens.
Last updated:
This page is about getting a coding agent to ship WidgetKit surfaces and Live Activities correctly: widget extension + timeline provider, families and rendering modes, ActivityKit lifecycle, and background refresh when the timeline needs new data. For Siri/Shortcuts intent design, see App Intents with AI agents. For Claude Code-only skill shopping lists, see Best Claude Code skills for SwiftUI.
What the agent has to get right
WidgetKit "extend[s] the reach of your app by creating widgets, watch complications, Live Activities, and controls." Apple's overview: widgets elevate a small amount of timely, personally relevant information and can offer specific functionality without launching the app — Home Screen, Today View, desktop, Lock Screen accessories, Smart Stack and more.
ActivityKit lets you "start a Live Activity to share live updates from your app" for events that last several hours (sports score, delivery ETA, workout). Live Activities appear on the Lock Screen, in the Dynamic Island, in CarPlay, and on a paired Mac or Apple Watch per Apple's Live Activities article and HIG Live Activities.
Three layers show up in almost every PR:
Widget extension + timeline — add a widget extension (Creating a widget extension); implement
TimelineProviderorAppIntentTimelineProvider, entries, and a reload policy that respects the daily budget.Presentation — support the right
WidgetFamilyvalues,@Environment(\.widgetRenderingMode)for full-color / accented / vibrant, and HIG Widgets rules: glanceable content, not a mini app.Live Activities — when the user is tracking a short-lived event, use ActivityKit (
Activity.request/update/end) inside the same widget extension rather than abusing local notifications as a fake live scoreboard (Displaying live data with Live Activities).
Rules worth adding to AGENTS.md or CLAUDE.md:
WidgetKit: create a real widget extension target. Use TimelineProvider/AppIntentTimelineProvider; do not reload every second. Read App Group snapshots in the provider; put network work in the app or BG tasks. Live Activities use ActivityKit for multi-hour events — not repeating local notifications. Match families and rendering modes; keep UI glanceable per HIG Widgets.
Step 1: install a WidgetKit skill
Ask the agent to:
Install Widgets Agent Skill (
npx skills add https://github.com/n0an/Widgets-Agent-Skill --skill widgets) as the primary WidgetKit/Live Activities coach.Optionally install Swift and Apple platform skills (fal3) and select
app-intents-widgetswhen configuration intents and system surfaces dominate.Apple Native Skills (
npx skills add Yar177/appleNativeSkills --skill apple-system-integration) and Claude Apple Dev Skills (npx skills add laramarcodes/claude-apple-dev-skills) add widgets/Live Activities inside broader Apple packs.
Honest limit: do not install every widget-adjacent pack at once. One dedicated WidgetKit skill plus fal3 when you also need App Intents/widget configuration is enough for most PRs.
Step 2: timeline provider, not a mini app
Point the agent at Apple's Creating a widget extension article. Require:
A widget extension target (not widgets drawn only inside the main app process for Home Screen placement).
A timeline of entries with an explicit reload policy (
.atEnd/.after(date)/.never) — reject "reload every few seconds" unless Apple push-updated widgets or Live Activities apply.Families the product actually supports, with previews via
#Preview(as:).Correct rendering mode handling for tinted Home Screen / Lock Screen (accented / vibrant).
Step 3: Live Activities via ActivityKit
When the feature is a multi-hour event:
Define
ActivityAttributes+ContentState.Present UI with
ActivityConfiguration(Lock Screen + Dynamic Island).Start/update/end with
Activity.request/update/endas in Apple's Live Activities article.For push updates, follow Apple's push-to-start / push token guidance — do not invent a polling loop inside the extension.
Step 4: keep data fresh with background execution
Widget providers should read cached App Group data. When the cache must update while the app is suspended, install Background Execution Agent Skill and use BGAppRefreshTask, background URLSession, or silent push as Apple documents — then call WidgetCenter reload APIs from the app side. Pairing WidgetKit + Background Execution stops the agent stuffing heavy network calls into getTimeline.
Tools compared (5)
| Tool | Best for | Agents (README) | Install (README) | License | Stars | Last push |
|---|---|---|---|---|---|---|
| Widgets Agent Skill (n0an) | Dedicated WidgetKit skill: timelines, families, tinting, interactive widgets, Controls, Live Activities, push-updated widgets | Claude Code, Cursor, Codex, Gemini | npx skills add https://github.com/n0an/Widgets-Agent-Skill --skill widgets | MIT | 15 | 8 Sep 2026 ⚠ |
| Background Execution Agent Skill (n0an) | BGTaskScheduler, background URLSession and silent push — use when widgets/Live Activities need fresh data without a foreground launch | Claude Code, Cursor, Codex, Gemini | npx skills add https://github.com/n0an/Background-Execution-Agent-Skill --skill background-execution | MIT | 13 | 8 Sep 2026 ⚠ |
| Swift and Apple platform skills (fal3) (fal3) | Collection including app-intents-widgets for App Intents, App Shortcuts, WidgetKit and system surfaces | Claude Code, Cursor, Codex, Gemini | git clone https://github.com/fal3/claude-skills-collection.git then python3 scripts/install_skills.py --dest "$HOME/.agents/skills" | MIT | 19 | 28 Oct 2026 |
| Apple Native Skills (Yar177) | apple-system-integration covers widgets/Live Activities with EventKit, UserNotifications, App Intents and BGTaskScheduler at the integration level | Claude Code, Cursor, Codex, Gemini, Windsurf | npx skills add Yar177/appleNativeSkills --skill apple-system-integration | MIT | 0 | 17 Jun 2026 ⚠ |
| Claude Apple Dev Skills (laramarcodes) | ios-dev skill covers SwiftUI, widgets, Live Activities, App Intents and StoreKit 2 for iPhone/iPad | Claude Code, Cursor, Codex | npx skills add laramarcodes/claude-apple-dev-skills | MIT | 4 | 29 Jul 2026 ⚠ |
⚠ = no push for more than 4 weeks. fal3 was pushed on 28 Oct 2026. The n0an WidgetKit/Background skills (8 Sep) and the two packs (June–July) are older — verify their advice against the current SDK before treating every API name as current.
Which one to pick:
Default WidgetKit + Live Activities coaching: Widgets Agent Skill.
Need configuration intents / system surfaces too: fal3
app-intents-widgets.Timeline refresh while suspended: Background Execution Agent Skill alongside the WidgetKit skill.
Broader Apple system-integration pack after merge: Apple Native Skills
apple-system-integration.Full ios-dev pack including widgets after merge: Claude Apple Dev Skills.
A prompt that keeps the agent honest
Setting up the agent itself: Claude Code for iOS development, Codex for iOS development or Cursor rules for SwiftUI.
Add a Home Screen medium widget and a Live Activity for an in-progress order. Use a widget extension with AppIntentTimelineProvider for the widget and ActivityKit for the Live Activity. Read order snapshots from an App Group; do not fetch the network inside getTimeline. Schedule BGAppRefresh to refresh the snapshot and reload timelines. Support accented rendering. No custom floating overlay pretending to be the Dynamic Island.
FAQ
- What is WidgetKit for AI coding agents?
- WidgetKit is Apple's framework to extend an app with widgets, watch complications, Live Activities and controls. Agent skills teach Claude Code, Cursor or Codex to create a widget extension, pick a TimelineProvider or AppIntentTimelineProvider, respect reload budgets and rendering modes, and wire Live Activities through ActivityKit instead of inventing custom overlay UI.
- How do Live Activities differ from widgets?
- Apple's ActivityKit overview says a Live Activity shares live updates from your app for an event that lasts several hours — Lock Screen, Dynamic Island, CarPlay, Mac and Apple Watch. Widgets are longer-lived Home Screen / Today View / desktop surfaces with a daily timeline reload budget. Use WidgetKit skills for both UIs, and ActivityKit APIs (Activity.request / update / end) for the Live Activity lifecycle.
- Should the agent put arbitrary networking inside a TimelineProvider?
- Keep providers cheap. Apple's Creating a widget extension guidance centers on glanceable, timely content. Fetch and cache snapshots in the app or via background URLSession / BGAppRefresh, share them through an App Group, and have the provider read that snapshot. Pair a WidgetKit skill with a Background Execution skill when silent push or scheduled refresh is required.
- Which tool should I install first for WidgetKit?
- Start with the dedicated Widgets Agent Skill (n0an) for timeline providers, families, tinting, Controls and Live Activities. Add fal3's app-intents-widgets skill when configuration intents and system surfaces dominate. Apple Native Skills apple-system-integration and Claude Apple Dev Skills ios-dev cover widgets/Live Activities inside broader Apple packs.
- Does this page overlap App Intents or Liquid Glass guides?
- No. App Intents with AI agents (queued) owns Siri/Shortcuts entities and app shortcuts. This page owns WidgetKit timelines, widget families, Controls and ActivityKit Live Activities — even when a widget uses AppIntentConfiguration. SwiftUI Liquid Glass (queued) owns glassEffect materials, not widget extensions.