axiom-foundation-models-diag

axiom-foundation-models-diag is a skill for Claude Code, Codex from ComeOnOliver/skillshub. It costs 44 tokens per session (6,576 once invoked), scanned A, original, MIT.

A troubleshooting guide for Apple's Foundation Models framework, which provides an on-device language model for tasks such as summarising text. It covers context limits, safety blocks, speed, availability, language support, and unexpected output.

In plain words
What is it for?
Use it to investigate context-window errors, safety violations, slow generation, unavailable models, unsupported languages, frozen interfaces, or incorrect results.
Why use it?
It helps distinguish framework or device constraints from bugs in an app's use of the model.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to investigate context-window errors, safety violations, slow generation, unavailable models, unsupported languages, frozen interfaces, or incorrect results.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/comeonoliver/skillshub/axiom-foundation-models-diag
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.

Any agent
npx skills add ComeOnOliver/skillshub --skill axiom-foundation-models-diag
Clone the repo
git clone --depth 1 https://github.com/ComeOnOliver/skillshub

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/comeonoliver/skillshub/axiom-foundation-models-diag/github.svg)](https://agentmods.dev/skills/comeonoliver/skillshub/axiom-foundation-models-diag)
Your own site
<a href="https://agentmods.dev/skills/comeonoliver/skillshub/axiom-foundation-models-diag"><img src="https://agentmods.dev/badge/skills/comeonoliver/skillshub/axiom-foundation-models-diag/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for axiom-foundation-models-diag

Your own site · 80×15
<a href="https://agentmods.dev/skills/comeonoliver/skillshub/axiom-foundation-models-diag"><img src="https://agentmods.dev/badge/skills/comeonoliver/skillshub/axiom-foundation-models-diag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,576 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00044 $0.06576
Opus 5 $0.00022 $0.03288
Sonnet 5 $0.00009 $0.01315
Haiku 4.5 $0.00004 $0.00658

Measured 9d ago against content hash 4a8f66fa1645, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

axiom-foundation-models-diag 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 9d 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.

skills/CharlesWiltgen/Axiom/axiom-foundation-models-diag/SKILL.md · 1,032 lines

How it starts

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

Foundation Models Diagnostics

Overview

Foundation Models issues manifest as context window exceeded errors, guardrail violations, slow generation, availability failures, and unexpected output. Core principle 80% of Foundation Models problems stem from misunderstanding model capabilities (3B parameter device-scale model, not world knowledge), context limits (4096 tokens), or availability requirements—not framework bugs.

Red Flags — Suspect Foundation Models Issue

If you see ANY of these, suspect a Foundation Models misunderstanding, not framework breakage:

  • Generation takes >5 seconds
  • Error: exceededContextWindowSize
  • Error: guardrailViolation
  • Error: unsupportedLanguageOrLocale
  • Model gives hallucinated/wrong output
  • UI freezes during generation
  • Feature works in simulator but not on device
  • FORBIDDEN "Foundation Models is broken, we need a different AI"
    • Foundation Models powers Apple Intelligence across millions of devices
    • Wrong output = wrong use case (world knowledge vs summarization)
    • Do not rationalize away the issue—diagnose it

Critical distinction Foundation Models is a device-scale model (3B parameters) optimized for summarization, extraction, classification—NOT world knowledge or complex reasoning. Using it for the wrong task guarantees poor results.

Mandatory First Steps

ALWAYS run these FIRST (before changing code):

// 1. Check availability
let availability = SystemLanguageModel.default.availability

switch availability {
case .available:
    print("✅ Available")
case .unavailable(let reason):
    print("❌ Unavailable: \(reason)")
    // Possible reasons:
    // - Device not Apple Intelligence-capable
    // - Region not supported
    // - User not opted in
}

// Record: "Available? Yes/no, reason if not"

// 2. Check supported languages
let supported = SystemLanguageModel.default.supportedLanguages
print("Supported languages: \(supported)")
print("Current locale: \(Locale.current.language)")

if !supported.contains(Locale.current.language) {
    print("⚠️ Current language not supported!")
}

// Record: "Language supported? Yes/no"

// 3. Check context usage
let session = LanguageModelSession()
// After some interactions:
print("Transcript entries: \(session.transcript.entries.count)")

// Rough estimation (not exact):
let transcriptText = session.transcript.entries
    .map { $0.content }
    .joined()
print("Approximate chars: \(transcriptText.count)")
print("Rough token estimate: \(transcriptText.count / 3)")
// 4096 token limit ≈ 12,000 characters

// Record: "Approaching context limit? Yes/no"

// 4. Profile with Instruments
// Run with Foundation Models Instrument template
// Check:
// - Initial model load time
// - Token counts (input/output)
// - Generation time per request
// - Areas for optimization

// Record: "Latency profile: [numbers from Instruments]"

// 5. Inspect transcript for debugging
print("Full transcript:")
for entry in session.transcript.entries {
    print("Entry: \(entry.content.prefix(100))...")
}

// Record: "Any unusual entries? Repeated content?"

Read the full file on GitHub · 1,032 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. 9d ago First seen · 1,032 lines · 44 tokens per session scan A 4a8f66fa1645

Subscribe to this mod's changes

axiom-foundation-models-diag is a skill published in the GitHub repository ComeOnOliver/skillshub (63 stars, last pushed 2mo ago), licensed MIT. It adds 44 tokens to every session and 6,576 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories