MCPInstall

foundation-models

Use when implementing on-device AI with Apple's Foundation Models framework (iOS 26+), building summarization/extraction/classification features, or using @Generable for type-safe structured output.

Installs
152
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/johnrogers/claude-swift-engineering --skill foundation-models
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads foundation-models automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Foundation Models

Apple's on-device AI framework providing access to a 3B parameter language model for summarization, extraction, classification, and content generation. Runs entirely on-device with no network required.

Overview

Foundation Models enable intelligent text processing directly on device without server round-trips, user data sharing, or network dependencies. The core principle: leverage on-device AI for specific, contained tasks (not for general knowledge).

Reference Loading Guide

ALWAYS load reference files if there is even a small chance the content may be required. It's better to have the context than to miss a pattern or make a mistake.

ReferenceLoad When
Getting StartedSetting up LanguageModelSession, checking availability, basic prompts
Structured OutputUsing @Generable for type-safe responses, @Guide constraints
Tool CallingIntegrating external data (weather, contacts, MapKit) via Tool protocol
StreamingAsyncSequence for progressive UI updates, PartiallyGenerated types
TroubleshootingContext overflow, guardrails, errors, anti-patterns

Core Workflow

  1. Check availability with SystemLanguageModel.default.availability
  2. Create LanguageModelSession with optional instructions
  3. Choose output type: plain String or @Generable struct
  4. Use streaming for long generations (>1 second)
  5. Handle errors: context overflow, guardrails, unsupported language

Model Capabilities

Use CaseFoundation Models?Alternative
SummarizationYes-
Extraction (key info)Yes-
ClassificationYes-
Content taggingYes (built-in adapter)-
World knowledgeNoChatGPT, Claude, Gemini
Complex reasoningNoServer LLMs

Platform Requirements

  • iOS 26+, macOS 26+, iPadOS 26+, visionOS 26+
  • Apple Intelligence-enabled device (iPhone 15 Pro+, M1+ iPad/Mac)
  • User opted into Apple Intelligence

Common Mistakes

  1. Using Foundation Models for world knowledge — The 3B model is trained for on-device tasks only. It won't know current events, specific facts, or "who is X". Use ChatGPT/Claude for that. Keep prompts to: summarizing user's own content, extracting info, classifying text.

  2. Blocking the main thread — LanguageModelSession calls must run on a background thread or async context. Blocking the main thread locks UI. Always use Task { } or background queue.

  3. Ignoring context overflow — The model has finite context. If the user pastes a 50KB document, it will fail silently or truncate. Check input length and trim/truncate proactively.

  4. Forgetting to check availability — Not all devices support Foundation Models. Check SystemLanguageModel.default.availability before using. Graceful degradation is required.

  5. Ignoring guardrails — The model won't answer harmful queries. Instead of fighting it, design prompts that respect safety guidelines. Rephrasing requests usually works.

FAQ

What does the foundation-models skill do?

Use when implementing on-device AI with Apple's Foundation Models framework (iOS 26+), building summarization/extraction/classification features, or using @Generable for type-safe structured output.

How do I install foundation-models?

Run npx skills add https://github.com/johnrogers/claude-swift-engineering --skill foundation-models in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/foundation-models/ (personal) or .claude/skills/foundation-models/ (project).

Which AI agents can use foundation-models?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is foundation-models safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains foundation-models?

It is published by johnrogers in johnrogers/claude-swift-engineering. It has 152 recorded installs.

More from johnrogers/claude-swift-engineering

View all →

swift-style

johnrogers/claude-swift-engineering

Swift code style conventions for clean, readable code. Use when writing Swift code to ensure consistent formatting, naming, organization, and idiomatic patterns.

Mobile1.5K installs

ios-hig

johnrogers/claude-swift-engineering

Open the skill to read its SKILL.md instructions.

Mobile267 installs

swiftui-patterns

johnrogers/claude-swift-engineering

Use when implementing iOS 17+ SwiftUI patterns: @Observable/@Bindable, MVVM architecture, NavigationStack, lazy loading, UIKit interop, accessibility (VoiceOver/Dynamic Type), async operations (.task/.refreshable), or migrating from ObservableObject/@StateObject.

Mobile258 installs

ios-26-platform

johnrogers/claude-swift-engineering

Use when implementing iOS 26 features (Liquid Glass, new SwiftUI APIs, WebView, Chart3D), deploying iOS 26+ apps, or supporting backward compatibility with iOS 17/18.

Mobile242 installs

composable-architecture

johnrogers/claude-swift-engineering

Use when building features with TCA (The Composable Architecture), structuring reducers, managing state, handling effects, navigation, or testing TCA features. Covers @Reducer, Store, Effect, TestStore, reducer composition, and TCA patterns.

swift-testing

johnrogers/claude-swift-engineering

Use when writing tests with Swift Testing (@Test,

Testing & QA205 installs

Popular mobile skills

View category →

design-mobile-apps

designed-by-ai/skills

Design mobile app screens with Sleek, edit Sleek projects, and implement their designs in React Native or HTML.

Mobile1.1M installs

ios-design

uizze.sh

Design and review iOS UI/UX for iPhone apps in SwiftUI, UIKit, or React Native. Use for mobile app design, screen redesigns, navigation flows, typography, forms, keyboard and safe-area layout, and accessibility checks. Apply Apple Human Interface Guidelines and consult real product references through the optional Uizze connection.

Mobile416.5K installs

vercel-react-native-skills

vercel-labs/agent-skills

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

OfficialMobile256.7K installs

animate-expo

emilkowalski/skills

Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web animation use animate.

Mobile140.1K installs

xcode-project-setup

firebase/agent-skills

Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).

OfficialMobile131.2K installs

firebase-remote-config-basics

firebase/agent-skills

Manages Firebase Remote Config templates, feature flags, loading strategies, and SDKs (Android, iOS). Use when downloading/deploying remoteconfig JSON templates, managing version history/feature flags, setting in-app defaults, fetchAndActivate(), real-time listeners, or SDK setup. Don't use for Firebase Hosting, Auth, Firestore, Data Connect, Crashlytics, or App Hosting.

OfficialMobile121.7K installs