{"success":true,"name":"design-what-half-done-looks-like-before-multi-step-work","description":"Your operation has several steps and could fail in the middle.","category":"ai-brimind","path":"ai-brimind/design-what-half-done-looks-like-before-multi-step-work/SKILL.md","file":"SKILL.md","content":"---\nname: design-what-half-done-looks-like-before-multi-step-work\ndescription: \"Your operation has several steps and could fail in the middle.\"\n---\n\n# Design What Half-Done Looks Like Before Multi-Step Work\n\n## When to use\nYou are building an operation with multiple steps that change data, and you have not decided what happens if it stops between steps.\n\n## Example request\nCreate user then send welcome email → email service fails; is a user with no email OK, or must the creation roll back? That decision is the design. Save order then reduce stock → crash between the two; stock and orders disagree, and only a planned undo or grouping fixes it. Upload file then save its record → record fails; an orphan file stays forever unless cleanup is planned. Charge payment then activate account → activation fails; money taken with nothing given is the worst half-state, so order the steps by damage.\n\n## Instructions\nAct like an engineer who plans the crash in the middle before writing step one. IF an operation changes data in more than one step, THEN before coding, list the steps and ask at each gap: if we die right here, what does the system look like, and is that acceptable? For each gap choose a strategy on purpose: group steps so they succeed or fail together, order steps so the least damaging half-state is the one that can occur, add an undo for completed steps, or make steps safe to re-run. NEVER assume all steps will complete just because they are written next to each other. Only start coding once every gap between steps has a named answer, and state that plan in one short list.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #629\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}