axiom-foundation-models
Use when implementing on-device AI with Apple's Foundation Models framework — prevents context overflow, blocking UI, wrong model use cases, and manual JSON parsing when @Generable should be used. iOS 26+, macOS 26+, iPadOS 26+, axiom-visionOS 26+
npx skills add majiayu000/claude-skill-registry --skill axiom-foundation-models-charleswiltgen-axiom --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Prompts an agent to assist implementing on-device AI using Apple Foundation Models, emphasizing structured output with @Generable, streaming for long generations, and patterns for safe, async usage on Apple devices.
How it works
- Recommends using on-device Foundation Models for tasks like summarization, extraction, and classification, and building tool-calling patterns for external data.
- Encourages preventing context overflow and UI blocking, with guidance to use asynchronous patterns and background tasks.
- Introduces Pattern 2 (@Generable) to produce type-safe, structured outputs by defining a Swift @Generable struct and calling session.respond(to: generating: Type.self).
- Describes how constrained decoding via @Generable ensures the model outputs conform to the defined schema, avoiding manual JSON parsing.
- Provides guidance for streaming (Pattern 3) when generation exceeds 1 second, with a loop over partial results to update the UI incrementally.
- Covers error handling for guardrail violations and unsupported languages, and includes an availability check for Apple Intelligence-enabled devices and regions.
- Outlines a decision tree and several first-step checks (availability, use case, schema design, tools, streaming).
When to use it
- Use when implementing on-device AI features with Foundation Models.
- Use for text summarization, classification, extraction, and building structured outputs via @Generable.
- Use when you need streaming for long generations or when you need to call external data via tools.
- Use to debug context overflow, guardrail violations, availability, and language support issues.
What it can touch
- Tools and APIs mentioned include LanguageModelSession, @Generable types, streamResponse, and supporting Swift constructs as shown in examples. The skill references Foundation Models, and methods like respond(to:), generating:, and streamResponse are used in code snippets.
Caveats
- Emphasizes that Foundation Models are suited for summarization, extraction, and classification, not world knowledge or complex reasoning.
- Warns against blocking the main thread and against manual JSON parsing; recommends @Generable to guarantee structure.
- Requires availability on Apple Intelligence devices in supported regions and handling of guardrails, languages, and context overflow.
- Contains several conditional patterns and examples; outcomes depend on correct implementation of @Generable schemas and proper error handling.
# Foundation Models — On-Device AI for Apple Platforms ## When to Use This Skill Use when: - Implementing on-device AI features with Foundation Models - Adding text summarization, classification, or extraction capabilities - Creating structured output from LLM responses - Building tool-calling patterns for external data integration - Streaming generated content for better UX - Debugging Foundation Models issues (context overflow, slow generation, wrong output) - Deciding between Foundation Models vs server LLMs (ChatGPT, Claude, etc.) #### Related Skills - Use `axiom-foundation-models-diag` for systematic troubleshooting (context exceeded, guardrail violations, availability problems) - Use `axiom-foundation-models-ref` for complete API reference with all WWDC code examples --- ## Red Flags — Anti-Patterns That Will Fail ### ❌ Using for World Knowledge **Why it fails**: The on-device model is 3 billion parameters, optimized for summarization, extraction, classification — **NOT** world knowledge or complex reasoning. **Example of wrong use**: ```swift // ❌ BAD - Asking for world knowledge let session = LanguageModelSession() let response = try await session.respond(to: "What's the ca
- When to Use This Skill
- Red Flags — Anti-Patterns That Will Fail
- ❌ Using for World Knowledge
- ❌ Blocking Main Thread
- ❌ Manual JSON Parsing
- ❌ Ignoring Availability Check
- ❌ Single Huge Prompt
- ❌ Not Handling Context Overflow
- ❌ Not Handling Guardrail Violations
- ❌ Not Handling Unsupported Language
- Mandatory First Steps
- 1. Check Availability
- 2. Identify Use Case
- 3. Design @Generable Schema
What does the axiom-foundation-models skill do?
Use when implementing on-device AI with Apple's Foundation Models framework — prevents context overflow, blocking UI, wrong model use cases, and manual JSON parsing when @Generable should be used. iOS 26+, macOS 26+, iPadOS 26+, axiom-visionOS 26+
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill axiom-foundation-models-charleswiltgen-axiom --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
