/app-intents:app-intentsfrom app-intents
Writes and reviews Swift App Intents code exposing app actions to Siri, Shortcuts, Spotlight, widgets, Control Center, and Apple Intelligence. Covers AppIntent, AppEntity, EntityQuery, AppShortcutsProvider, Focus Filters, and Siri AI Developer Preview features.
Ships in app-intents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write and review Swift code that exposes app functionality through the App Intents framework, ensuring correct protocol conformance, safe data flow, and idiomatic discoverability wiring.
Review process:
perform(), return types, dialog) using references/fundamentals.md.references/parameters.md.references/entities.md.AppShortcutsProvider registration and discoverability UI using references/shortcuts-and-siri.md.OpenIntent navigation and snippet view return types using references/open-and-snippet-intents.md.references/dependencies.md.IndexedEntity, IndexedEntityQuery, and attribute sets using references/spotlight.md.@AssistantEntity / @AssistantIntent schema adoption using references/assistant-schemas.md.references/siri-intelligence.md.references/siri-ai-tools.md, entity property descriptions / generable entities / card snippets using references/siri-ai-entities.md, and any Skills.skillsbundle using references/app-skills.md.IntentValueRepresentation, system-integration annotations) using references/onscreen-awareness.md.references/long-running-and-execution.md.references/testing-intents.md (covers the new AppIntentsTesting framework). For the Siri Metadata Analyzer and Siri Evaluations, use references/siri-evaluations.md.references/anti-patterns.md.If doing partial work, load only the relevant reference files.
Match the user's goal to the read order. Load only what you need.
references/fundamentals.md - protocol, perform(), return typesreferences/shortcuts-and-siri.md - register it so it shows upreferences/parameters.md - @Parameter, prompts, disambiguationreferences/entities.md - if the parameter is a domain entityreferences/entities.md - AppEntity, IndexedEntity, @Propertyreferences/spotlight.md - indexing strategies, attribute setsreferences/shortcuts-and-siri.md - flexible matching, phrase rulesreferences/open-and-snippet-intents.md - inline vs indirect snippets, SnippetIntent, Button(intent:)references/fundamentals.md - return types and snippet design rulesreferences/siri-ai-entities.md - SnippetRepresentableEntity + CardSnippet when the card belongs to an entity rather than to one intent's result (27.3)references/open-and-snippet-intents.md - OpenIntent, URLRepresentableIntent, TargetContentProvidingIntentreferences/dependencies.md - navigator / scene routingreferences/siri-intelligence.md - the integration model, finding content (semantic index / structured search / in-app search), custom responses, donations, confirmation/ownershipreferences/assistant-schemas.md - schema macros, domains, multi-schema requirements, Xcode snippetsreferences/onscreen-awareness.md - view annotations, content transfer, system-integration annotationsreferences/siri-ai-tools.md - @AppIntent(.tool), metadata the model reads, results and errors, finding entities, schema + tool, availability gating, adoption orderreferences/siri-ai-entities.md - property description: / visibility: / authenticationPolicy:, @AppEntity(.generable), CardSnippetreferences/siri-evaluations.md - run sirimetadataanalyzer after every metadata changereferences/app-skills.md - bundle layout, SKILL.md frontmatter and body rules, diagnostics, build-output checkreferences/siri-ai-tools.md - the tools the skill orchestrates must exist and be clear on their ownreferences/siri-evaluations.md - analyzer findings, SiriScenario / UserTurn / Calls / Finds / Loads, metrics, reading a failed reportreferences/testing-intents.md - AppIntentsTesting for the tools themselvesreferences/assistant-schemas.md - schema macros, domains, Use Model action, onscreen contentreferences/entities.md - @Property, Transferable (required for several schemas)references/onscreen-awareness.md - the 4 annotation APIs, content transfer, displayRepresentations fast path, annotations on notifications/Now Playing/AlarmKitreferences/siri-intelligence.md - how onscreen context fits the larger Siri storyreferences/long-running-and-execution.md - LongRunningIntent, CancellableIntent, allowedExecutionTargets, background GPUreferences/fundamentals.md - ProgressReportingIntent, supportedModesreferences/parameters.md - EntityCollection (identifiers-only parameters)references/entities.md - SyncableEntity for cross-device identity, RelevantEntities for proactive suggestionsreferences/assistant-schemas.md - IntentValueQuery, SemanticContentDescriptor, @UnionValuereferences/entities.md - Transferable + OpenIntent pairingreferences/open-and-snippet-intents.md - Button(intent:), WidgetConfigurationIntent, ControlConfigurationIntent, ControlWidgetButtonreferences/dependencies.md - App Group shared storage, process boundariesreferences/fundamentals.md - intents as canonical action layerreferences/dependencies.md - @Dependency, cross-module AppIntentsPackagereferences/entities.md - entity-as-bridge patternreferences/testing-intents.md - the AppIntentsTesting framework (out-of-process integration), direct struct unit tests, mocking @Dependency, test-only intents, what you can't testreferences/anti-patterns.md - 50+ catches with before/after fixes, including the Siri AI (27.3) onesQuick orientation when you know the task but not the right API.
Generic action?
→ AppIntent
Opens the app to a specific entity?
→ OpenIntent (+ TargetContentProvidingIntent on iOS)
→ on iOS 27+, @AppIntent(schema: .system.open) on the OpenIntent, with a legacy sibling intent for older OS
Renders an interactive view only, no business logic?
→ SnippetIntent
Needs to bring the app forward conditionally?
→ AppIntent with supportedModes (iOS 26+)
→ or ForegroundContinuableIntent (iOS 17-18)
Runs longer than 30 seconds (upload, sync, inference)?
→ LongRunningIntent + performBackgroundTask (iOS 27+)
Needs to clean up gracefully when cancelled (with the reason)?
→ CancellableIntent + withIntentCancellationHandler (iOS 26.4+)
Deletes entities with standard confirmation?
→ DeleteIntent
Routes a search query into the app?
→ ShowInAppSearchResultsIntent
Backs widget configuration?
→ WidgetConfigurationIntent (empty conformance, no perform)
Backs a Control Center control?
→ ControlConfigurationIntent
Has a universal-link URL representation?
→ URLRepresentableIntent + OpenIntent (no perform needed)
Matches an Apple Intelligence domain?
→ AppIntent + @AppIntent(schema: .domain.action)
Custom action Siri's model should call (27.3+)?
→ @AppIntent(.tool) (adds ToolIntent)
→ Shortcuts-only schema domain: @AppIntent(.tool, schema: .journal.createEntry)
→ primary-domain schema: no .tool, it is a build error
Fixed set known at compile time?
→ AppEnum
Dynamic data with a persistent id?
→ AppEntity
Entity must appear in Spotlight?
→ AppEntity + IndexedEntity
Entity IS a file (scan, voice memo, exported image)?
→ FileEntity
Computed / aggregated data with no stable id?
→ TransientAppEntity
A value Siri's model writes from the conversation (draft, plan, score sheet)?
→ @AppEntity(.generable) (GenerableEntity, 27.3+)
Should show a custom card in Siri responses?
→ AppEntity + SnippetRepresentableEntity returning a CardSnippet (27.3+)
Needs Apple Intelligence schema awareness?
→ AppEntity + @AppEntity(schema: .domain.type)
Supports cross-app sharing?
→ AppEntity + Transferable
Small fixed set, enumerable?
→ EnumerableEntityQuery (also gets a basic Find intent)
Large dataset, searchable by name?
→ EntityQuery + EntityStringQuery
Many queryable properties, user should build predicates?
→ EntityPropertyQuery (auto-generates Find intent with comparators + sort)
Simple id-only lookup, no search?
→ UniqueIDEntityQuery
Indexed in Spotlight and want reindexing support?
→ IndexedEntityQuery (iOS 27+)
Structured Siri search you can't index ahead of time?
→ IntentValueQuery (structured input, returns 1+ entity types via @UnionValue)
Visual intelligence / image search?
→ IntentValueQuery + SemanticContentDescriptor
Content is local and indexable?
→ IndexedEntity + indexAppEntities (semantic index) - the primary path
→ add IndexedEntityQuery for reindexing support (iOS 27+)
Too large / server-side / too volatile to index?
→ IntentValueQuery (structured search input)
User wants to search inside your own UI?
→ @AppIntent(schema: .system.searchInApp) + ShowInAppSearchResultsIntent
Content nobody has found or used yet, but relevant right now?
→ RelevantEntities.updateEntities(_:for:) (iOS 27+)
Teach the system how people use the app (patterns)?
→ IntentDonationManager (donate UI interactions)
Entity is a parameter of a tool intent (27.3+)?
→ IndexedEntity first; EnumerableEntityQuery for a small bounded set
→ never a "search" tool: Siri finds the entity and passes it in
Fits a schema in a primary Siri domain (messages, mail, notes, calendar, photos, ...)?
→ @AppIntent(schema:) only
Fits a schema in a Shortcuts-only domain (books, browser, journal, presentation, reader, spreadsheet, whiteboard, wordProcessor)?
→ @AppIntent(.tool, schema:)
Custom action a person would ask for in one sentence?
→ @AppIntent(.tool), with title + description + parameter descriptions written for the model
Several tools must be combined, or the request needs app-specific context?
→ an app skill in Skills.skillsbundle, on top of tools that already work alone
Exact phrase from Spotlight / Action button / Shortcuts?
→ AppShortcut (still needed, but unavailable to Siri once the app has any tool)
Widget configuration, snippet intent, helper step, needs a specific screen?
→ not a tool
Stored on the entity struct, should appear in Shortcuts/Find/summary?
→ @Property
Derived from an underlying model object (cheap to compute)?
→ @ComputedProperty (preferred over @Property for wrappers around models)
Derived AND should be indexed in Spotlight?
→ @ComputedProperty(indexingKey: \.keyName)
Expensive to compute (network, ML inference, heavy query)?
→ @DeferredProperty (async getter, only runs when system asks)
Internal to the entity, not shown anywhere?
→ plain stored property (no wrapper)
IndexedEntity, OpenIntent, focus filters, and control widgets require iOS 16+; @AssistantEntity / @AssistantIntent schemas require iOS 18.2+; anchored relative date styles and many assistant schemas require iOS 18.4+. The 27 releases (WWDC 2026, iOS 27 / macOS 27) add LongRunningIntent, EntityCollection, SyncableEntity, RelevantEntities, IndexedEntityQuery, OwnershipProvidingEntity, allowedExecutionTargets, the AppIntentsTesting framework, and native Duration/PersonNameComponents parameters; CancellableIntent and IntentValueRepresentation are iOS 26.4+; supportedModes is iOS 26+. Apple's own naming for the WWDC 2026 cohort is "the 27 releases" - use that, not "iOS 19". The Siri AI Developer Preview (27.3) adds ToolIntent / @AppIntent(.tool), GenerableEntity / @AppEntity(.generable), property description: / visibility:, SnippetRepresentableEntity + CardSnippet, app skills (Skills.skillsbundle), sirimetadataanalyzer, and the SiriEvaluations framework. Tools and generable entities are unavailable on watchOS and tvOS, work only in development builds and internal TestFlight during the preview, and the API may still change.@Model class or other reference-type data model conform to AppEntity. AppEntity requires Sendable; @Model classes are not sendable. Create a separate struct entity that shadows the fields you want to expose.ModelContext across actor boundaries. ModelContext is not sendable. Pass ModelContainer (which is sendable) and create a local context inside the actor that needs one.AppShortcutsProvider. Types not registered there will not appear in Shortcuts, Siri suggestions, or the action button picker. (Tool intents on 27.3 are the exception for Siri AI only: Siri's model discovers @AppIntent(.tool) intents from their metadata, with no phrase. They still need an App Shortcut for Spotlight and the Action button.)\(.applicationName). The App Intents macro rejects phrases without it at compile time, because phrases without the app name would collide with other apps' commands.@Query from inside an intent. @Query only works inside a View. Run a one-shot FetchDescriptor through a ModelContext instead, or route through a centralized data controller.perform(). Inject them through @Dependency and register them once in App.init() with AppDependencyManager.shared.add(dependency:).String(format:) or manual concatenation for localized intent dialog. Use LocalizedStringResource, and use Foundation's grammar-agreement markdown (^[\(count) item](inflect: true)) inside an AttributedString for pluralization.CSSearchableItemActionType user activities through the same action. See references/open-and-snippet-intents.md.OpenIntent for "take me to this thing" actions, AppIntent & ShowsSnippetView for self-contained one-shot summaries, and AppIntent & ShowsSnippetIntent + a paired SnippetIntent when the snippet contains Button(intent:) and needs to re-render after buttons fire.static let isDiscoverable: Bool = false on helper intents that only back a widget button, snippet button, or other intent - otherwise they pollute the user's Shortcuts library.WidgetCenter.shared.reloadAllTimelines() inside perform() before returning.Button(intent:) lives inside a widget view, share state between the intent (runs in the app process) and the widget's timeline provider (runs in the extension process) via App Group UserDefaults(suiteName:) or a shared ModelContainer URL - never UserDefaults.standard or in-memory @Dependency state.YourShortcutsProvider.updateAppShortcutParameters() to invalidate the cached candidate list.EnumerableEntityQuery when the whole set is small and cheap to load; implement EntityQuery + EntityStringQuery when the dataset is large or searchable; add EntityPropertyQuery to get a system-generated Find intent for free. entities(for identifiers:) is mandatory on every query; without it, parameter resolution breaks.@Property (stored) or @ComputedProperty (derived). Plain stored properties are invisible to the App Intents framework.TransientAppEntity for return data that's computed on the fly (summaries, aggregates). Don't try to shoehorn it into AppEntity with a fake id.URLRepresentableEntity and conform the open intent to URLRepresentableIntent - the system routes opens through your existing link handler without a perform()..userActivity(_:element:) on the view with Transferable conformance on the entity. Identification alone is not enough; Siri needs exportable content.SnippetIntent.perform() is called multiple times per user interaction (initial show, after each button tap, on appearance changes, on reload()). Keep it pure: read state, assemble the view, return. Never mutate app state or kick off slow work inside a snippet intent's perform().AppShortcuts per app, 1000 total trigger phrases (including parameter expansions). The first phrase in each shortcut's array is the primary one - it's shown on the Shortcuts home tile and as Siri's "what can I do with X?" answer.supportedModes + continueInForeground (iOS 26+) over ForegroundContinuableIntent / needsToContinueInForegroundError for new code that conditionally foregrounds. The newer form lets one intent declare it may run background or foreground based on runtime state.AttributedString rather than String so rich formatting (bold, italic, lists, tables) is preserved losslessly.App struct initializer is executed when an intent runs, even if the UI never appears. Do all intent-relevant setup (ModelContainer creation, AppDependencyManager.shared.add(...), log plumbing) inside init(), not inside view modifiers like .task or .onAppear.LocalizedStringResource is the standard string type everywhere in App Intents (titles, dialog, parameter prompts). It shares string catalogs with SwiftUI, so localization works out of the box.inflect: true) works in English, French, German, Italian, Spanish, and Portuguese (both variants). For other locales it falls back to the unmodified form.LongRunningIntent and do the work inside performBackgroundTask { ... } - and report progress regularly, because going quiet makes the system revoke the runtime extension. Pair with CancellableIntent to clean up with the cancellation reason. Don't try to beat the limit with a detached Task; unmanaged tasks aren't covered by the extension.EntityCollection<Entity> instead of [Entity] for parameters that may hold many entities when perform() mostly needs ids - it skips full entity resolution during parameter handling. Call resolvedEntities() only when you need the full objects.$parameter.valueState (.set(value) / .set(nil) / .unset), not a plain nil check - otherwise voice commands can never clear a field.SyncableEntity when Siri might reference them in a cross-device conversation. If the id is already consistent everywhere (server UUID, CloudKit record id), just adopt the protocol; otherwise pair local and stable ids with SyncableEntityIdentifier.OwnershipProvidingEntity and keep their ownership (.shared / .public) current, so Siri confirms actions on content the user shared or published. By default Siri assumes entities are private and may skip confirmation.IntentValueRepresentation via the ValueRepresentation builder to the entity's transferRepresentation - FileRepresentation/DataRepresentation only cover file formats. Use the key-path form (ValueRepresentation(exporting: \.place)) when the entity already stores the system type..userActivity for one primary item, .appEntityIdentifier(_:) for one among a few, .appEntityIdentifier(forSelectionType:) on a List/collection for many (lazy), .appEntityUIElements(_:) for custom Canvas/CALayer drawing. Annotations on Notifications, Now Playing, and AlarmKit require a real AppEntity - TransientAppEntity has no persistent id and can't be used there. Add a displayRepresentations query method so Siri can resolve onscreen entities without a full DB fetch.IntentDonationManager (the system already donates Siri/Shortcuts runs); donate after the action completes, don't over-donate (the system will start ignoring you), and delete stale donations.@AppIntent(.tool). The model decides when to call a tool and how to fill it from the intent's title, description (plus searchKeywords), and each parameter's title and description - there is no separate tool name or model-only description, so never invent one. Write them for someone who has never seen the app, with formats, units, and what an empty optional means..tool to an intent that conforms to a primary-domain schema (.messages.sendMessage, ...) - it is a build error and Siri already handles it. Only Shortcuts-only schema domains combine with .tool, as @AppIntent(.tool, schema:).IndexedEntity, preferred) or EnumerableEntityQuery and passes them as parameters. For tools Siri does not use suggestedEntities(), EntityStringQuery, or EntityPropertyQuery.requestConfirmation on destructive tools (validate, then confirm, then mutate).CustomLocalizedStringResourceConvertible errors that say what went wrong and what would fix it. Validate every model-supplied value in perform().@AppEntity(.generable) only for transient values a tool acts on that the model can write from the request. Every property needs a precise description:; an app-owned entity inside a generable entity is a build error that stops all metadata export - make it a separate intent parameter.@Property / @ComputedProperty / @DeferredProperty of an entity Siri sees a description:, hide sensitive ones with visibility: .internal (never together with an indexing key), and gate reading aloud with authenticationPolicy:.ToolIntent / GenerableEntity in an @available(iOS 27.3, macOS 27.3, visionOS 27.3, *) extension instead of marking the type; wrap in #if !os(watchOS) && !os(tvOS) where those platforms build.Skills.skillsbundle/Skills/<name>/SKILL.md) is read by Siri's model on the device, not by you. name must match the directory, only name + description frontmatter is supported, and one error disables every skill in the app. Refer to tools by title in natural language, never by Swift type name. Write skills for task context and multi-tool orchestration, never to explain a single tool.xcrun sirimetadataanalyzer <built .app>, fix the findings in source metadata, then test with Siri on a device. Cover tool choice, parameters, and skills with SiriEvaluations scenarios.AppIntentsTesting framework (out-of-process, in an XCUITest bundle) for the integration surface - intents, queries, spotlightQuery(), viewAnnotations(); use test-only intents (isDiscoverable = false + #if DEBUG) to seed data and reach internal state. Keep direct perform() struct tests for pure logic.If the user asks for a review, organize findings by file. For each issue:
Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.
If the user asks you to write or fix intent code, make the changes directly instead of returning a findings report.
Example output:
Line 18: SwiftData @Model cannot conform to AppEntity (not Sendable).
// Before
extension Article: AppEntity { ... }
// After
struct ArticleEntity: AppEntity {
var id: UUID
var title: String
static let typeDisplayRepresentation: TypeDisplayRepresentation = "Article"
static let defaultQuery = ArticleEntityQuery()
var displayRepresentation: DisplayRepresentation {
DisplayRepresentation(title: "\(title)")
}
}
Line 42: Siri phrase missing \(.applicationName) - will fail to build.
// Before
AppShortcut(intent: OpenArticleIntent(), phrases: ["Open an article"], ...)
// After
AppShortcut(intent: OpenArticleIntent(), phrases: ["Open an article in \(.applicationName)"], ...)
Article as AppEntity will fail to compile on Swift 6; create a shadow struct.\(.applicationName) is required in every phrase.End of example.
references/fundamentals.md - AppIntent protocol, perform(), return types (IntentResult, ProvidesDialog, ReturnsValue, ShowsSnippetView, OpensIntent), intent dialog, grammar agreement.references/parameters.md - @Parameter, primitive vs entity parameters, @AppEnum, dialog options, parameter prompts.references/entities.md - AppEntity, IndexedEntity, shadow-struct pattern, display representations, entity queries (EnumerableEntityQuery, EntityQuery, EntityStringQuery, UniqueIDEntityQuery).references/shortcuts-and-siri.md - AppShortcutsProvider, phrases (\(.applicationName) rule), shortcutTileColor, SiriTipView, ShortcutsLink, parameter presentation.references/open-and-snippet-intents.md - OpenIntent, snippet views (ShowsSnippetView), navigation via data controller, when to use which.references/dependencies.md - @Dependency, AppDependencyManager, data-controller pattern, ModelContainer vs ModelContext sendability, main-actor vs local-context tradeoff.references/spotlight.md - IndexedEntity, IndexedEntityQuery (reindexing), CSSearchableIndex, attributeSet, semantic index, index-on-launch vs index-on-change, debounced reindexing.references/assistant-schemas.md - @AssistantEntity, @AssistantIntent, schema adoption, multi-schema requirements, .system.searchInApp, Visual Intelligence (iPad/macOS, system stores), Xcode code snippets, caveats.references/siri-intelligence.md - the Siri / Apple Intelligence integration model: finding content (semantic index / structured search / in-app search), custom responses, interaction donations, confirmation + OwnershipProvidingEntity, validation flow.references/siri-ai-tools.md - Siri AI Developer Preview (27.3): @AppIntent(.tool) / ToolIntent, metadata the model reads, results and errors, finding entity parameters, @AppIntent(.tool, schema:), App Shortcuts interaction, trait syntax, gating below 27.3, adoption order.references/siri-ai-entities.md - property description: / authenticationPolicy: / visibility:, @AppEntity(.generable) / GenerableEntity, SnippetRepresentableEntity + CardSnippet.references/app-skills.md - Skills.skillsbundle: when a skill is worth writing, bundle layout, SKILL.md frontmatter and body rules, diagnostics, .skillsc build-output check.references/siri-evaluations.md - sirimetadataanalyzer (options, rule ids, workflow) and the SiriEvaluations framework (scenarios, expectations, metrics, running, reading failures).references/onscreen-awareness.md - the 4 on-screen annotation APIs, content transfer (IntentValueRepresentation, resolve vs import), displayRepresentations fast path, entity annotations on Notifications / Now Playing / AlarmKit.references/long-running-and-execution.md - the 30-second budget, LongRunningIntent + performBackgroundTask, CancellableIntent, background GPU, allowedExecutionTargets.references/testing-intents.md - the AppIntentsTesting framework (out-of-process integration), direct perform() unit tests, mocking @Dependency via AppDependencyManager, test-only intents, what you can't unit-test.references/anti-patterns.md - common mistakes LLMs make when generating App Intents code.agents/openai.yaml (opens in a new tab)references/anti-patterns.md (opens in a new tab)references/app-skills.md (opens in a new tab)references/assistant-schemas.md (opens in a new tab)references/dependencies.md (opens in a new tab)references/entities.md (opens in a new tab)references/fundamentals.md (opens in a new tab)references/long-running-and-execution.md (opens in a new tab)references/onscreen-awareness.md (opens in a new tab)references/open-and-snippet-intents.md (opens in a new tab)references/parameters.md (opens in a new tab)references/shortcuts-and-siri.md (opens in a new tab)references/siri-ai-entities.md (opens in a new tab)references/siri-ai-tools.md (opens in a new tab)references/siri-evaluations.md (opens in a new tab)references/siri-intelligence.md (opens in a new tab)references/spotlight.md (opens in a new tab)references/testing-intents.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
app-intents, siri, shortcuts, spotlight, apple-intelligence, swift
Generated from the plugin's indexed repository (n0an/app-intents-agent-skill) — no native marketplace selected
npx claudepluginhub p/n0an-app-intentsOther plugins' skills for the same job