ios-on-device-intelligence
Design, build, evaluate, or review Apple on-device intelligence features — Foundation Models, Vision, Core ML, Speech, Translation, Natural Language, Sound Analysis, and App Intents — with explicit availability, typed and validated output, privacy boundaries, review before side effects, and device evaluation. Use when a feature generates, extracts, classifies, transcribes, translates, or acts on user content with an Apple model or framework.
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ios-on-device-intelligence
- description
- Design, build, evaluate, or review Apple on-device intelligence features — Foundation Models, Vision, Core ML, Speech, Translation, Natural Language, Sound Analysis, and App Intents — with explicit availability, typed and validated output, privacy boundaries, review before side effects, and device evaluation. Use when a feature generates, extracts, classifies, transcribes, translates, or acts on user content with an Apple model or framework.
- allowed-tools
- Read, Grep, Glob, Edit, Write, Bash
- last_verified
- 1787097600000
02 资源文件 1
- 参考文档references/details.md7.9 KB
03 SKILL.md 正文
iOS On-Device Intelligence
Overview
Use this skill to choose the narrowest intelligence route and keep availability, privacy, model output, deterministic validation, review, fallback, evaluation, and physical-device evidence explicit.
authorized source -> bounded input -> available model/asset -> cancellable proposal -> validation/provenance -> review/authorization -> durable result or side effect
Read before acting
- Inspect the actual Xcode targets, deployment target, device family, model resources, language assets, entitlements, usage descriptions, persistence, network/server routes, and current AI adapter.
- Read the AI route selector, Foundation Models mental model, privacy/availability/fallback guidance, availability/proof matrix, and evaluation/safety/fallback recipe.
- This skill owns the model, its availability, and its output. When live capture, media import, or audio sessions feed the model, pair it with ios-media-and-inputs for the capture lifecycle.
- Refresh the official Apple pages listed in
references/details.md(last checked August 2026) before relying on model availability, device/region/language behavior, API spelling, output safety, tool calling, context limits, or privacy claims.
Route workflow
- State the user outcome and decide whether a model is necessary. Use deterministic code for calculations, parsing, validation, routing, permissions, sorting, and safety rules; use a model only when ambiguity or learned perception/language is the value.
- Choose the narrowest route: Foundation Models for bounded language generation/extraction; Vision for system observations; Core ML for a packaged custom model; Speech for the exact transcription route; Translation for supported language pairs; Natural Language for deterministic text analysis; Sound Analysis for bounded audio classification; App Intents for system-discoverable actions.
- Record the route matrix: target SDK, OS/device eligibility, Apple Intelligence/model state, model/resource version, locale/language asset, permission, input sensitivity/retention, server or Private Cloud Compute boundary, expected uncertainty, and manual/deterministic fallback.
- Model availability as state, not a Boolean: available, not eligible, disabled, model/asset not ready, unsupported language, permission denied, context exceeded, guardrail refusal, cancelled, input failure, service error, and retry/manual route.
- Keep trusted instructions separate from user or external content. Bound input size, duration, image/audio dimensions, context, tool arguments, and concurrency. Version prompts, schemas, model revisions, preprocessing, and evaluation fixtures.
- Prefer typed/guided output for structured proposals. Validate every field, enum, range, identifier, source reference, confidence/quality value, and authorization before it can affect domain state, export, messaging, payment, health data, or an irreversible action.
- Keep tools narrow and app-owned. Prefer read-only tools; for mutation require deterministic authorization, validation, idempotence, timeout/error handling, audit/provenance, and explicit user confirmation. The model never becomes the authority for permissions or side effects.
- Store generated drafts, observations, predictions, transcripts, translations, and classifications separately from trusted domain truth. Show source context/uncertainty when it matters, allow edit/reject/retry, redact logs, and define raw-input/output retention and deletion.
- Evaluate representative, empty, oversized, multilingual, adversarial, safety-sensitive, low-quality, and stale-input fixtures. Record quality, abstention/refusal, correction rate, latency, memory, battery, thermal state, dropped inputs, and device/OS/model configuration.
- Verify the actual physical device and target language/model configuration for any claim that depends on Apple Intelligence availability, camera/microphone/sensor behavior, on-device performance, or system-surface invocation. A simulator, mock, preview, or successful compile is narrower evidence.
Fast path
Establish a deterministic baseline before tuning a model. Compare a representative fixture set covering valid output, malformed output, refusal, missing context, and oversized context, and promote only fields that pass schema, safety, and human-review gates. Expand the fixture set only when a failure reveals a new risk class.
Evaluation and safety contract
For each evaluation record:
- route/framework/API and source URL;
- target SDK, OS/build, device family, region/language, Apple Intelligence/model/asset state, and model/prompt/schema version;
- input source, redaction/minimization, maximum size, retention, and consent/permission state;
- expected behavior, fixture class, output type, quality/correction/abstention metric, latency, memory, battery, and thermal observations;
- validation/review/commit rule, fallback, and unresolved risks.
Re-run representative prompts/fixtures after OS, SDK, model, language, prompt, schema, preprocessing, or tool changes. Test prompt-injection-like content when user or web content enters the context. Apple guardrails are a base layer; add app-specific domain, audience, privacy, and harm validation.
Non-negotiable safety and evidence rules
- Never present generated text, OCR, classification, translation, transcription, sound analysis, or model output as medical/legal/financial truth, identity, authenticity, guaranteed accuracy, or authorization without domain validation and appropriate human review.
- Never claim “on-device,” “private,” “real-time,” “supported,” “accurate,” or “safe” from an imported framework, model response, simulator, preview, mock, one prompt, one language, one device, or successful compile.
- Keep source permission, model availability, input availability, output quality, domain validation, and side-effect authorization separate. A model that is ready can still return an unusable or unsafe proposal.
- Do not send sensitive prompts, audio, images, health/personal data, or model output remotely or retain raw inputs beyond the stated feature. Do not add broad permissions, analytics, telemetry, accounts, or servers merely to make an AI demo work.
- Cancel and clean up model sessions, capture, inference, translation, transcription, tool calls, and background tasks when the feature ends. Ignore stale results so an older proposal cannot overwrite newer user state.
Per-framework boundaries, deliverable, change boundary, and sources: references/details.md.
04 同仓库更多 Skills
no-description
暂无简介
good-skill
Fixture skill that satisfies every rule.
broken-link
Links to a reference file that does not exist.
Bad_Name
Name violates the kebab-case rule and does not match the directory.
skill-authoring
Write, review, and validate portable agent skills in SKILL.md format. Use when creating a new skill, editing an existing one, or asked whether a skill follows the Agent Skills spec.
weigh-bags
Record scale readings for each bag — empty (tare), outbound, current, final — and reconcile them against the itemised inventory to find unaccounted weight. Use when the user gives a bag weight, says how heavy something is, weighs their luggage, or asks how close to the limit they are. Appends to bags.yaml and runs scripts/reconcile.py.