From emasoft-complete-ios-app-authoring
App Intents on iOS/iPadOS/macOS 26 (Swift 6.2) — expose app actions and content to Siri, Apple Intelligence, Shortcuts, Spotlight, Visual Intelligence, the Action Button, Control Center, and interactive widgets. Use when implementing or debugging AppIntent, AppEntity, AppEnum, EntityQuery, AppShortcutsProvider, SnippetIntent, IndexedEntity, assistant schemas (@AppIntent(schema:)), Spotlight indexing, or migrating from SiriKit/INIntent — or any "App Intents / App Shortcut / Siri phrase / Visual Intelligence" task.
How this skill is triggered — by the user, by Claude, or both
Slash command
/emasoft-complete-ios-app-authoring:app-intentsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The App Intents framework exposes your app's actions and content to the system:
references/apple-intelligence-and-visual.mdreferences/architecture-and-targets.mdreferences/entities-and-queries.mdreferences/intent-fundamentals.mdreferences/interactive-snippets.mdreferences/migration-from-sirikit.mdreferences/shortcuts-and-siri.mdreferences/spotlight-indexing.mdreferences/system-integrations.mdreferences/testing.mdreferences/troubleshooting.mdThe App Intents framework exposes your app's actions and content to the system:
Siri, Apple Intelligence, the Shortcuts app, Spotlight, Visual Intelligence, the
Action Button (iPhone 15 Pro+/16+), the Apple Pencil Pro squeeze, Control Center
/ Lock Screen, and interactive widgets / Live Activities — all from plain Swift
structs, no .intentdefinition files, no code generation.
import AppIntents.AppIntent (an action), AppEntity (a dynamic value), AppEnum (a fixed set). Discoverability comes from AppShortcutsProvider and/or the @AppIntent(schema:) assistant-schema macro.App Intents uses build-time metadata extraction. At compile time your Swift
source is read into an .appintentsmetadata bundle inside your app. The system
reads that bundle without running your app — which is why your intents,
entities, and shortcuts are available the instant the app is installed, and why
half the framework's constraints exist:
static let, string literals). A computed property or function call fails to build with "Expression is not a string literal".AppIntent/AppEntity struct is a BREAKING CHANGE. The struct name is the stable identity — renaming invalidates every Shortcut a user already built, and every donated Spotlight entry. Treat the name like a public API.AppIntentsPackage (see references/architecture-and-targets.md).Carry this model first; it pre-empts most build errors.
AppIntent, AppEntity, AppEnum, or EntityQuery.AppShortcutsProvider / App Shortcuts and Siri phrases.SnippetIntent), Control Center controls, Action-Button capture, or Visual Intelligence image search.IntentModes).INIntent / .intentdefinition).import AppIntents
struct AddToFavoritesIntent: AppIntent {
static let title: LocalizedStringResource = "Add to Favorites" // MUST be constant
@Parameter(title: "Landmark", requestValueDialog: "Which landmark?")
var landmark: LandmarkEntity
@Dependency var store: FavoritesStore // injected, see below
static var parameterSummary: some ParameterSummary {
Summary("Add \(\.$landmark) to favorites")
}
func perform() async throws -> some IntentResult & ProvidesDialog {
try await store.addFavorite(landmark.id) // thin bridge — logic lives in the store
return .result(dialog: "Added \(landmark.name) to favorites.")
}
}
Register dependencies as early as possible — in App.init(), never onAppear:
@main struct MyApp: App {
init() { AppDependencyManager.shared.add { FavoritesStore() } }
}
If you register too late, any intent that runs before that point crashes with a nil dependency. This is one of the most common production crashes — see references/troubleshooting.md.
perform() is the ONLY place for side effects. Never mutate state in init; entities are constructed constantly (in queries + parameter resolution).var id: UUID { UUID() } is a bug — it mints a new id every read, so the system can never re-resolve a stored reference ("Entity not found"). Use a durable id (landmark.databaseID).requestConfirmation / requestChoice, the call throws — let it propagate. Catching it and returning .result(dialog: "Cancelled") is a documented bug that swallows the system's cancel semantics.\(.applicationName), with at most one @Parameter per phrase. (Full phrase rules: references/shortcuts-and-siri.md.)SnippetIntent.perform() — it runs multiple times per lifecycle. Snippet performs must be read-only. (Full update-cycle: references/interactive-snippets.md.)Which protocol should my intent conform to?
| Need | Protocol |
|---|---|
| A basic action | AppIntent |
| Open the app to show content | OpenIntent (+ TargetContentProvidingIntent for declarative nav) |
| Render an interactive view inline | SnippetIntent |
| Support the system undo gesture | UndoableIntent (iOS 26) |
| Control Center / Lock-Screen control | ControlConfigurationIntent (needs a Widget Extension) |
| Action-Button locked-camera capture | CameraCaptureIntent (needs a Locked Camera Capture Extension) |
| Audio capture | AudioRecordingIntent |
| Match an Apple-Intelligence domain | @AppIntent(schema:) macro (NOT protocol inheritance) |
Which entity type? Fixed compile-time set → AppEnum. Dynamic set → AppEntity. Spotlight-searchable → AppEntity + IndexedEntity. A single global instance → UniqueAppEntity. A file → FileEntity. Image-searchable → AppEntity + Transferable + OpenIntent.
Which query type? All values fit in memory → EnumerableEntityQuery. Text search → EntityStringQuery. Property filtering (auto-enables Shortcuts' Find/Filter) → EntityPropertyQuery. ID-lookup only → EntityQuery (base). Visual-Intelligence image search → IntentValueQuery.
@Property vs @ComputedProperty vs @DeferredProperty?
| Property type | When | Overhead |
|---|---|---|
@Property | Value stored on the entity struct | Low |
@ComputedProperty (iOS 26) | Derived from a source of truth (model, UserDefaults) — prefer this, no duplication | Low |
@DeferredProperty (iOS 26) | Expensive (network / heavy I/O) — async getter, called only when the system asks | Lowest (lazy) |
Load-bearing performance rule: entities must be cheap to create. Never do network work in init — push it into a @DeferredProperty. (Details: references/entities-and-queries.md.)
Does this intent need to open the app? → pick an IntentModes value (supportedModes). OpenIntent foregrounds automatically — do not set supportedModes on it. (Full mode table + continueInForeground: references/intent-fundamentals.md.)
static let supportedModes: IntentModes replaces the old static var openAppWhenRun: Bool for foreground control. .background / .foreground / [.background, .dynamic] / [.background, .deferred].@AppIntent / @AppEntity / @AppEnum macros replace the deprecated @AssistantIntent / @AssistantEntity / @AssistantEnum.@ComputedProperty / @DeferredProperty are new iOS-26 entity property kinds.SnippetIntent (interactive), UndoableIntent, requestChoice, structured IntentDialog(full:supporting:), TargetContentProvidingIntent + .onAppIntentExecution, macOS-Spotlight inline execution — all iOS 26.AppIntent, @Parameter, parameterSummary, return-type composition, dialog, IntentModes/supportedModes + continueInForeground, @Dependency, OpenIntent, UndoableIntent, requestChoice, requestConfirmation (+ conditions), requestValue, authenticationPolicy, custom errors, AppIntentError.AppEntity, AppEnum, the property-kind decision, the full EntityQuery family (Enumerable/String/Property), suggestedEntities(), Transferable, @UnionValue, FileEntity, UniqueAppEntity, URLRepresentableIntent/Entity.AppShortcutsProvider, phrase rules, parameterized vs generic shortcuts, NegativeAppShortcutPhrases, updateAppShortcutParameters(), SiriTipView, ShortcutsLink, ShortcutTileColor, dialog/confirmation, surfaces (Action Button / Pencil Pro).IndexedEntity, indexing-key tables, the two donation APIs, the donation lifecycle, OpenIntent-tap handling, auto-generated Find/Filter, macOS-Spotlight inline execution.SnippetIntent, the 6-step update cycle, Button(intent:)/Toggle(isOn:intent:), confirmation snippets, snippet chaining, reload(), the "model entities not values" + "read-only perform" rules.@AppIntent(schema:) macro, the full app-intent-domain catalog (Mail/Photos/Browser/… with action/entity/enum lists), Visual Intelligence image search (IntentValueQuery / SemanticContentDescriptor), on-screen entities for Siri/ChatGPT, PredictableIntent, AttributedString rich-text gotcha.ControlConfigurationIntent, CameraCaptureIntent, AudioRecordingIntent and their extension-target requirements.TargetContentProvidingIntent + onAppIntentExecution declarative navigation, scene handling, AppDependencyManager, AppIntentsPackage cross-target sharing.INIntent / .intentdefinition / INObject / INShortcut → App Intents mapping, before/after Swift, coexistence.AppDependencyManager, what can only be tested on device.find …/*.appintentsmetadata + subsystem:com.apple.appintents Console workflow, and the diagnostics table.WWDC: 2025-244 (Explore the App Intents framework), plus the assistant-schema and Visual-Intelligence sessions. Apple docs: /AppIntents, /AppIntents/app-intent-domains.
npx claudepluginhub emasoft/emasoft-complete-ios-app-authoring --plugin emasoft-complete-ios-app-authoringProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.