Cancellation & Terminal State Safety
Make asynchronous work terminate exactly once across generator return, cancellation, timeouts, lost wakeups, permit ownership, competing completions, blocked workers, and shutdown. This bundle repairs the state transitions where a caller believes work ended but tasks, locks, or callbacks remain active. Use it for intermittent hangs, duplicate finalization, late results, and resource leaks during cancellation.
Works with every agent that reads SKILL.md — Claude Code, Cursor, Codex CLI, Gemini CLI, GitHub Copilot, Windsurf, OpenClaw, and more.
One payment, lifetime access. 8 skills unlock instantly in your library.
What's included
8 skillsRepair async-generator cleanup leaks after early break, return, throw, timeout, cancellation, or pending-next races.
Repair lost cancellation signals, orphaned async work, retry-after-cancel bugs, stale completions, and unclear request-vs-durable task lifetimes.
Repair double completion, duplicate callbacks, timeout/cancel races, stale retry callbacks, duplicate response writes, and cleanup running twice.
Repair lost wakeups in condition variables, worker queues, shutdown gates, wait/notify loops, and hand-built events.
Repair semaphore permit leaks and over-release bugs across exceptions, cancellation, timeouts, task submission, and shutdown.
Repair thread-pool starvation from nested waits, callback affinity, fan-out, or shutdown competition without adding capacity.
Repair apps that lose jobs, events, or writes when containers restart, deployments roll, or processes receive termination signals.
Safely detect, verify, quarantine, and clean up orphaned cloud resources after failed provisioning, deletions, or database drift.
See it in action
Repair Async Generator Cleanup Bugs
Example session with this skill installed
Our TypeScript service wraps a broker subscription in two async-generator adapters. Breaking from for-await closes the outer generator, but the inner subscription keeps receiving messages and its heartbeat timer survives. A pending next() can also resolve after cancellation and publish one more value. Repair locally with a fake subscription and controlled promises. Preserve message order, buffer size, retry behavior, and timeout values; do not connect to the broker.
- Read your context and instructions
- Compiled the repair async generator
Cleanup leak found. The adapter forwards next but not return, so breaking from for-await leaves the source producer and subscription alive. The repair forwards all terminal operations, makes finalization single-owner, cancels the pending read, preserves the original error, and verifies that no value or resource survives termination.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs these skills for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every skill in this bundle passes our trust checks.
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