Works with the AI tools you already use
Repair Semaphore Permit Leaks
Repair semaphore permit leaks and over-release bugs across exceptions, cancellation, timeouts, task submission, and shutdown.
Secure checkout via Stripe
See it in action
You say
Our Java ingestion service acquires a fair Semaphore before submitting work to an ExecutorService. If execute() rejects the task or cancellation wins before the worker starts, the callback that normally releases the permit never runs. After repeated deploy drains, all permits disappear and new requests block. Repair locally with a fake executor and deterministic barriers. Preserve the permit count, fairness, queue policy, timeout values, and retry behavior; do not touch production workers.
Your agent does
Permit leak found. The request acquires before task submission, but executor rejection bypasses the callback that normally releases it. The repair assigns ownership immediately after successful acquire, transfers it only after accepted submission, funnels all terminal paths through one guarded release, and validates rejection, cancellation, timeout, and duplicate-cleanup orderings with deterministic barriers.
What you get
About this skill
The problem
Concurrency gates often fail silently when semaphores leak permits after exceptions or cancellations. This leads to services that gradually stop accepting work despite having idle resources or, conversely, exceeding configured limits.
What it does
- Identifies every semaphore instance and guarded resource across the codebase.
- Reconstructs permit ownership timelines for success, timeout, and cancellation paths.
- Repairs acquisition/release symmetry to ensure every permit has exactly one terminal disposition.
- Fixes partial-failure cleanup in weighted/multi-permit acquisition logic.
- Implements idempotent, owner-aware release mechanisms without altering business retry logic.
Why this beats prompting it yourself
General LLMs often suggest simple try-finally blocks that fail during complex race conditions or async cancellations. This skill uses a strict conservation invariant and permit-ownership registry to ensure logic is mathematically sound across all possible failure states.
Use cases
- Fixing services that eventually hang or "freeze" under high load.
- Ensuring worker pools don't exceed memory limits due to double-releases.
- Hardening async task submissions where permits are stranded on submission failure.
- Converting sleep-based race tests into deterministic concurrency barriers.
Known limitations
Does not modify global infrastructure settings like external load balancer capacity. Requires repository access to inspect local synchronization primitives.
How to install
Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean today
- 30-day refund guarantee
- One-time purchase, yours forever
- Secure checkout via Stripe
Frequently Asked Questions
Popular in AI Agents & LLM Ops

AI Coding Prompt Refiner for Better Developer Results
Transforms vague coding requests into precise, scoped, testable, AI-ready prompts for Cursor, Claude Code, Codex CLI, Replit, and other coding agents.
agentic-workflow
A risk-aware, evidence-based engineering lifecycle protocol for robust agentic task execution and safety.
codex-grade-coding
Turn your AI agent into a senior engineer with strict task classification and verification-driven coding protocols.
truth-first
Eliminate hallucinations with an evidence-first verification framework for system state, configs, and file contents.