core-motion

Installation
SKILL.md

Core Motion

Reading the device's motion and environmental sensors: raw accelerometer/gyro, fused device motion, steps, activity classification, headphone motion, and altitude. The deep API reference — every manager, the push/pull delivery models, attitude reference frames, permissions, and battery discipline — lives in references/guide.md. This file is the decision and discipline layer: read it first, open the guide for specifics.

Dials

Set these explicitly at the start; they change what "correct" means.

  1. SENSOR — device-motion (default; fused CMDeviceMotion — attitude, rotationRate, gravity, userAcceleration) · raw-accel-gyro (unprocessed streams; only when you need raw signal) · pedometer (steps/distance/floors via CMPedometer) · activity (CMMotionActivityManager) · headphone (AirPods motion, iOS 14+) · altimeter (relative altitude/pressure).
  2. DELIVERY — push-updates (default; start…Updates(to:withHandler:) on a background OperationQueue, event-driven) · pull-query (start…Updates() then read the snapshot from a render/timer tick; or queryPedometerData/queryActivityStarting against the system cache).
  3. FREQUENCY — the update interval (…UpdateInterval, in seconds). Pick the lowest rate the feature needs: UI/parallax 30–60 Hz, gestures ~20 Hz, games 60 Hz. Don't max it.

When to use

Building or reviewing any feature that reads motion sensors: tilt/orientation UI, level/compass, shake or gesture detection, step counters and fitness tracking, activity-aware behavior, AirPods head tracking, or barometric altitude. If you only need device heading, prefer Core Location's heading API; Core Motion's north-referenced frames are heavier.

Core rules

Installs
1
GitHub Stars
1
First Seen
Jun 18, 2026
core-motion — moritztucher/swift-agent-skills