backgroundtaskslisted
Install: claude install-skill caglarbaranbora/Apple-Agent-Kit
# BackgroundTasks — Foundations Skill
## Purpose
Route BackgroundTasks implementation tasks to the minimum required
BackgroundTasks Knowledge Contracts. v1 scope is scheduling and running
deferred background work through `BGTaskScheduler` -- registration,
submission, execution, expiration handling, processing constraints, and
the hand-off point where background-refreshed data reaches a widget --
not `BGContinuedProcessingTask`, not legacy Background Fetch, not
unrelated background modes, and not `URLSession` background transfer.
## Routing
Load only the contracts relevant to the task. All paths relative to
knowledge/backgroundtasks/.
- Registering a task identifier with `BGTaskScheduler.shared.register(forTaskWithIdentifier:using:launchHandler:)`; declaring `BGTaskSchedulerPermittedIdentifiers`; choosing `BGAppRefreshTaskRequest` vs `BGProcessingTaskRequest`; submitting with `submit(_:)`; or reasoning about `earliestBeginDate` -> background-task-registration-and-scheduling.md
- Handling the `BGTask` delivered to a `launchHandler` (casting to `BGAppRefreshTask`/`BGProcessingTask`); setting `expirationHandler`; calling `setTaskCompleted(success:)`; or re-submitting a request for the next occurrence -> task-execution-and-expiration-handling.md
- Setting `BGProcessingTaskRequest.requiresNetworkConnectivity`/`requiresExternalPower`; or deciding whether work belongs on `BGProcessingTaskRequest` versus `BGAppRefreshTaskRequest` -> processing-task-constraints-and-condition