background-work
Skill0 starsChanged 4 days agoMITView on GitHub
What the operating systems allow when the app is not in front, and how long-running work should report progress. Use when a feature needs to keep working after the screen closes, run on a schedule, show progress or send notifications.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- accessibilitySkill
- actionsSkill
- adding-a-featureSkill
- agent-workflowSkill
- app-contextSkill
- approval-and-safetySkill
- backend-proxySkill
- build-an-appSkill
- capture-learningsSkill
- clean-architectureSkill
- customizing-the-assistantSkill
- delegate-to-agentSkill
- edit-boundariesSkill
- i18n-and-rtlSkill
- model-providersSkill
- performanceSkill
- permissions-and-platformSkill
- read-the-docsSkill
- reliable-mutationsSkill
- routingSkill
- secretsSkill
- state-managementSkill
- storing-dataSkill
- testingSkill
- ui-designSkill
- upgrade-the-frameworkSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Don't load this for slow code that freezes the screen.
- Very specific: line 30
Keep job state in the database (storing-data), not in memory, so the app can pick up after being closed.
- Distinctive: line 32
Use a notification only to tell the person something finished or needs them, and only after a permission request that the person can refuse.
- Very specific: line 33
If a real background mechanism is unavoidable, ask the person for the dependency first, then add its platform settings …
- Distinctive: line 45
No automated check. Review by hand: can the person see it, stop it, and find it again after a restart?
- Very specific: line 46
Test the job's steps as actions (testing) and run the app on a real device in the background for the platforms you support.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Background work
Don't load this for slow code that freezes the screen; see performance. For platform permissions, see permissions-and-platform.
Rule
Long work shows its progress in the UI and can be stopped. No hidden loop, timer or isolate keeps working on its own. Anything that needs a new dependency (background execution, notifications, scheduling) needs the person's approval first: say what it is for and what it costs, and wait. No automated check exists for this rule; the app today has no background work (lib/main.dart only starts the app), except the in-app model download in projects set up with --model both or on-device, which shows progress and can be cancelled.
Why
Mobile systems stop or kill background apps, so work that only runs "in the background" silently does not finish. Hidden work also cannot be approved, observed or cancelled by the person, which breaks the idea that the UI and assistant share one visible set of actions.
How
What each OS allows, in short:
- iOS: almost nothing once the app is suspended; short grace time, then system-scheduled refreshes at the system's discretion. Exact timing is not available.
- Android: background work must be scheduled through the system (and long work shown with a foreground-service notification); the system limits it further when battery is low.
- Web: nothing runs when the tab is closed; throttled when hidden.
- macOS, Windows, Linux: the app keeps running while it is open, even without focus; nothing runs after it quits unless the person sets up a login item or service.
So design for "work happens while the app is open", and make the rest resumable:
- Make the work an action (
actions) that does one bounded piece and returns. A long job is many small calls, each recorded. - Keep job state in the database (
storing-data), not in memory, so the app can pick up after being closed. - Show progress in a screen the person can open: a count, a status line, a stop button. Put the same facts in the screen summary (
app-context) so the assistant can report them. - Use a notification only to tell the person something finished or needs them, and only after a permission request that the person can refuse.
- If a real background mechanism is unavoidable, ask the person for the dependency first, then add its platform settings (
permissions-and-platform).
Anti-patterns
- A
Timer.periodicor endlesswhileloop started at launch. - Assuming a task will run on a schedule on iOS.
- Adding a plugin because "it is only one package".
- Progress kept only in a variable, lost when the app closes.
- An action that runs for minutes with no way to cancel.
Verification
- No automated check. Review by hand: can the person see it, stop it, and find it again after a restart?
- Test the job's steps as actions (
testing) and run the app on a real device in the background for the platforms you support.
Related skills
actions— one bounded step per callstoring-data— job state that survives restartsreliable-mutations— safe retries of a steppermissions-and-platform— notification and background settings
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

