Logo van Duo App Intents

Duo App Intents

Community
Kimeur
duo-app-intents

App Intents on iPhone Duo: AppIntent, AppEntity with EntityStringQuery, OpenIntent with TargetContentProvidingIntent and onAppIntentExecution (UISceneAppIntent and AppIntentSceneDelegate in UIKit) to show the right item in the right pane or window, handlesExternalEvents to pick the window, intents that work with the phone closed (supportedModes .background, IntentDialog, ProvidesDialog, isVoiceOnly), onscreen awareness when two panes are visible (appEntityIdentifier, appEntityIdentifier(forSelectionType:), NSUserActivity), App Shortcuts (AppShortcutsProvider) and AppIntentsTesting runs on the Duo simulator in each pose. Use when an app adds Siri, Shortcuts, Spotlight or Apple Intelligence actions, when an intent opens the wrong pane or an extra window, or when an intent must work while the phone is closed.

Overzicht

UitgeverKimeur
Repositoryduology
Skillnaamduo-app-intents
Sterren
40
Forks
2
Meegeleverde bestanden
5
LicentieMIT
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 5

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door Kimeur op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Duo App Intents in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/Kimeur/duology/tree/main/plugins/duology-features/skills/duo-app-intents
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Kimeur/duology.git /tmp/duology
mkdir -p .claude/skills
cp -r /tmp/duology/plugins/duology-features/skills/duo-app-intents .claude/skills/duo-app-intents
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Duo App Intents in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Duo App Intents automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Duo App Intents niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

duo-app-intents

App Intents describe your app's actions and content to Siri, Shortcuts, Spotlight, widgets and Apple Intelligence (App Intents). On iPhone Duo an intent can arrive while the phone is closed, while two panes are on screen, or while two windows of your app share the inner display. This skill makes each intent land in the right place.

Load neighbours when the task needs them: duo-scenes (windows, Split View, the scene manifest), duo-continuity (window models that survive a fold), duo-intelligence (the summaries an intent can return), duo-system-surfaces (widgets and controls that run intents).

Labels: measured means we ran it on the iPhone Duo simulator (iOS 27.1) on 20 October 2026, with AppIntentsTesting driving the intents; see references/evidence.md. Unverified means we could not confirm it. Everything else comes from Apple's pages, linked inline. Full source list: reference/sources.md.

What Apple says, and what it doesn't

Apple's iPhone Duo pages and the six Duo Tech Talks don't mention App Intents. The Duo rules below join Apple's App Intents guides (Directing app intents to your app's scenes, Configuring the runtime behavior, Providing contextual cues) with Apple's Duo scene rules and our measurements.

Situation on iPhone DuoWhat happenedSource
OpenIntent with the phone closedonAppIntentExecution ran 0.9 to 1.7 s before perform(); the collapsed split view showed the notemeasured
The same with the phone openThe list and the note side by side, the row still visiblemeasured
A .background intent with the app behind another appperform() ran in the background mode; the scene stayed in the backgroundmeasured, closed and open
An OpenIntent with the app behindThe handler ran while the scene was still inactive, then the same window became active with the note; no new windowmeasured, closed and open
Notes on screen for SiriClosed: 1 (the open note). Open: 4 (three rows and the open note)measured
Two windows on the inner displayThe system routes by contentIdentifier to the window that prefers itApple's routing guide; unverified on Duo

Rules

  1. An intent changes a window's model, never a view. The model survives the fold; views get rebuilt (duo-continuity).
  2. Take the item as a parameter. Open, two notes can be on screen at once, in two panes or two windows. Never read "the selected note" inside perform().
  3. Open content with OpenIntent plus TargetContentProvidingIntent, and set the selection in onAppIntentExecution. The split view then does the right thing on each display.
  4. Route to an existing window; don't open a new one. Prefer the window that already shows the item with handlesExternalEvents(preferring:allowing:). New windows work only on the inner display (duo-scenes).
  5. Default to the background. An intent that answers in words works closed, open and in a pocket. Ask for the foreground only when the person must see something.
  6. Annotate each pane. The list with appEntityIdentifier(forSelectionType:identifier:), the open item with appEntityIdentifier(_:) or an NSUserActivity.
  7. Turn on multiple scenes. Apple's routing needs UIApplicationSupportsMultipleScenes set to YES, even with one scene (routing guide).
  8. Test each intent closed and open with AppIntentsTesting, then try it with Siri on a device.
  9. Gate below iOS 26. TargetContentProvidingIntent, onAppIntentExecution and supportedModes are iOS 26; the view annotations are iOS 18.4. iPhone Duo runs iOS 27.1, so this only matters for other iPhones: add the conformance in an @available(iOS 26.0, *) extension, mark supportedModes @available(iOS 26.0, *), and wrap the modifiers in if #available.

1. An entity and its query

swift
import AppIntents
import Observation

struct Note: Identifiable, Hashable, Sendable {
    let id: UUID
    var title: String
    var body: String
}

/// One store for the whole app, shared by every window and by the intents.
@MainActor @Observable
final class NoteLibrary {
    static let shared = NoteLibrary()
    var notes: [Note] = []
    func note(_ id: Note.ID?) -> Note? { notes.first { $0.id == id } }
}

struct NoteEntity: AppEntity {
    static let typeDisplayRepresentation: TypeDisplayRepresentation = "Note"
    static let defaultQuery = NoteQuery()

    let id: UUID
    @Property(title: "Title") var title: String

    init(_ note: Note) {
        id = note.id
        title = note.title
    }

    var displayRepresentation: DisplayRepresentation { DisplayRepresentation(title: "\(title)") }
}

struct NoteQuery: EntityStringQuery {
    func entities(for identifiers: [UUID]) async throws -> [NoteEntity] {
        await MainActor.run {
            NoteLibrary.shared.notes.filter { identifiers.contains($0.id) }.map(NoteEntity.init)
        }
    }

    func entities(matching string: String) async throws -> [NoteEntity] {
        await MainActor.run {
            NoteLibrary.shared.notes.filter { $0.title.localizedCaseInsensitiveContains(string) }.map(NoteEntity.init)
        }
    }

    func suggestedEntities() async throws -> [NoteEntity] {
        await MainActor.run { NoteLibrary.shared.notes.prefix(10).map(NoteEntity.init) }
    }
}
  • The store lives at app level, above every window, so an intent finds the same data whichever display is in use.
  • EntityStringQuery lets Shortcuts, Siri and AppIntentsTesting find a note by name. Mark properties with @Property so the system (and tests) can read them.
  • Index entities in Spotlight with IndexedEntity when Siri should find them by meaning (WWDC26 session 343). Nothing about that is Duo-specific.

2. Open an item in the right pane

swift
import AppIntents
import SwiftUI

// requires: Note, NoteLibrary, NoteEntity (section 1); NoteDetail (your view)

struct OpenNoteIntent: OpenIntent, TargetContentProvidingIntent {
    static let title: LocalizedStringResource = "Open Note"
    static let description: IntentDescription? = "Shows a note in Notes."

    @Parameter(title: "Note") var target: NoteEntity

    /// Lets the system pick the window that already shows this note.
    static func contentIdentifier(for id: UUID) -> String { "note:\(id.uuidString)" }
    var contentIdentifier: String { Self.contentIdentifier(for: target.id) }

    func perform() async throws -> some IntentResult { .result() }
}

@MainActor @Observable
final class NotesWindowModel {                      // one per window
    var selection: Note.ID?
}

struct NotesWindow: View {
    @Environment(NoteLibrary.self) private var library
    @State private var model = NotesWindowModel()

    var body: some View {
        @Bindable var model = model
        NavigationSplitView {
            List(library.notes, selection: $model.selection) { note in
                Text(note.title)
            }
            .navigationTitle("Notes")
        } detail: {
            if let note = library.note(model.selection) {
                NoteDetail(note: note)
            } else {
                ContentUnavailableView("No Note Selected", systemImage: "note.text")
            }
        }
        // Runs in this window before perform(): closed, the split view shows the note;
        // open, the list and the note side by side.
        .onAppIntentExecution(OpenNoteIntent.self) { intent in
            model.selection = intent.target.id
        }
        // Prefer the window that already shows the note; accept any other.
        .handlesExternalEvents(
            preferring: Set(model.selection.map { [OpenNoteIntent.contentIdentifier(for: $0)] } ?? []),
            allowing: ["*"]
        )
    }
}
  • onAppIntentExecution(_:perform:) (iOS 26) hands the intent to a scene before perform() and before the app comes forward, so the window is ready when it appears (doc). Don't ask the person for values in that closure.
  • Measured: closed, the handler set the selection and the collapsed split view showed the note; the list row was gone. Open, the list and the note showed side by side. Same code, no size-class check.
  • OpenIntent makes the system run the intent in the foreground (measured: perform() reported the foreground mode).
  • For a layout without a split view, set the selection the same way and let your pane layout (duo-layout) decide what shows closed and open.
  • UIKit: UISceneAppIntent, AppIntentSceneDelegate and scene activation conditions. Code: references/routing.md.

3. Pick the window

Only the inner display can create a window, and people may have two windows of your app side by side there (duo-scenes). An intent should reach the window that already shows its item, and otherwise the current one.

  • Put the item's ID in contentIdentifier, as above. In each window, list the identifiers it prefers in handlesExternalEvents(preferring:allowing:) and allow "*" so some window always accepts.
  • Never call openWindow or activateSceneSession from perform(). On the closed phone the request may fail (talk 111464) or replace the visible window (measured in duo-scenes), and the person ends up somewhere they didn't ask for.
  • Measured: with one window, an OpenIntent from the background changed that window's selection; the window root didn't start again, so no second window appeared.
  • Unverified: which window receives the intent when two windows share the inner display, and what happens when the phone closes with two windows open. Test it on a device.

4. Intents that work with the phone closed

swift
import AppIntents

// requires: NoteLibrary, NoteEntity (section 1)

/// Works with the phone closed: it runs in the background and answers in words.
struct ReadNoteSummaryIntent: AppIntent {
    static let title: LocalizedStringResource = "Read Note Summary"
    static let description: IntentDescription? = "Reads the start of a note without opening the app."
    static let supportedModes: IntentModes = .background

    @Parameter(title: "Note") var note: NoteEntity

    func perform() async throws -> some IntentResult & ReturnsValue<String> & ProvidesDialog {
        let text = await MainActor.run { NoteLibrary.shared.note(note.id)?.body ?? "" }
        let summary = text.isEmpty ? "The note is empty." : String(text.prefix(140))
        // The full dialog must make sense on its own: Siri may only speak it.
        return .result(
            value: summary,
            dialog: IntentDialog(full: "\(note.title) says: \(summary)", supporting: "\(summary)")
        )
    }
}
  • supportedModes (iOS 26) is a hint; OpenIntent and a few other types force the foreground, and an App Intents extension always runs in the background (runtime guide).
  • Measured, closed and open: with the app behind Settings, this intent ran in the background mode and the scene stayed in the background.
  • Write the full dialog so it works spoken alone. systemContext.isVoiceOnly (iOS 27) tells you when there is no screen at all, for example with AirPods (doc).
  • Needs the screen only sometimes: use [.background, .foreground(.dynamic)], check systemContext.currentMode.canContinueInForeground, then call continueInForeground(_:alwaysConfirm:). The app opens on whichever display is in use, so the result must make sense in the compact layout too.
  • Longer than 30 seconds: adopt LongRunningIntent (iOS 27) and report progress (doc).
  • Summaries from a language model: reuse duo-intelligence's fallbacks. A .background intent must still answer when the model can't.

More, with a snippet view and the foreground hand-off: references/running-modes.md.

5. Onscreen awareness with two panes

Tell Siri which items are on screen (Providing contextual cues). Apple's split: a collection annotation on a list, a view annotation on an item that is one of many, an NSUserActivity on a screen given to one item (WWDC26 session 343).

swift
import AppIntents
import SwiftUI

// requires: Note, NoteLibrary, NoteEntity, NotesWindowModel (sections 1 and 2)

/// Tells Siri which notes are on screen. Open, the list and the note are both visible;
/// closed, only one of them is.
struct AnnotatedNoteList: View {
    @Environment(NoteLibrary.self) private var library
    @Bindable var model: NotesWindowModel

    var body: some View {
        List(library.notes, selection: $model.selection) { note in
            Text(note.title)
        }
        .appEntityIdentifier(forSelectionType: Note.ID.self) { id in   // rows, fetched lazily
            EntityIdentifier(for: NoteEntity.self, identifier: id)
        }
    }
}

struct AnnotatedNoteDetail: View {
    let note: Note

    var body: some View {
        ScrollView { Text(note.body).padding() }
            .navigationTitle(note.title)
            .appEntityIdentifier(EntityIdentifier(for: NoteEntity.self, identifier: note.id))
    }
}
  • Measured (viewAnnotations() in AppIntentsTesting): closed with the note open, one annotation, the note. Open, four: the three rows and the note, so the open note appears twice. Right after launch, with only the list showing, one run reported the three rows and another reported none; read annotations after the screen settles.
  • Closing the phone collapses the split view, and the list leaves the view tree. Its annotations went with it (measured), so the closed phone only tells Siri about the open note. Apple says row annotations vanish with their view, while a collection annotation can still report a selected row that scrolled away (session 343).
  • Measured in the open run: isSelected was false for all four annotations, the selected row and the open note included, although Apple's testing guide expects true for the item a detail screen shows. Don't rely on it to tell Siri which pane is "current".
  • A screen given to one item can attach an NSUserActivity with appEntityIdentifier instead (userActivity(_:element:_:) in SwiftUI). We didn't measure that form.
  • Unverified: how Siri resolves "this note" when the list and a different note are both on screen. Keep the open note's annotation on the detail view, and make every intent take the note as a parameter.

6. App Shortcuts

swift
import AppIntents

// requires: OpenNoteIntent, ReadNoteSummaryIntent (sections 2 and 4)

struct NotesShortcuts: AppShortcutsProvider {
    static var appShortcuts: [AppShortcut] {
        AppShortcut(
            intent: ReadNoteSummaryIntent(),
            phrases: ["Read a note in \(.applicationName)", "What's in my \(\.$note) note in \(.applicationName)"],
            shortTitle: "Read Note",
            systemImageName: "text.bubble"
        )
        AppShortcut(
            intent: OpenNoteIntent(),
            phrases: ["Open \(\.$target) in \(.applicationName)"],
            shortTitle: "Open Note",
            systemImageName: "note.text"
        )
    }
}
  • Every phrase names the app, and the full dialog carries everything for people who only hear it (HIG: App Shortcuts).
  • Call NotesShortcuts.updateAppShortcutParameters() when notes change, so phrases with a note name stay current.
  • Put the background intent first. It works in every pose, which makes it the best one for the Action button and the closed phone.

Test it

  1. Add a UI test bundle and import AppIntentsTesting. It runs your intents in the app on the simulator, with no Siri (WWDC26 session 295, docs).
  2. Run the tests once closed and once open. A test can't fold the phone: press the pose in Device Hub first, or run duo-pose set closed and duo-pose set open from duo-pose-matrix.
  3. Check what is on screen with XCUI queries and viewAnnotations(). Code and pitfalls: references/testing.md.
  4. Then try the phrases with Siri on a device, closed and open. Unverified: Siri itself on the Duo simulator.

Checklist

  • Entities have an EntityStringQuery and @Property titles; the store sits above every window.
  • Intents that show content adopt OpenIntent plus TargetContentProvidingIntent (UISceneAppIntent in UIKit) and set the window model's selection in onAppIntentExecution.
  • contentIdentifier carries the item's ID; each window prefers its own item and allows "*".
  • No intent opens a window or reads the current selection in perform().
  • UIApplicationSupportsMultipleScenes is YES.
  • Intents that don't need the screen run in .background and return a full dialog that works spoken alone.
  • The list and the open item carry entity annotations in both layouts.
  • App Shortcut phrases name the app; parameters update when content changes.
  • AppIntentsTesting passes closed and open; Siri tried on a device in both.

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Duo App Intents?

App Intents on iPhone Duo: AppIntent, AppEntity with EntityStringQuery, OpenIntent with TargetContentProvidingIntent and onAppIntentExecution (UISceneAppIntent and AppIntentSceneDelegate in UIKit) to show the right item in the right pane or window, handlesExternalEvents to pick the window, intents that work with the phone closed (supportedModes .background, IntentDialog, ProvidesDialog, isVoiceOnly), onscreen awareness when two panes are visible (appEntityIdentifier, appEntityIdentifier(forSelectionType:), NSUserActivity), App Shortcuts (AppShortcutsProvider) and AppIntentsTesting runs on t...

Waarom Duo App Intents gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Duo App Intents bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Duo App Intents in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/Kimeur/duology/tree/main/plugins/duology-features/skills/duo-app-intents. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Duo App Intents gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Duo App Intents gebruiken?

Zoveel als je wilt. Je kunt Duo App Intents gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Duo App Intents gratis?

Ja. Deze skill is door Kimeur op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇