Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

background-agents

FreeRuns bundled scriptsNot checked

Configure and run background agents with reusable profiles for agent engines, model providers and execution backends. Use when delegating background work…

glebisby glebis★ 417 GitHub stars

About this skill

Background Agents

Run the requested work through a selected profile, verify the remote outcome, and return usable results with run references.

Keep four choices separate: execution backend (Trigger.dev by default), agent engine (for example Pi), model provider, and model. Changing one does not automatically change the others. Profiles select deployed tasks; they do not install a new engine or grant it tools.

Select configuration

Use the configuration explicitly supplied by the user, otherwise BACKGROUND_AGENT_PROFILES, otherwise agents.profiles.json in the working project. Do not search unrelated projects or reuse remembered account/project identifiers.

Read references/profiles.md when creating, extending or resolving profiles. Copy assets/profiles.example.json as a starting point; it contains environment references, not working deployment identifiers.

The standard-library helper lists and resolves profiles without executing jobs:

python3 scripts/profiles.py --config agents.profiles.json list
python3 scripts/profiles.py --config agents.profiles.json validate
python3 scripts/profiles.py --config agents.profiles.json resolve pi-openrouter

Run helper commands from this skill folder, or use the helper's resolved path and the project's configuration path. An explicit profile takes precedence over defaultProfile. Unset references, unknown profiles, disabled profiles and inheritance cycles stop resolution. An omitted backend resolves to Trigger.dev. An explicitly selected different backend must never silently fall back to Trigger.dev.

Confirm the deployed contract

Inspect the selected backend's task metadata or implementation before execution:

  • Match project, environment, task, expected input/output and available tools.
  • Verify engine/provider/model when the profile specifies them. A profile's model label is an expectation, not a model override supported by every task.
  • Check actual concurrency, duration and retry settings. Profile limits describe desired bounds; they do not reconfigure a deployed task by themselves.
  • For Trigger.dev, development runs use a local worker; cloud execution requires a deployed production, staging or preview worker. Keep the selected environment explicit.
  • Distinguish a fresh per-run session from durable conversation state. Do not promise continuity unless the task implements it.

If the task lacks a required capability, use an already deployed compatible profile or implement the missing capability within the user's scope. Do not ask a prompt-only agent to claim it searched, ran tools or updated records.

Execute and verify

For Cloudflare Workers/Workflows, read references/cloudflare.md. The optional adapter and Worker template support a prompt-only Pi core engine; Trigger.dev remains the default.

Prefer an available backend MCP tool when it supports the selected profile and required operation. For Trigger.dev, the CLI is a fallback:

npx trigger.dev@latest tasks trigger "$TASK_ID" \
  --project-ref "$PROJECT_REF" --env "$ENVIRONMENT" \
  --payload-file payload.json --idempotency-key "$REQUEST_ID" \
  --wait --timeout "$TIMEOUT_SECONDS"

Derive these values from the resolved profile and actual task contract. Include a branch/login profile when required. Check the installed CLI's help for current flags.

  • Give each job a bounded payload and a stable request identity derived from its operation and canonical inputs. Reuse it when an outcome is uncertain; changed inputs need a new identity.
  • Respect shared provider quotas as well as task concurrency. Moving work to another backend must not bypass a shared research allowance.
  • Preserve receipts with profile, environment, task, request identity, run ID/status and result disposition. Keep private payloads and credentials out of general receipts.
  • A submission or deployment is not a completed job. Inspect terminal status and output. After a timeout, reconcile the existing run before submitting another.
  • For failures, fix a demonstrated cause before a bounded retry. Stop and report when repeated failures require a credential, capability or external change.
  • Do not wrap Trigger.dev wait.*, triggerAndWait or batchTriggerAndWait in Promise.all.

Handle results

Validate outputs against the task's actual schema and the user's acceptance criteria. For source review or enrichment, read references/evidence-review.md before dispatch and before import. Unknown, proposed, accepted and verified outcomes remain distinct.

Import only the intended validated results. Correct an error in an agent-generated proposal without rewriting unrelated records or changing review decisions. Report completed/failed/pending coverage, useful results, unresolved gaps and remote run links. Say whether the work used saved evidence or fresh external research.

Creden

Full SKILL.md on GitHub

Install background-agents in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

agents/openai.yamlassets/cloudflare-worker/.gitignoreassets/cloudflare-worker/package.jsonassets/cloudflare-worker/src/index.tsassets/cloudflare-worker/src/pi-agent.tsassets/cloudflare-worker/tsconfig.jsonassets/cloudflare-worker/wrangler.jsoncassets/profiles.example.jsonreferences/cloudflare.mdreferences/evidence-review.mdreferences/profiles.mdscripts/cloudflare_workflows.pyscripts/profiles.pyscripts/test_cloudflare_workflows.pyscripts/test_profiles.py

FAQ

What does the background-agents skill do?

Configure and run background agents with reusable profiles for agent engines, model providers and execution backends. Use when delegating background work, reusing agents across sessions, or adding an engine or backend. Trigger.dev and Cloudflare Workflows are available backends; the approach is extensible. Includes optional source-backed evidence review.

How do I install the background-agents skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the background-agents skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare background-agents with