Global Validation

Implement server-side input validation and sanitization across application entry points.

Updated Nov 15, 2025
One-click install
npx skills add https://github.com/DevanB/lucidlog --skill global-validation-devanb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Global Validation
Source: https://github.com/DevanB/lucidlog/tree/main/.claude/skills/global-validation
Command: npx skills add https://github.com/DevanB/lucidlog --skill global-validation-devanb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the critical problem of insecure or inconsistent data input, which can lead to security vulnerabilities, data corruption, and application errors. It ensures all incoming data is rigorously validated and sanitized, protecting your application from malicious input and maintaining data integrity.

Core Features & Use Cases

  • Server-Side Security: Implements allowlist-based validation and sanitization to prevent injection attacks.
  • Consistent Data Integrity: Ensures all application entry points validate data against business rules and type constraints.
  • Use Case: When creating a new user registration form, use this skill to guide the AI in implementing server-side validation rules for email format, password strength, and sanitizing all text inputs to prevent XSS attacks.

Quick Start

Implement global validation for the new user profile update API endpoint, including allowlists for allowed fields and specific error messages.

Frequently Asked Questions about Global Validation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent SQL injection and XSS attacks in my API endpoints?

Server-side validation using allowlists and sanitization prevents SQL injection and XSS attacks. Implement allowlist-based validation rules in your API endpoints and form request classes to accept only expected data formats and values, then sanitize inputs to strip malicious content before processing.

What's the best way to validate form data across all entry points in my application?

Enforce consistent validation at every entry point—form request classes, API endpoints, controllers, and services—against the same business rules and type constraints. This prevents data corruption and security vulnerabilities by ensuring no malicious or malformed data reaches your database or business logic.

How do I validate file uploads for size and format securely?

Validate file uploads server-side by checking file format, size limits, and content against allowlists before storage. Sanitize filenames and reject files that don't match expected types to prevent directory traversal, command injection, and denial-of-service attacks.

Can I use validation to enforce password strength and email format requirements?

Yes. Implement type checks and format validation rules in your form request classes to enforce password strength policies and validate email format. Server-side validation ensures these rules are always applied, preventing weak credentials and invalid data from entering your system.

Why should validation happen on both client and server side?

Client-side validation improves user experience with immediate feedback, but server-side validation is mandatory for security—it prevents attackers from bypassing client checks. Always implement allowlist-based, type-checked validation server-side to guarantee data integrity and block malicious input.

How do I provide actionable error messages when validation fails?

Return specific, descriptive error messages that explain which field failed and why—for example, 'email must be a valid format' or 'password must contain at least 12 characters.' Clear errors help users correct input while preventing information disclosure that attackers could exploit.