/ios-swift-skills:swift-speechanalyzer-framework-expertfrom ios-swift-skills
Implements, migrates, debugs, and reviews on-device transcription using Apple's SpeechAnalyzer framework on iOS 26, macOS 26, visionOS 26, and tvOS 26. Covers setup, locale assets, permissions, lifecycle, and migration from SFSpeechRecognizer or Whisper.
Ships in ios-swift-skills. 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.
Use the API surface in the project’s installed SDK. This guide is compatibility-first for the stable Xcode 26.6 / iOS 26.5 SDK and retains a transcription path for OS 26.
SpeechAnalyzer, SpeechTranscriber, AssetInventory, and AnalyzerInput require iOS 26, macOS 26, visionOS 26, or tvOS 26. They are unavailable on watchOS.DictationTranscriber is available on iOS 26, macOS 26, and visionOS 26, but not tvOS/watchOS.SpeechTranscriber.isAvailable is hardware-sensitive. An OS version check alone is insufficient.AVAudioSession and requests record permission.#available(iOS 27, macOS 27, ...) runtime gate, and retain the 26 implementation. A stable 26 compiler cannot resolve an unknown symbol merely because it appears inside #available.Do not hardcode a language count. Query locale support on the running device.
SpeechTranscriber.isAvailable.SpeechTranscriber.supportedLocale(equivalentTo:); exact Locale equality can reject a usable regional equivalent.AssetInventory.reserve(locale:) when the app owns that reservation.AssetInventory.assetInstallationRequest(supporting:) and await downloadAndInstall() when it returns a request.SpeechAnalyzer.bestAvailableAudioFormat(compatibleWith:) before installing an audio path.SpeechAnalyzer, supply AnalyzerInput values, and consume transcriber.results in tracked structured work.AsyncStream alone does not finish analysis.There is no SpeechTranscriber.allocate(locale:) in the stable 26 SDK. Locale reservation is an AssetInventory responsibility.
Read examples/basic_setup.swift for a scoped preparation helper that releases its reservation on success and failure.
AssetInventory.reserve(locale:) returns true when it created a new app reservation and false when that locale was already reserved. Release only reservations the current owner created; do not tear down another feature’s reservation. Respect maximumReservedLocales and expose an explicit release action.
AssetInstallationRequest conforms to ProgressReporting. Its progress property is Foundation Progress, not an AsyncSequence. Pass the object to UI/observation code or inspect fractionCompleted; never write for try await over it.
Read examples/locale_manager.swift for equivalence lookup, explicit reservation ownership, installation, Foundation Progress handoff, and release.
The element type is SpeechTranscriber.Result. Use:
result.text for the most likely AttributedString;String(result.text.characters) when plain text is required;result.alternatives only when alternative reporting was configured;result.isFinal to distinguish final from volatile output;result.range and configured attributes when reconciling time-indexed text.There is no SpeechTranscriptionResult type and no result.transcription property in the stable 26 SDK.
When volatile reporting is enabled, replace the current volatile segment rather than repeatedly appending it. Append finalized text once. For editors that can receive overlapping ranges, reconcile by result.range instead of assuming a single volatile phrase.
Read examples/error_handling.swift for typed validation errors and correct result accumulation.
async let or a task group for finite file transcription.finalizeAndFinishThroughEndOfInput() to drain and finalize, or cancelAndFinishNow() when results are no longer needed.MainActor state. Capture a dedicated synchronized feeder and hop to the main actor only for UI/error delivery.@unchecked Sendable without a concrete synchronization/ownership invariant.An iOS host app needs both:
NSSpeechRecognitionUsageDescriptionNSMicrophoneUsageDescriptionRequest speech and microphone authorization before starting the engine. Configure and activate the app’s AVAudioSession according to the broader audio policy; the sample owns a record-only measurement session and deactivates it on stop. Apps that mix playback, calls, or other recorders need a central session coordinator.
Install the tap only after obtaining a nonoptional analyzer format. Remove the tap, stop the engine, finish input, finalize/cancel the analyzer, await the result task, deactivate the session, and release the owned reservation on every stop/failure path.
Read these two files together:
The sample feeder performs bounded conversion in the audio tap and never touches UI-isolated state. Profile this path on supported devices. A production recorder with stricter real-time requirements should use a preallocated/ring-buffer architecture appropriate to its latency budget.
File analysis does not need microphone permission or an iOS audio session. Prepare assets, open AVAudioFile, start analysis with finishAfterFile: true, and consume results with structured concurrency.
Read examples/file_transcription.swift. Invoke it inside withPreparedSpeechTranscriber from the basic example so reservation ownership stays scoped.
SpeechTranscriber.isAvailable is false, disable the feature or evaluate DictationTranscriber on supported platforms and query its locale support separately.SFSpeechRecognizer only behind a deliberate lower-OS or feature-gap adapter; its authorization, request, result, and network behavior differ.Progress is observed as Foundation Progress.SpeechTranscriber.Result.text and preserve AttributedString when useful.README.md (opens in a new tab)agents/openai.yaml (opens in a new tab)examples/basic_setup.swift (opens in a new tab)examples/buffer_converter.swift (opens in a new tab)examples/error_handling.swift (opens in a new tab)examples/file_transcription.swift (opens in a new tab)examples/live_transcription.swift (opens in a new tab)examples/locale_manager.swift (opens in a new tab)examples/prompts.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fal3/swift-apple-skills --plugin ios-swift-skills14 skills in this plugin
/app-intents-widgetsDesign, implement, debug, and verify stable App Intents and WidgetKit integrations, including AppIntent, AppEntity, AppEnum, entity queries, AppShortcutsProvider, dependency injection, shared extension data, widget timelines, relevance, controls, Live Activity selection, deep links, handoff, confirmation, and privacy. Use when exposing app actions to Siri or Shortcuts, building configurable or interactive widgets, sharing state with extensions, or choosing the correct system surface for an action. Do not use for ordinary in-app buttons, generic SwiftUI layout, background scheduling without a widget or intent, SiriKit-only legacy work with no migration request, or Live Activity push-server implementation as the sole task./apple-evaluationsBuild, review, and debug generative AI quality regression suites with Apple's Evaluations framework, including Evaluation, datasets, metrics, Swift Testing integration, calibrated model judges, and tool-call trajectories. Use when measuring an Apple-platform intelligence feature, comparing prompts or models, or diagnosing misleading evaluation results. Do not use for ordinary deterministic unit tests, UI automation, performance profiling alone, model training, or an unrelated vendor's evaluation framework.Other plugins' skills for the same job