sync-worker

Coordinate background queue processing with atomic claims and retry handling.

6|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/anotherben/claude-harness --skill sync-worker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync-worker
Source: https://github.com/anotherben/claude-harness/tree/main/skills/sync-worker
Command: npx skills add https://github.com/anotherben/claude-harness --skill sync-worker

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Background processing patterns to ensure reliable, idempotent, and scalable queue execution across multiple workers and systems.

Core Features & Use Cases

  • Atomic queue claims using FOR UPDATE SKIP LOCKED to avoid duplicate work.
  • Exponential backoff and dead-letter handling for robust retry logic.
  • Checkpointing, stale-lock detection, and echo-detection patterns to prevent loops and quota waste.

Quick Start

Review existing workers, adopt atomic claim patterns, implement backoff, and add dead-letter handling to new queues.

Frequently Asked Questions about sync-worker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent duplicate work in background queue processing with multiple workers?

Prevent duplicate work in background queue processing by using atomic queue claims with FOR UPDATE SKIP LOCKED, ensuring multiple workers safely claim unique jobs without overlapping execution. This pattern coordinates reliable, scalable processing across concurrent workers.

What is the best way to handle failed background jobs without losing data?

Handle failed background jobs safely by implementing exponential backoff for transient errors and dead-letter handling for permanent failures. This robust retry logic ensures safe re-execution while isolating problematic jobs to prevent quota waste and data loss.

How does checkpointing work for reliable queue workers?

Checkpointing for reliable queue workers saves execution progress so interrupted jobs can resume without restarting from the beginning. Combined with stale-lock detection and echo-detection, it prevents infinite retry loops and ensures idempotent processing across system failures.

Why do my background queue workers get stuck on stale locks?

Background queue workers get stuck on stale locks when prior execution crashes leave rows permanently locked. Implement stale-lock detection and recovery patterns to identify abandoned jobs and safely re-queue them, preventing system bottlenecks and avoiding duplicate work during retries.

Can I use these background queue patterns for email_queue and sync workers?

Yes, you can use these background queue patterns for email_queue and sync workers like rex_sync_queue and rex_sync_retry_queue. The atomic updates, backoff, and checkpointing mechanisms apply broadly to any system requiring reliable, idempotent background job execution.