Builds sensor workflows with Core Motion for accelerometer, gyroscope, device motion, pedometer, activity recognition, altitude, headphone motion, workout motion, and submersion/depth data. Use for motion interaction, steps, activity classification, AirPods tracking, or watchOS depth features.
Ships in all-ios-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.
Access accelerometer, gyroscope, attitude/device motion, pedometer, altitude, and specialized sensors using Core Motion. Targets Swift 6.4 / iOS 26+.
Add NSMotionUsageDescription to Info.plist explaining why the app accesses motion sensors.
Check authorization status for managers exposing privacy controls (CMPedometer, CMMotionActivityManager, CMAltimeter):
import CoreMotion
guard CMMotionActivityManager.authorizationStatus() != .denied else {
// Prompt user to enable motion permissions in Settings
return
}
Raw accelerometer/gyro streams under CMMotionManager do not prompt for permission directly but require the usage description and throw errors on unauthorized access.
Maintain exactly one shared CMMotionManager instance per application to avoid sensor contention:
final class MotionProvider {
static let shared = MotionProvider()
let manager = CMMotionManager()
func startAccelerometer() {
guard manager.isAccelerometerAvailable else { return }
manager.accelerometerUpdateInterval = 1.0 / 60.0 // 60 Hz
manager.startAccelerometerUpdates(to: .main) { data, error in
guard let accel = data?.acceleration else { return }
// Process acceleration: x, y, z
}
}
func stop() {
manager.stopAccelerometerUpdates()
}
}
Prefer CMDeviceMotion over raw sensor data. It fuses accelerometer, gyro, and magnetometer data into clean attitude, user acceleration, and gravity vectors:
manager.deviceMotionUpdateInterval = 1.0 / 60.0
manager.startDeviceMotionUpdates(using: .xArbitraryZVertical, to: .main) { motion, error in
guard let motion else { return }
let roll = motion.attitude.roll
let pitch = motion.attitude.pitch
let yaw = motion.attitude.yaw
}
Track steps, distance, and user movement state:
let pedometer = CMPedometer()
if CMPedometer.isStepCountingAvailable() {
pedometer.startUpdates(from: .now) { data, error in
guard let data else { return }
print("Steps: \(data.numberOfSteps)")
}
}
let activityManager = CMMotionActivityManager()
if CMMotionActivityManager.isActivityAvailable() {
activityManager.startActivityUpdates(to: .main) { activity in
guard let activity else { return }
if activity.walking { print("Walking") }
if activity.running { print("Running") }
}
}
startRelativeAltitudeUpdates).stopDeviceMotionUpdates()) when views disappear or when the app transitions to the background.CMDeviceMotion.attitude instead.isAvailable flags before calling startUpdates.NSMotionUsageDescription present and descriptive in Info.plistCMMotionManager instance used app-wideCMDeviceMotion used for orientation and tilt calculations instead of raw accelerometerWhat SKILL.md sets; muted values are Claude Code's defaults
/all-ios-skills:core-motionfrom all-ios-skills
npx claudepluginhub thienqo/ios-skills --plugin all-ios-skills95 skills in this plugin
/accessorysetupkitDiscover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based scanning, or setting up accessories without requiring broad Bluetooth permissions./activitykitBuild or review Live Activities and Dynamic Island experiences with ActivityKit, including lifecycle, layouts, push updates, and scheduled delivery. Use for time-sensitive Lock Screen or Dynamic Island state; route ordinary widgets to widgetkit./adattributionkitMeasure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks, updating conversion values, implementing re-engagement attribution, configuring publisher or advertiser apps, or replacing SKAdNetwork with AdAttributionKit for ad measurement.Other plugins' skills for the same job