background-execution

Solid

Writes and reviews Swift code for background execution on Apple platforms - BGTaskScheduler (app refresh, processing, continued processing), beginBackgroundTask assertions, background URLSession downloads/uploads, silent and VoIP push, background modes (audio, location, BLE), the SwiftUI .backgroundTask modifier, and macOS schedulers. Use when scheduling deferred work, finishing work after the app backgrounds, transferring files in the background, waking the app via push, or debugging background tasks that never run.

Code & Development 10 stars 0 forks Updated 3 days ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
35
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

Write and review Swift code that runs work while the app is backgrounded or suspended, choosing the right API for the job and respecting the system's constraints so the work actually runs and the app is not terminated. Review process: 1. Establish the background execution model (lifecycle, budgets, force-quit, the five principles) using `references/fundamentals.md`. 1. Confirm the chosen API matches the work using the decision tree below; reroute if it does not. 1. Validate `BGTaskScheduler` usage (registration timing, Info.plist, expiration, `setTaskCompleted`) using `references/bg-task-scheduler.md`. 1. Validate task assertions (`beginBackgroundTask`/`endBackgroundTask`, `performExpiringActivity`) using `references/task-assertions.md`. 1. Validate background `URLSession` config and the relaunch flow using `references/background-url-session.md`. 1. Validate silent/VoIP push payloads, headers, and handlers using `references/background-push.md`. 1. Validate `UIBackgroundModes` declarations and location specifics using `references/background-modes.md`. 1. Validate background audio (session category, recording while locked, interruptions, route changes, mic permission) using `references/background-audio.md`. 1. Validate SwiftUI `ScenePhase` / `.backgroundTask` usage using `references/swiftui-background-tasks.md`. 1. Validate macOS schedulers (`NSBackgroundActivityScheduler`, `beginActivity`, `SMAppService`) using `references/macos-background.md`. 1. Check testing/debugging and...

Details

Author
n0an
Repository
n0an/Background-Execution-Agent-Skill
Created
2 months ago
Last Updated
3 days ago
Language
N/A
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

background-processing

Schedule and execute background work on iOS using BGTaskScheduler. Use when registering BGAppRefreshTask for short background fetches, BGProcessingTask for long-running maintenance, BGContinuedProcessingTask (iOS 26+) for foreground-started work that continues in background, background URLSession downloads, or background push notifications. Covers Info.plist configuration, expiration handling, task completion, and debugging with simulated launches.

3 Updated 5 days ago
thiennc-tesoglobal
AI & Automation Listed

backgroundtasks

Route BackgroundTasks implementation tasks to the correct Knowledge Contracts -- background task registration and scheduling, task execution and expiration handling, processing task constraints and conditions, and background refresh and widget timeline hookup. Use when registering a task identifier with BGTaskScheduler.register(forTaskWithIdentifier:using:launchHandler:), declaring BGTaskSchedulerPermittedIdentifiers, submitting a BGAppRefreshTaskRequest/BGProcessingTaskRequest, reading earliestBeginDate, handling a BGTask/BGAppRefreshTask/BGProcessingTask in a launch handler, setting expirationHandler, calling setTaskCompleted(success:), setting requiresNetworkConnectivity/requiresExternalPower, or scheduling background refresh that feeds a widget. v1 is BGTaskScheduler-based scheduling and execution only -- no BGContinuedProcessingTask, no legacy Background Fetch (setMinimumBackgroundFetchInterval, performFetchWithCompletionHandler), no unrelated background modes (background audio, background location, VoIP

1 Updated today
caglarbaranbora
AI & Automation Featured

background-processing

Generates background processing infrastructure with BGTaskScheduler, background refresh, background downloads, and silent push handling. Use when user needs background tasks, periodic refresh, background URLSession downloads, or silent push notification processing.

719 Updated 1 months ago
rshankras