- Home
- Skills
- APIs & Backend
- Repair ETag Precondition Races
Works with the AI Agents you already use
Repair ETag Precondition Races
Repair ETag and HTTP precondition bugs that allow lost updates, stale overwrites, incorrect 304/412 responses, or weak-validator misuse.
$1
Repair ETag Precondition Races
Example session with this skill installed
Our Java REST API reads the row version, checks If-Match in the controller, then updates in a separate transaction. Two writers can both pass and one silently overwrites the other. Repair with barriers and an in-memory repository. Preserve authorization, transaction isolation, conflict response body, audit events, and retry policy.
- Read your context and instructions
- Compiled the repair etag precondition
Atomic-precondition defect found. The controller validates ETag against a detached snapshot, while the later update predicate does not include that version, so both writers can pass. The repair moves strong If-Match enforcement into the atomic write condition, preserves authorization/audit/conflict contracts, distinguishes wildcard and weak validators, and proves exactly one winner with deterministic barriers.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Race conditions occur when HTTP If-Match checks are evaluated outside of the database transaction, leading to lost updates or stale data corruption. Weak ETags are often incorrectly accepted for unsafe methods, or 304/412 status codes are reversed, breaking client-side caching logic.
What it does
- Audits repository code to find non-atomic precondition checks in read-modify-write cycles.
- Refactors ETag generation to ensure validators accurately identify specific representation versions.
- Standardizes strong versus weak comparison logic and wildcard semantics across create and update paths.
- Implements deterministic local fixtures and barriers to verify concurrency fixes without production access.
- Injects redacted observability to track rejections and terminal state transitions.
Why this beats prompting it yourself
General LLMs often suggest simple retries or lock-waits that don't address the underlying architectural flaw of non-atomic validation. This skill enforces a strict resource register and failure timeline, ensuring the fix is bound to the transaction lifecycle rather than just adding "optimistic" fluff.
Use cases
- Preventing two concurrent writes from both passing a stale If-Match precondition.
- Correcting repository logic where 304 Not Modified is sent for changed resources.
- Hardening API endpoints that allow weak ETags for PUT or PATCH operations.
- Fixing inconsistent wildcard handling between resource creation and updates.
Known limitations
Requires access to local repository files to inspect logic. It cannot fix issues residing in external load balancers, CDNs, or third-party API gateways that strip headers.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Cannot choose or change authorization, business conflict handling, transaction isolation, cache policy, response bodies, status contracts, and idempotency; cannot verify production infrastructure or prove every runtime, proxy, network, or scheduler ordering.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago
Permissions
Run on a clean branch with repository files and disposable local fixtures. Review every patch and validation result before merge. Keep production services, real credentials, customer payloads, and deployment out of scope.