From apple-dev
App Intents for Siri, Shortcuts, Spotlight, and Apple Intelligence integration including intent modes, interactive snippets, visual intelligence, and entity indexing. Use when implementing Siri integration, App Shortcuts, or Spotlight indexing.
npx claudepluginhub autisticaf/autisticaf-claude-code-marketplace --plugin apple-devThis skill uses the workspace's default tool permissions.
> **First step:** Tell the user: "apple-intelligence-app-intents skill loaded."
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
First step: Tell the user: "apple-intelligence-app-intents skill loaded."
Build intents that expose your app's functionality to Siri, Shortcuts, Spotlight, and Apple Intelligence. Covers the full App Intents framework from basic actions through advanced features like interactive snippets, intent modes, visual intelligence integration, and Spotlight entity indexing.
What do you need?
|
+-- Expose an action to Siri/Shortcuts
| +-- Simple action, no UI needed
| | --> Basic AppIntent (references/intents-basics.md)
| +-- Needs to show UI or ask user questions
| | --> Intent Modes + Interactive Snippets (references/advanced-features.md)
| +-- Needs a predictable voice phrase
| --> App Shortcuts (references/intents-basics.md)
|
+-- Make content searchable
| +-- In Spotlight
| | --> IndexedEntity + @Property (references/entities-spotlight.md)
| +-- In Visual Intelligence
| | --> IntentValueQuery + SemanticContentDescriptor (references/advanced-features.md)
| +-- As onscreen entities for Siri/ChatGPT
| --> .userActivity() + EntityIdentifier (references/advanced-features.md)
|
+-- Show rich results in Siri
| +-- Static display only
| | --> .result(view:) snippet (references/advanced-features.md)
| +-- Interactive buttons/controls
| --> SnippetIntent protocol (references/advanced-features.md)
|
+-- Present choices to the user
| --> requestChoice(between:) (references/advanced-features.md)
|
+-- Share intents via Swift Package
--> AppIntentsPackage protocol (references/advanced-features.md)
| Feature | Minimum OS | Framework |
|---|---|---|
AppIntent protocol | iOS 16 / macOS 13 | AppIntents |
AppEntity protocol | iOS 16 / macOS 13 | AppIntents |
AppShortcutsProvider | iOS 16 / macOS 13 | AppIntents |
@Parameter macro | iOS 16 / macOS 13 | AppIntents |
IndexedEntity protocol | iOS 18 / macOS 15 | AppIntents |
@Property with indexingKey | iOS 18 / macOS 15 | AppIntents |
Intent Modes (supportedModes) | iOS 26 / macOS 26 | AppIntents |
requestChoice(between:) | iOS 26 / macOS 26 | AppIntents |
@ComputedProperty | iOS 26 / macOS 26 | AppIntents |
@DeferredProperty | iOS 26 / macOS 26 | AppIntents |
SnippetIntent protocol | iOS 26 / macOS 26 | AppIntents |
AppIntentsPackage protocol | iOS 26 / macOS 26 | AppIntents |
Onscreen entities (.userActivity()) | iOS 26 / macOS 26 | AppIntents |
@UnionValue | iOS 18 / macOS 15 | AppIntents |
| Task | Type/API | Reference File |
|---|---|---|
| Define an action | AppIntent protocol | references/intents-basics.md |
| Accept parameters | @Parameter macro | references/intents-basics.md |
| Create voice phrases | AppShortcutsProvider | references/intents-basics.md |
| Define a data entity | AppEntity protocol | references/entities-spotlight.md |
| Index in Spotlight | IndexedEntity protocol | references/entities-spotlight.md |
| Mark indexable fields | @Property(indexingKey:) | references/entities-spotlight.md |
| Run in background/foreground | supportedModes | references/advanced-features.md |
| Continue in foreground | continueInForeground() | references/advanced-features.md |
| Show result UI | .result(view:) | references/advanced-features.md |
| Interactive result UI | SnippetIntent protocol | references/advanced-features.md |
| Present choices | requestChoice(between:) | references/advanced-features.md |
| Visual intelligence search | IntentValueQuery | references/advanced-features.md |
| Onscreen entity association | .userActivity() modifier | references/advanced-features.md |
| Computed/deferred properties | @ComputedProperty, @DeferredProperty | references/advanced-features.md |
| Share via packages | AppIntentsPackage | references/advanced-features.md |
Read the user's code or requirements to determine:
Based on the need, read from this directory:
Apply patterns from the reference files. Check for common mistakes (see Top Mistakes below).
apple-intelligence-visual-intelligence/apple-intelligence-foundation-models/generators-deep-linking/ skillThese are the most frequent errors when implementing App Intents.
// ❌ Wrong -- no title or description
struct MyIntent: AppIntent {
func perform() async throws -> some IntentResult {
return .result()
}
}
// ✅ Correct -- static title is required
struct MyIntent: AppIntent {
static var title: LocalizedStringResource = "Do Something"
static var description: IntentDescription = "Performs the action"
func perform() async throws -> some IntentResult {
return .result()
}
}
// ❌ Wrong -- entities updated but Spotlight not notified
func saveRecipe(_ recipe: Recipe) {
database.save(recipe)
}
// ✅ Correct -- reindex after mutations
func saveRecipe(_ recipe: Recipe) async throws {
database.save(recipe)
try await CSSearchableIndex.default().indexAppEntities()
}
// ❌ Wrong -- forces app to foreground for a simple toggle
struct ToggleFavoriteIntent: AppIntent {
static var title: LocalizedStringResource = "Toggle Favorite"
static var openAppWhenRun = true // Unnecessary
func perform() async throws -> some IntentResult {
toggleFavorite()
return .result()
}
}
// ✅ Correct -- runs silently in background
struct ToggleFavoriteIntent: AppIntent {
static var title: LocalizedStringResource = "Toggle Favorite"
var supportedModes: IntentModes { .background }
func perform() async throws -> some IntentResult {
toggleFavorite()
return .result()
}
}
// ❌ Wrong -- entity has no way to be queried
struct NoteEntity: AppEntity {
var id: String
var title: String
// Missing: static var defaultQuery
}
// ✅ Correct -- provides a query so Siri can resolve entities
struct NoteEntity: AppEntity {
var id: String
var title: String
static var defaultQuery = NoteEntityQuery()
// ... typeDisplayRepresentation, displayRepresentation
}
// ❌ Wrong -- indexing thousands of items at once blocks the main thread
func indexAll() async throws {
let allItems = database.fetchAll() // 50,000 items
try await CSSearchableIndex.default().indexAppEntities()
}
// ✅ Correct -- batch index and run off main thread
func indexAll() async throws {
try await CSSearchableIndex.default().indexAppEntities(
of: RecipeEntity.self
)
}
Before shipping App Intents integration:
AppIntent has a static var title and static var descriptionAppEntity has typeDisplayRepresentation, displayRepresentation, and defaultQuery@Parameter properties have descriptive titlesEntityStringQuery or EntityPropertyQueryIndexedEntity types call CSSearchableIndex.default().indexAppEntities() after data changes@Property fields used in indexing have indexingKey set\(.applicationName)SnippetIntent (not plain AppIntent)perform() handles errors gracefully and returns meaningful dialog