Index of every page on this site: llms.txt
All skills
neha avatar

/forms-and-validation

@eb9f097
Run it yourself

Review React Native forms for validation timing, keyboard handling, error focus, and preserved dirty state. Use when building or reviewing login, signup, checkout, settings, or multi-step forms.

Use this Skill: https://skilld.dev/gh/neha/rn-developer-skills/forms-and-validation

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈54 tokens for metadata: the name and description. ≈1k when used: this file.

Description uses 2.7% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈217 characters, or 2.7%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Forms and Validation Skill

Applicability

  • Platforms: iOS and Android
  • React Native: 0.76+ (New Architecture interop assumed unless a checklist item says otherwise)

When to Use

  • Building or reviewing a login, signup, checkout, settings, or other multi-field form
  • Changing validation, keyboard behaviour, or submit handling
  • Reviewing a wizard or multi-step flow that collects user input

Severity

  • Merge-blocking: a double submit, or this diff discards dirty input with no prompt.
  • Should-fix: validation timing, keyboard, and autofill.

Guidance

State

This skill owns whether dirty form input survives navigation.

  • Each field has one source of truth; the screen does not mix uncontrolled inputs with a second copy of the same value
  • Dirty values survive leaving the screen and coming back, including when the app is backgrounded mid-edit
  • A submit in flight is not sent again (the button ignores repeat presses). Retrying a failed POST when the network returns is owned by state-and-data
  • Leaving with unsaved changes asks the user before discarding, when the data would be lost

Validation

  • Format checks run on blur or submit, not on every keystroke
  • Server checks (taken email, payment decline) run on submit and map to the field they belong to
  • The first invalid field is scrolled into view and focused
  • Errors are text next to the field and are announced. Colour-only state is owned by accessibility
  • The submit control shows a loading state and stays disabled only while the request is in flight, with a visible reason when it cannot be used

Incorrect:

<TextInput
  value={email}
  onChangeText={(next) => {
    setEmail(next);
    setEmailError(isEmail(next) ? '' : 'Enter a valid email');
  }}
/>

Correct:

<TextInput
  value={email}
  onChangeText={setEmail}
  onBlur={() => setEmailError(isEmail(email) ? '' : 'Enter a valid email')}
  accessibilityLabel="Email"
  keyboardType="email-address"
  autoCapitalize="none"
  textContentType="emailAddress"
/>

Keyboard and platform input

  • The focused field stays visible above the keyboard (keyboard avoiding view, or a scroll view that knows the keyboard inset)
  • The keyboard type matches the field (email, phone, number, decimal)
  • Secure fields use secure entry and do not log their values
  • Autofill hints (textContentType / autoComplete) are set for credentials and contact fields
  • A multi-step form keeps earlier steps' values until the whole flow finishes or the user cancels

Accessibility

  • Every input has a label
  • The error is associated with its field and announced when it appears
  • Focus moves to the error, or the error summary, after a failed submit

Anti-Patterns

Anti-Pattern Risk Fix
Validating on every keystroke The field is "wrong" before the user finishes typing Validate on blur and on submit
Clearing the form when the screen blurs Back navigation or a permission prompt wipes the draft Keep draft state above the screen, or in a store that survives the pop
Disabling submit with no message The user cannot tell what is missing Keep submit available and show field errors, or explain the disabled state
Retrying a failed POST automatically A payment or signup can be created twice Retry only when the user asks, after confirming the server did not apply it

Pitfalls

  • iOS and Android report keyboard height differently, and Android's adjustResize can double-shift a view that also uses a keyboard-avoiding wrapper. Test both.
  • Numeric keyboards still allow paste of non-numeric text. Validate the value, not the keyboard.
  • secureTextEntry can reset the cursor or clear the field on some Android versions when toggled. Test the show/hide password control.
  • A wizard that stores steps only in screen state loses them when a step unmounts. Keep the draft in one place that outlives each step.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    The skill is a standard technical checklist for reviewing React Native forms and validation logic. It promotes security and accessibility best practices without containing any executable code or malicious patterns.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

Signed by skilld at eb9f097. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 2 months ago
version
1.1.0
platforms
[
  "ios",
  "android"
]
react-native-version
0.76+
Other metadata
tags
[
  "react-native",
  "forms",
  "validation",
  "keyboard"
]

README badge

README badge for neha/rn-developer-skills/forms-and-validation