backend-validation
Installation
SKILL.md
Backend Validation
Use this skill when
- Validating request payloads and query params
- Defining validation schemas server-side
- Returning structured validation errors
Do not use this skill when
- Client-side validation only
- Validating internal trusted data
Instructions
- Validate all external input: body, query, path, headers, files.
- Use a schema library (Zod, Joi, class-validator, Pydantic).
- Sanitize and coerce types at the boundary.
- Return structured field-level errors (field, message, code).
- Distinguish validation errors (4xx) from logic errors (5xx).
- Set explicit limits: length, ranges, allowed values.
- Validate at the API boundary, not only in services.