/destinations:destinationsfrom Destinations
Provides vocabulary, Provider construction patterns, and best practices for the Destinations Swift framework. Covers Flow, Destination, Provider, StateModeling, Event, Interactor, and ActionSequence.
Ships in Destinations. 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.
A View/UIViewController never knows about other screens, datasources, or what an action does — it only sends an EventType to its state model via handleEvent(_:content:). Presentation and Interactor wiring live in the Provider, keyed by event.
ViewFlow/ControllerFlow) — owns all live Destinations, builds new ones via Providers. Handles all view navigation plumbing.ViewDestination/ControllerDestination) — coordinates one screen's routing/requests. Built once in a Provider, otherwise left alone.DestinationPresentation/InteractorConfiguration.StateModeling) — owns View state, business logic, lifecycle hooks. The View observes this, not the Destination.EventTypeable) — An enum type that is generally used to perform a Destination presentation or an Interactor request, which are called via configuration models bound to specific Event types in the Provider. Events are the foundation for decoupling the UI from the actions that the user interactions should trigger. Generally every Destination gets its own Event enum.performAction(for:content:) which accesses an InteractorConfiguration assigned to an Event in the Provider. Always prefer using an async Interactor (AsyncInteractable) whenever possible.ActionSequenceConfiguration, ActionGroupConfiguration, ActionBranchConfiguration).Define the app-level enums (destination types, content type, tab type) first.
Set up a ViewFlow/ControllerFlow at the app root with a starting DestinationPresentation and a [DestinationType: Provider] dictionary; see references/providers.md.
Hold a ViewFlow in @State on the App, not @StateObject; the UI updates on replaceRoot with @State.
Add Destinations one at a time using the workflow below.
Each Destination's files should live together in a directory:
And all of the Destination directories should live in a Modules directory
Data models should live in one Models directory
Interactors should all live in one Interactors directory
Transformers should all live in one Transformers directory
Types should all live in one Types directory
Errors should all live in one Errors directory
buildDestination; call assignAssociatedView and assignInteractor(_:to:) for each Interactor, then return.preflightIgnoredEvents.performAction (single InteractorConfiguration) or performActions (sequences and groups) call and its returned Result, or call the Interactor directly (lookup via interactor(for:)) if the user wishes to avoid an extra Event.performAction(for:content:) inside handleThrowable. The async performAction still presents but returns presentationResultNotSupported, since presentations have no result.prepareForAppearance(isVisible:)/prepareForDisappearance(wasVisible:) for setup/teardown code, not the View's unreliable onAppear()/onDisappear(). The isVisible flag denotes when the View is actually on-screen.handleEvent → state model → performAction.@Observable.Button action sending handleEvent, except inside List/ForEach rows.InteractorConfiguration.assistantType: default .basicAsync; use .transformer(request:result:) when request/result content types differ from the Destination's; reserve .custom for genuinely custom logic (e.g. consuming an AsyncStream).DestinationPresentation.assistantType is a separate, simpler enum (ActionAssistantType): .basic normally, .custom(assistant:) only to pick a Destination type dynamically at runtime from event content.| Scenario | Preferred pattern |
|---|---|
| View state | @Observable state model property |
| Setup/teardown on appear/disappear | prepareForAppearance(isVisible:) / prepareForDisappearance(wasVisible:) |
| Presentation | throwing performAction(for:content:) inside handleThrowable |
| Interactor result | await destination.performAction(for:content:) returned Result |
| Chain of related requests | performActions with an ActionSequenceConfiguration: static ones built in the Provider and bound to an Event; dynamic ones built in the state model |
| Parallel requests merged into one result | performActions with an ActionGroupConfiguration, bound directly to an Event |
| One-off Interactor call without an Event | destination.interactor(for:) |
| Interactor content types differ from Destination's | .transformer(request:result:) assistant |
| Dismiss a sheet | A few sheets: Done Event bound to .sheet(type: .dismiss) in the sheet's Provider. Many sheets (SwiftUI): one dynamic sheet Destination, with a dismissal closure passed in its content (see references/presentations.md) |
| Pick a presentation route at runtime | ActionAssistantType.custom presentation assistant (see references/presentations.md) |
| Initial content request | prepareForAppearance(isVisible:) on the state model |
| Setup the Interactor itself needs (e.g. a camera capture session) | configureInteractor(_:type:) on the state model |
Read only the reference relevant to the task:
references/providers.md: building Destinations, binding Events, preflight checks, registering with the Flow.references/presentations.md: presentation types, navigation/tab/sheet containers, runtime routing.references/interactors.md: async Interactors, requests, assistant types, direct Interactor access.references/action-sequences.md: chained, parallel, and branching Interactor workflows.references/state-models.md: state model rules and lifecycle hooks.references/views.md: View protocols, interface state objects, Event enums, Destinations view modifiers.Reference snippets conform to DestinationTypes. This is not a framework protocol; it's an app-defined protocol of shared typealiases (DestinationType, ContentType, TabType, InteractorType), e.g. protocol DestinationTypes { typealias DestinationType = Route; typealias ContentType = AppContentType; ... }. Use the project's equivalent, or create one.
Narrative guides, fetched from GitHub when needed (they aren't bundled with this skill):
MigrationGuide2.0.md): breaking changes.onAppear/onDisappear for setup/teardown instead of the state model lifecycle hooks.handleInteractorResult/handleAsyncInteractorResult for new code instead of awaiting performAction..custom Interactor assistant just to bridge mismatched content types.Events and InteractorType enums, typically on its DestinationStateable interface state object, and add a case for it to the app's destination type enum.@Observable state model conforming to StateModeling; implement handleEvent(_:content:) and the lifecycle hooks it needs.DestinationStateable object, observe the state model, send events via handleEvent. Layout only.presentationsData and interactorsData, then implement buildDestination.Users can scaffold an empty Destination with the /new-destination <Name> action.
Destinationable.swift and its conformances.Tests/SwiftUI/DestinationsSwiftUI.xcodeproj / Tests/UIKit/DestinationsUIKit.xcodeproj, not xcodebuild -scheme Destinations.README.md (opens in a new tab)references/action-sequences.md (opens in a new tab)references/interactors.md (opens in a new tab)references/presentations.md (opens in a new tab)references/providers.md (opens in a new tab)references/state-models.md (opens in a new tab)references/views.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub poetmountain/destinations --plugin destinations2 skills in this plugin
Other plugins' skills for the same job