Skip to content
Back to skills

Add Form Validation

ASecurity

Adds matching client and server validation to a form, with plain error messages that are announced to screen readers.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 15, 2026
ai-agentsrustdatabase

Works with

  • cli

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill add-form-validation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Add Form Validation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Add Form Validation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-add-form-validation/badge)](https://www.skillsdirectory.com/skills/workspace-templates-add-form-validation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: add-form-validation
description: Adds matching client and server validation to a form, with plain error messages that are announced to screen readers.
argument-hint: "[form component or route]"
user-invocable: true
disable-model-invocation: true
---

Add validation to the form: $ARGUMENTS

1. Find the form, its submit handler and the endpoint that receives it. Detect the validation library already in use (zod, yup, valibot, Joi, class-validator, pydantic) and use it; add nothing new unless none exists.
2. List every field with its rule: required, type, length, format, range, and cross-field rules such as matching passwords. Show this list before coding.
3. Define one schema and use it on both sides. On the server, validate before any database write, return a 422 with `{ field, message }` pairs, and never trust client checks.
4. In the UI, validate on blur and on submit, show messages beside the field, link them with `aria-describedby`, set `aria-invalid`, and move focus to the first error. Do not clear user input on failure.
5. Messages say what to do ("Enter a date after today"), not what went wrong internally.
6. Add tests for one valid case and one failure per rule.

Run the tests. Report the rules added and any rule you were unsure about, and ask before changing database constraints.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.