megastep/codex-skills/axiom-extensions-widgets
Claude Code and agent skill by megastep/codex-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when implementing widgets, Live Activities, or Control Center controls - enforces correct patterns for timeline management, data sharing, and extension lifecycle to prevent common crashes and memory issues
Install
npx vskill@latest install megastep/codex-skills/axiom-extensions-widgetsSKILL.md
The same SKILL.md was published earlier as megastep/codex-skills/axiom-extensions-widgets.
Extensions & Widgets — Discipline
Core Philosophy
"Widgets are not mini apps. They're glanceable views into your app's data, rendered at strategic moments and displayed by the system. Extensions run in sandboxed environments with limited memory and execution time."
Mental model: Think of widgets as archived snapshots on a timeline, not live views. Your widget doesn't "run" continuously — it renders, gets archived, and the system displays the snapshot.
Extension sandboxing: Extensions have:
- Limited memory (~30MB)
- No network access in widget views (fetch in TimelineProvider only)
- Separate bundle container from main app
- Require App Groups for data sharing
When to Use This Skill
✅ Use this skill when:
- Implementing any widget (Home Screen, Lock Screen, StandBy, Control Center)
- Creating Live Activities
- Debugging why widgets show stale data
- Widget not appearing in gallery
- Interactive buttons not responding
- Live Activity fails to start
- Control Center control is unresponsive
- Sharing data between app and widget/extension
❌ Do NOT use this skill for:
- Pure App Intents implementation (use app-intents-ref)
- SwiftUI layout questions (use swiftui-layout)
- Performance profiling (use swiftui-performance)
- General debugging (use xcode-debugging)
Related Skills
- extensions-widgets-ref — Comprehensive API reference
- app-intents-ref — App Intents for interactive widgets
- swift-concurrency — Async patterns for data fetching
- swiftdata — Using SwiftData with App Groups
Example Prompts
1. "My widget isn't updating"
→ This skill covers timeline policies, refresh budgets, manual reload, and App Groups configuration
2. "How do I share data between app and widget?"
→ This skill explains App Groups entitlement, shared UserDefaults, and container URLs
3. "Widget shows old data even after I update the app"
→ This skill covers container paths, UserDefaults suite names, and WidgetCenter reload
4. "Live Activity fails to start"
→ This skill covers 4KB data limit, ActivityAttributes constraints, authorization checks
5. "Control Center control takes forever to respond"
→ This skill covers async ValueProvider patterns and optimistic UI
6. "Interactive widget button does nothing"
→ This skill covers App Intent perform() implementation and WidgetCenter reload
Red Flags / Anti-Patterns
Pattern 1: Network Calls in Widget View
Time cost: 2-4 hours debugging why widgets are blank or show errors
Symptom
- Widget renders but shows no data
- Console errors: "NSURLSession not available in widget extension"
- Widget appears blank intermittently
❌ BAD Code
Why it fails: Widget views are rendered, archived, and reused. Network calls in views are unreliable and may not execute.
✅ GOOD Code
Pattern: Fetch data in main app, save to shared storage, read in widget.
Can TimelineProvider make network requests?
Yes, but with important caveats:
Constraints:
- 30-second timeout - System kills extension if getTimeline() doesn't complete
- No background sessions - Can't download large files
- Battery cost - Every timeline reload uses battery
- Not guaranteed - May fail on poor connections
Best practice: Prefetch in main app (faster, more reliable), use TimelineProvider network as fallback only.
Pattern 2: Missing App Groups
Time cost: 1-2 hours debugging why widget shows empty/default data
Symptom
- Widget always shows placeholder or default values
- Changes in main app don't reflect in widget
- UserDefaults reads return nil in widget
❌ BAD Code
Why it fails: UserDefaults.standard accesses different containers in app vs. extension.
✅ GOOD Code
Verification:
Pattern 3: Over-Refreshing (Budget Exhaustion)
Time cost: Poor user experience, battery drain, widgets stop updating
Symptom
- Widget updates frequently at first, then stops
- Console logs: "Timeline reload budget exhausted"
- Widget becomes stale after a few hours
❌ BAD Code
Why it's bad: System gives 40-70 reloads/day. This approach uses 24 reloads/hour → exhausts budget in 2-3 hours.
✅ GOOD Code
Guidelines:
- 15-60 minute intervals for most widgets
- 5-15 minutes for time-sensitive data (stocks, sports)
- Use
.atEndpolicy for automatic reload - Let system decide optimal refresh based on user engagement
Pattern 4: Blocking Main Thread in Controls
Time cost: Control Center control unresponsive, poor UX
Symptom
- Tapping control in Control Center shows spinner for seconds
- Control seems "stuck" or frozen
- No immediate visual feedback
❌ BAD Code
Why it's bad: Button renders on main thread. Blocking network/database calls freeze UI.
✅ GOOD Code
Pattern: Use ControlValueProvider for async data, provide instant previewValue fallback.
Pattern 5: Missing Dismissal Policy (Zombie Live Activities)
Time cost: User annoyance, negative reviews
Symptom
- Live Activities stay on Lock Screen for hours after event ends
- Users must manually dismiss completed activities
- Activity shows "Delivered" but won't disappear
❌ BAD Code
Why it's bad: Activities persist indefinitely unless explicitly ended.
✅ GOOD Code
Best practices:
.immediate— Transient events (timer completed, song finished).default— Most activities (shows "completed" state for ~4 hours).after(date)— Specific end time (meeting ends, flight lands)
Pattern 6: Exceeding 4KB Data Limit (Live Activities)
Time cost: Activity fails to start silently, hard to debug
Symptom
Activity.request()throws error- Console: "Activity attributes exceed size limit"
- Activity never appears on Lock Screen
❌ BAD Code
Why it fails: ActivityAttributes + ContentState combined must be < 4KB.
✅ GOOD Code
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingaxiom-extensions-widgets/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/megastep/codex-skills/axiom-extensions-widgets)