concurrency-anomaly-detector
Concurrency Anomaly Detector
When to Use
You have existing application code that interacts with a database and you need to know whether it is safe under concurrent execution.
This skill applies when:
- A bug only manifests under concurrent load and is hard to reproduce in tests
- Code is being reviewed before deployment to a high-concurrency environment
- The application recently migrated to a database with a different default isolation level
- The codebase accesses multiple tables in a single transaction
- Any code follows the pattern: read a value, make a decision, write a result
The core insight from Kleppmann: Concurrency bugs caused by weak transaction isolation are not just theoretical. They cause real financial losses and data corruption. They are triggered only by unfortunate timing, making them nearly impossible to catch by testing. The only reliable approach is to analyze the code structure — not the test results — and identify which patterns are structurally vulnerable.
Companion skill: transaction-isolation-selector — once anomalies are identified, that skill selects the minimum safe isolation level. This skill identifies what anomalies exist in current code; the companion skill recommends what to do about them.