react-form-validator

react-form-validator is a skill for Claude Code from smicolon/ai-kit. It costs 56 tokens per session (4,491 once invoked), scanned A, original, MIT.

A React and Next.js form helper that uses React Hook Form to manage form state and Zod to check submitted values against a schema.

In plain words
What is it for?
Use it for login, signup, data-entry, and other forms that need typed fields, validation, submission handling, and error feedback.
Why use it?
It prevents inconsistent or missing validation and makes form errors, loading states, and accessible messages part of the standard implementation.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the nextjs plugin — 3 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/smicolon/ai-kit/react-form-validator
Any agent
npx skills add smicolon/ai-kit --skill react-form-validator
Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit

Made for: Claude Code.

Or install nextjs, the plugin that ships this one along with the rest of its 3 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for react-form-validator

README.md
[![agentmods](https://agentmods.dev/badge/skills/smicolon/ai-kit/react-form-validator.svg)](https://agentmods.dev/skills/smicolon/ai-kit/react-form-validator)
Your own site
<a href="https://agentmods.dev/skills/smicolon/ai-kit/react-form-validator"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/react-form-validator.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,491 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00056 $0.04491
Opus 5 $0.00028 $0.02246
Sonnet 5 $0.00011 $0.00898
Haiku 4.5 $0.00006 $0.00449

Measured 2d ago against content hash 80dac708ff9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

react-form-validator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packs/nextjs/skills/react-form-validator/SKILL.md · 674 lines

How it starts

The opening of the file, as written. The whole thing — 674 lines — stays where its author put it; the contents beside it link to each section on GitHub.

React Form Validator

Auto-enforces React Hook Form + Zod validation pattern for ALL forms in Next.js/React applications.

Activation Triggers

This skill activates when:

  • Creating form components
  • Using <form>, <input>, form elements
  • Mentioning "form", "validation", "submit", "input"
  • Handling form state or submission
  • Creating login, signup, or data entry forms

Required Form Pattern (MANDATORY)

ALL forms MUST use:

  • React Hook Form for form state management
  • Zod for schema validation
  • TypeScript types inferred from Zod schema
  • Error handling with accessible error messages
  • Loading states during submission

Auto-Validation Process

Step 1: Detect Form Without Pattern

When detecting a form being created:

// ❌ WRONG - Uncontrolled form, no validation
function LoginForm() {
  const handleSubmit = (e) => {
    e.preventDefault()
    const email = e.target.email.value  // No validation!
    const password = e.target.password.value
    // Submit...
  }

  return (
    <form onSubmit={handleSubmit}>
      <input name="email" type="email" />
      <input name="password" type="password" />
      <button>Login</button>
    </form>
  )
}

Step 2: Identify Missing Requirements

Detect:

  • ❌ No React Hook Form
  • ❌ No Zod validation
  • ❌ No TypeScript types
  • ❌ No error display
  • ❌ No loading state

Step 3: Auto-Fix to Correct Pattern

After (Correct Pattern):

'use client'
import { useForm } from 'react-hook-form'
import { zodResolver } from '@hookform/resolvers/zod'
import * as z from 'zod'

// 1. Define Zod schema
const loginSchema = z.object({
  email: z.string().email('Invalid email address'),
  password: z.string().min(8, 'Password must be at least 8 characters'),
})

// 2. Infer TypeScript type from schema
type LoginFormData = z.infer<typeof loginSchema>

function LoginForm() {
  // 3. Set up React Hook Form with Zod resolver
  const {
    register,
    handleSubmit,
    formState: { errors, isSubmitting },
  } = useForm<LoginFormData>({
    resolver: zodResolver(loginSchema),
  })

  // 4. Type-safe submit handler
  const onSubmit = async (data: LoginFormData) => {
    try {
      await loginUser(data)
      // Handle success
    } catch (error) {
      // Handle error
    }
  }

  return (
    <form onSubmit={handleSubmit(onSubmit)} className="space-y-4">
      {/* Email field */}
      <div>
        <label htmlFor="email" className="block text-sm font-medium">
          Email
        </label>
        <input
          {...register('email')}
          id="email"
          type="email"
          className="mt-1 block w-full rounded-md border-gray-300"
          aria-invalid={!!errors.email}
          aria-describedby={errors.email ? 'email-error' : undefined}
        />
        {errors.email && (
          <p id="email-error" className="mt-1 text-sm text-red-600" role="alert">
            {errors.email.message}
          </p>
        )}
      </div>

      {/* Password field */}
      <div>
        <label htmlFor="password" className="block text-sm font-medium">
          Password
        </label>
        <input
          {...register('password')}
          id="password"
          type="password"
          className="mt-1 block w-full rounded-md border-gray-300"
          aria-invalid={!!errors.password}
          aria-describedby={errors.password ? 'password-error' : undefined}
        />
        {errors.password && (
          <p id="password-error" className="mt-1 text-sm text-red-600" role="alert">
            {errors.password.message}
          </p>
        )}
      </div>

      {/* Submit button with loading state */}
      <button
        type="submit"
        disabled={isSubmitting}
        className="w-full py-2 px-4 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50"
      >
        {isSubmitting ? 'Logging in...' : 'Login'}
      </button>
    </form>
  )
}

Read the full file on GitHub · 674 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 674 lines · 56 tokens per session scan A 80dac708ff9e

Subscribe to this mod's changes

react-form-validator is a skill published in the GitHub repository smicolon/ai-kit (6 stars, last pushed 2d ago), licensed MIT. It adds 56 tokens to every session and 4,491 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

web-artifacts-builder

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

ThinkInAIXYZ/deepchat · 64 tokens

frontend-code-review

Trigger when the user requests a review of frontend files (e.g., .tsx, .ts, .js). Support both pending-change reviews and focused file reviews while applying the checklist rules.

sangrokjung/claude-forge · 42 tokens

panel-app-react-vite-creator

Create or update an engineering-style NextClaw Panel component with pnpm, Vite, React, TypeScript, and Tailwind CSS, then build it into a static .panel directory inside a schema v2 package or an explicitly loose workspace Panel. Use for modern, reusable, complex, Agent-powered, typed Panel interfaces.

Peiiii/nextclaw · 73 tokens

port-component

Ports a UI component from the gaia mono repo (theexperiencecompany/gaia) into the gaia-ui registry. Use when asked to port, copy, migrate, or bring over a component from gaia, the mono repo, or the main repo into gaia-ui. The user may give a component name ("port weather-card"), a file path in the gaia repo, or a…

theexperiencecompany/gaia-ui · 113 tokens

react-rendering-lifecycle-safety

当任务触达动态 React 组件类型、列表 key、streaming UI,或 iframe/editor/media 等需要保持实例状态的界面时使用;也用于排查重渲染导致的焦点、选区、输入法或内嵌状态丢失。普通 React 修改不自动触发。.

Peiiii/nextclaw · 76 tokens

tailwind-css-patterns

Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.

figueroaignacio/ignaciofigueroa.dev · 62 tokens