background-processing — Claude Code skill: guide and setup
Sets up iOS background execution using BGTaskScheduler, URLSession, and push triggers. Useful when you need feed updates or nightly database maintenance.
npx skills add dpearson2699/swift-ios-skills --skill background-processing -a claude-codeWhat background-processing does
This skill guides background execution setup for Swift projects. It provides patterns for short-lived BGAppRefreshTask calls and heavy maintenance jobs via BGProcessingTask. You also get workflows for foreground-initiated work continuing offscreen through BGContinuedProcessingTask on iOS 26+.
Task handlers require early setup. You must register them with BGTaskScheduler before app launch finishes, either in App.init() for SwiftUI or didFinishLaunchingWithOptions for UIKit. Omitting an identifier from BGTaskSchedulerPermittedIdentifiers inside Info.plist causes submit(_:) to fail with notPermitted.
System time limits require defensive code. The skill includes patterns for assigning expirationHandler to cancel ongoing Swift tasks cleanly. That keeps the operating system from terminating the process abruptly.
What it helps with
- configure
BGTaskSchedulerPermittedIdentifiersinInfo.plist - register background task handlers during SwiftUI app startup
- implement
expirationHandlerto stop running async operations - schedule maintenance tasks requiring external power with
BGProcessingTask
Example prompts for the agent
- Configure a
BGAppRefreshTaskto refresh our feed in a SwiftUI app - Show how to set up
BGProcessingTaskfor database cleanup when plugged into power - Check our
Info.plistfor the necessary background task identifiers and background modes
How to install background-processing
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill background-processing -a claude-code2Manually: put the files in place
~/.claude/skills/background-processing/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/background-processing/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill background-processing -a codex2Manually: put the files in place
.agents/skills/background-processing/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill background-processing -a cursor2Manually: put the files in place
.cursor/skills/background-processing/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dpearson2699/swift-ios-skills background-processing2Manually: put the files in place
.github/skills/background-processing/SKILL.md1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill background-processing -a gemini-cli2Platform CLI
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/background-processingManually: put the files in place
.devin/skills/background-processing/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill background-processing -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about background-processing
How to install background-processing in Claude Code?
Run npx skills add dpearson2699/swift-ios-skills --skill background-processing -a claude-code. The skill will be available to the agent immediately.
What does background-processing do?
It teaches coding agents how to implement iOS background work using BGTaskScheduler. The skill includes code snippets for task registration, expiration handling, and Info.plist keys.
Why must background tasks be registered before app launch completes?
BGTaskScheduler rejects registrations attempted later in the lifecycle. You must set them up in UIKit's didFinishLaunchingWithOptions or inside SwiftUI's App.init().