Community-maintained Agent Skills for complete Swift and Apple-platform app delivery.
72
90%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Medium
Suggest reviewing before use
Control home automation accessories and commission Matter devices into an app ecosystem. HomeKit manages the home/room/accessory hierarchy, characteristics, and automation triggers; MatterSupport handles ecosystem device commissioning.
NSHomeKitUsageDescription to Info.plist._matter._tcp, _matterc._udp, _matterd._udp), and set the extension's principal class to MatterAddDeviceExtensionRequestHandler.HomeKit loads asynchronously. Maintain a single HMHomeManager instance and await the homeManagerDidUpdateHomes(_:) delegate callback before accessing homes or primaryHome.
HMHomeManager -> HMHome -> HMRoom -> HMAccessory -> HMService -> HMCharacteristicimport HomeKit
final class HomeStore: NSObject, HMHomeManagerDelegate {
let manager = HMHomeManager()
override init() {
super.init()
manager.delegate = self
}
func homeManagerDidUpdateHomes(_ manager: HMHomeManager) {
// Safe to read homes and accessories
let primary = manager.primaryHome
}
}Interact with accessory services (e.g. lights, thermostats) via HMCharacteristic:
func setLightPower(_ characteristic: HMCharacteristic, isOn: Bool) async throws {
guard characteristic.characteristicType == HMCharacteristicTypePowerState else { return }
try await characteristic.writeValue(isOn)
}
func readTemperature(_ characteristic: HMCharacteristic) async throws -> Double? {
try await characteristic.readValue()
return characteristic.value as? Double
}Group changes into scenes and automate execution:
// Create an action set (scene)
func createNightScene(home: HMHome, lightAction: HMCharacteristicWriteAction<Bool>) async throws {
let actionSet = try await home.addActionSet(withName: "Good Night")
try await actionSet.addAction(lightAction)
}
// Event-based automation
func addTrigger(home: HMHome, trigger: HMEventTrigger) async throws {
try await home.addTrigger(trigger)
try await trigger.enable(true)
}Use MatterSupport to onboard Matter devices into your ecosystem:
import MatterSupport
let topology = MatterAddDeviceRequest.Topology(ecosystemName: "MyHome", homes: [home])
let request = MatterAddDeviceRequest(topology: topology)
try await request.perform()The system invokes your MatterAddDeviceExtensionRequestHandler subclass in the extension target to complete pairing.
homes synchronously at launch: manager.homes is empty until homeManagerDidUpdateHomes fires._matter._tcp, _matterc._udp, and _matterd._udp in NSBonjourServices.characteristic.writeValue(_:) rather than mutating state locally.NSHomeKitUsageDescription present in target Info.plistHMHomeManager instantiated once and guarded until homeManagerDidUpdateHomes fireswriteValue(_:) with error handlingtrigger.enable(true) after creation.tessl-plugin
skills
accessorysetupkit
references
activitykit
adattributionkit
references
alarmkit
references
app-clips
app-intents
app-store-optimization
app-store-review
apple-on-device-ai
appmigrationkit
audioaccessorykit
references
authentication
references
avfoundation-audio
references
avkit
background-processing
references
browserenginekit
callkit
references
carplay
cloudkit
contacts-framework
references
core-bluetooth
references
core-data
core-haptics
references
core-motion
references
core-nfc
references
coreml
references
cryptokit
cryptotokenkit
debugging-instruments
device-integrity
references
energykit
references
eventkit
family-controls
references
financekit
focus-engine
gamekit
git-branching-workflow
references
healthkit
references
homekit
references
ios-accessibility
ios-app-workflow
references
ios-ettrace-performance
ios-localization
ios-memgraph-analysis
ios-networking
ios-simulator
references
metrickit
references
musickit
references
natural-language
paperkit
references
passkit
references
pdfkit
pencilkit
references
permissionkit
references
photokit
push-notifications
quicklook
references
realitykit
references
relevancekit
references
scenekit
sensorkit
shazamkit
references
speech-recognition
references
spritekit
storekit
swift-api-design-guidelines
swift-architecture
references
swift-charts
swift-codable
references
swift-code-review
swift-concurrency
swift-formatstyle
references
swift-language
swift-security
references
swift-testing
swiftdata
swiftlint
swiftui-animation
swiftui-gestures
references
swiftui-layout-components
swiftui-liquid-glass
references
swiftui-patterns
swiftui-performance
swiftui-responsive-layout
swiftui-uikit-interop
swiftui-webkit
tabletopkit
tipkit
vision-framework
weatherkit
references