apple-foundation-models-skill

apple-foundation-models-skill is a skill for Claude Code from alessiorubicini/Apple-Foundation-Models-Agent-Skill. It costs 68 tokens per session (663 once invoked), scanned A, original, MIT.

A reference guide for Apple’s FoundationModels framework, the software interface used to add Apple’s on-device language-model features to iOS and macOS apps.

In plain words
What is it for?
Use it when building features such as generated text, structured results, tool calls, streaming responses, image attachments, or multi-step AI agents in Apple apps.
Why use it?
It helps developers find the relevant API guidance before writing or reviewing code, including guidance for newer beta APIs.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the apple-foundation-models plugin — 2 skills shipped together

Good fit Use it when building features such as generated text, structured results, tool calls, streaming responses, image attachments, or multi-step AI agents in Apple apps.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alessiorubicini/apple-foundation-models-agent-skill/apple-foundation-models-skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add alessiorubicini/Apple-Foundation-Models-Agent-Skill --skill apple-foundation-models-skill
Clone the repo
git clone --depth 1 https://github.com/alessiorubicini/Apple-Foundation-Models-Agent-Skill

Made for: Claude Code.

Or install apple-foundation-models, the plugin that ships this one along with the rest of its 2 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for apple-foundation-models-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/alessiorubicini/apple-foundation-models-agent-skill/apple-foundation-models-skill/github.svg)](https://agentmods.dev/skills/alessiorubicini/apple-foundation-models-agent-skill/apple-foundation-models-skill)
Your own site
<a href="https://agentmods.dev/skills/alessiorubicini/apple-foundation-models-agent-skill/apple-foundation-models-skill"><img src="https://agentmods.dev/badge/skills/alessiorubicini/apple-foundation-models-agent-skill/apple-foundation-models-skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for apple-foundation-models-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/alessiorubicini/apple-foundation-models-agent-skill/apple-foundation-models-skill"><img src="https://agentmods.dev/badge/skills/alessiorubicini/apple-foundation-models-agent-skill/apple-foundation-models-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 663 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.00663
Opus 5.5 $0.00027 $0.00265
Sonnet 5.5 $0.00014 $0.00133
Haiku 4.5 $0.00007 $0.00066

Measured 2mo ago against content hash 6bdbf7b06dd0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

apple-foundation-models-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

apple-foundation-models-skill/SKILL.md · 34 lines

How it starts

The opening of the file, as written. The whole thing — 34 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Apple Foundation Models Skill

Use this skill as a focused router for the public FoundationModels API. Preserve the request's deployment target and distinguish OS 26 APIs from OS 27 additions in code and explanations.

Workflow

  1. Confirm the target OS and toolchain. Keep OS 26 compatibility paths separate from APIs introduced in OS 27.
  2. Read references/_index.md, then load only the references required by the request. Do not load the entire reference set.
  3. Apply the shared requirements below before emitting code. Use the selected references for API signatures, examples, recovery behavior, and edge cases.
  4. Produce Swift 6 code. Mark OS 27-only code clearly and use availability guards where a project supports older releases.

Shared Requirements

  • Check SystemLanguageModel.availability or PrivateCloudComputeLanguageModel.availability before creating a session with that Apple-provided model. A custom LanguageModel must expose readiness through its own design.
  • Keep LanguageModelSession in @State or an actor-isolated owner; never create it as a local value in an event handler.
  • Wrap every respond call and every ResponseStream iteration in do/catch. On OS 27, distinguish LanguageModelError, model-specific errors, LanguageModelSession.Error, and LanguageModelSession.ToolCallError; use deprecated LanguageModelSession.GenerationError only for OS 26 compatibility.
  • Recover explicitly from context overflow: on OS 27, trim or replace the mutable transcript and retry, or create a new session; on OS 26, create a new session after .exceededContextWindowSize.
  • Use @Generable only on structs and enums. Match each @Guide constraint to the property's type.
  • Treat Tool.call(arguments:) as async throws; propagate failures instead of suppressing them with try?.
  • Run session work with structured concurrency. Do not block the main actor or use DispatchQueue.main.async as a substitute for isolation.
  • Call synchronous prewarm(promptPrefix:) during idle time, not immediately before generation.
  • Use SystemLanguageModel.contextSize and try await PrivateCloudComputeLanguageModel.contextSize rather than copying a token limit into control flow. Apple's on-device model documentation currently specifies a 4,096-token session context window.

Read the full file on GitHub · 34 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · -5 lines · -21 tokens per session 6bdbf7b06dd0
  2. 3mo ago First seen · 39 lines · 89 tokens per session scan A bb36d612928c

Subscribe to this mod's changes

apple-foundation-models-skill is a skill published in the GitHub repository alessiorubicini/Apple-Foundation-Models-Agent-Skill (16 stars, last pushed 2mo ago), licensed MIT. It adds 68 tokens to every session and 663 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

apple-foundation-models-skill compared with skills from other repositories

apple-foundation-models-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
apple-foundation-models-skillalessiorubicini/Apple-Foundation-Models-Agent-SkillSkill162mo agoMITA68Claude Code
apple-foundation-models-conversation-context-buildersambitcreate/Swift-Foundation-Models-SkillsSkill268mo agoMITA21Codex
apple-foundation-models-dynamic-schemassambitcreate/Swift-Foundation-Models-SkillsSkill268mo agoMITA20Codex
apple-foundation-models-error-recoverysambitcreate/Swift-Foundation-Models-SkillsSkill268mo agoMITA23Codex
apple-foundation-models-generation-tuningsambitcreate/Swift-Foundation-Models-SkillsSkill268mo agoMITA23Codex
apple-foundation-models-playground-learningsambitcreate/Swift-Foundation-Models-SkillsSkill268mo agoMITA19Codex
apple-foundation-models-session-patternssambitcreate/Swift-Foundation-Models-SkillsSkill268mo agoMITA23Codex