{"success":true,"name":"protect-users-from-destructive-actions-friction-or-undo","description":"Wiring a delete/remove/reset action in a frontend and about to just call the API.","category":"ai-brimind","path":"ai-brimind/protect-users-from-destructive-actions-friction-or-undo/SKILL.md","file":"SKILL.md","content":"---\nname: protect-users-from-destructive-actions-friction-or-undo\ndescription: \"Wiring a delete/remove/reset action in a frontend and about to just call the API.\"\n---\n\n# Protect Users from Destructive Actions: Friction or Undo\n\n## When to use\nYou are implementing an action that destroys or overwrites data, and its protection (confirmation, undo, or safeguards) isn't designed.\n\n## Example request\nOne-click permanent delete next to the edit button → accidents guaranteed; separating destructive actions spatially and styling them as dangerous is the base rule. A confirm dialog saying 'Are you sure? OK/Cancel' → users click OK on reflex; naming the object ('Delete project Alpha?') with verb buttons is the pattern. Confirming EVERY tiny reversible action → dialog fatigue, users stop reading; undo-instead-of-confirm for reversible things is the mechanism. Deleting a whole account with the same friction as deleting a note → risk mismatch; typing-the-name confirmation for catastrophic actions is the standard.\n\n## Instructions\nAct like a safety engineer who matches the protection level to the damage level — too little protection loses data, too much trains users to click through blindly. Classify every destructive action by reversibility: (1) REVERSIBLE (item goes to trash, can be restored) → no dialog at all: act immediately and offer 'Undo' in a toast — this is friendlier AND safer than confirmations users stop reading; check whether the backend supports soft-delete before assuming; (2) HARD TO REVERSE (permanent delete, overwrite) → one confirmation dialog that names the exact object and consequence ('Delete invoice #1042? This cannot be undone.') with verb-labeled buttons ('Delete invoice' / 'Keep it') — never OK/Cancel; the destructive button styled with the reserved danger color, and NOT placed where the default safe button usually sits; (3) CATASTROPHIC (delete account, wipe workspace) → heavy friction: type the name to confirm, or a two-step process. Everywhere: keep destructive buttons visually and spatially separated from frequent actions so misclicks can't reach them, and disable the button while the request runs so double-clicks don't fire twice. Reuse the project's dialog and toast components. If you don't know whether an action is reversible on the backend, ask — the whole design depends on it. Finish by stating each destructive action's class and its matching protection — proving the friction fits the risk.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #412\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}