Token导航 LogoToken导航

Agent Skill · 研究检索

core-ml(核心毫升)

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

core-ml 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 33,574。

总安装 2,328周安装 99GitHub Stars 227下载 816核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/rshankras/claude-code-apple-skills --skill core-ml

这个 Skill 是做什么的

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

整合 Core ML、Vision 与自然语言框架,助力 Apple 平台 AI 功能开发。适用于图像识别、文本分析与机器学习模型部署场景。提供模型导入、预处理与 on-device 推理的完整流程指导。

安装方式:GitHub,命令为 npx skills add https://github.com/rshankras/claude-code-apple-skills --skill core-ml。core-ml 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/core-ml

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

core-ml 怎么安装?

在终端执行 npx skills add https://github.com/rshankras/claude-code-apple-skills --skill core-ml。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

core-ml 支持哪些 AI 工具?

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

core-ml 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

core-ml 是免费的吗?

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

core-ml 用的人多吗?

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

core-ml 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

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

值得选的地方

  • 同时适配 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调用外部服务未明确有提醒
core-ml

核心毫升 · 本页

2,328227只读未明确有提醒

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

SKILL.md 原文

Core ML Skills

Combined advisory, generator, and workflow skill for integrating machine learning into Apple platform apps. Covers Core ML model integration, Vision framework image analysis, NaturalLanguage framework text processing, Create ML training, and on-device model optimization.

When This Skill Activates

Use this skill when the user:

  • Wants to add ML capabilities to their app
  • Needs to integrate a Core ML model (.mlmodel) into an Xcode project
  • Wants to use the Vision framework for image analysis (faces, text recognition, body pose, object detection)
  • Wants to use the NaturalLanguage framework for text processing (sentiment, entities, language detection)
  • Needs to train a custom model with Create ML
  • Wants to optimize a model for on-device use (quantization, pruning, palettization)
  • Needs to choose between Core ML and Foundation Models (Apple Intelligence)
  • Asks about image classification, object detection, sound classification, or tabular data prediction
  • Wants real-time camera + ML processing

Decision Guide: Core ML vs Foundation Models

Before generating code, determine which framework is appropriate.

Use Foundation Models (Apple Intelligence) When:

  • You need general-purpose text generation, summarization, or conversational AI
  • Target is iOS 26+ / macOS 26+ (Foundation Models requires Apple Silicon + latest OS)
  • The task is open-ended language understanding or generation
  • You want @Generable structured output from natural language
  • See apple-intelligence/foundation-models/ skill for implementation

Use Core ML When:

  • You need specialized ML: image classification, object detection, sound classification, custom regression/classification
  • You have a trained model (.mlmodel,.mlpackage) or plan to train one
  • You need broad device support (iOS 14+ / macOS 11+)
  • The task requires domain-specific predictions (medical imaging, product recognition, custom NLP)
  • Performance-critical inference on Neural Engine or GPU

Use Vision Framework When (No Custom Model Needed):

  • Image classification using Apple's built-in models
  • Face detection and facial landmark analysis
  • Text recognition (OCR) with VNRecognizeTextRequest
  • Body and hand pose detection
  • Barcode and QR code scanning
  • Image similarity and saliency detection
  • Horizon detection, rectangle detection

Use NaturalLanguage Framework When (No Custom Model Needed):

  • Sentiment analysis on text
  • Language identification
  • Tokenization (word, sentence, paragraph boundaries)
  • Named entity recognition (people, places, organizations)
  • Word and sentence embeddings for similarity comparison
  • Lemmatization and part-of-speech tagging

Pre-Generation Checks

1. Project Context Detection

  • Check deployment target (Core ML requires iOS 11+ / macOS 10.13+; Vision requires iOS 11+; NaturalLanguage requires iOS 12+)
  • Check for existing ML code or models
  • Identify project structure and source file locations
  • Determine if SwiftUI or UIKit/AppKit

2. Conflict Detection

Search for existing ML integration:

Glob: **/*Model*.swift, **/*Classifier*.swift, **/*Predictor*.swift, **/*.mlmodel, **/*.mlmodelc, **/*.mlpackage
Grep: "import CoreML" or "import Vision" or "import NaturalLanguage"

If found, ask user:

  • Extend existing ML setup?
  • Replace with new implementation?
  • Add additional model/capability?

Configuration Questions

Ask user via AskUserQuestion:

  1. What ML capability do you need?

- Image classification (identify objects in photos) - Object detection (locate objects with bounding boxes) - Text analysis (sentiment, entities, language) - Custom Core ML model integration - Vision framework (OCR, faces, poses) - Sound classification - Tabular data prediction

  1. Do you have a trained model, or need to train one?

- I have a.mlmodel /.mlpackage file - I want to train with Create ML - I want to use Apple's built-in models (Vision / NaturalLanguage)

  1. Performance requirements?

- Real-time (camera feed, < 33ms per prediction) - Interactive (user-initiated, < 500ms acceptable) - Background processing (batch, latency not critical)

Core ML Model Integration

Adding a Model to Xcode

  1. Drag .mlmodel or .mlpackage into Xcode project navigator
  2. Xcode auto-generates a Swift class with the model name
  3. The generated class provides type-safe input/output interfaces
  4. Xcode compiles to .mlmodelc at build time (optimized for device)

Loading Models

// Option 1: Auto-generated class (simplest)
let model = try MyImageClassifier(configuration: MLModelConfiguration())

// Option 2: Generic MLModel loading (flexible)
let url = Bundle.main.url(forResource: "MyModel", withExtension: "mlmodelc")!
let config = MLModelConfiguration()
config.computeUnits = .all  // CPU + GPU + Neural Engine
let model = try MLModel(contentsOf: url, configuration: config)

// Option 3: Async loading (recommended for large models)
let model = try await MLModel.load(contentsOf: url, configuration: config)

Making Predictions

// Type-safe prediction with auto-generated class
let input = MyImageClassifierInput(image: pixelBuffer)
let output = try model.prediction(input: input)
print(output.classLabel)       // "cat"
print(output.classLabelProbs)  // ["cat": 0.95, "dog": 0.04, ...]

// Batch predictions
let batch = MLArrayBatchProvider(array: inputs)
let results = try model.predictions(from: batch)

Create ML Training Overview

Image Classification

  • Minimum: 10 images per category; Recommended: 40+ per category
  • Organize images in folders named by category
  • Supports JPEG, PNG, HEIC formats
  • Data augmentation applied automatically (rotation, flip, crop)
  • Transfer learning from Apple's base models

Text Classification

  • Training data: text samples with labels (CSV or JSON)
  • Use cases: sentiment analysis, spam detection, topic classification, intent recognition
  • Minimum 10 samples per class; 100+ recommended for accuracy

Tabular Classification / Regression

  • Structured data in CSV or JSON
  • Automatic feature engineering
  • Supports: Boosted Tree, Random Forest, Linear Regression, Decision Tree

Sound Classification

  • Audio files organized by category
  • Environmental sounds, speech detection, music genre
  • Minimum 10 samples per category at 15+ seconds each

Object Detection

  • Images with bounding box annotations (JSON format)
  • Outputs bounding boxes + class labels + confidence
  • Minimum 30 annotated images per class; 300+ recommended

Training Approach

  • Xcode Create ML App: Visual interface, drag-and-drop, no code required
  • CreateML Framework: Programmatic training in Swift Playgrounds or macOS apps
  • coremltools (Python): Convert models from TensorFlow, PyTorch, ONNX to Core ML format

Vision Framework Capabilities

CapabilityRequest ClassCustom Model Needed?
Image classificationVNClassifyImageRequestNo (built-in)
Object detectionVNDetectObjectsRequest (custom model)Yes
Face detectionVNDetectFaceRectanglesRequestNo
Face landmarksVNDetectFaceLandmarksRequestNo
Text recognition (OCR)VNRecognizeTextRequestNo
Body poseVNDetectHumanBodyPoseRequestNo
Hand poseVNDetectHumanHandPoseRequestNo
Barcode detectionVNDetectBarcodesRequestNo
Image saliencyVNGenerateAttentionBasedSaliencyImageRequestNo
Horizon detectionVNDetectHorizonRequestNo
Rectangle detectionVNDetectRectanglesRequestNo
Image similarityVNGenerateImageFeaturePrintRequestNo

Vision Request Pipeline

// Multiple requests on the same image
let handler = VNImageRequestHandler(cgImage: cgImage, options: [:])
try handler.perform([
    textRequest,     // OCR
    faceRequest,     // Face detection
    barcodeRequest   // Barcode scanning
])
// Each request's results are populated independently

NaturalLanguage Framework

Sentiment Analysis

Returns a score from -1.0 (negative) to +1.0 (positive):

let tagger = NLTagger(tagSchemes: [.sentimentScore])
tagger.string = "This app is amazing!"
let (tag, _) = tagger.tag(at: text.startIndex, unit: .paragraph, scheme: .sentimentScore)
// tag?.rawValue == "0.9" (positive)

Language Detection

let language = NLLanguageRecognizer.dominantLanguage(for: "Bonjour le monde")
// language == .french

Tokenization

let tokenizer = NLTokenizer(unit: .word)
tokenizer.string = "Hello, world!"
tokenizer.enumerateTokens(in: text.startIndex..<text.endIndex) { range, _ in
    print(text[range])  // "Hello" then "world"
    return true
}

Named Entity Recognition

let tagger = NLTagger(tagSchemes: [.nameType])
tagger.string = "Tim Cook visited Apple Park in Cupertino."
tagger.enumerateTags(in: text.startIndex..<text.endIndex, unit: .word, scheme: .nameType) { tag, range in
    if let tag, tag != .other {
        print("\(text[range]): \(tag.rawValue)")
        // "Tim": PersonalName, "Cook": PersonalName
        // "Apple Park": OrganizationName, "Cupertino": PlaceName
    }
    return true
}

Model Optimization

Quantization (coremltools Python)

Reduces model size by lowering numerical precision:

  • Float32 to Float16: ~50% size reduction, minimal accuracy loss
  • Float16 to Int8: ~50% further reduction, test accuracy carefully
import coremltools as ct
from coremltools.models.neural_network import quantization_utils

model = ct.models.MLModel("MyModel.mlmodel")

# Float16 quantization (safe default)
model_fp16 = quantization_utils.quantize_weights(model, nbits=16)
model_fp16.save("MyModel_fp16.mlmodel")

# Int8 quantization (aggressive, test accuracy)
model_int8 = quantization_utils.quantize_weights(model, nbits=8)
model_int8.save("MyModel_int8.mlmodel")

Palettization

Reduces unique weight values using k-means clustering:

from coremltools.optimize.coreml import palettize_weights, OpPalettizerConfig

config = OpPalettizerConfig(nbits=4)  # 16 unique values per tensor
model_palettized = palettize_weights(model, config)

Pruning

Removes near-zero weights (sparse model):

from coremltools.optimize.torch.pruning import MagnitudePruner, MagnitudePrunerConfig

config = MagnitudePrunerConfig(target_sparsity=0.75)  # Remove 75% of weights
pruner = MagnitudePruner(model, config)

Optimization Guidelines

  • Always benchmark accuracy after optimization
  • Start with Float16 (safest, best effort-to-reward ratio)
  • Test on target device (Neural Engine behavior differs from GPU)
  • Profile with Xcode Instruments > Core ML Performance

Performance Patterns

Compute Unit Selection

let config = MLModelConfiguration()

// Best performance — let system choose CPU, GPU, or Neural Engine
config.computeUnits = .all

// CPU only — predictable latency, no GPU/NE contention
config.computeUnits = .cpuOnly

// CPU + Neural Engine — good balance, avoids GPU contention with UI
config.computeUnits = .cpuAndNeuralEngine

// CPU + GPU — when Neural Engine unavailable
config.computeUnits = .cpuAndGPU

Async Prediction for UI Responsiveness

func classify(_ image: UIImage) async throws -> String {
    let model = try await MLModelManager.shared.model(named: "Classifier")
    // Prediction runs off main thread via structured concurrency
    let input = try MLDictionaryFeatureProvider(dictionary: ["image": image.pixelBuffer!])
    let result = try await Task.detached {
        try model.prediction(from: input)
    }.value
    return result.featureValue(for: "classLabel")?.stringValue ?? "unknown"
}

Batch Processing

// Process multiple images efficiently
let inputs = images.map { MyModelInput(image: $0.pixelBuffer!) }
let batch = MLArrayBatchProvider(array: inputs)
let results = try model.predictions(from: batch)

for i in 0..<results.count {
    let output = results.features(at: i)
    print(output.featureValue(for: "classLabel")?.stringValue ?? "")
}

Compile Model at Install Time

// Compile .mlmodel to .mlmodelc at install (not runtime)
// This is done automatically when you add .mlmodel to Xcode target
// For downloaded models, compile once and cache:
let compiledURL = try MLModel.compileModel(at: downloadedModelURL)
let permanentURL = appSupportDir.appendingPathComponent("MyModel.mlmodelc")
try FileManager.default.copyItem(at: compiledURL, to: permanentURL)

Generation Process

Step 1: Determine Capability

Based on user's answer to configuration questions, select the appropriate template(s) from templates.md.

Step 2: Generate Core Files

CapabilityFiles Generated
Any Core MLMLModelManager.swift
Image classificationImageClassifier.swift
Text analysisTextAnalyzer.swift
Vision requestsVisionService.swift
Custom modelModelConfig.swift + model-specific predictor
Camera + MLCameraMLPipeline.swift

Step 3: Determine File Location

Check project structure:

  • If Sources/ exists -> Sources/ML/
  • If App/Services/ exists -> App/Services/ML/
  • If App/ exists -> App/ML/
  • Otherwise -> ML/

Output Format

After generation, provide:

Files Created

ML/
├── MLModelManager.swift        # Central model lifecycle management
├── ImageClassifier.swift       # Vision-based image classification (if needed)
├── TextAnalyzer.swift          # NaturalLanguage wrapper (if needed)
├── ModelConfig.swift           # Compute unit configuration
└── VisionService.swift         # Vision request pipeline (if needed)

Integration Steps

  1. Add .mlmodel file to Xcode project (if using custom model)
  2. Import the generated ML service files
  3. Initialize the service in your app's dependency injection
  4. Call prediction methods from your views/view models
  5. Handle errors and display results

Testing

  • Use known test inputs with expected outputs
  • Verify confidence thresholds
  • Profile prediction latency on target device
  • Test graceful degradation when model unavailable

References

平台分布

Codex

38.4%
按下载量换算313

Claude

27.95%
按下载量换算228

Cursor

16.92%
按下载量换算138

Gemini CLI

10.09%
按下载量换算82

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

继续浏览同类 Skills