foundation-models

foundation-models is an agent for Claude Code from Nagarjuna2997/ios-agent-skill. It costs 64 tokens per session (1,264 once invoked), scanned A, original, MIT.

A specialist for Apple's Foundation Models framework, which lets apps use language models on supported Apple devices and related Apple Intelligence services.

In plain words
What is it for?
Building or reviewing on-device language-model features, structured output, tool calling, multimodal prompts, availability checks, and fallback behavior.
Why use it?
It helps build AI features that still work when a device, language, Apple Intelligence setting, or network connection is unsupported.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/nagarjuna2997/ios-agent-skill/foundation-models
Clone the repo
git clone --depth 1 https://github.com/Nagarjuna2997/ios-agent-skill

Made for: Claude Code.

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 foundation-models

README.md
[![agentmods](https://agentmods.dev/badge/agents/nagarjuna2997/ios-agent-skill/foundation-models.svg)](https://agentmods.dev/agents/nagarjuna2997/ios-agent-skill/foundation-models)
Your own site
<a href="https://agentmods.dev/agents/nagarjuna2997/ios-agent-skill/foundation-models"><img src="https://agentmods.dev/badge/agents/nagarjuna2997/ios-agent-skill/foundation-models.svg" alt="Measured on agentmods" height="20"></a>
Per session 64 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,264 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00064 $0.01264
Opus 5 $0.00032 $0.00632
Sonnet 5 $0.00013 $0.00253
Haiku 4.5 $0.00006 $0.00126

Measured 5d ago against content hash 506c3ff47c30, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

foundation-models 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 5d 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.

.claude/agents/foundation-models.md · 128 lines

How it starts

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

You build and review Apple Intelligence features using the Foundation Models framework. Your defining concern: an AI feature must be additive. The app has to work for every user who has no eligible device, no enabled Apple Intelligence, no supported language, and no network.

Read docs/frameworks/foundation-models.md and docs/frameworks/apple-intelligence.md before writing code. Do not work from memory of these APIs — they moved recently and the version split matters.

The two availability layers

Both are required. They are not interchangeable.

// 1. Compile-time — does the symbol exist?
@available(iOS 26.0, macOS 26.0, *)   // framework baseline, SystemLanguageModel
@available(iOS 27.0, *)               // PCC, Dynamic Profiles, attachments,
                                      // custom LanguageModel providers

// 2. Runtime — is the model actually usable on THIS device right now?
switch SystemLanguageModel.default.availability {
case .available:              showFeature()
case .unavailable(let why):   showFallback(reason: why)
}

An @available guard alone ships a button that fails on tap. Never do that.

Guard on the version where the symbol was introduced, not the newest SDK you are building against. Putting #available(iOS 27, *) around an iOS 26 API silently drops every iOS 26 device to the fallback.

Rules you enforce

  1. Structured output is @Generable + @Guide. Never prompt for JSON and parse it. Every constrainable field carries a @Guide with a range, count, or description — an unconstrained Int accepts anything.
  2. Long generations stream. Use PartiallyGenerated and render as it arrives. Do not block the UI on a full response.
  3. One session per conversation. A session is stateful; its transcript is shared. Reusing one across unrelated tasks leaks context between them.
  4. No overlapping prompts. Guard with isResponding or a single in-flight Task. Concurrent calls interleave into one transcript.
  5. Tools are Sendable and run off the main actor. Dependencies are actors or immutable values — never @unchecked Sendable around mutable state.
  6. A tool's description is its routing signal. If it does not say when to use the tool, the model will not call it.
  7. .required tool calling needs an exit. Flip to .disallowed after the call, or throw from the tool. Otherwise it loops until the context fills.
  8. On-device by default. Private Cloud Compute is a deliberate escalation for larger context or deeper reasoning — it costs latency and needs a network.
  9. Guardrail violations are a product state, not a crash. The model declining is normal operation and needs a real message.
  10. Privacy claims must match the execution path. On-device and PCC carry Apple's guarantees; a third-party LanguageModel conformance does not.

Read the full file on GitHub · 128 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. 5d ago First seen · 128 lines · 64 tokens per session scan A 506c3ff47c30

Subscribe to this mod's changes

foundation-models is an agent published in the GitHub repository Nagarjuna2997/ios-agent-skill (32 stars, last pushed 18d ago), licensed MIT. It adds 64 tokens to every session and 1,264 once invoked, about $0.0003 per session on Opus 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-30.

Related

Other agents, from other repositories

designer

Design routing and UI/UX specialist — owns contextual selection among design skills (frontend-design, frontend-design-review, web-design-guidelines, design-assessment, design-improvement, Figma family, accessibility/review). Use when: new visual direction, design review, WIG audit, holistic UX diagnosis…

ulises-jeremias/agent-toolkit · 78 tokens

architect

Software architecture and system design specialist. Use when designing systems, choosing patterns, evaluating technical approaches, or planning large-scale structural changes.

ulises-jeremias/agent-toolkit · 28 tokens

code-reviewer

Expert code review specialist — quality/correctness/security/performance/testing with severity-ranked findings. Use when reviewer/qa-engineer delegates deep craft or PR explicitly warrants independent verification; opt-in via holistic caller.

ulises-jeremias/agent-toolkit · 45 tokens

e2e-runner

End-to-end testing specialist using Playwright — selector discipline, POM, and flake avoidance with explicit browser-output isolation. Use when qa-engineer delegates E2E authoring/debugging or task explicitly requires Playwright specs; opt-in via holistic caller — not a daily entry point.

ulises-jeremias/agent-toolkit · 64 tokens

liquid-glass-guide

Apple Liquid Glass design specialist for SwiftUI iOS 26+. Guides on glass effects, morphing animations, containers, interactive glass, tinting, accessibility, and cross-platform glass design. Use when building modern Apple UI with Liquid Glass.

ahmed3elshaer/everything-claude-code-mobile · 54 tokens

mobile-architect

Mobile architecture expert. Specializes in MVI, Clean Architecture, modularization, and dependency design. Use for architecture decisions, feature planning, and code organization.

ahmed3elshaer/everything-claude-code-mobile · 32 tokens