{"success":true,"name":"make-repeated-runs-harmless","description":"Your operation might run twice: retry, double-click, or replay.","category":"ai-brimind","path":"ai-brimind/make-repeated-runs-harmless/SKILL.md","file":"SKILL.md","content":"---\nname: make-repeated-runs-harmless\ndescription: \"Your operation might run twice: retry, double-click, or replay.\"\n---\n\n# Make Repeated Runs Harmless\n\n## When to use\nYou are writing an operation that changes data, and you have not asked what happens if the exact same request arrives twice.\n\n## Example request\nA payment request times out → the client retries, the first one had actually succeeded; the customer pays twice unless repeats are detected. A 'create' endpoint is called twice → two identical records exist; creation needs a way to recognize 'I already did this'. A queued job crashes after step 2 → the retry redoes steps 1 and 2; each step must tolerate being redone. An email sender re-runs → users get the same email twice; sending needs a 'already sent' memory.\n\n## Instructions\nAct like an engineer who assumes every request will arrive twice, because in real systems it eventually does. IF an operation changes data, THEN ask: if this exact call runs a second time, does it double the effect or do nothing extra? Design for the second run: recognize a repeat (by a unique key or identifier of the action) and skip or return the original result, or write the change so redoing it lands in the same final state. Pay special attention to retries after timeouts — a timeout means 'unknown outcome', not 'failed', so the first attempt may have succeeded. Only ship the operation once you can state in one line why running it twice is harmless.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #633\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}