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-charleswiltgen-axiom-2 --agent claude-code

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

Facts
Files in the skill folder: 2
SKILL.md size: 32 KB
Bundled scripts: none
Version: 1.0.0
Requires: iOS 26+, macOS 26+, iPadOS 26+, axiom-visionOS 26+
Path: skills/ai-llm/axiom-foundation-models-charleswiltgen-axiom-2/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

Instructs on-device AI usage with Foundation Models for Apple platforms, covering when to use for summarization, extraction, or structured output, and when to stream, call tools, or handle availability and errors. Emphasizes using @Generable for structured data, avoiding manual JSON parsing, and planning streaming for long generations.

How it works

  • Recommends choosing Foundation Models for on-device tasks like summarization, extraction, or classification, and using tool calling for external data when needed.
  • Provides a Pattern 1 Basic Session workflow with LanguageModelSession, including how to supply optional Instructions and how to perform multi-turn interactions.
  • Describes Pattern 2: using @Generable to produce structured output, showing a struct annotated with @Generable, a generating: Type, and how constrained decoding yields a type-safe result.
  • Explains Pattern 3: streaming generation via session.streamResponse and a PartiallyGenerated type to progressively update UI.
  • Details how properties order affects generation, how to integrate with SwiftUI, and how to handle streaming view identity for stable UI updates.
  • Covers Pattern 4: Tool Calling for external data sources and cautions.
  • Lists mandatory steps like availability checks, use-case design, and streaming planning to manage long generations.

When to use it

  • Use when implementing on-device AI features with Foundation Models.
  • Use for text summarization, classification, extraction, or building structured output via @Generable.
  • Use streaming for long generations to improve UX.
  • Use tool calling when external data is required.
  • Use availability checks and proper error handling to avoid app crashes.

What it can touch

  • Involves Foundation Models APIs such as LanguageModelSession, session.respond, and session.streamResponse.
  • Uses @Generable types and PartiallyGenerated for structured outputs.
  • Requires iOS 26+, macOS 26+, iPadOS 26+, axiom-visionOS 26+.

Caveats

  • Avoid world-knowledge use; Foundation Models are not for encyclopedic knowledge or complex reasoning.
  • Do not block the main thread; use async patterns and background tasks for generation.
  • Do not parse JSON manually; use @Generable to guarantee structure.
  • Ensure availability checks before invoking AI features; fall back gracefully if unavailable.
  • Manage streaming errors gracefully; partial results may be shown.
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 Generation Errors
  9. Mandatory First Steps
  10. 1. Check Availability
  11. 2. Identify Use Case
  12. 3. Design @Generable Schema
  13. 4. Consider Tools for External Data
  14. 5. Plan Streaming for Long Generations
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-charleswiltgen-axiom-2 --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