Use when implementing BGTaskScheduler, debugging background tasks that never run, understanding why tasks terminate early, or testing background execution - systematic task lifecycle management with proper registration, expiration handling, and Swift 6 cancellation patterns
View on GitHubCharlesWiltgen/Axiom
axiom
.claude-plugin/plugins/axiom/skills/axiom-background-processing/SKILL.md
January 16, 2026
Select agents to install to:
npx add-skill https://github.com/CharlesWiltgen/Axiom/blob/main/.claude-plugin/plugins/axiom/skills/axiom-background-processing/SKILL.md -a claude-code --skill axiom-background-processingInstallation paths:
.claude/skills/axiom-background-processing/# Background Processing ## Overview Background execution is a **privilege**, not a right. iOS actively limits background work to protect battery life and user experience. **Core principle**: Treat background tasks as discretionary jobs — you request a time window, the system decides when (or if) to run your code. **Key insight**: Most "my task never runs" issues stem from registration mistakes or misunderstanding the 7 scheduling factors that govern execution. This skill provides systematic debugging, not guesswork. **Energy optimization**: For reducing battery impact of background tasks, see `axiom-energy` skill. This skill focuses on task **mechanics** — making tasks run correctly and complete reliably. **Requirements**: iOS 13+ (BGTaskScheduler), iOS 26+ (BGContinuedProcessingTask), Xcode 15+ ## Example Prompts Real questions developers ask that this skill answers: #### 1. "My background task never runs. I register it, schedule it, but nothing happens." → The skill covers the registration checklist and debugging decision tree for "task never runs" issues #### 2. "How do I test background tasks? They don't seem to trigger in the simulator." → The skill covers LLDB debugging commands and simulator limitations #### 3. "My task gets terminated before it completes. How do I extend the time?" → The skill covers task types (BGAppRefresh 30s vs BGProcessing minutes), expiration handlers, and incremental progress saving #### 4. "Should I use BGAppRefreshTask or BGProcessingTask? What's the difference?" → The skill provides decision tree for choosing the correct task type based on work duration and system requirements #### 5. "How do I integrate Swift 6 concurrency with background task expiration?" → The skill covers withTaskCancellationHandler patterns for bridging BGTask expiration to structured concurrency #### 6. "My background task works in development but not in production." → The skill covers the 7 scheduling factors, throttling behavior, and production