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.
npx skills add alessiorubicini/Apple-Foundation-Models-Agent-Skill --skill apple-foundation-models-skillgit clone --depth 1 https://github.com/alessiorubicini/Apple-Foundation-Models-Agent-SkillWrote 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.
[](https://agentmods.dev/skills/alessiorubicini/apple-foundation-models-agent-skill/apple-foundation-models-skill)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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
- Confirm the target OS and toolchain. Keep OS 26 compatibility paths separate from APIs introduced in OS 27.
- Read references/_index.md, then load only the references required by the request. Do not load the entire reference set.
- Apply the shared requirements below before emitting code. Use the selected references for API signatures, examples, recovery behavior, and edge cases.
- Produce Swift 6 code. Mark OS 27-only code clearly and use availability guards where a project supports older releases.
Shared Requirements
- Check
SystemLanguageModel.availabilityorPrivateCloudComputeLanguageModel.availabilitybefore creating a session with that Apple-provided model. A customLanguageModelmust expose readiness through its own design. - Keep
LanguageModelSessionin@Stateor an actor-isolated owner; never create it as a local value in an event handler. - Wrap every
respondcall and everyResponseStreamiteration indo/catch. On OS 27, distinguishLanguageModelError, model-specific errors,LanguageModelSession.Error, andLanguageModelSession.ToolCallError; use deprecatedLanguageModelSession.GenerationErroronly 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
@Generableonly on structs and enums. Match each@Guideconstraint to the property's type. - Treat
Tool.call(arguments:)asasync throws; propagate failures instead of suppressing them withtry?. - Run session work with structured concurrency. Do not block the main actor or use
DispatchQueue.main.asyncas a substitute for isolation. - Call synchronous
prewarm(promptPrefix:)during idle time, not immediately before generation. - Use
SystemLanguageModel.contextSizeandtry await PrivateCloudComputeLanguageModel.contextSizerather than copying a token limit into control flow. Apple's on-device model documentation currently specifies a 4,096-token session context window.
What ships with it
20 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/_index.md 2.6 KB
- references/concurrency.md 1.5 KB
- references/custom-language-model-provider.md 4.3 KB
- references/dynamic-profiles.md 6.5 KB
- references/error-handling.md 8.2 KB
- references/generation-options.md 4.9 KB
- references/glossary.md 2.9 KB
- references/guided-generation.md 5.5 KB
- references/os-27-api-changes.md 7.6 KB
- references/performance.md 4.8 KB
- references/private-cloud-compute.md 6.2 KB
- references/prompt-attachments.md 6.2 KB
- references/prompting-techniques.md 10 KB
- references/session-lifecycle.md 7.5 KB
- references/session-properties.md 3.4 KB
- references/streaming.md 6.2 KB
- references/symbol-index.md 107 KB
- references/system-language-model.md 4.3 KB
- references/tool-calling.md 6.7 KB
- references/transcripts.md 3.7 KB
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.
- 2mo ago Changed · -5 lines · -21 tokens per session 6bdbf7b06dd0
- 3mo ago First seen · 39 lines · 89 tokens per session scan A bb36d612928c
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.
apple-foundation-models-skill compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| apple-foundation-models-skillalessiorubicini/Apple-Foundation-Models-Agent-Skill | Skill | 16 | 2mo ago | MIT | A | 68 | Claude Code |
| apple-foundation-models-conversation-context-buildersambitcreate/Swift-Foundation-Models-Skills | Skill | 26 | 8mo ago | MIT | A | 21 | Codex |
| apple-foundation-models-dynamic-schemassambitcreate/Swift-Foundation-Models-Skills | Skill | 26 | 8mo ago | MIT | A | 20 | Codex |
| apple-foundation-models-error-recoverysambitcreate/Swift-Foundation-Models-Skills | Skill | 26 | 8mo ago | MIT | A | 23 | Codex |
| apple-foundation-models-generation-tuningsambitcreate/Swift-Foundation-Models-Skills | Skill | 26 | 8mo ago | MIT | A | 23 | Codex |
| apple-foundation-models-playground-learningsambitcreate/Swift-Foundation-Models-Skills | Skill | 26 | 8mo ago | MIT | A | 19 | Codex |
| apple-foundation-models-session-patternssambitcreate/Swift-Foundation-Models-Skills | Skill | 26 | 8mo ago | MIT | A | 23 | Codex |