Skip to content
Back to skills

Background Work Skill

ASecurity

Build or change queues, jobs, workers, schedulers, retries, leases, and distributed workflows with bounded concurrency and idempotent recovery.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agents

Works with

  • terminal

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add kinqsradiollc/BrainRouter --skill background-work-skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Background Work Skill?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Background Work Skill
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kinqsradiollc-background-work-skill/badge)](https://www.skillsdirectory.com/skills/kinqsradiollc-background-work-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: background-work-skill
description: Build or change queues, jobs, workers, schedulers, retries, leases, and distributed workflows with bounded concurrency and idempotent recovery.
allowed-tools: [read_file, list_dir, grep_search, glob_files, write_file, edit_file, apply_patch, lsp, run_command, artifact_write]
---

# Reliable background work

## Overview

Assume background work can be duplicated, delayed, interrupted, reordered, or
run concurrently. Make ownership, durable state, retry ceilings, cancellation,
and recovery visible rather than relying on one healthy process.

## When to Use

Use for queues, scheduled jobs, workers, webhooks, event consumers, leases,
distributed workflows, retries, polling, fan-out, and long-running operations.

## Workflow

1. Define the durable unit of work, ownership key, state machine, completion
   evidence, and what makes processing safe to repeat.
2. Separate enqueue acceptance from execution. Persist enough state to resume,
   reconcile, cancel, and explain the job after a process restart.
3. Bound concurrency, attempts, execution time, backoff, payload size, and
   result size. Add jitter and a terminal failure path where repeated retries
   would amplify load.
4. Make side effects idempotent through stable keys, compare-and-set state,
   uniqueness, or downstream idempotency support. Treat at-least-once delivery
   as the default unless stronger guarantees are proven.
5. Handle lease expiry, stale workers, partial progress, shutdown, cancellation,
   and poison input without losing or silently completing work.
6. Test duplicate delivery, concurrent claims, restart, timeout, cancellation,
   exhausted retries, and dependency recovery.

## Verification

- [ ] Work state and completion evidence survive process restart.
- [ ] Concurrency, attempts, time, payload, and output are bounded.
- [ ] Duplicate delivery and stale ownership cannot duplicate side effects.
- [ ] Cancellation and terminal failure are explicit and observable.
- [ ] Recovery tests cover interruption and dependency failure.

## Red Flags

- Fire-and-forget work with no durable status or reconciliation.
- Infinite retry, fixed tight retry loops, or unbounded fan-out.
- A lease with no expiry or a worker heartbeat with no stale-owner recovery.
- “Exactly once” claims based only on queue configuration.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.