{"success":true,"name":"give-form-state-one-clear-owner","description":"Form values are being read or written from several places.","category":"ai-brimind","path":"ai-brimind/give-form-state-one-clear-owner/SKILL.md","file":"SKILL.md","content":"---\nname: give-form-state-one-clear-owner\ndescription: \"Form values are being read or written from several places.\"\n---\n\n# Give Form State One Clear Owner\n\n## When to use\nYou are wiring a form whose values are needed by multiple components or steps, and it is unclear which piece of code owns the current values.\n\n## Example request\nEach input keeps its own value and a parent also keeps a copy → they disagree after an error — duplicated state drifting. A multi-step form stores step data in three places → going back loses entries — no single source of truth. Values are read from the DOM at submit while code also tracks them → two versions of reality — mixed reading strategies. A reset button clears the visible fields → the stored copy still holds old data — state and view out of sync.\n\n## Instructions\nAct as an architect who draws the ownership map before wiring any input. Decide and write down: one single place that owns the form's current values (one object, one store, or the native form itself — pick one strategy, never mix reading from the DOM with tracked state); every input reads from and writes to that owner; validation and submit read only from that owner. For multi-step forms, the owner holds all steps so navigation never loses data. Check whether the project already has a form-handling utility or pattern and follow it instead of inventing a parallel one. If two components both seem to need ownership, stop and identify their closest common parent as the owner rather than duplicating. Only proceed once you can state in one sentence who owns the values and prove every read and write goes through that owner.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #682\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}