Skip to content
app-intents logo

App Intents

app-intents

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.

SKILL.md

Full skill instructions

App Intents

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.

When This Skill Activates

  • User wants to add Siri or Shortcuts integration
  • User asks about App Intents, AppIntent, or AppEntity
  • User needs Spotlight indexing for app content
  • User wants to create App Shortcuts with voice phrases
  • User is implementing interactive snippets for Siri results
  • User asks about intent modes (foreground, background)
  • User needs visual intelligence integration via App Intents
  • User wants onscreen entity support for Siri/​ChatGPT
  • User asks about Swift package support for App Intents

Decision Tree

What do you need?
|
+-- Expose an action to Siri/​Shortcuts
|   +-- Simple action, no UI needed
|   |   --> Basic AppIntent (intents-basics.md)
|   +-- Needs to show UI or ask user questions
|   |   --> Intent Modes + Interactive Snippets (advanced-features.md)
|   +-- Needs a predictable voice phrase
|       --> App Shortcuts (intents-basics.md)
|
+-- Make content searchable
|   +-- In Spotlight
|   |   --> IndexedEntity + @Property (entities-spotlight.md)
|   +-- In Visual Intelligence
|   |   --> IntentValueQuery + SemanticContentDescriptor (advanced-features.md)
|   +-- As onscreen entities for Siri/​ChatGPT
|       --> .userActivity() + EntityIdentifier (advanced-features.md)
|
+-- Show rich results in Siri
|   +-- Static display only
|   |   --> .result(view:) snippet (advanced-features.md)
|   +-- Interactive buttons/​controls
|       --> SnippetIntent protocol (advanced-features.md)
|
+-- Present choices to the user
|   --> requestChoice(between:) (advanced-features.md)
|
+-- Share intents via Swift Package
    --> AppIntentsPackage protocol (advanced-features.md)

API Availability

FeatureMinimum OSFramework
AppIntent protocoliOS 16 / macOS 13AppIntents
AppEntity protocoliOS 16 / macOS 13AppIntents
AppShortcutsProvideriOS 16 / macOS 13AppIntents
@Parameter macroiOS 16 / macOS 13AppIntents
IndexedEntity protocoliOS 18 / macOS 15AppIntents
@Property with indexingKeyiOS 18 / macOS 15AppIntents
Intent Modes (supportedModes)iOS 26 / macOS 26AppIntents
requestChoice(between:)iOS 26 / macOS 26AppIntents
@ComputedPropertyiOS 26 / macOS 26AppIntents
@DeferredPropertyiOS 26 / macOS 26AppIntents
SnippetIntent protocoliOS 26 / macOS 26AppIntents
AppIntentsPackage protocoliOS 26 / macOS 26AppIntents
Onscreen entities (.userActivity())iOS 26 / macOS 26AppIntents
@UnionValueiOS 18 / macOS 15AppIntents

Quick Reference

TaskType/​APIReference File
Define an actionAppIntent protocolintents-basics.md
Accept parameters@Parameter macrointents-basics.md
Create voice phrasesAppShortcutsProviderintents-basics.md
Define a data entityAppEntity protocolentities-spotlight.md
Index in SpotlightIndexedEntity protocolentities-spotlight.md
Mark indexable fields@Property(indexingKey:)entities-spotlight.md
Run in background/​foregroundsupportedModesadvanced-features.md
Continue in foregroundcontinueInForeground()advanced-features.md
Show result UI.result(view:)advanced-features.md
Interactive result UISnippetIntent protocoladvanced-features.md
Present choicesrequestChoice(between:)advanced-features.md
Visual intelligence searchIntentValueQueryadvanced-features.md
Onscreen entity association.userActivity() modifieradvanced-features.md
Computed/​deferred properties@ComputedProperty, @DeferredPropertyadvanced-features.md
Share via packagesAppIntentsPackageadvanced-features.md

Process

1. Identify Integration Needs

Read the user's code or requirements to determine:

  • What actions should be exposed to Siri/​Shortcuts
  • What content should be searchable in Spotlight
  • Whether interactive snippets are needed for Siri results
  • Whether the intent needs foreground UI or can run in background
  • Target platform and minimum OS version

2. Load Relevant Reference Files

Based on the need, read from this directory:

  • intents-basics.md -- AppIntent protocol, @Parameter, perform(), App Shortcuts
  • entities-spotlight.md -- AppEntity, IndexedEntity, Spotlight indexing, @Property
  • advanced-features.md -- Intent modes, interactive snippets, visual intelligence, onscreen entities, choices, packages

3. Review or Implement

Apply patterns from the reference files. Check for common mistakes (see Top Mistakes below).

4. Cross-Reference

  • For Visual Intelligence camera search, see apple-intelligence/​visual-intelligence/
  • For Foundation Models on-device LLM, see apple-intelligence/​foundation-models/
  • For deep linking from intents, see generators/​deep-linking/ skill

Top Mistakes

These are the most frequent errors when implementing App Intents.

1. Missing static metadata

// ❌ 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()
    }
}

2. Forgetting to index entities after changes

// ❌ 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()
}

3. Using foreground intent for background-safe work

// ❌ 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()
    }
}

4. Not providing EntityStringQuery for entities

// ❌ 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
}

5. Returning too many Spotlight results

// ❌ 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
    )
}

Review Checklist

Before shipping App Intents integration:

  • Every AppIntent has a static var title and static var description
  • Every AppEntity has typeDisplayRepresentation, displayRepresentation, and defaultQuery
  • @Parameter properties have descriptive titles
  • Entities used in Shortcuts have EntityStringQuery or EntityPropertyQuery
  • IndexedEntity types call CSSearchableIndex.default().indexAppEntities() after data changes
  • @Property fields used in indexing have indexingKey set
  • App Shortcuts have clear, natural-language phrases with \(.applicationName)
  • Intent modes match the actual work: background for data ops, foreground for UI
  • Interactive snippets use SnippetIntent (not plain AppIntent)
  • perform() handles errors gracefully and returns meaningful dialog
  • Intents are tested in Shortcuts app and via Siri voice
  • Deep links from entity results navigate to the correct screen

References

More skills from rshankras

apple-intelligence logo
rshankras/claude-code-apple-skills

apple-intelligence

Apple Intelligence skills for on-device AI features including Foundation Models, Visual Intelligence, App Intents, and intelligent assistants. Use when implementing AI-powered features.

778 241
View
release-review logo
rshankras/claude-code-apple-skills

release-review

Senior developer-level release review for macOS/iOS apps. Identifies security, privacy, UX, and distribution issues with actionable fixes. Use when preparing an app for release, want a critical review, or before App Store submission.

778 234
View
security logo
rshankras/claude-code-apple-skills

security

Security review and guidance for iOS, macOS, and watchOS apps. Covers secure storage, biometric authentication, network security, and platform-specific patterns. Use when implementing security features or reviewing code for vulnerabilities.

778 230
View
generators logo
rshankras/claude-code-apple-skills

generators

Code generator skills that produce production-ready Swift code for common app components. Use when user wants to add logging, analytics, onboarding, review prompts, networking, authentication, paywalls, settings, persistence, error monitoring, CI/CD pipelines, localization, push notifications, de...

778 221
View
shared logo
rshankras/claude-code-apple-skills

shared

Platform-agnostic skills including skill creation templates and best practices. Use when creating new skills or improving existing ones.

778 197
View
testing logo
rshankras/claude-code-apple-skills

testing

TDD and testing skills for iOS/macOS apps. Covers characterization tests, TDD workflows, test contracts, snapshot tests, and test infrastructure. Use for test-driven development, adding tests to existing code, or building test infrastructure.

778 194
View
monetization logo
rshankras/claude-code-apple-skills

monetization

Monetization strategy for iOS/macOS apps. Covers readiness assessment, pricing model selection, tier structuring, free trial strategy, and implementation guidance. Use when deciding what to charge, how to price, or planning monetization end-to-end.

778 185
View
legal logo
rshankras/claude-code-apple-skills

legal

Legal document generation and compliance guidance for indie Apple developers. Covers privacy policies, terms of service, EULAs, GDPR/CCPA/DPDP compliance, and Apple App Store legal requirements. Use when user needs legal documents or compliance guidance.

778 176
View
growth logo
rshankras/claude-code-apple-skills

growth

Growth skills for indie Apple developers — user acquisition, analytics interpretation, press/media outreach, community building, and indie business operations. Use when user asks about growing their app, understanding metrics, getting press coverage, or running an indie dev business.

778 170
View
core-ml logo
rshankras/claude-code-apple-skills

core-ml

Core ML, Create ML, Vision framework, Natural Language framework, on-device ML integration. Use when user wants image classification, text analysis, object detection, sound classification, model optimization, or custom model integration. Covers Core ML vs Foundation Models decision.

778 166
View
memory logo
rshankras/claude-code-apple-skills

memory

Swift 6.2 InlineArray and Span types for zero-overhead memory access, fixed-size collections, and safe pointer alternatives. Use when optimizing performance-critical code paths.

778 0
View
review-response-writer logo
rshankras/claude-code-apple-skills

review-response-writer

Write professional, empathetic responses to App Store reviews that build trust and turn critics into fans. Use when responding to negative reviews, drafting templates for common review types, or improving review management strategy.

778 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View