
Background tasks
Builds budgeted, idempotent expo-background-task jobs that run on iOS and Android
Background tasks is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- JavaScript, TypeScript
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 16
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Background tasks
This skill guides an agent through adding periodic background work to an Expo React Native app with expo-background-task and expo-task-manager. It sets up a single runner that applies a time budget, never throws, and records each run in a durable run log, along with a port that schedules jobs at one explicit interval of at least 15 minutes after startup.
The workflow covers defining tasks at module scope in an entry-imported registry, writing jobs that run without React and avoid running migrations, and giving every job a foreground path through the same runner. The skill also ships a zero-dependency checker script that scans the project for these rules and reports pass or fail, and it includes device-proof steps for forcing runs on an Android emulator and an iOS device.
It expects an Expo project with the config plugin for expo-background-task, and TypeScript and Jest for the templates and tests. Reference files cover platform limits, job design, and testing.
When your agent uses it
Builds expo-background-task jobs: idempotent, budgeted runs. Use when adding periodic sync, TaskManager.defineTask, leaving expo-background-fetch, or a background task never runs. Not for reminders (local-notifications).
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Runs JavaScript and TypeScript scripts(see the files on GitHub)
- Network calls found in its scripts(see the files on GitHub)
- License: MIT(see the files on GitHub)
From a static check of its 55 files (419 KB) on GitHub on 5 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the react-native plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add zakariaf/ReactNative-Skills
/plugin install react-native@react-native-skillsOr copy only this skill to ~/.claude/skills/background-tasks:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/background-tasks &&
cp -R "$tmp/skills/background-tasks" ~/.claude/skills/background-tasks &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/background-tasks inside it instead.
Copy the skill folder to ~/.agents/skills/background-tasks to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/background-tasks &&
cp -R "$tmp/skills/background-tasks" ~/.agents/skills/background-tasks &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/background-tasks inside it instead.
Copy the skill folder to ~/.cursor/skills/background-tasks to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/background-tasks &&
cp -R "$tmp/skills/background-tasks" ~/.cursor/skills/background-tasks &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/background-tasks inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/zakariaf/ReactNative-Skills.git --path skills/background-tasksOr copy the folder to ~/.gemini/skills/background-tasks yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/background-tasks:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/background-tasks &&
cp -R "$tmp/skills/background-tasks" ~/.copilot/skills/background-tasks &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/background-tasks inside it instead.
Get the folder:
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.gitThen copy ReactNative-Skills/skills/background-tasks into your agent's skills folder as background-tasks. Agents that support SKILL.md read one folder per skill.
What it does
- Budgeted job runner
- Runs each job under a fixed time limit, stops at step boundaries, and records crashes and timeouts instead of throwing.
- Module-scope task registry
- Defines every background task at top level in a file the app entry imports, so headless launches can find it.
- Idempotent job design
- Guides jobs to use idempotency keys, state transitions and one commit per step so repeated or cut runs stay safe.
- Interval reconciliation
- Schedules jobs after startup with one interval of at least 15 minutes and removes tasks the build no longer defines.
- Foreground fallback path
- Runs the same jobs on app activity or after writes, kept separate from background records in the run log.
- Checker script
- Scans the project for the skill's rules and prints a pass or fail result with a line per finding.
- Device proof steps
- Explains how to force a background run on an Android emulator with adb and on an iOS device, then read the run record.
Good for
- Add a periodic sync that uploads queued local changes when the phone allows it
- Replace an expo-background-fetch task with expo-background-task
- Define a new background job and register it after app startup
- Debug a background task that never runs on an iOS device or Android emulator
- Write Jest tests that prove a background job is safe to run twice
Background tasks FAQ
What does Background tasks need from the project?
It expects expo-background-task and expo-task-manager installed with npx expo install, and the expo-background-task config plugin listed in the app config. Templates are written in TypeScript and tested with Jest.
Does the skill change how often jobs run?
It sets one explicit interval of at least 15 minutes and reconciles registrations after startup. The guide notes that intervals are minimums and iOS often runs tasks in windows, so exact timing is not guaranteed.
Can background jobs run database migrations?
No. A background run opens the database only at the current schema version and defers the job when the schema is behind, leaving migrations to the foreground start.
Which checks does the bundled script perform?
The script is a zero-dependency checker run with node that scans the project for the skill's rules, such as task definition placement, job names, budgets and SDK import confinement, and prints PASS or FAIL lines.
How do I install Background tasks in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/background-tasks to use it in all your projects, or to .claude/skills/background-tasks in one project. Or install the react-native plugin, which includes it: /plugin marketplace add zakariaf/ReactNative-Skills, then /plugin install react-native@react-native-skills.
Does Background tasks run scripts?
Yes. It runs JavaScript and TypeScript scripts. Its scripts contain network calls. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Background tasks?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Background tasks?
The closest alternatives to Background tasks are Expo prebuild and config plugins, App startup and bootstrap, Expo overview, Architecture and boundaries and Debug menu and test hooks.
Where this comes from
- Description: from the skill's own SKILL.md.
More from zakariaf/ReactNative-Skills

Turns canvas taps, swipes and drags into typed intents hit-tested on the drawn layout
- Open source
- 16 GitHub stars
- Developer tools

Adds a gated debug menu, debug deep link and simulated clock and offline mode to React
- Open source
- 16 GitHub stars
- Developer tools

Checks React Native code for accessibility labels, touch targets, text scaling
- Open source
- 16 GitHub stars
- Developer tools

Sells a one-time Premium unlock through the App Store and Google Play
- Open source
- 16 GitHub stars
- Finance and payments

Walks an Expo app through an SDK, Xcode or Android toolchain upgrade in one commit
- Open source
- 16 GitHub stars
- Developer tools

Builds React Native forms with one valibot schema, catalog-key errors and keyboard-aware
- Open source
- 16 GitHub stars
- Developer tools


