input-validator
Skill3 starsChanged 11 months agoApache-2.0View on GitHub
Implement input validation and sanitization. Use when the user needs to validate request data, sanitize user inputs, or create validation schemas.
In this repository100 other files it gives its agents.
- accessibility-checkerSkill
- analytics-trackerSkill
- api-contract-testerSkill
- api-documentation-generatorSkill
- api-rate-limiterSkill
- appstore-screenshot-resizerSkill
- architecture-documenterSkill
- authentication-implementerSkill
- aws-resource-provisionerSkill
- browser-extension-builderSkill
- caching-implementerSkill
- changelog-generatorSkill
- chart-generatorSkill
- ci-pipeline-debuggerSkill
- cli-tool-builderSkill
- code-documenterSkill
- code-explainerSkill
- code-migration-helperSkill
- code-refactorerSkill
- code-reviewerSkill
- color-palette-generatorSkill
- comment-generatorSkill
- contributing-guide-writerSkill
- cron-job-schedulerSkill
- css-animatorSkill
- csv-processorSkill
- data-aggregatorSkill
- database-backup-restoreSkill
- database-migration-generatorSkill
- database-query-optimizerSkill
- data-transformerSkill
- data-validatorSkill
- date-time-helperSkill
- debug-helperSkill
- dependency-updaterSkill
- dependency-vulnerability-checkerSkill
- discord-bot-builderSkill
- docker-compose-builderSkill
- dockerfile-generatorSkill
- e2e-test-builderSkill
- email-template-builderSkill
- env-setupSkill
- error-handlerSkill
- error-message-writerSkill
- error-response-handlerSkill
- etl-pipeline-builderSkill
- file-organizerSkill
- form-builderSkill
- git-commit-messageSkill
- github-actions-builderSkill
- gitignore-generatorSkill
- graphql-schema-builderSkill
- icon-system-builderSkill
- integration-test-builderSkill
- jsdoc-generatorSkill
- json-schema-generatorSkill
- kubernetes-manifest-generatorSkill
- license-chooserSkill
- linter-fixerSkill
- load-testerSkill
- The first 60 shown.
The file
Files
Input Validator
Validate and sanitize user inputs for security and data integrity.
Validation Libraries
| Language | Library |
| JavaScript | Zod, Yup, Joi |
| Python | Pydantic, Marshmallow |
| Go | validator |
Zod (TypeScript)
import { z } from 'zod';
// Define schema
const userSchema = z.object({
email: z.string().email(),
password: z.string().min(8).max(100),
age: z.number().int().positive().optional(),
role: z.enum(['user', 'admin']).default('user'),
tags: z.array(z.string()).max(10),
});
// Validate
const result = userSchema.safeParse(input);
if (!result.success) {
console.log(result.error.format());
}
// Infer TypeScript type
type User = z.infer<typeof userSchema>;
// Transform and validate
const sanitizedSchema = z.object({
email: z.string().email().toLowerCase().trim(),
username: z.string()
.min(3)
.max(20)
.regex(/^[a-zA-Z0-9_]+$/),
});Pydantic (Python)
from pydantic import BaseModel, EmailStr, validator, Field
from typing import Optional, List
class UserCreate(BaseModel):
email: EmailStr
password: str = Field(min_length=8, max_length=100)
age: Optional[int] = Field(None, gt=0, lt=150)
tags: List[str] = Field(default_factory=list, max_items=10)
@validator('password')
def password_complexity(cls, v):
if not any(c.isupper() for c in v):
raise ValueError('must contain uppercase')
if not any(c.isdigit() for c in v):
raise ValueError('must contain digit')
return v
# Usage
try:
user = UserCreate(**data)
except ValidationError as e:
print(e.json())Express Middleware
import { z } from 'zod';
const validate = (schema) => (req, res, next) => {
const result = schema.safeParse(req.body);
if (!result.success) {
return res.status(400).json({
error: 'Validation failed',
details: result.error.format(),
});
}
req.body = result.data;
next();
};
app.post('/users', validate(userSchema), createUser);Common Validations
| Type | Validation |
| Format, domain | |
| Password | Length, complexity |
| URL | Format, protocol |
| Phone | Format, country |
| Date | Format, range |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

