global-validation
Implement comprehensive input validation on both client and server sides with clear error messages, type checking, and sanitization to prevent security vulnerabilities. Use this skill when validating user input, implementing form validation, checking data types and formats, sanitizing input to prevent injection attacks (SQL, XSS, command injection), validating business rules, providing field-specific error messages, implementing server-side validation for all entry points (API endpoints, web forms, background jobs), using client-side validation for immediate user feedback, applying allowlists over blocklists, validating ranges and required fields, or ensuring consistent validation across the application. Apply this skill when handling any user input, building forms, creating API endpoints, or reviewing code for security and data integrity.
When & Why to Use This Skill
This Claude skill empowers developers to implement a robust, multi-layered input validation framework across both client and server architectures. By prioritizing security-first practices like allowlisting, data sanitization, and strict type checking, it effectively mitigates critical vulnerabilities such as SQL injection, XSS, and command injection while ensuring data integrity and a seamless user experience through clear, field-specific feedback.
Use Cases
- Security Hardening: Sanitizing user-provided data and implementing allowlists to prevent common web vulnerabilities like SQL injection and Cross-Site Scripting (XSS).
- API Integrity: Enforcing strict server-side validation and type checking for all API endpoints to ensure incoming data meets business rules and schema requirements.
- User Experience Enhancement: Developing immediate client-side validation logic to provide users with real-time, helpful error messages during form submission.
- Standardized Code Audits: Reviewing existing codebases to identify missing validation logic and ensuring consistent data handling across all application entry points.
| name | Global Validation |
|---|---|
| description | Implement comprehensive input validation on both client and server sides with clear error messages, type checking, and sanitization to prevent security vulnerabilities. Use this skill when validating user input, implementing form validation, checking data types and formats, sanitizing input to prevent injection attacks (SQL, XSS, command injection), validating business rules, providing field-specific error messages, implementing server-side validation for all entry points (API endpoints, web forms, background jobs), using client-side validation for immediate user feedback, applying allowlists over blocklists, validating ranges and required fields, or ensuring consistent validation across the application. Apply this skill when handling any user input, building forms, creating API endpoints, or reviewing code for security and data integrity. |
Global Validation
When to use this skill
- When validating user input in forms, API endpoints, or any entry point
- When implementing form validation (client-side and server-side)
- When checking data types, formats, and ranges
- When sanitizing input to prevent injection attacks (SQL, XSS, command injection)
- When validating business rules and constraints
- When providing clear, field-specific error messages to users
- When implementing server-side validation (always required for security)
- When using client-side validation for immediate user feedback
- When applying allowlists to define what is allowed rather than blocklists
- When validating required fields and mandatory data
- When ensuring consistent validation across all entry points
- When reviewing code for validation completeness and security
This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle global validation.
Instructions
For details, refer to the information provided in this file: global validation