Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add j4flmao/agent-skills --skill distributed-lockinggit clone --depth 1 https://github.com/j4flmao/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/j4flmao/agent-skills/distributed-locking)<a href="https://agentmods.dev/skills/j4flmao/agent-skills/distributed-locking"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/distributed-locking/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/distributed-locking"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/distributed-locking.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00113 | $0.04170 |
| Opus 5 | $0.00056 | $0.02085 |
| Sonnet 5 | $0.00023 | $0.00834 |
| Haiku 4.5 | $0.00011 | $0.00417 |
Grade A, and why
backend-distributed-locking scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 508 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Backend Distributed Locking
Purpose
Coordinate access to shared resources across multiple service instances using distributed locks with guaranteed safety properties.
Agent Protocol
Trigger
Exact user phrases: "distributed lock", "Redis lock", "Redlock", "ZooKeeper lock", "advisory lock", "PostgreSQL lock", "pg_advisory_lock", "lease", "distributed mutex", "fencing token", "lock timeout".
Input Context
- Resource being protected.
- Available infrastructure (Redis, PostgreSQL, ZooKeeper, etcd).
- Number of competing instances.
- Duration of the critical section.
Output Artifact
Lock configuration or implementation code. No file unless requested.
Response Format
Provider: {Redis|PostgreSQL|ZooKeeper|etcd}
Strategy: {Redlock|Advisory|Ephemeral|Lease}
TTL: {duration}
Safety: {fencing?}
Completion Criteria
- Lock acquisition and release implemented correctly.
- Lock timeout (TTL) configured.
- Fencing token mechanism in place for critical resources.
- Deadlock prevention: no nested locks.
- Graceful degradation: lock acquisition failure does not crash the service.
Max Response Length
4 lines per lock configuration. 20 lines for implementation.
Architecture Decision Tree
Which Lock Provider?
What infrastructure is already available?
├── Redis → High throughput, short locks, needs Redlock for failover
├── PostgreSQL → Same DB as data, simple setup, lock contention impacts DB
├── ZooKeeper/etcd → Strong consistency, leader election, operational complexity
└── In-memory → Single instance only, NOT distributed
Which Lock Strategy?
Is the critical section short (< 1 second)?
├── Yes → Redis simple lock or PostgreSQL advisory lock
└── No → Is the critical section a resource write?
├── Yes → Lease-based lock with fencing token
└── No → Redlock (Redis with multi-node failover)
Is strong consistency required?
├── Yes → ZooKeeper/etcd (sequential consistency, fencing built-in)
└── No → Is failover safety required?
├── Yes → Redlock (Redis, 3+ nodes)
└── No → Single Redis lock or PG advisory lock
What ships with it
9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/distributed-locking-advanced.md 6.6 KB
- references/distributed-locking-fundamentals.md 6.0 KB
- references/fencing-tokens-deep.md 5.8 KB
- references/lock-contention-analysis.md 8.9 KB
- references/lock-deep-dive.md 3.6 KB
- references/lock-implementations.md 3.4 KB
- references/lock-providers.md 7.4 KB
- references/lock-strategies.md 4.2 KB
- references/lock-testing.md 8.1 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 508 lines · 113 tokens per session scan A d9407f4ec21b
backend-distributed-locking is a skill published in the GitHub repository j4flmao/agent-skills (23 stars, last pushed 5d ago), licensed MIT. It adds 113 tokens to every session and 4,170 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
nestjs-scheduling
Implement distributed cron jobs with Redis-based locking and BullMQ offloading in NestJS. Use when adding @Cron scheduled tasks, preventing duplicate runs across pods, or delegating heavy work to queue workers.
using-redis-token-buckets
Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…
spring-boot-cache
Provides patterns for implementing Spring Boot caching: configures Redis/Caffeine/EhCache providers with TTL and eviction policies, applies @Cacheable/@CacheEvict/@CachePut annotations, validates cache hit/miss behavior, and exposes metrics via Actuator. Use when adding caching to Spring Boot services, configuring…
using-redis-token-buckets
Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…
spring-data-redis
Use when implementing caching, session storage, rate limiting, or any Redis integration. Covers cache-aside pattern, key naming, TTL strategy, and serialization config.
background-job-orchestrator
Expert in background job processing with Bull/BullMQ (Redis), Celery, and cloud queues. Implements retries, scheduling, priority queues, and worker management. Use for async task processing, email campaigns, report generation, batch operations. Activate on "background job", "async task", "queue", "worker", "BullMQ"…