- Home
- Skills
- Agents & Orchestration
- Repair Resource Lifecycle Race Bugs
More screenshots
Works with the AI tools you already use
Repair Resource Lifecycle Race Bugs
Diagnose and repair asynchronous resource create/update/delete races, tombstones, late callbacks, retries, and reconciliation.
$8.99
Repair Resource Lifecycle Race Bugs
Example session with this skill installed
A delete event for 'user-123' arrived at 10:00:01, but the late 'create' callback finished at 10:00:05, resurrecting the resource. Help me fix this lifecycle race.
- Read your context and instructions
- Compiled the repair resource lifecycle
The issue is a classic resurrection race where the system lacks a terminal state (tombstone) to prevent late-arriving create confirmations from overwriting a completed deletion.
Diagnosis
- Identity:
user-123 - Conflict: The
deleteoperation finished locally, but the provider'screatecallback was still in flight.
Root Cause: The system treats the absence of a record as "not yet created" rather than "already deleted," allowing the late callback to insert a stale record.
Implementation: Tombstone Pattern
Replace the hard delete with a soft-delete tombstone that includes a deleted_at timestamp or a monotonically increasing version ID to discard late-arriving operations.
interface ResourceState {
id: string;
status: 'active' | 'deleted';
version: number;
deletedAt?: Date;
}
async function handleCreateCallback(providerResult: any) {
const { id, version } = providerResult;
// Atomic check-and-set or transaction
const existing = await db.resources.find(id);
if (existing && (existing.status === 'deleted' || existing.version >= version)) {
console.log(`[Lifecycle] Ignoring late callback for ${id}. Resource already terminal.`);
// Cleanup provider resource if necessary
await provider.cleanup(id);
return;
}
await db.resources.upsert({
id,
status: 'active',
version,
updatedAt: new Date()
});
}
Deterministic Test Plan
it('should discard create callback if delete occurred during flight', async () => {
const store = new MockStore();
const lifecycle = new LifecycleManager(store);
// 1. Start creation
const createPromise = lifecycle.create('res-1');
// 2. Immediate delete before callback returns
await lifecycle.delete('res-1');
// 3. Resolve late create callback
await mockProvider.resolveCreate('res-1');
// 4. Invariant: Store must still reflect 'deleted' state
const finalState = await store.get('res-1');
expect(finalState.status).toBe('deleted');
});
Next steps
- Update your database schema to include a
versionordeleted_atcolumn. - Modify the
deletehandler to write the tombstone instead of purging the row. - Add a background TTL task to purge expired tombstones after your max-retry window.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
Repair Resource Lifecycle Race Bugs targets production and repository defects around diagnose and repair asynchronous resource create/update/delete races, tombstones, late callbacks, retries, and reconciliation.. It examines resource generation/operation identity, create versus delete ordering, late provider callbacks, tombstone and terminal-state semantics, retry/idempotency behavior, cleanup ownership, reconciler authority, mixed-version rollout and observability, then establishes one explicit repair contract and focused deterministic validation.
The skill works from repository access or partial evidence such as snippets, logs, configuration, traces, and architecture notes. It preserves existing product/security policy, avoids invented execution claims, and keeps production systems, real credentials, and deployment outside the validation path.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
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 1 month ago
- Passed all security checks, Safe to install