
Foundation models
Guides an agent through building on-device LLM features with Apple's Foundation Models
Foundation models is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 924
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Foundation models
This skill gives a coding agent working knowledge of Apple's Foundation Models framework for iOS and macOS apps. It covers checking whether the on-device model is available, creating sessions with instructions, generating text, and producing typed Swift output with @Generable and @Guide constraints. It also walks through tool calling, snapshot streaming into SwiftUI, multi-turn conversations, and the iOS 27 error types that replace the older GenerationError.
The material focuses on working within the model's small context window and limited capabilities. It explains how to measure token usage with tokenUsage(for:), how to check whether a prompt fits before sending it, how to condense a transcript when context overflows, and how to choose sampling settings. It also includes prompt-writing patterns for summarization, extraction and classification, and a pre-ship checklist. Companion reference files cover safety guardrails, Private Cloud Compute and utilities.
The skill is written for Swift projects that target Apple platforms. It contains no scripts, and its frontmatter lists the tools it may use, including Read, Write, Edit, Glob, Grep, Bash and AskUserQuestion.
When your agent uses it
On-device LLM integration using Apple's Foundation Models framework. Use when implementing AI text generation, structured output, or tool calling.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Instructions only, no scripts(see the files on GitHub)
- Asks for: Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion(see the files on GitHub)
- License: MIT(see the files on GitHub)
From a static check of its 4 files (55 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the apple-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add rshankras/claude-code-apple-skills
/plugin install apple-skills@indie-apple-stackOr copy only this skill to ~/.claude/skills/foundation-models:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/foundation-models &&
cp -R "$tmp/skills/apple-intelligence/foundation-models" ~/.claude/skills/foundation-models &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/foundation-models inside it instead.
Copy the skill folder to ~/.agents/skills/foundation-models to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/foundation-models &&
cp -R "$tmp/skills/apple-intelligence/foundation-models" ~/.agents/skills/foundation-models &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/foundation-models inside it instead.
Copy the skill folder to ~/.cursor/skills/foundation-models to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/foundation-models &&
cp -R "$tmp/skills/apple-intelligence/foundation-models" ~/.cursor/skills/foundation-models &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/foundation-models inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/rshankras/claude-code-apple-skills.git --path skills/apple-intelligence/foundation-modelsOr copy the folder to ~/.gemini/skills/foundation-models yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/foundation-models:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/foundation-models &&
cp -R "$tmp/skills/apple-intelligence/foundation-models" ~/.copilot/skills/foundation-models &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/foundation-models inside it instead.
Get the folder:
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills.gitThen copy claude-code-apple-skills/skills/apple-intelligence/foundation-models into your agent's skills folder as foundation-models. Agents that support SKILL.md read one folder per skill.
What it does
- Model availability checks
- Covers how to test whether the on-device model is ready and how to show fallback UI on unsupported devices.
- Typed structured output
- Explains defining @Generable types with @Guide constraints so responses arrive as Swift values.
- Tool calling setup
- Describes defining tools the model can call, with naming rules and session-level tool handling.
- Token budget management
- Shows measuring instruction, tool and prompt token costs and checking prompts fit the context window.
- Streaming and sessions
- Covers streaming partial results into SwiftUI and reusing sessions for multi-turn chat.
- iOS 27 error migration
- Lists the new LanguageModelError and session error types and how they replace the deprecated GenerationError.
Good for
- Add a summarization feature to an iOS app using the on-device model
- Parse event details from free text into a typed Swift struct
- Build a chat assistant in SwiftUI that keeps conversation context
- Stream a generated response into a SwiftUI view as it arrives
- Check whether a long prompt fits the context window before sending it
- Classify support tickets into fixed categories with guided output
Foundation models FAQ
What does the skill need to be used?
It is aimed at Swift projects using Apple's Foundation Models framework, targeting iOS 27 and macOS 27 according to its frontmatter, with examples in Swift and SwiftUI.
What does the on-device model handle well?
The skill says the roughly 3B-parameter on-device model suits summarization, extraction, classification, tagging, revision and short chat, and not math, code generation, facts or world knowledge.
When does the skill activate?
It activates when the user wants AI text generation, structured data from natural language, prompting or LLM integration, agentic features, summarization or extraction, or questions about Private Cloud Compute and guardrails.
Does the skill include scripts?
No. The skill folder contains no scripts; it is instructions plus companion reference files.
How do I install Foundation models in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/foundation-models to use it in all your projects, or to .claude/skills/foundation-models in one project. Or install the apple-skills plugin, which includes it: /plugin marketplace add rshankras/claude-code-apple-skills, then /plugin install apple-skills@indie-apple-stack.
Does Foundation models run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Foundation models?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Foundation models?
The closest alternatives to Foundation models are Apple intelligence, Axiom audit foundation models, Core ML, Axiom AI and Axiom swift.
Where this comes from
- Description: from the skill's own SKILL.md.
More from rshankras/claude-code-apple-skills

Guides an agent through App Store listings, keywords, screenshots, reviews and marketing
- Open source
- 924 GitHub stars
- Marketing and SEO

Guides an iOS developer through AdAttributionKit ad measurement and postback testing
- Open source
- 924 GitHub stars
- Marketing and SEO

Drafts App Store descriptions, promo text and What's New notes for iOS apps
- Open source
- 924 GitHub stars
- Writing style

Plans Apple Search Ads campaigns for indie apps: keywords, bids, budgets and ROAS
- Open source
- 924 GitHub stars
- Marketing and SEO

Sets price and localized listing text for a one-time App Store in-app purchase
- Open source
- 924 GitHub stars
- Developer tools

Guides an agent through App Store title, subtitle and keyword optimization for Apple apps
- Open source
- 924 GitHub stars
- Marketing and SEO


