agentleFS
hi-donwihi-donwi/Donwi-Skills/skills/background-jobs/SKILL.md

background-jobs

Skill0 starsChanged 13 days agoMITView on GitHub

Build durable background jobs, scheduled tasks, transactional outboxes, retries, leases, and dead-letter recovery. Use for asynchronous business effects, not CI pipelines or frontend async state.

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use query-optimization, containerization and 5 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ffsshhttiikkSkill

    query-optimization

    Database query optimization

    Also in 4 projects that use this

  • mmondoraSkill

    containerization

    Docker best practices for cloud-native applications. Multi-stage builds, distroless images, security scanning, non-root users, Cloud Run orchestration. Use when writing Dockerfiles, configuring container builds, or deploying to Cloud Run/GKE.

    Also in 3 projects that use this

  • mmondoraSkill

    infrastructure-as-code

    Infrastructure as Code with Terraform and Pulumi. State management, modularity, drift detection, secrets handling. Use when provisioning cloud resources, writing Terraform/Pulumi modules, or managing infrastructure configuration.

    Also in 4 projects that use this

  • wpankSkill

    caching

    Caching strategies, invalidation, eviction policies, HTTP caching, distributed caching, and anti-patterns. Use when designing cache layers, choosing eviction policies, debugging stale data, or optimizing read-heavy workloads.

    Also in 4 projects that use this

  • harrissohail6Skill

    caching-strategies

    Caching patterns and strategies. Auto-activates when implementing caching, Redis, or performance optimization.

    Also in 3 projects that use this

  • harrissohail6Skill

    clean-architecture

    Clean architecture and SOLID principles. Auto-activates when designing systems or refactoring code structure.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Commit the job or outbox with the initiating local mutation.

    line 30
  2. Distinctive:

    Test crashes before/after effects, dispatch loss, stale workers, cancellation, and replay.

    line 43
  3. Distinctive:

    Every committed intent is recoverable.

    line 51

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Background Jobs and Durable Effects

Overview

Persist the intention before dispatch and make repeated delivery safe. Broker acknowledgment is not proof that a business effect happened exactly once.

When to use

  • Adding workers, recurring tasks, durable dispatch, retries, or crash recovery.
  • Coordinating database commits and asynchronous external side effects.

Hand off when

NeedSkill
HTTP delivery signatures and partner endpoint safetywebhook-integrations
Human approval policy and document revisionsworkflow-approvals
Pipeline jobs and automated build gatesci-cd

Process

  1. Define job identity, scope, initiator, payload version, operation key, timeout, retry budget, cancellation, ordering, and the business completion condition.
  2. Commit the job or outbox with the initiating local mutation. Use a durable existing mechanism; do not introduce a broker or paid service solely because this skill loaded.
  3. Claim work atomically with a lease and incarnation/fencing token. Renew or expire ownership explicitly; a recovered worker must not accept a former owner's commit.
  4. Deduplicate each business effect with stable operation keys. For external systems, use supported idempotency or reconcile uncertain results before sending again.
  5. Reconstruct verified tenant context and current permissions/lifecycle in workers. Payload fields are not authority; cap per-tenant concurrency and resource consumption.
  6. Retry only transient failures with bounded backoff and jitter. Preserve attempt history; dead-letter permanent or exhausted work and expose an authorized recovery path.
  7. Specify recurrence timezone, daylight-saving behavior, overlap, missed runs, and a stable occurrence key. Catch-up must not bill, renew, or notify twice.
  8. Monitor queue age, completion latency, failed attempts, and abandoned leases. Test crashes before/after effects, dispatch loss, stale workers, cancellation, and replay.

Red flags

  • Best-effort publish after commit, unbounded retries, or acknowledgment before durable state.
  • Treating deduplicated messages as deduplicated external effects.
  • Replaying dead-letter work without checking current authority or payload compatibility.

Verification

  • Every committed intent is recoverable; duplicate attempts produce one business result.
  • Stale workers cannot commit and uncertain external outcomes have reconciliation.
  • Scheduling, cancellation, tenant fairness, and dead-letter replay are tested.

References

  • references/durable-execution.md - crash boundaries and recovery contracts.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.