{"success":true,"name":"make-form-submission-states-visible-and-safe","description":"You are wiring a form's submit button and its result handling.","category":"ai-brimind","path":"ai-brimind/make-form-submission-states-visible-and-safe/SKILL.md","file":"SKILL.md","content":"---\nname: make-form-submission-states-visible-and-safe\ndescription: \"You are wiring a form's submit button and its result handling.\"\n---\n\n# Make Form Submission States Visible and Safe\n\n## When to use\nYou are implementing or fixing the submit action of a form, and the button, loading state, error display, or double-submit protection is not yet handled.\n\n## Example request\nUser clicks Send twice → two identical requests fire — missing submit lock while pending. Request fails → nothing changes on screen; user thinks it worked — missing visible error state. Server rejects one field → the whole form clears and the user retypes everything — input not preserved on error. Success happens → but the button still says loading forever — the pending state was never reset.\n\n## Instructions\nAct as a careful implementer who treats every submit as a small state machine: idle → submitting → success or error. Before coding, list these four states and define exactly what the user sees in each: disable the button and show a pending indicator while submitting; on success, show clear confirmation and reset or redirect; on error, show a readable message next to the problem and keep the user's typed values intact; always return the button to a usable state. Check whether the project or its form library already provides pending/error handling and reuse it instead of hand-rolling flags. If you are unsure what the server returns on failure (status codes, error body shape), inspect a real response first — do not invent the error format. Only confirm the task done when all four states are demonstrably handled and you can explain how double submits and silent failures are now impossible, not just unlikely.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #673\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}