Choose transaction boundaries and handle concurrent writes correctly.
Scanned 9/3/2026
Install to Claude Code
npx -y skills add Andersseen/agentyx --skill transactions-and-consistency --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Transactions And Consistency?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/andersseen-transactions-and-consistency)More formats (shields.io, HTML) on the badges page.
---
name: transactions-and-consistency
description: Choose transaction boundaries and handle concurrent writes correctly.
---
# Transactions and consistency
Concurrency defects are rare in testing and constant in production. Decide the boundary and the
isolation deliberately.
## Scope transactions tightly
A transaction should cover exactly the writes that must succeed or fail together. Long transactions
hold locks and connections, and turn one slow operation into a system-wide stall.
## Keep external calls outside
Never hold a transaction open across a network request to another service. The remote call cannot be
rolled back, and its latency becomes lock duration.
## Know your isolation level
The default isolation of your database determines which anomalies are possible. Read-modify-write
sequences need explicit locking or a compare-and-set, because reading and then writing is not atomic.
## Make retries safe
Give operations an idempotency key so a retried request cannot apply twice. Clients, queues and
proxies all retry, and at-least-once delivery is the normal case.
## Prefer atomic operations to read-then-write
Let the database compute the new value in one statement instead of reading it into the application
and writing it back. That closes the window where another writer intervenes.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!