Token导航 LogoToken导航

Agent Skill · 研究检索

sensorkit(sensorkit 搜索)

sensorkit 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

sensorkit 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 9,167。

总安装 14,811周安装 611GitHub Stars 533下载 4,839核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sensorkit(sensorkit 搜索)
来源仓库:https://github.com/dpearson2699/swift-ios-skills
仓库路径:skills/sensorkit
安装命令:
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill sensorkit
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill sensorkit

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找、检索和筛选相关信息,支持关键词和任务场景匹配。适合快速定位候选结果,提升信息获取效率。sensorkit 属于研究检索类 Skill,可作为该场景下的辅助能力补充。可结合来源仓库和原始 README 进一步验证功能细节。安装前建议确认权限范围和维护状态,避免意外联网或命令执行。

注意工具输出不能直接作为最终结论,需人工复核关键信息。

来源仓库内路径:skills/sensorkit

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/dpearson2699/swift-ios-skills --skill sensorki…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

sensorkit 怎么安装?

在终端执行 npx skills add https://github.com/dpearson2699/swift-ios-skills --skill sensorkit。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

sensorkit 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

sensorkit 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

sensorkit 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

sensorkit 用的人多吗?

公开数据是累计安装 14,811 次,近一周安装 611 次,下载 4,839 次,GitHub 533 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

sensorkit 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
sensorkit

sensorkit 搜索 · 本页

14,811533需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

SensorKit

Collect research-grade sensor data from iOS and watchOS devices for approved research studies. SensorKit provides access to ambient light, motion, device usage, keyboard metrics, visits, phone/messaging usage, speech metrics, face metrics, wrist temperature, heart rate, ECG, and PPG data. Targets Swift 6.3 / iOS 26+.

SensorKit is restricted to Apple-approved research studies. Apps must submit a research proposal to Apple and receive the com.apple.developer.sensorkit.reader.allow entitlement before any sensor data is accessible. This is not a general-purpose sensor API -- use CoreMotion for standard accelerometer/gyroscope needs.

Contents

Overview and Requirements

SensorKit enables research apps to record and fetch sensor data across iPhone and Apple Watch. The framework requires:

  1. Apple-approved research study -- submit a proposal at researchandcare.org.
  2. SensorKit entitlement -- Apple grants com.apple.developer.sensorkit.reader.allow only for approved studies.
  3. Manual provisioning profile -- Xcode requires an explicit App ID with the SensorKit capability enabled.
  4. User authorization -- the system presents a Research Sensor & Usage Data sheet that users approve per-sensor.
  5. 24-hour data hold -- newly recorded data is inaccessible for 24 hours, giving users time to delete data they do not want to share.

An app can access up to 7 days of prior recorded data for an active sensor.

Entitlements

Add the SensorKit reader entitlement to a .entitlements file. List only the sensors your study uses:

<key>com.apple.developer.sensorkit.reader.allow</key>
<array>
    <string>ambient-light-sensor</string>
    <string>motion-accelerometer</string>
    <string>motion-rotation-rate</string>
    <string>device-usage</string>
    <string>keyboard-metrics</string>
    <string>messages-usage</string>
    <string>phone-usage</string>
    <string>visits</string>
    <string>pedometer</string>
    <string>on-wrist</string>
</array>

Xcode build settings for manual signing:

SettingValue
Code Signing EntitlementsYourApp.entitlements
Code Signing IdentityApple Developer
Code Signing StyleManual
Provisioning ProfileExplicit profile with SensorKit capability

Info.plist Configuration

Three keys are required:

<!-- Study purpose shown in the authorization sheet -->
<key>NSSensorKitUsageDescription</key>
<string>This study monitors activity patterns for sleep research.</string>

<!-- Link to your study's privacy policy -->
<key>NSSensorKitPrivacyPolicyURL</key>
<string>https://example.com/privacy-policy</string>

<!-- Per-sensor usage explanations -->
<key>NSSensorKitUsageDetail</key>
<dict>
    <key>SRSensorUsageMotion</key>
    <dict>
        <key>Description</key>
        <string>Measures physical activity levels during the study.</string>
        <key>Required</key>
        <true/>
    </dict>
    <key>SRSensorUsageAmbientLightSensor</key>
    <dict>
        <key>Description</key>
        <string>Records ambient light to assess sleep environment.</string>
    </dict>
</dict>

If Required is true and the user denies that sensor, the system warns them that the study needs it and offers a chance to reconsider.

Authorization

Request authorization for the sensors your study needs. The system shows the Research Sensor & Usage Data sheet on first request.

import SensorKit

let reader = SRSensorReader(sensor: .ambientLightSensor)

// Request authorization for multiple sensors at once
SRSensorReader.requestAuthorization(
    sensors: [.ambientLightSensor, .accelerometer, .keyboardMetrics]
) { error in
    if let error {
        print("Authorization request failed: \(error)")
    }
}

Check a reader's current status before recording:

switch reader.authorizationStatus {
case .authorized:
    reader.startRecording()
case .denied:
    // User declined -- direct to Settings > Privacy > Research Sensor & Usage Data
    break
case .notDetermined:
    // Request authorization first
    break
@unknown default:
    break
}

Monitor status changes through the delegate:

func sensorReader(_ reader: SRSensorReader, didChange authorizationStatus: SRAuthorizationStatus) {
    switch authorizationStatus {
    case .authorized:
        reader.startRecording()
    case .denied:
        reader.stopRecording()
    default:
        break
    }
}

Available Sensors

Device Sensors

SensorTypeSample Type
.deviceUsageReportDevice usageSRDeviceUsageReport
.keyboardMetricsKeyboard activitySRKeyboardMetrics
.onWristStateWatch wrist stateSRWristDetection

App Activity Sensors

SensorTypeSample Type
.messagesUsageReportMessages app usageSRMessagesUsageReport
.phoneUsageReportPhone call usageSRPhoneUsageReport

User Activity Sensors

SensorTypeSample Type
.accelerometerAcceleration dataCMAccelerometerData
.rotationRateRotation rateCMGyroData
.pedometerDataStep/distance dataCMPedometerData
.visitsVisited locationsSRVisit
.mediaEventsMedia interactionsSRMediaEvent
.faceMetricsFace expressionsSRFaceMetrics
.heartRateHeart rateHeart rate data
.odometerSpeed/slopeOdometer data
.siriSpeechMetricsSiri speechSRSpeechMetrics
.telephonySpeechMetricsPhone speechSRSpeechMetrics
.wristTemperatureWrist temp (sleep)SRWristTemperatureSession
.photoplethysmogramPPG streamSRPhotoplethysmogramSample
.electrocardiogramECG streamSRElectrocardiogramSample

Environment Sensors

SensorTypeSample Type
.ambientLightSensorAmbient lightSRAmbientLightSample
.ambientPressurePressure/tempPressure data

SRSensorReader

SRSensorReader is the central class for accessing sensor data. Each instance reads from a single sensor.

import SensorKit

// Create a reader for one sensor
let lightReader = SRSensorReader(sensor: .ambientLightSensor)
let keyboardReader = SRSensorReader(sensor: .keyboardMetrics)

// Assign delegate to receive callbacks
lightReader.delegate = self
keyboardReader.delegate = self

The reader communicates entirely through SRSensorReaderDelegate:

Delegate MethodPurpose
sensorReader(_:didChange:)Authorization status changed
sensorReaderWillStartRecording(_:)Recording is about to start
sensorReader(_:startRecordingFailedWithError:)Recording failed to start
sensorReaderDidStopRecording(_:)Recording stopped
sensorReader(_:didFetch:)Devices fetched
sensorReader(_:fetching:didFetchResult:)Sample received
sensorReader(_:didCompleteFetch:)Fetch completed
sensorReader(_:fetching:failedWithError:)Fetch failed

Recording and Fetching Data

Start and Stop Recording

// Begin recording -- sensor stays active as long as any app has a stake
reader.startRecording()

// Stop recording -- framework deactivates the sensor when
// no app or system process is using it
reader.stopRecording()

Fetch Data

Build an SRFetchRequest with a time range and target device, then pass it to the reader:

let request = SRFetchRequest()
request.device = SRDevice.current
request.from = SRAbsoluteTime(CFAbsoluteTimeGetCurrent() - 86400 * 2)  // 2 days ago
request.to = SRAbsoluteTime.current()

reader.fetch(request)

Receive results through the delegate:

func sensorReader(
    _ reader: SRSensorReader,
    fetching request: SRFetchRequest,
    didFetchResult result: SRFetchResult<AnyObject>
) -> Bool {
    let timestamp = result.timestamp

    switch reader.sensor {
    case .ambientLightSensor:
        if let sample = result.sample as? SRAmbientLightSample {
            let lux = sample.lux
            let chromaticity = sample.chromaticity
            let placement = sample.placement
            processSample(lux: lux, chromaticity: chromaticity, at: timestamp)
        }
    case .keyboardMetrics:
        if let sample = result.sample as? SRKeyboardMetrics {
            let words = sample.totalWords
            let speed = sample.typingSpeed
            processKeyboard(words: words, speed: speed, at: timestamp)
        }
    case .deviceUsageReport:
        if let sample = result.sample as? SRDeviceUsageReport {
            let wakes = sample.totalScreenWakes
            let unlocks = sample.totalUnlocks
            processUsage(wakes: wakes, unlocks: unlocks, at: timestamp)
        }
    default:
        break
    }

    return true  // Return true to continue receiving results
}

func sensorReader(_ reader: SRSensorReader, didCompleteFetch request: SRFetchRequest) {
    print("Fetch complete for \(reader.sensor)")
}

func sensorReader(
    _ reader: SRSensorReader,
    fetching request: SRFetchRequest,
    failedWithError error: any Error
) {
    print("Fetch failed: \(error)")
}

Data Holding Period

SensorKit imposes a 24-hour holding period on newly recorded data. Fetch requests whose time range overlaps this period return no results. Design data collection workflows around this delay.

SRDevice

SRDevice identifies the hardware source for sensor samples. Use it to distinguish data from iPhone versus Apple Watch.

// Get the current device
let currentDevice = SRDevice.current
print("Model: \(currentDevice.model)")
print("System: \(currentDevice.systemName) \(currentDevice.systemVersion)")

// Fetch all available devices for a sensor
reader.fetchDevices()

Handle fetched devices through the delegate:

func sensorReader(_ reader: SRSensorReader, didFetch devices: [SRDevice]) {
    for device in devices {
        let request = SRFetchRequest()
        request.device = device
        request.from = SRAbsoluteTime(CFAbsoluteTimeGetCurrent() - 86400)
        request.to = SRAbsoluteTime.current()
        reader.fetch(request)
    }
}

func sensorReader(_ reader: SRSensorReader, fetchDevicesDidFailWithError error: any Error) {
    print("Failed to fetch devices: \(error)")
}

SRDevice Properties

PropertyTypeDescription
modelStringUser-defined device name
nameStringFramework-defined device name
systemNameStringOS name (iOS, watchOS)
systemVersionStringOS version
productTypeStringHardware identifier
currentSRDeviceClass property for the running device

Common Mistakes

DON'T: Attempt to use SensorKit without the entitlement

// WRONG -- fails at runtime with SRError.invalidEntitlement
let reader = SRSensorReader(sensor: .ambientLightSensor)
reader.startRecording()

// CORRECT -- obtain entitlement from Apple first, configure manual
// provisioning profile, then use SensorKit

DON'T: Expect immediate data access

// WRONG -- fetching data recorded moments ago returns nothing
reader.startRecording()
// ... record for a few minutes ...
let request = SRFetchRequest()
request.from = SRAbsoluteTime(CFAbsoluteTimeGetCurrent() - 300)
request.to = SRAbsoluteTime.current()
reader.fetch(request)  // Empty results due to 24-hour hold

// CORRECT -- fetch data that is at least 24 hours old
request.from = SRAbsoluteTime(CFAbsoluteTimeGetCurrent() - 86400 * 3)
request.to = SRAbsoluteTime(CFAbsoluteTimeGetCurrent() - 86400)
reader.fetch(request)

DON'T: Forget to set the delegate before fetching

// WRONG -- no delegate means no callbacks, results are silently lost
let reader = SRSensorReader(sensor: .accelerometer)
reader.startRecording()
reader.fetch(request)

// CORRECT -- assign delegate first
reader.delegate = self
reader.startRecording()
reader.fetch(request)

DON'T: Skip per-sensor Info.plist usage detail

// WRONG -- missing NSSensorKitUsageDetail for the sensor
// Authorization sheet shows no explanation, user is less likely to approve

// CORRECT -- add usage detail for every sensor you request
// See Info.plist Configuration section above

DON'T: Ignore SRError codes

// WRONG -- generic error handling
func sensorReader(_ reader: SRSensorReader, fetching: SRFetchRequest, failedWithError error: any Error) {
    print("Error")
}

// CORRECT -- handle specific error codes
func sensorReader(_ reader: SRSensorReader, fetching: SRFetchRequest, failedWithError error: any Error) {
    if let srError = error as? SRError {
        switch srError.code {
        case .invalidEntitlement:
            // Entitlement missing or sensor not in entitlement array
            break
        case .noAuthorization:
            // User has not authorized this sensor
            break
        case .dataInaccessible:
            // Data in 24-hour holding period or otherwise unavailable
            break
        case .fetchRequestInvalid:
            // Invalid time range or device
            break
        case .promptDeclined:
            // User declined the authorization prompt
            break
        @unknown default:
            break
        }
    }
}

Review Checklist

  • Apple-approved research study in place before development
  • com.apple.developer.sensorkit.reader.allow entitlement lists only needed sensors
  • Manual provisioning profile with explicit App ID and SensorKit capability
  • NSSensorKitUsageDescription in Info.plist with clear study purpose
  • NSSensorKitPrivacyPolicyURL in Info.plist with valid privacy policy URL
  • NSSensorKitUsageDetail entries for every requested sensor
  • Required key set appropriately for essential vs. optional sensors
  • Authorization requested before recording, status checked before fetching
  • Delegate assigned before calling startRecording() or fetch(_:)
  • Fetch request time ranges account for 24-hour data holding period
  • SRError codes handled in all failure delegate methods
  • fetchDevices() used to discover available devices before fetching
  • stopRecording() called when data collection is complete
  • sensorReader(_:fetching:didFetchResult:) returns true to continue or false to stop

References

平台分布

Codex

35.49%
按下载量换算1,717

Claude

31.81%
按下载量换算1,539

Cursor

18.32%
按下载量换算887

Gemini CLI

9.97%
按下载量换算482

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills