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 agentmods add agents/nagarjuna2997/ios-agent-skill/foundation-modelsgit clone --depth 1 https://github.com/Nagarjuna2997/ios-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/agents/nagarjuna2997/ios-agent-skill/foundation-models)<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>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 | $0.00064 | $0.01264 |
| Opus 5 | $0.00032 | $0.00632 |
| Sonnet 5 | $0.00013 | $0.00253 |
| Haiku 4.5 | $0.00006 | $0.00126 |
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.
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
- Structured output is
@Generable+@Guide. Never prompt for JSON and parse it. Every constrainable field carries a@Guidewith a range, count, or description — an unconstrainedIntaccepts anything. - Long generations stream. Use
PartiallyGeneratedand render as it arrives. Do not block the UI on a full response. - One session per conversation. A session is stateful; its transcript is shared. Reusing one across unrelated tasks leaks context between them.
- No overlapping prompts. Guard with
isRespondingor a single in-flightTask. Concurrent calls interleave into one transcript. - Tools are
Sendableand run off the main actor. Dependencies are actors or immutable values — never@unchecked Sendablearound mutable state. - A tool's
descriptionis its routing signal. If it does not say when to use the tool, the model will not call it. .requiredtool calling needs an exit. Flip to.disallowedafter the call, or throw from the tool. Otherwise it loops until the context fills.- On-device by default. Private Cloud Compute is a deliberate escalation for larger context or deeper reasoning — it costs latency and needs a network.
- Guardrail violations are a product state, not a crash. The model declining is normal operation and needs a real message.
- Privacy claims must match the execution path. On-device and PCC carry
Apple's guarantees; a third-party
LanguageModelconformance does not.
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.
- 5d ago First seen · 128 lines · 64 tokens per session scan A 506c3ff47c30
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.
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…
architect
Software architecture and system design specialist. Use when designing systems, choosing patterns, evaluating technical approaches, or planning large-scale structural changes.
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.
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.
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.
mobile-architect
Mobile architecture expert. Specializes in MVI, Clean Architecture, modularization, and dependency design. Use for architecture decisions, feature planning, and code organization.