Install
$ agentstack add skill-n0an-widgets-agent-skill-widgets ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Write and review SwiftUI WidgetKit code, choosing the right configuration, timeline policy, and surface so the widget renders correctly in every mode, updates within its budget, and behaves correctly across the extension/app process boundary.
Review process:
- Establish the widget execution model (the extension process, app groups, the timeline lifecycle, the reload budget) using
references/fundamentals.md. - Validate the timeline provider (
placeholder/snapshot/timeline, reload policy,WidgetCenterreloads, entry relevance) usingreferences/timeline-provider.md. - Validate the configuration and any user-configurable parameters (
StaticConfiguration,AppIntentConfiguration,WidgetConfigurationIntent) usingreferences/configuration-and-intents.md. - Check whether any legacy API is in use and route it to the modern equivalent (SiriKit
.intentdefinition→ App Intents, ClockKit → WidgetKit,PreviewProvider→#Preview) usingreferences/migration-and-deprecations.md. - Validate data loading - networking, persistence, images, location - in the provider and intents using
references/data-and-networking.md. - Validate family support and per-family layout (
WidgetFamily, sizing, content margins,ViewThatFits) usingreferences/families-and-layout.md. - Validate Lock Screen / accessory widgets and watch complications (
widgetLabel,AccessoryWidgetBackground, the transparent-container trick, ClockKit migration) usingreferences/lock-screen-and-watch.md. - Validate rendering across full-color, accented, tinted, and vibrant modes (
widgetRenderingMode,widgetAccentable,widgetAccentedRenderingMode, the luminance-to-alpha trick) usingreferences/rendering-modes-and-tinting.md. - Validate interactivity (
Button(intent:),Toggle(intent:), the app-process boundary,reloadTimelines,invalidatableContent) usingreferences/interactive-widgets.md. - Validate deep links and navigation into the app (
widgetURL,Link,onOpenURL,OpenIntent) usingreferences/deep-linking-and-navigation.md. - Validate animations and entry transitions (
contentTransition,.transition+ identity,invalidatableContent, what doesn't animate) usingreferences/animations-and-transitions.md. - Validate Control Center controls (
ControlWidget, toggle vs button,SetValueIntent, value providers,ControlCenterreloads) usingreferences/controls.md. - Validate Live Activities and the Dynamic Island (
ActivityAttributes,ActivityConfiguration,DynamicIsland, request/update/end, push,supplementalActivityFamilies) usingreferences/live-activities.md. - Validate Smart Stack relevance (
TimelineEntryRelevance,relevance()/WidgetRelevance,RelevanceConfiguration, push-based relevance) usingreferences/relevance-and-smart-stacks.md. - Check the design and gallery presentation (glanceability, sizes, the don'ts,
configurationDisplayName/description, the placeholder) usingreferences/design-and-gallery.md. - Validate previews and the testing/debugging workflow (
#Preview(as:), WidgetKit developer mode, the reload budget) usingreferences/previews-and-testing.md. - Validate platform-specific surfaces (visionOS spatial widgets, CarPlay, macOS menu bar, the availability map) using
references/platforms.md. - Catch common mistakes using
references/anti-patterns.md.
If doing partial work, load only the relevant reference files.
Task-based routing
Match the user's goal to the read order. Load only what you need.
"Create my first widget" / "show me a complete widget"
references/fundamentals.md- the extension, the widget bundle, the timeline lifecyclereferences/worked-example.md- one widget built end to end (entry → provider → layout → links → tinting → animation → preview)references/timeline-provider.md-TimelineProvider, entries, reload policyreferences/families-and-layout.md- pick families, per-family layoutreferences/previews-and-testing.md-#Preview(as:)to iterate
"Let the user configure my widget"
references/configuration-and-intents.md-AppIntentConfiguration+WidgetConfigurationIntent, dynamic options, defaultsreferences/timeline-provider.md-AppIntentTimelineProvider(the intent is the first argument)
"Add a Lock Screen widget / watch complication"
references/lock-screen-and-watch.md- accessory families,widgetLabel,AccessoryWidgetBackground, gauges, ClockKit migrationreferences/rendering-modes-and-tinting.md- accessory widgets are always rendered in a tint mode
"My widget looks wrong in tinted / dark / accented mode"
references/rendering-modes-and-tinting.md-widgetRenderingMode,widgetAccentable,widgetAccentedRenderingMode, the luminance-to-alpha trick, designing for the accent groupreferences/lock-screen-and-watch.md- the transparentcontainerBackgroundfor accessory widgets
"Add a button / toggle inside my widget"
references/interactive-widgets.md-Button(intent:)/Toggle(intent:), the app-process boundary, App Group store,reloadTimelines,invalidatableContentreferences/configuration-and-intents.md-isDiscoverable = falseon helper intents
"Add a Control Center control / Action button / Lock Screen control"
references/controls.md-ControlWidget,ControlWidgetToggle(SetValueIntent) vsControlWidgetButton(AppIntent), value providers,ControlCenter.shared.reloadControlsreferences/interactive-widgets.md- the same app-process / shared-store rules apply
"Build a Live Activity / Dynamic Island"
references/live-activities.md-ActivityAttributes/ContentState,ActivityConfiguration,DynamicIslandregions, request/update/end, staleness, push,supplementalActivityFamilies, the iOS-27 landscape Dynamic Islandreferences/interactive-widgets.md-LiveActivityIntentbuttons
"Keep my widget fresh from the server"
references/timeline-provider.md- reload policy, the reload budget, reload on app backgroundreferences/relevance-and-smart-stacks.md- push-updated widgets (WidgetPushHandler, iOS 26), and when a Live Activity is the right tool instead
"Make my widget show up in the Smart Stack at the right time"
references/relevance-and-smart-stacks.md-TimelineEntryRelevance,relevance()+WidgetRelevance,RelevanceConfiguration(watchOS 26),RelevantContext
"Fetch data / load images / use a database or location in my widget"
references/data-and-networking.md- App Group snapshot,asyncfetch in the provider, image downsampling, SwiftData/Core Data,NSWidgetUsesLocationreferences/timeline-provider.md- where fetching fits in the lifecycle and the budget
"Deep link / open my app from the widget"
references/deep-linking-and-navigation.md-widgetURLvsLink, per-family rules,onOpenURL,OpenIntent
"Animate my widget / make values roll or transition"
references/animations-and-transitions.md- entry diffing,contentTransition(.numericText),.transition+.id,invalidatableContent, what doesn't animate
"Modernize an old widget / I'm seeing IntentConfiguration / ClockKit / PreviewProvider"
references/migration-and-deprecations.md- the old → new map,CustomIntentMigratedAppIntent, the ClockKit migrator, dual-path#available
"Design my widget well / make it gallery-ready"
references/design-and-gallery.md- glanceable/personal/relevant, sizes & tap styles, the don'ts, the snapshot, the placeholder
"Support visionOS / CarPlay / macOS / Apple Watch"
references/platforms.md- spatial widgets (supportedMountingStyles,widgetTexture,levelOfDetail), CarPlay, macOS menu bar, the availability map
"My widget won't update / shows stale data / never appears"
references/previews-and-testing.md- the reload budget, WidgetKit developer mode, debuggingreferences/anti-patterns.md- the usual causes
"I'm hitting build errors or rendering bugs"
references/anti-patterns.md- catches with before/after fixes
Decision trees
Quick orientation when you know the task but not the right API.
Which configuration should the widget use?
No user configuration, fixed behavior?
-> StaticConfiguration(kind:provider:)
User picks parameters (account, city, repo)?
-> AppIntentConfiguration(kind:intent:provider:) + WidgetConfigurationIntent (iOS 17+)
Migrating an existing iOS 14-16 configurable widget?
-> WidgetConfigurationIntent + CustomIntentMigratedAppIntent (keep intentClassName)
-> or keep IntentConfiguration(kind:intent:provider:) with the legacy INIntent
Appears in the Smart Stack only when relevant (watchOS)?
-> RelevanceConfiguration(kind:provider:) (watchOS 26+)
Which timeline provider?
StaticConfiguration?
-> TimelineProvider (placeholder / getSnapshot / getTimeline, completion-based)
AppIntentConfiguration?
-> AppIntentTimelineProvider (placeholder / snapshot(for:in:) / timeline(for:in:), async, intent FIRST)
RelevanceConfiguration (watchOS)?
-> RelevanceEntriesProvider (placeholder / relevance() / entry(configuration:context:), one entry per config)
Which reload policy?
Next update time is known (countdown ends, event starts)?
-> .after(date)
Entries cover a window and the next batch can be computed at the end?
-> .atEnd
Content only changes from interaction / push, never on a schedule?
-> .never (then reload via WidgetCenter from an intent, app, or push)
Which interactive element?
Inside a widget or Live Activity, runs an action?
-> Button(intent:) with an AppIntent (iOS 17+)
Inside a widget, binary on/off?
-> Toggle(isOn:intent:) with an AppIntent (iOS 17+)
Inside a Control Center control, binary on/off?
-> ControlWidgetToggle(action:) with a SetValueIntent
Inside a Control Center control, runs an action / opens the app?
-> ControlWidgetButton(action:) with an AppIntent (or OpenIntent to launch)
Widget vs Live Activity vs Control?
Glanceable data on a schedule, lives on Home/Lock Screen?
-> Widget (timeline)
Ongoing, time-bound event the user wants to watch live (delivery, game, workout)?
-> Live Activity (ActivityKit) - NOT a fast-reloading widget
A quick action or state toggle from Control Center / Lock Screen / Action button?
-> Control (ControlWidget)
Core Instructions
- A widget runs in a separate extension process, not your app. It is always SwiftUI, even in a UIKit app. The system archives your view and renders it later - your code is not running while the widget is on screen. Share data with the app only through an App Group container (shared
UserDefaults(suiteName:), a shared file, or a sharedModelContainer/Core Data store) - neverUserDefaults.standard, never in-memory singletons. - Never make a widget interactive with a closure or
onTapGesture. The only interactivity isButton(intent:)/Toggle(intent:)backed by anAppIntent(iOS 17+), plusLink/widgetURLfor deep links. Anything else silently does nothing. - Always mark the widget's background with
.containerBackground(for: .widget) { ... }(iOS 17+). Without it the widget is blank in the gallery, can't be removed/relocated cleanly, and the system can't substitute the material background in Lock Screen / StandBy / tinted contexts. The container type isContainerBackgroundPlacement(value.widget) - there is noWidgetBackgroundPlacement. - Never do blocking or asynchronous work in
placeholder(in:)- it must return synchronously with stand-in data. Do real fetching ingetSnapshot/getTimeline(or the asyncsnapshot/timeline). Use.redacted(reason: .placeholder)for the first-render stand-in. getSnapshot(andsnapshot(for:in:)) is what the widget gallery shows - return realistic, populated sample data even when the user has none yet, never an empty/loading state.- Treat timeline reloads as a budgeted, opportunistic resource, not a timer. The system gives roughly 40-70 reloads/day per widget and learns from viewing habits. Never assume
.after(date)fires exactly on time. Provide multiple entries to cover a window, pick the policy that matches your data (.atEnd/.after/.never), and trigger a finalWidgetCenter.shared.reloadAllTimelines()when the app enters the background if data changed. TimelineReloadPolicyis a struct;.after(_:)takes aDate, not aTimeInterval.WidgetCenter.shared.reloadTimelines(ofKind:)takes the widget'skindstring - keepkindvalues as shared constants so the app and extension can't drift.- For a configurable widget, use
AppIntentConfiguration+ aWidgetConfigurationIntent(iOS 17+) and anAppIntentTimelineProviderwhosesnapshot/timelinetake the intent as the first argument.WidgetConfigurationIntentlives in the AppIntents module and needs noperform(). Provide sensible@Parameterdefaults; never force the user to configure before the widget shows anything. - Never write a new configurable widget with the legacy SiriKit path -
IntentConfiguration, anINIntentfrom a.intentdefinitionfile, orIntentTimelineProvider. Since iOS 17 the modern path is App Intents (AppIntentConfiguration+WidgetConfigurationIntent+AppIntentTimelineProvider). Only keep the legacy types behind#availablewhen deploying below iOS 17, and when migrating an existing one conform the new intent toCustomIntentMigratedAppIntentwith the originalintentClassNameso saved configurations survive. Likewise build watch complications with WidgetKit (+ aCLKComplicationWidgetMigrator), not ClockKit, and previews with#Preview(as:), notPreviewProvider. Seereferences/migration-and-deprecations.md. - Don't fetch data inside the widget view (no
AsyncImage, no network at render time) - the view is an archived snapshot rendered later. Resolve data and downsample images during timeline generation and put them in the entry, prefer reading an App-Group snapshot the app wrote, and always complete the provider (fall back to last-good data on error). Seereferences/data-and-networking.md. - Switch on
@Environment(\.widgetFamily)and design each supported family deliberately. List only the families you actually lay out insupportedFamilies- shipping a family you didn't design looks broken. Accessory families (accessoryCircular/accessoryRectangular/accessoryInline) are iOS 16+;accessoryCorneris watchOS only. - Design for every rendering mode, not just full color. Read
@Environment(\.widgetRenderingMode)(.fullColor/.accented/.vibrant); bothWidgetRenderingModeandWidgetAccentedRenderingModeare structs with type properties, not enums. In.accentedmode the system flattens your view into two tint groups by alpha - put foreground content in the accent group with.widgetAccentable(), and control how images flatten with.widgetAccentedRenderingMode(.desaturated / .accented / .accentedDesaturated / .fullColor)(the image modifier is iOS 18+). - For a multicolor image or icon that the accent group would crush into a flat silhouette: on iOS 18+ use
.widgetAccentedRenderingMode(.desaturated)(the system maps luminance to alpha and recolors for you); on iOS 17 and below that modifier doesn't exist, so apply the manual.luminanceToAlpha()filter (bright pixels opaque, dark transparent) to preserve the shape's internal detail as a clean monochrome glyph - it also stays useful on iOS 18+ for hands-on control. Pair it with a soft gradient background and.widgetAccentable(). (Seereferences/rendering-modes-and-tinting.md.) - For an accessory/Lock Screen widget or watch complication that should let the watch face or wallpaper show through, give it a
…
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: n0an
- Source: n0an/Widgets-Agent-Skill
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.