The problem
Siri, Shortcuts, Spotlight, widgets, controls, the Action button and Apple Intelligence all ask your app the same two questions: what can you do, and what do you have. App Intents is the single answer to both. Teams get into trouble when they bolt one intent onto a finished app for one surface, then discover the entity model is wrong for the next. Model your actions and content once, at the domain level, and every surface reuses them.
Start with the action: AppIntent
An AppIntent (iOS 16) is a struct with a title, optional parameters and an async perform(). Antoine van der Lee makes the case for doing this first in App Intent driven development: build each feature’s action as an intent from the start, call it from your own buttons, and the system integrations come almost free later. That matches how Apple now ships the framework, where the same intent drives a widget button, a control, a Shortcuts action and Siri.
The running example is a hiking app with trails.
import AppIntents
struct StartHikeIntent: AppIntent {
static let title: LocalizedStringResource = "Start hike"
static let description = IntentDescription("Starts recording a hike on a trail.")
@Parameter(title: "Trail")
var trail: TrailEntity
static var parameterSummary: some ParameterSummary {
Summary("Start a hike on \(\.$trail)")
}
func perform() async throws -> some IntentResult & ProvidesDialog {
try await HikeRecorder.shared.start(trailID: trail.id)
return .result(dialog: "Started recording on \(trail.name).")
}
}
HikeRecorder is your own app code. Use static let for title and description; Swift 6 rejects mutable static state, and older samples that use static var produce warnings or errors under strict concurrency.
Keep perform() free of UI. If the action must show your app, either set static let openAppWhenRun = true or, better, write a separate OpenIntent (shown later). Antoine notes in his Spotlight article that UI work inside perform() belongs on the main actor; mark the method @MainActor when it touches navigation state.
Describe your content: AppEntity and EntityQuery
A parameter type the system can pick, display and pass around must conform to AppEntity (iOS 16). An entity is a lightweight description of your data with a stable identifier and a display representation. It is not your persistence model. Keep the two separate so the entity never forces a schema change.
import AppIntents
struct TrailEntity: AppEntity {
static let typeDisplayRepresentation: TypeDisplayRepresentation = "Trail"
static let defaultQuery = TrailQuery()
let id: UUID
let name: String
let lengthKilometers: Double
var displayRepresentation: DisplayRepresentation {
DisplayRepresentation(
title: "\(name)",
subtitle: "\(lengthKilometers.formatted(.number.precision(.fractionLength(1)))) km",
image: .init(systemName: "figure.hiking")
)
}
}
The query tells the system how to find entities. EntityQuery (iOS 16) needs entities(for:) to resolve identifiers, and suggestedEntities() to fill pickers. Adopt EntityStringQuery as well so Shortcuts and Siri can search by text.
import AppIntents
struct TrailQuery: EntityStringQuery {
func entities(for identifiers: [TrailEntity.ID]) async throws -> [TrailEntity] {
await TrailStore.shared.trails(ids: identifiers)
}
func suggestedEntities() async throws -> [TrailEntity] {
await TrailStore.shared.favorites()
}
func entities(matching string: String) async throws -> [TrailEntity] {
await TrailStore.shared.trails(matching: string)
}
}
actor TrailStore {
static let shared = TrailStore()
private var all: [TrailEntity] = []
func trails(ids: [UUID]) -> [TrailEntity] {
all.filter { ids.contains($0.id) }
}
func favorites() -> [TrailEntity] {
Array(all.prefix(10))
}
func trails(matching text: String) -> [TrailEntity] {
all.filter { $0.name.localizedStandardContains(text) }
}
}
The store here holds entities in memory to keep the example short. In a real app it reads your SwiftData or SQLite store and maps rows to entities. The query can run in an extension process, so the data must live where both can reach it, typically an App Group.
Two rules save debugging time. Identifiers must be stable across launches and devices, because Shortcuts saves them inside people’s automations. And entities(for:) must return quickly, because the system calls it to resolve every parameter before perform() runs.
That second point has a new fix in the 27 releases. Matthew Cassinelli describes EntityCollection, which passes only identifiers to perform() instead of resolving every entity. In his test, tagging 1,000 photos dropped from 1,199 ms to 4 ms. Apple’s documentation lists EntityCollection as iOS 27 and later, so keep the array parameter for older systems.
Ship App Shortcuts with phrases
An intent alone appears in the Shortcuts action list, but people have to build a shortcut to use it. An AppShortcutsProvider (iOS 16) declares ready-made shortcuts with spoken phrases. Apple’s App Shortcuts page explains that the compiler extracts them, so they work as soon as the app is installed, with no registration call.
import AppIntents
struct HikingShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: StartHikeIntent(),
phrases: [
"Start a hike in \(.applicationName)",
"Start \(\.$trail) in \(.applicationName)"
],
shortTitle: "Start hike",
systemImageName: "figure.hiking"
)
}
}
Every phrase must contain \(.applicationName). A phrase with a parameter, like the second one, only matches values the system already knows, which come from suggestedEntities(). When those change, for example after the person adds a favorite trail, call HikingShortcuts.updateAppShortcutParameters() (iOS 16) so the phrases learn the new names.
shortTitle and systemImageName are what Spotlight shows next to your app icon when someone searches for it, as Antoine’s Spotlight article walks through. Keep the short title to a verb and an object.
Apple notes on the App Shortcuts page that it may extract anonymized phrases, titles and descriptions to train the models behind this feature. Write them as you would want them read: plain, specific, localized.
Put entities in Spotlight
Since iOS 18, an entity that conforms to IndexedEntity can go straight into a Core Spotlight index. Apple’s guide Making app entities available in Spotlight says conformance is the only requirement; the protocol provides defaults for everything. You add indexingKey to properties that should be searchable, and donate entities to a named index.
import AppIntents
import CoreSpotlight
struct IndexedTrail: IndexedEntity {
static let typeDisplayRepresentation: TypeDisplayRepresentation = "Trail"
static let defaultQuery = IndexedTrailQuery()
let id: UUID
@Property(title: "Name")
var name: String
@Property(title: "Description", indexingKey: \.contentDescription)
var summary: String
var displayRepresentation: DisplayRepresentation {
DisplayRepresentation(title: "\(name)")
}
init(id: UUID, name: String, summary: String) {
self.id = id
self.name = name
self.summary = summary
}
}
enum TrailIndexer {
static func donate(_ trails: [IndexedTrail]) async throws {
try await CSSearchableIndex(name: "Trails").indexAppEntities(trails)
}
}
IndexedTrailQuery mirrors the earlier query and is left out. Use a named index, not the default one; Apple reserves the default index for prototyping. Indexing an entity whose identifier is already present updates it in place.
If you already index CSSearchableItem values, you do not need to start over. Call associateAppEntity(_:priority:) on each attribute set to attach the entity, and give favorites a higher priority so Spotlight ranks them first. On iOS 27, implement IndexedEntityQuery so Spotlight can ask you to reindex after a problem.
Finally, give every indexed entity an OpenIntent. Without one, tapping a Spotlight result has nowhere to go.
import AppIntents
struct OpenTrailIntent: OpenIntent {
static let title: LocalizedStringResource = "Open trail"
@Parameter(title: "Trail")
var target: TrailEntity
@MainActor
func perform() async throws -> some IntentResult {
Router.shared.showTrail(id: target.id)
return .result()
}
}
Router is a @MainActor @Observable class that owns your NavigationStack path.
Apple Intelligence and Siri AI: what actually ships
This is where most blog posts are out of date, in both directions.
Apple’s Apple Intelligence and Siri AI page lists five things that make your app understandable to the system: index entities in Spotlight, make entities transferable, adopt schemas, associate entities with on-screen views, and donate actions. Schemas are the contract. When an entity or intent conforms to a system schema in a domain such as messages or photos, Siri knows what it is without your app’s name appearing in the request. The WWDC26 session Build intelligent Siri experiences with App Schemas shows entities declared with a schema macro, indexingKey on searchable properties, and the .appEntityIdentifier(_:) view modifier for on-screen awareness of list rows.
Custom actions are a different story. Apple’s Siri AI Developer Preview page covers turning your own intents into tools Siri can call and adding app skills for multi-step requests. It states plainly that the preview works in development builds and for internal TestFlight testers, and is not available to external testers or App Store users. It also warns that the API may change during the preview. Jason Cross at Macworld reported in November that this is tied to the 27.3 betas and expects publishing to open when 27.3 is released. Until Apple says so, treat it as unreleased.
So the practical split today:
- Ship now: intents, entities, queries, App Shortcuts, Spotlight indexing, open intents, schemas where your domain fits one, and view annotations for on-screen content.
- Build and test now, ship later: custom tool intents and skills for Siri AI.
Everything in the first list is also what the preview builds on, so none of it is wasted.
Matthew Cassinelli’s WWDC26 recap is the best single list of the other 27 additions: LongRunningIntent for work past the usual 30-second limit with a Live Activity showing progress, SyncableEntity for identifiers that match across devices, and @UnionValue for parameters that accept more than one type. All are iOS 27 and later, so gate them.
Traps
- Entity equals model. Making your SwiftData
@Modelclass the entity couples your store to the system’s caching of identifiers. Map instead. - Unstable IDs. Row numbers or array indexes break saved shortcuts. Use UUIDs or server IDs.
- Slow
suggestedEntities(). Pickers in Shortcuts and widget configuration call it often. Return a short, cached list. - Missing target membership. An intent used by a widget or control must be in the extension target, and an
OpenIntentused by a control must be in both the app and the extension. - Forgetting
updateAppShortcutParameters(). Parameterized phrases silently stop matching new content. - Overclaiming Siri AI. Do not promise custom Siri actions in App Store copy while the feature is a developer preview.
Checklist
| Goal | API | Minimum |
|---|---|---|
| Expose an action | AppIntent |
iOS 16 |
| Expose content | AppEntity + EntityQuery / EntityStringQuery |
iOS 16 |
| Zero-setup Siri and Shortcuts | AppShortcutsProvider, AppShortcut |
iOS 16 |
| Refresh parameter phrases | updateAppShortcutParameters() |
iOS 16 |
| Open content from results | OpenIntent |
iOS 16 |
| Index entities in Spotlight | IndexedEntity, indexAppEntities(_:priority:) |
iOS 18 |
| Reindex on request | IndexedEntityQuery |
iOS 27 |
| Large selections | EntityCollection |
iOS 27 |
| Long tasks | LongRunningIntent |
iOS 27 |
| Custom Siri AI tools | Developer preview | Not on the App Store yet |
Test each intent in the Shortcuts app first. If it works there with every parameter empty, prefilled and searched, it will work in Spotlight, widgets and controls too.
Sources and further reading
- App Shortcuts Apple Developer Documentation
- Making app entities available in Spotlight Apple Developer Documentation
- Siri AI Developer Preview Apple Developer Documentation
- Apple Intelligence and Siri AI Apple Developer Documentation
- Build intelligent Siri experiences with App Schemas Apple, WWDC26
- App Intents Spotlight integration using Shortcuts Antoine van der Lee, SwiftLee
- App Intent driven development in Swift and SwiftUI Antoine van der Lee, SwiftLee
- WWDC26 Sessions: Discover new capabilities in the App Intents framework Matthew Cassinelli
- Get Significant Siri AI Performance Improvements With Large EntityCollections Matthew Cassinelli
- With iOS 27.3, the Siri AI floodgates are about to open Jason Cross, Macworld