global-validation
在客户端和服务器端实施全面的输入验证,具有清晰的错误消息、类型检查和清理,以防止安全漏洞。在验证用户输入、实施表单验证、检查数据类型和格式、清理输入以防止注入攻击(SQL、XSS、命令注入)、验证业务规则、提供特定字段的错误消息、为所有入口点实施服务器端验证(API端点、Web表单、后台作业)、使用客户端验证提供即时用户反馈、应用允许列表而非阻止列表、验证范围和必填字段或确保应用程序中验证的一致性时使用此技能。在处理任何用户输入、构建表单、创建API端点或审查代码的安全性和数据完整性时应用此技能。
📖 中文导读:在客户端和服务器端实施全面的输入验证,具有清晰的错误消息、类型检查和清理,以防止安全漏洞。在验证用户输入、实施表单验证、检查数据类型和格式、清理输入以防止注入攻击(SQL、XSS、命令注入)、验证业务规则、提供特定字段的错误消息、为所有入口点实施服务器端验证(API端点、Web表单、后台作业)、使用客户端验证提供即时用户反馈、应用允许列表而非阻止列表、验证范围和必填字段或确保应用程序中验证的一致性时使用此技能。在处理任何用户输入、构建表单、创建API端点或审查代码的安全性和数据完整性时应用此技能。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
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