Agent skill
skills-intrusive-memory-swifthablare
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/skills-intrusive-memory-swifthablare
SKILL.md
Skill: Register a Custom Voice Provider
Use this skill when you need to add a new VoiceProvider implementation and expose it through the shared
VoiceProviderRegistry.
Steps
-
Create the provider type
- Add a new file under
Sources/SwiftHablare/Providers/(or a nested folder) that defines a type conforming toVoiceProvider. - Implement
isConfigured()to verify the provider’s own persisted settings (API keys, model IDs, etc.). - Keep persistence local to the provider—use
UserDefaults, the keychain, or custom storage as needed. - Supply a SwiftUI configuration panel by implementing
makeConfigurationView(onConfigured:)when SwiftUI is available.
- Add a new file under
-
Declare a descriptor
- Extend the provider with a static
descriptorproperty returningVoiceProviderDescriptor. - Populate the descriptor with a stable identifier, display name, enablement defaults, and a factory closure that returns a new instance of the provider.
- If the provider needs custom configuration UI, pass a configuration panel builder (otherwise the registry uses
makeConfigurationView(onConfigured:)).
- Extend the provider with a static
-
Register the provider
- During startup (for example in
SwiftHablare.configureVoiceProviders()or app initialization), callawait VoiceProviderRegistry.shared.register(NewProvider.descriptor)or subclassVoiceProviderAutoRegistrarto register automatically when the module loads on Objective-C platforms. - The registry persists enablement state automatically and will call the provider’s
isConfigured()before returning it fromconfiguredProvider(for:).
- During startup (for example in
-
Surface configuration UI
- Use
VoiceProviderRegistry.shared.configurationPanel(for:onConfigured:)when the user enables the provider or wants to edit its settings. - Ensure the configuration view saves credentials/settings and calls the completion handler with
trueupon success so the registry can mark the provider as enabled.
- Use
-
Verify integration
- Fetch the updated catalog with
VoiceProviderRegistry.shared.availableProviders()and confirm the new provider appears with the correct enablement and configuration status. - Run any relevant unit tests or add new coverage specific to the provider.
- Fetch the updated catalog with
References
Sources/SwiftHablare/VoiceProvider.swiftSources/SwiftHablare/VoiceProviderRegistry.swiftSources/SwiftHablare/Providers/AppleVoiceProvider.swiftSources/SwiftHablare/Providers/ElevenLabsVoiceProvider.swift
Didn't find tool you were looking for?