Build a Form
End-to-end workflow for building and validating a form
CLAUDE.md
When building a form:
- Define the form fields, their types, and validation rules.
- Create the form component with controlled inputs and labels.
- Add client-side validation with clear, specific error messages per field.
- Add a submit handler that disables the button during submission and shows a loading state.
- Handle the API response: show a success message or display server-side errors mapped to the correct fields.
- Test with valid data, empty fields, invalid formats, and rapid double-submission.
- Verify keyboard navigation: Tab through all fields, submit with Enter.
Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.