Agent skill · Frontend

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+

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill axiom-foundation-models --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 42 KB
Bundled scripts: none
Version: 1.0.0
Requires: iOS 26+, macOS 26+, iPadOS 26+, axiom-visionOS 26+
Path: skills/ai-ml/axiom-foundation-models/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Guides on-device Foundation Models usage for Apple platforms, focusing on preventing context overflow, UI blocking, incorrect use cases, and manual JSON parsing by leveraging patterns like @Generable for structured output and streaming for long generations.

How it works

  • Emphasizes using on-device models via Foundation Models framework on iOS 26+, macOS 26+, iPadOS 26+, axiom-visionOS 26+.
  • Illustrates avoiding common anti-patterns: world-knowledge prompts, blocking main thread, manual JSON parsing, and missing availability checks.
  • Promotes pre-flight steps: check availability, identify concrete use case (summarization, extraction, classification, content tagging), design @Generable schema for structured outputs, consider tools for external data, and plan streaming for long generations.
  • Provides concrete code patterns:
    • Availability checks via SystemLanguageModel.default.availability with cases .available and .unavailable(reason).
    • Pattern usage: Pattern 1 for basic session; Pattern 2 shows how to define @Generable structs and call session.respond with generating: Type.self to get type-safe output; includes constraints decoding and supported types.
    • Tools for external data and streaming via session.streamResponse when generating long results.
  • Contains a decision tree to choose pattern based on use case (world knowledge vs summarization vs structured extraction vs tool calling vs streaming).

When to use it

  • Use when implementing on-device AI features with Foundation Models.
  • Use for text summarization, classification, or extraction; building structured output; tool-calling patterns; streaming generated content; debugging issues like context overflow or slow generation; choosing between Foundation Models vs server LLMs.

What it can touch

  • Mentions APIs and types such as LanguageModelSession, @Generable-annotated types (e.g., Person, Itinerary, DayPlan), and session.respond/streamResponse usage. It references availability checks and error cases like GenerationError.guardrailViolation and .unsupportedLanguageOrLocale.
  • Specific code examples show usage of LanguageModelSession, @Generable, and streamResponse for incremental UI updates.

Caveats

  • Warns about world-knowledge misuse and the 4096-token context window, and the need to handle guardrails, unsupported language, and availability.
  • Emphasizes that Foundation Models are intended for certain use cases (summarization, extraction, classification, tagging) and not for world knowledge or complex reasoning.
  • Requires iOS 26+, macOS 26+, iPadOS 26+, axiom-visionOS 26+.
  • License is MIT.
From the SKILL.md

# 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

What's inside
Steps it walks through
  1. When to Use This Skill
  2. Red Flags — Anti-Patterns That Will Fail
  3. ❌ Using for World Knowledge
  4. ❌ Blocking Main Thread
  5. ❌ Manual JSON Parsing
  6. ❌ Ignoring Availability Check
  7. ❌ Single Huge Prompt
  8. ❌ Not Handling Context Overflow
  9. ❌ Not Handling Guardrail Violations
  10. ❌ Not Handling Unsupported Language
  11. Mandatory First Steps
  12. 1. Check Availability
  13. 2. Identify Use Case
  14. 3. Design @Generable Schema
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
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 --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.

Keep going