
Sensorkit
Wire Apple SensorKit into an approved iOS research app with correct entitlements, plist keys, authorization, and sample-type handling.
Install
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill sensorkitWhat is this skill?
- Checklist for Apple-approved research studies and com.apple.developer.sensorkit.reader.allow entitlement
- NSSensorKitUsageDescription, privacy policy URL, and per-sensor NSSensorKitUsageDetail keys including ECG and PPG
- requestAuthorization flow, per-sensor user approval, and 24-hour hold before fetch results
- Correct sample shapes and delegate callbacks (e.g. CMAccelerometerData, CMGyroData, SR* types—not wrong casts)
- Eval-backed scenarios for setup checklists and fetch-handler review
Adoption & trust: 1.2k installs on skills.sh; 713 GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Vercel React Native Skillsvercel-labs/agent-skills
Firebase Basicsfirebase/agent-skills
Building Native Uiexpo/skills
Firebase Ai Logic Basicsfirebase/agent-skills
Native Data Fetchingexpo/skills
Firebase Firestorefirebase/agent-skills
Journey fit
Primary fit
SensorKit is implemented during product build when connecting native iOS sensors and research APIs—not during ideation or launch. Canonical shelf is integrations because the skill centers on platform APIs, entitlements, and delegate/fetch wiring rather than UI or pure PM.
Common Questions / FAQ
Is Sensorkit safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Sensorkit
{ "skill_name": "sensorkit", "evals": [ { "id": 1, "prompt": "Draft a setup checklist for an approved sleep research app that uses SensorKit ambient light, keyboard metrics, wrist temperature, ECG, and PPG. Include entitlement values, Info.plist usage-detail keys, authorization flow, and fetch timing constraints.", "expected_output": "A SensorKit setup checklist grounded in Apple requirements for approved research studies, with correct entitlement and Info.plist details and the 24-hour hold.", "files": [], "expectations": [ "States that SensorKit requires an Apple-approved research study and the com.apple.developer.sensorkit.reader.allow entitlement.", "Includes ECG and PPG entitlement values and their NSSensorKitUsageDetail dictionaries.", "Mentions NSSensorKitUsageDescription, NSSensorKitPrivacyPolicyURL, and per-sensor NSSensorKitUsageDetail entries.", "Explains requestAuthorization, per-sensor user approval, and the 24-hour holding period before fetch results are available." ] }, { "id": 2, "prompt": "Review this SensorKit fetch handler design for sample-type mistakes: it casts accelerometer to CMAccelerometerData, rotation rate to CMGyroData, wristTemperature to SRWristTemperature, ECG to SRElectrocardiogramSample, and PPG to SRPhotoplethysmogramSample. Return corrected sample shapes and delegate callbacks that should be implemented.", "expected_output": "A correction note that identifies the wrong casts and names the required SRSensorReaderDelegate callbacks.", "files": [], "expectations": [ "Corrects accelerometer and rotation rate to recorded CoreMotion sample arrays.", "Corrects wrist temperature to SRWristTemperatureSession, with contained SRWristTemperature readings.", "Corrects ECG and PPG to arrays of SRElectrocardiogramSample and SRPhotoplethysmogramSample.", "Includes stopRecordingFailedWithError, fetchDevicesDidFailWithError, didFetchResult, didCompleteFetch, and fetching failed callbacks." ] }, { "id": 3, "prompt": "A fitness app without a research study wants live step counts, workout heart-rate summaries, and an Apple Watch motion interaction. Explain whether SensorKit is the right framework and where each responsibility should be routed.", "expected_output": "A boundary memo that refuses to use SensorKit for ordinary fitness features and routes work to CoreMotion and HealthKit.", "files": [], "expectations": [ "Says SensorKit is not appropriate without an Apple-approved research study and entitlement.", "Routes live steps and motion interaction work to CoreMotion.", "Routes workout and heart-rate record handling to HealthKit.", "Avoids giving SensorKit implementation steps for the non-research fitness app." ] } ] } # SensorKit Extended Patterns Overflow reference for the `sensorkit` skill. Contains delegate wiring, multi-sensor management, and detailed sample type usage that exceed the main skill file's scope. ## Contents - [Full Delegate Implementation](#full-delegate-implementation) - [Multi-Sensor Manager](#multi-sensor-manager) - [Ambient Light Samples](#ambient-light-samples) - [Keyboard Metrics Deep Dive](#keyboard-metrics-deep-dive) - [Device Usage Reports](#device-usage-reports) - [Phone and Messages Usage](#phone-and-messages-usage) - [Visit Tracking](#visit-tracking) - [Media Events](#media-events) - [Wrist Detection](#wrist-detection) - [Speech Metrics](#speech-metrics) - [Face Metrics](#face-metrics) - [Wrist Temperature](#wrist-temperature) - [Electrocardiogram and PPG](#electrocardiogram-and-ppg) - [SRAbsoluteTime Utilities](#srabsolutetime-utilities) - [Deletion Records](#deletion-records) - [Testing Considerations](#testing-considerations) ## Full Delegate Implementation A complete `SRSensorReaderDelegate` implementation covering all callbacks: ```swift