AI-generated code assumes a single-user demo: a cache that's never invalidated, two users editing the same row, a socket that reconnects but never re-syncs, state that's fine until it's concurrent. It passes your manual test and breaks under real traffic. Name the shared state and the concurrent paths explicitly, add a load test (k6, Locust, or Playwright) that simulates the real pattern, and wire up error tracking so the race conditions that only surface in production actually reach you.
Prompt to paste
This works for one user but I'm worried about concurrency. Walk the code for shared or global state, caches, and any resource two users could touch at once. List the race conditions and stale-state risks, explain what breaks under load, and propose a fix for each. Then write a load test that reproduces the worst one.