mcpField
F
form-validation

form-validation

github.com/aj-geddesDevelopment373500 installsUpdated 34w ago
Repository

About form-validation

form-validation is a TypeScript-oriented skill guide for implementing form input checks, submission handling, and real-time error feedback. It includes reference approaches for React, Vue, and server-side validation.

Key features

  1. 01Client-side validation
  2. 02Server-side validation integration
  3. 03Real-time error feedback
  4. 04TypeScript form types
  5. 05React and Vue reference guides

Use cases

  1. 01Validate user input
  2. 02Handle form submissions
  3. 03Build multi-step forms
  4. 04Define complex validation rules

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill form-validation

After installing, type/form-validationin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
custom-validator-hook.md
formik-with-yup-validation.md
react-hook-form-with-typescript.md
server-side-validation-integration.md
vue-vee-validate.md
templates/
component-template.tsx

Details

From the project README

Form Validation

Table of Contents

Overview

Implement comprehensive form validation including client-side validation, server-side synchronization, and real-time error feedback with TypeScript type safety.

When to Use

  • User input validation
  • Form submission handling
  • Real-time error feedback
  • Complex validation rules
  • Multi-step forms

Quick Start

Minimal working example:

// types/form.ts
export interface LoginFormData {
  email: string;
  password: string;
  rememberMe: boolean;
}

export interface RegisterFormData {
  email: string;
  password: string;
  confirmPassword: string;
  name: string;
  terms: boolean;
}

// components/LoginForm.tsx
import { useForm, SubmitHandler } from 'react-hook-form';
import { LoginFormData } from '../types/form';

const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;

export const LoginForm: React.FC = () => {
  const {
    register,
    handleSubmit,
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
React Hook Form with TypeScriptReact Hook Form with TypeScript
Formik with Yup ValidationFormik with Yup Validation
Vue Vee-ValidateVue Vee-Validate
Custom Validator HookCustom Validator Hook
Server-Side Validation IntegrationServer-Side Validation Integration

Best Practices

✅ DO
  • Follow established patterns and conventions
  • Write clean, maintainable code
  • Add appropriate documentation
  • Test thoroughly before deploying
❌ DON'T
  • Skip testing or validation
  • Ignore error handling
  • Hard-code configuration values

Comments

Markdown supported