Create a Dart-based macOS background activity process managed by launchd. Use when Codex needs to scaffold or fix a LaunchAgent for a Dart program, generate the executable entrypoint, write the plist, or ensure App Background Activity shows the intended process name instead of a shell wrapper.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Create a Dart-based macOS background activity process managed by launchd. Use when Codex needs to scaffold or fix a LaunchAgent for a Dart program, generate the executable entrypoint, write the plist, or ensure App Background Activity shows the intended process name instead of a shell wrapper.
Create Dart Background Activity Process
Workflow
Check repo and environment first.
If the repo uses FVM, run Dart and Flutter commands through fvm.
Prefer a checked-in executable entrypoint path such as daemon/bin/<service_name> or bin/<service_name>.
Define the background process shape.
Choose a stable launchd Label, for example com.example.sync_agent.
Decide whether the process is:
a pure Dart CLI launched with dart run
an AOT-compiled Dart executable
a wrapper script that resolves the Dart SDK and then execs the real process
Prefer an AOT executable or a checked-in launcher script over /bin/zsh -lc ....
Create the Dart entrypoint.
Add or update a dedicated CLI entrypoint such as bin/<service_name>.dart.
Keep startup deterministic:
parse config from env vars or a config file
initialize logging early
trap termination signals if graceful shutdown matters
keep the main isolate alive with the long-running task loop
If the service needs restart safety, make failures exit non-zero and let launchd restart it.
Create a real executable for launchd.
Do not register /bin/zsh, /bin/bash, or sh as ProgramArguments[0].