axiom-foundation-models-diag▌
charleswiltgen/axiom · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
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.
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?"
What this tells you
- Unavailable → Proceed to Pattern 1a/1b/1c (availability issues)
- Context exceeded → Proceed to Pattern 2a (token limit)
- Guardrail error → Proceed to Pattern 2b (content policy)
- Language error → Proceed to Pattern 2c (unsupported language)
- Wrong output → Proceed to Pattern 3a/3b/3c (output quality)
- Slow generation → Proceed to Pattern 4a/4b/4c/4d (performance)
- UI frozen → Proceed to Pattern 5a (main thread blocking)
MANDATORY INTERPRETATION
Before changing ANY code, identify ONE of these:
- If
availability = .unavailable→ Device/region/opt-in issue (not code bug) - If error is
exceededContextWindowSize→ Too many tokens (condense transcript) - If error is
guardrailViolation→ Content policy triggered (not model failure) - If error is
unsupportedLanguageOrLocale→ Language not supported (check supported list) - If output is hallucinated → Wrong use case (world knowledge vs extraction)
- If generation >5 seconds → Not streaming or need optimization
- If UI frozen → Calling on main thread (use Task {})
If diagnostics are contradictory or unclear
- STOP. Do NOT proceed to patterns yet
- Add detailed logging to every
respond()call - Run with Instruments Foundation Models template
- Establish baseline: what's actually happening vs what you assumed
Decision Tree
Foundation Models problem?
│
├─ Won't start?
│ ├─ .unavailable → Availability issue
│ │ ├─ Device not capable? → Pattern 1a (device requirement)
│ │ ├─ Region restriction? → Pattern 1b (regional availability)
│ │ └─ User not opted in? → Pattern 1c (Settings check)
│ │
├─ Generation fails?
│ ├─ exceededContextWindowSize → Context limit
│ │ └─ Long conversation or verbose prompts? → Pattern 2a (condense)
│ │
│ ├─ guardrailViolation → Content policy
│ │ └─ Sensitive or inappropriate content? → Pattern 2b (handle gracefully)
│ │
│ ├─ unsupportedLanguageOrLocale → Language issue
│ │ └─ Non-English or unsupported language? → Pattern 2c (language check)
│ │
│ └─ Other error → General error handling
│ └─ Unknown error type? → Pattern 2d (catch-all)
│
├─ Output wrong?
│ ├─ Hallucinated facts → Wrong model use
│ │ └─ Asking for world knowledge? → Pattern 3a (use case mismatch)
│ │
│ ├─ Wrong structure → Parsing issue
│ │ └─ Manual JSON parsing? → Pattern 3b (use @Generable)
│ │
│ ├─ Missing data → Tool needed
│ │ └─ Need external information? → Pattern 3c (tool calling)
│ │
│ └─ Inconsistent output → Sampling issue
│ └─ Different results each time? → Pattern 3d (temperature/greedy)
│
├─ Too slow?
│ ├─ Initial delay (1-2s) → Model loading
│ │ └─ First request slow? → Pattern 4a (prewarm)
│ │
│ ├─ Long wait for results → Not streaming
│ │ └─ User waits 3-5s? → Pattern 4b (streaming)
│ │
│ ├─ Verbose schema → Token overhead
│ │ └─ Large @Generable type? → Pattern 4c (includeSchemaInPrompt)
│ │
│ └─ Complex prompt → Too much processing
│ └─ Massive prompt or task? → Pattern 4d (break down)
│
└─ UI frozen?
└─ Main thread blocked → Async issue
└─ App unresponsive during generation? → Pattern 5a (Task {})
Diagnostic Patterns
Pattern 1a: Device Not Capable
Symptom:
SystemLanguageModel.default.availability = .unavailable- Reason: Device not Apple Intelligence-capable
Diagnosis:
let availability = SystemLanguageModel.default.availability
switch availability {
case .available:
print("✅ Available")
case .unavailable(let reason):
print("❌ Reason: \(reason)")
// Check if device-related
}
Fix:
// ❌ BAD - No availability UI
let session = LanguageModelSession() // Crashes on unsupported devices
// ✅ GOOD - Graceful UI
struct AIFeatureView: View {
@State private var availability = SystemLanguageModel.default.availability
var body: some View {
switch availability {
case .available:
AIContentView()
case .unavailable:
VStack {
Image(systemName: "cpu")
Text("AI features require Apple Intelligence")
.font(.headline)
Text("Available on iPhone 15 Pro and later")
.font(.caption)
.foregroundColor(.secondary)
}
}
}
}
Time cost: 5-10 minutes to add UI
P
How to use axiom-foundation-models-diag on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add axiom-foundation-models-diag
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches axiom-foundation-models-diag from GitHub repository charleswiltgen/axiom and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate axiom-foundation-models-diag. Access the skill through slash commands (e.g., /axiom-foundation-models-diag) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Competitive Analysis
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ Use When
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid When
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.7★★★★★56 reviews- ★★★★★Shikha Mishra· Dec 24, 2024
axiom-foundation-models-diag reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Isabella Diallo· Dec 24, 2024
axiom-foundation-models-diag reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Tariq Thomas· Dec 20, 2024
I recommend axiom-foundation-models-diag for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Xiao Gill· Dec 20, 2024
axiom-foundation-models-diag has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Alexander Rao· Dec 12, 2024
Keeps context tight: axiom-foundation-models-diag is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Zara Sanchez· Dec 8, 2024
axiom-foundation-models-diag is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Isabella Ghosh· Nov 27, 2024
Useful defaults in axiom-foundation-models-diag — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Alexander Patel· Nov 11, 2024
Keeps context tight: axiom-foundation-models-diag is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Ira Sanchez· Nov 3, 2024
I recommend axiom-foundation-models-diag for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Tariq Brown· Oct 22, 2024
Useful defaults in axiom-foundation-models-diag — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
showing 1-10 of 56