
form-validation-expert
Input validation and sanitization agent covering Joi, Yup, Zod, XSS, and CSRF defenses.
- version
- 1.0.0
- GitHub stars
- 79
What it does
- Adds the
validation-expertagent for form validation with Joi, Yup, and Zod schemas - Covers input sanitization, XSS prevention, CSRF protection, and secure file upload validation
Input validation, sanitization, and security expert
Add marketplace
/plugin marketplace add devsforge/marketplaceRun it inside Claude Code once, then install the plugin below.
Install
/plugin install form-validation-expert@devsforge-marketplaceRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceForm Validation Expert Agent
You are an expert in form validation, input sanitization, schema validation (Zod, Joi, Yup), and security best practices.
Core Responsibilities
- Design validation schemas with Zod/Joi
- Implement client/server-side validation
- Create custom validation rules
- Implement XSS prevention and sanitization
- Set up CSRF protection
- Validate file uploads
- Handle complex validation (nested objects, conditionals)
Zod Validation (TypeScript)
// user.validation.ts
import { z } from 'zod';
export const userSchema = z.object({
username: z.string()
.min(3, 'Username must be at least 3 characters')
.max(20, 'Username must not exceed 20 characters')
.regex(/^[a-zA-Z0-9_]+$/, 'Username can only contain letters, numbers, underscores'),
email: z.string().email('Invalid email').toLowerCase().trim(),
password: z.string()
.min(8, 'Password must be at least 8 characters')
.regex(/[A-Z]/, 'Must contain uppercase letter')
.regex(/[a-z]/, 'Must contain lowercase letter')
.regex(/[0-9]/, 'Must contain number')
.regex(/[^A-Za-z0-9]/, 'Must contain special character'),
confirmPassword: z.string(),
age: z.number().int().min(18, 'Must be 18+').max(120).optional(),
role: z.enum(['admin', 'user', 'moderator'])
}).refine(data => data.password === data.confirmPassword, {
message: 'Passwords do not match',
path: ['confirmPassword']
});
export type UserInput = z.infer<typeof userSchema>;
// Complex nested validation
export const orderSchema = z.object({
customer: z.object({
id: z.string().uuid(),
email: z.string().email()
}),
items: z.array(z.object({
productId: z.string().uuid(),
quantity: z.number().int().positive(),
price: z.number().positive()
})).min(1, 'Order must contain at least one item').max(50),
shippingAddress: z.object({
street: z.string().min(5),
city: z.string().min(2),
state: z.string().length(2),
zipCode: z.string().regex(/^\d{5}(-\d{4})?$/),
country: z.string().length(2)
}),
total: z.number().positive()
}).refine(data => {
const calculatedTotal = data.items.reduce((sum, item) => sum + (item.price * item.quantity), 0);
return Math.abs(calculatedTotal - data.total) < 0.01;
}, 'Total does not match sum of items');
// Conditional validation (discriminated union)
export const paymentSchema = z.discriminatedUnion('method', [
z.object({
method: z.literal('credit_card'),
cardNumber: z.string().regex(/^\d{16}$/),
expiryMonth: z.number().int().min(1).max(12),
expiryYear: z.number().int().min(new Date().getFullYear()),
cvv: z.string().regex(/^\d{3,4}$/)
}),
z.object({
method: z.literal('paypal'),
email: z.string().email()
}),
z.object({
method: z.literal('bank_transfer'),
accountNumber: z.string().min(8),
routingNumber: z.string().length(9)
})
]);
Express Middleware with Zod
// validation.middleware.ts
import { Request, Response, NextFunction } from 'express';
import { z, ZodError, ZodSchema } from 'zod';
export const validate = (schema: ZodSchema) => {
return async (req: Request, res: Response, next: NextFunction) => {
try {
req.body = await schema.parseAsync(req.body);
next();
} catch (error) {
if (error instanceof ZodError) {
return res.status(400).json({
success: false,
errors: error.errors.map(err => ({
field: err.path.join('.'),
message: err.message,
code: err.code
}))
});
}
next(error);
}
};
};
// Validate multiple sources
export const validateRequest = (schemas: {
body?: ZodSchema;
query?: ZodSchema;
params?: ZodSchema;
}) => {
return async (req: Request, res: Response, next: NextFunction) => {
try {
if (schemas.body) req.body = await schemas.body.parseAsync(req.body);
if (schemas.query) req.query = await schemas.query.parseAsync(req.query);
if (schemas.params) req.params = await schemas.params.parseAsync(req.params);
next();
} catch (error) {
if (error instanceof ZodError) {
return res.status(400).json({
success: false,
errors: error.errors.map(err => ({
field: err.path.join('.'),
message: err.message
}))
});
}
next(error);
}
};
};
// Usage
import express from 'express';
const router = express.Router();
router.post('/register', validate(userSchema), async (req, res) => {
const user = await userService.create(req.body);
res.json({ success: true, user });
});
Input Sanitization
// sanitization.ts
import validator from 'validator';
import xss from 'xss';
import DOMPurify from 'isomorphic-dompurify';
export class Sanitizer {
static sanitizeString(input: string): string {
return validator.escape(input.trim());
}
static sanitizeHTML(input: string): string {
return xss(input, {
whiteList: {
p: [], br: [], strong: [], em: [], a: ['href', 'title']
},
stripIgnoreTag: true
});
}
static preventXSS(input: string): string {
return DOMPurify.sanitize(input, {
ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a', 'p', 'br'],
ALLOWED_ATTR: ['href']
});
}
static sanitizeEmail(email: string): string {
return validator.normalizeEmail(email.toLowerCase().trim()) || '';
}
static sanitizeURL(url: string): string | null {
const trimmed = url.trim();
return validator.isURL(trimmed, { protocols: ['http', 'https'], require_protocol: true }) ? trimmed : null;
}
static sanitizeObject<T extends Record<string, any>>(obj: T): T {
const sanitized: any = {};
for (const [key, value] of Object.entries(obj)) {
if (typeof value === 'string') {
sanitized[key] = this.sanitizeString(value);
} else if (Array.isArray(value)) {
sanitized[key] = value.map(item =>
typeof item === 'object' ? this.sanitizeObject(item) :
typeof item === 'string' ? this.sanitizeString(item) : item
);
} else if (typeof value === 'object' && value !== null) {
sanitized[key] = this.sanitizeObject(value);
} else {
sanitized[key] = value;
}
}
return sanitized as T;
}
static preventSQLInjection(input: string): string {
const dangerous = [
/(\b(SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC)\b)/gi,
/(--|\||;|\/\*|\*\/)/g
];
let cleaned = input;
for (const pattern of dangerous) {
cleaned = cleaned.replace(pattern, '');
}
return validator.escape(cleaned);
}
}
// Middleware
export const sanitizeMiddleware = (req: Request, res: Response, next: NextFunction) => {
if (req.body) req.body = Sanitizer.sanitizeObject(req.body);
if (req.query) req.query = Sanitizer.sanitizeObject(req.query as Record<string, any>);
if (req.params) req.params = Sanitizer.sanitizeObject(req.params);
next();
};
File Upload Validation
// file-validation.ts
import multer from 'multer';
import path from 'path';
import crypto from 'crypto';
export const ALLOWED_FILE_TYPES = {
images: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],
documents: ['application/pdf', 'application/msword']
};
export const FILE_SIZE_LIMITS = {
image: 5 * 1024 * 1024, // 5MB
document: 10 * 1024 * 1024 // 10MB
};
const storage = multer.diskStorage({
destination: (req, file, cb) => cb(null, 'uploads/'),
filename: (req, file, cb) => {
const uniqueSuffix = `${Date.now()}-${crypto.randomBytes(6).toString('hex')}`;
cb(null, `${file.fieldname}-${uniqueSuffix}${path.extname(file.originalname)}`);
}
});
const fileFilter = (allowedTypes: string[]) => {
return (req: any, file: Express.Multer.File, cb: multer.FileFilterCallback) => {
if (allowedTypes.includes(file.mimetype)) {
cb(null, true);
} else {
cb(new Error(`Invalid file type. Allowed: ${allowedTypes.join(', ')}`));
}
};
};
export const uploadImage = multer({
storage,
fileFilter: fileFilter(ALLOWED_FILE_TYPES.images),
limits: { fileSize: FILE_SIZE_LIMITS.image }
});
Best Practices
- Validate on both client and server - Never trust client-side validation
- Use schema validation libraries - Zod/Joi/Yup, not custom code
- Sanitize all user input - Prevent XSS, SQL injection
- Implement CSRF protection - For state-changing operations
- Validate file uploads - Check type, size, content
- Clear error messages - Help users fix issues
- Type-safe validation - Use Zod with TypeScript
- Validate early - Fail fast with proper feedback
- Whitelist approach - Specify allowed, not forbidden
- Keep validation separate - Dedicated schema files
From the devsforge/marketplace README
Disclaimer: DevsForge Marketplace is an independent, community-developed open-source project. It is not affiliated with, endorsed by, or officially associated with Anthropic, PBC or any of its products (including Claude, Claude Code, or the Claude API). "Claude" and "Anthropic" are trademarks of Anthropic, PBC. This project is a third-party plugin built by the community to extend Claude Code functionality.
π DevsForge Marketplace
The Ultimate Plugin Ecosystem for Claude Code
161 Enterprise-Grade Plugins | 93 AI Agents | 65 Commands | 3 Super Plugins
Get Started β’ Browse Plugins β’ Documentation β’ Contributing
β‘ What's New in v1.2
β Plugin Compliance & QualityAll 161 plugins validated for Claude Code CLI Fixes Applied:
|
ποΈ Super Plugins (Advanced)Multi-component platforms with hooks & MCP servers Features:
|
β¨ Why DevsForge Marketplace?
π¨Curated QualityEvery plugin manually reviewed & enterprise-tested |
β‘Production ReadyBattle-tested in real-world scenarios |
πSecurity FirstZero dependencies, fully audited code |
πAdvanced FeaturesHooks, MCP servers, automation |
π―100% OriginalNo copycat plugins, pure innovation |
π― Quick Start
Installation
# π₯ One command to rule them all
/plugin marketplace add https://github.com/devsforge/marketplace.git
# β
Verify installation
/plugin marketplace list
# π Expected: devsforge-marketplace (1.2.0) - 161 plugins available
Using Plugins
# π Browse available plugins
/plugin
# π¦ Install specific plugin
/plugin install ai-architect@devsforge-marketplace
# π Install super plugin (with hooks & MCP)
/plugin install enterprise-workspace@devsforge-marketplace
# π Manage plugins
/plugin list # List installed
/plugin update ai-architect@devsforge-marketplace # Update plugin
/plugin remove debugger@devsforge-marketplace # Remove plugin
π¨ Featured Categories
π€ AI & Machine Learning (12 plugins)
- ai-architect - ML optimization & AI system design
- ai-ethics-officer - Ethical AI governance
- vision-specialist - Computer vision & image processing
- data-scientist - Data analysis & BigQuery operations
- data-analyst - Analytics & business intelligence
π Security & Compliance (15 plugins)
- enterprise-security-reviewer - B2B security assessments
- security-scanner - Vulnerability detection & remediation
- authentication-specialist - JWT, OAuth2, security patterns
- cors-security-expert - CORS configuration & best practices
- data-privacy-engineer - GDPR compliance & data protection
- compliance-automation-specialist - Regulatory automation
- legal-compliance-checker - Legal compliance validation
π» Development & Code Quality (25 plugins)
- code-quality-expert - Code governance & security
- code-migrator - Legacy code modernization
- debugger - Advanced debugging methodologies
- web-dev - React, Next.js, NestJS, TypeScript
- python-expert - Advanced Python development
- database-expert β‘ NEW - SQL optimization & query tuning
- docker-specialist β‘ NEW - Container optimization
- git-workflow-expert β‘ NEW - Advanced Git strategies
- rest-api-designer β‘ NEW - REST API best practices
- graphql-specialist β‘ NEW - GraphQL schema design
π§ DevOps & Infrastructure (18 plugins)
- devops-automator - CI/CD & infrastructure automation
- deployment-engineer - Production deployment strategies
- cloud-architect - Multi-cloud architecture
- monitoring-observability-specialist - System monitoring
- sre-reliability-engineer - Site reliability engineering
- cost-optimizer - Cloud cost optimization
π§ͺ Testing & QA (10 plugins)
- testing-orchestrator - Test automation frameworks
- unit-test-generator - Automated test generation
- api-quality-assurance - API testing & validation
- performance-benchmarker - Performance testing
- test-writer-fixer - Test creation & maintenance
π Documentation & Knowledge (8 plugins)
- codebase-documenter - Comprehensive code documentation
- technical-writer-pro - Technical documentation
- api-docs-generator - OpenAPI/Swagger docs
- doc-generator - Auto-documentation generation
π¨ Design & UX (8 plugins)
- ui-designer - Beautiful, functional interfaces
- ui-ux-engineer - React/Vue/Angular components
- accessibility-architect - WCAG 2.1 AA compliance
- mobile-ux-optimizer - Mobile-first experiences
- ux-researcher - User research & journey maps
π Data & Analytics (7 plugins)
- data-analyst - Analytics methodologies
- data-scientist - SQL queries & data insights
- database-performance-optimizer - Database optimization
- sql-query-optimizer - Advanced SQL optimization
π’ Enterprise & Business (12 plugins)
- software-architect - Scalable architecture design
- system-architect - Backend design & integration
- b2b-project-shipper - B2B project delivery
- customer-success-manager - Customer success ops
- technical-sales-engineer - Technical sales support
- pricing-packaging-specialist - Pricing strategies
π Productivity & Automation (15 plugins)
- workflow-optimizer - Workflow optimization
- project-shipper - Launch & release management
- sprint-prioritizer - Sprint planning & prioritization
- experiment-tracker - Experiment tracking & analysis
- finance-tracker - Budget & cost management
β‘ Super Plugins - Advanced (3 plugins)
π’ enterprise-workspace
Complete workspace management platform with hooks & MCP
Components:
- 3 Commands:
workspace-init,workspace-sync,workspace-audit - 2 Agents: workspace-architect, compliance-auditor
- 1 Hook: PostToolUse validation
- 1 MCP Server: workspace-state
- 1 Script: validate-workspace.sh
Features:
- β Architecture governance
- β Compliance tracking
- β Automated validation
- β State management
π€ ai-studio-orchestrator
Advanced multi-agent coordination platform
Components:
- 3 Commands:
orchestrate-task,monitor-performance,optimize-workflow - 2 Agents: task-coordinator, performance-analyzer
- 1 Hook: PreToolUse logging
- 1 MCP Server: orchestrator
- 1 Script: task-logger.sh
Features:
- β Task distribution
- β Load balancing
- β Performance analytics
- β Real-time monitoring
π§ devops-platform
Complete DevOps automation platform
Components:
- 3 Commands:
setup-pipeline,deploy-application,manage-infrastructure - 2 Agents: cicd-architect, infrastructure-engineer
- 1 Hook: PostToolUse config validation
- 1 MCP Server: devops-state
- 1 Script: validate-devops-config.sh
Features:
- β CI/CD pipelines (GitHub Actions, Jenkins, GitLab CI)
- β Zero-downtime deployments
- β Infrastructure as Code (Terraform, CloudFormation)
- β Security scanning
π Marketplace Statistics
| Category | Count | Description |
|---|---|---|
| π€ Agents | 93 | AI-powered development assistants |
| β‘ Commands | 65 | Instant productivity tools |
| π Super Plugins | 3 | Advanced multi-component platforms |
| Total | 161 | Production-ready plugins |
Quality Metrics
- β Average Documentation: 250+ lines per plugin
- β Code Examples: Real-world templates included
- β Testing: Enterprise-grade validation
- β Security: Zero external dependencies
- β Maintenance: Regular updates & improvements
ποΈ Architecture
devsforge-marketplace/
βββ .claude-plugin/
β βββ marketplace.json # π Marketplace registry (161 plugins)
β
βββ plugins/
β βββ agents/ # π€ 93 AI Agent Plugins
β β βββ ai-architect/
β β β βββ .claude-plugin/
β β β β βββ plugin.json
β β β βββ agents/
β β β βββ ai-engineer.md
β β βββ database-expert/ β‘ NEW in v1.1
β β βββ docker-specialist/ β‘ NEW in v1.1
β β βββ git-workflow-expert/ β‘ NEW in v1.1
β β βββ ... (90 more agents)
β β
β βββ commands/ # β‘ 65 Command Plugins
β β βββ api-designer/
β β β βββ .claude-plugin/
β β β β βββ plugin.json
β β β βββ commands/
β β β βββ api-designer.md
β β βββ env-validator/ β‘ NEW in v1.1
β β βββ import-organizer/ β‘ NEW in v1.1
β β βββ ... (62 more commands)
β β
β βββ super/ # π 3 Super Plugins
β βββ enterprise-workspace/
β β βββ .claude-plugin/
β β β βββ plugin.json # With hooks & MCP
β β βββ commands/ # Multiple commands
β β βββ agents/ # Multiple agents
β β βββ scripts/ # Automation scripts
β β βββ servers/ # MCP servers
β βββ ai-studio-orchestrator/
β βββ devops-platform/
β
βββ README.md # π This file
π Documentation
Plugin Installation Examples
# π€ AI & Machine Learning
/plugin install ai-architect@devsforge-marketplace
/plugin install data-scientist@devsforge-marketplace
/plugin install vision-specialist@devsforge-marketplace
# π» Development Tools
/plugin install web-dev@devsforge-marketplace
/plugin install python-expert@devsforge-marketplace
/plugin install debugger@devsforge-marketplace
# π Security & Compliance
/plugin install security-scanner@devsforge-marketplace
/plugin install authentication-specialist@devsforge-marketplace
/plugin install cors-security-expert@devsforge-marketplace
# π§ DevOps & Infrastructure
/plugin install devops-automator@devsforge-marketplace
/plugin install docker-specialist@devsforge-marketplace
/plugin install cloud-architect@devsforge-marketplace
# β‘ Productivity Commands
/plugin install code-review@devsforge-marketplace
/plugin install fix-github-issue@devsforge-marketplace
/plugin install pr-creator@devsforge-marketplace
# π Super Plugins (Advanced)
/plugin install enterprise-workspace@devsforge-marketplace
/plugin install ai-studio-orchestrator@devsforge-marketplace
/plugin install devops-platform@devsforge-marketplace
Marketplace Management
# π List installed marketplaces
/plugin marketplace list
# π Update marketplace
/plugin marketplace update devsforge-marketplace
# ποΈ Remove marketplace
/plugin marketplace remove devsforge-marketplace
# π Search plugins
/plugin search "security"
/plugin search "api design"
# π Show plugin details
/plugin info ai-architect@devsforge-marketplace
π οΈ Troubleshooting
β Marketplace Not Loading
Symptoms: Marketplace doesn't appear in /plugin marketplace list
Solutions:
- β
Verify
.claude-plugin/marketplace.jsonexists in repository root - β
Check JSON syntax:
claude plugin validate . - β Ensure Git repository is accessible and cloned correctly
- β Restart Claude Code CLI after adding marketplace
β Plugin Installation Failures
Symptoms: Error message "Plugin not found" or installation timeout
Solutions:
- β
Verify plugin source paths are correct:
./plugins/[type]/[name] - β
Ensure all required files exist:
.claude-plugin/plugin.json,commands/*.mdoragents/*.md - β Check network connectivity for Git-based plugin sources
- β
Try explicit version:
/plugin install [name]@devsforge-marketplace@1.0.0
β Super Plugin Issues
Symptoms: Hooks not triggering or MCP server connection errors
Solutions:
- β
Verify
${CLAUDE_PLUGIN_ROOT}environment variable resolves correctly - β
Check script permissions:
chmod +xon Linux/Mac - β Ensure Node.js is installed for MCP server JavaScript files
- β Review Claude Code logs for hook execution errors
β Performance Issues
Symptoms: Slow marketplace loading or plugin installation
Solutions:
- β Check internet connection speed (GitHub clone performance)
- β Verify available disk space (minimum 50MB required)
- β Close unnecessary applications to free system resources
- β Use local path installation for faster access after initial clone
π€ Contributing
We welcome contributions! Here's how you can help:
π― Contributing New Plugins
- π΄ Fork the repository
- π Create plugin structure in appropriate directory (
agents/,commands/, orsuper/) - π Follow
plugin.jsonschema requirements - π Add comprehensive documentation (200-700+ lines recommended)
- π§ͺ Test thoroughly with Claude Code CLI
- π Submit pull request with detailed description
π Plugin Quality Standards
- β Minimum 200 lines of documentation
- β Real-world code examples and templates
- β Phase-based methodologies
- β Best practices and anti-patterns
- β Quality metrics and KPIs
- β Business impact analysis
π‘ Contributing Ideas
- π¬ Open a GitHub Discussion with plugin proposal
- π Describe use case and business value
- π» Provide examples of desired functionality
- π³οΈ Community votes on most valuable additions
π Security & Trust
β οΈ Important Disclaimer
DevsForge Marketplace is an independent, community-driven project
- β NOT affiliated with Anthropic or Claude
- β NOT officially endorsed or connected to Anthropic
- β Community maintained by open-source contributors
- β οΈ Use at your own risk - review plugin code before production use
Security Measures
|
Our Practices:
|
Your Responsibilities:
|
π License
MIT License - See LICENSE for details
Copyright (c) 2025 DevsForge Community
π Acknowledgments
Built with β€οΈ by the DevsForge Community
Special thanks to:
- π¨ Anthropic for Claude Code CLI platform
- π» All plugin contributors and testers
- π’ Enterprise users providing valuable feedback
- π Open source community for inspiration
π Ready to supercharge your Claude Code experience?
Get Started Now β’ Browse Plugins β’ Contribute
DevsForge Marketplace v1.2 - The Ultimate Plugin Ecosystem for Claude Code
Details
- Marketplace
- devsforge/marketplace
- Source
- plugins/agents/form-validation-expert
- Author
- DevsForge Community
- Category
- Agents
- Keywords
- devsforge, agent, form, validation
- Listed since
- Apr 7, 2026
More from devsforge/marketplace
All 161- git-commit-helperv1.0.0
- git-guardianv1.0.0
- git-workflow-expertv1.0.0
- github-issue-fixv1.0.0
- graphql-specialistv1.0.0
- growth-hackerv1.0.0
- hotfix-deployerv1.0.0
- htaccess-generatorv1.0.0
- import-organizerv1.0.0
- incident-reporterv1.0.0
- infrastructure-maintainerv1.0.0
- intelligent-commitv1.0.0
- iot-solutions-architectv1.0.0
- issue-analyzerv1.0.0
- json-validatorv1.0.0
- legal-advisorv1.0.0
- legal-compliance-checkerv1.0.0
- license-compliancev1.0.0
- localization-specialistv1.0.0
- microservices-architectv1.0.0
- migration-helperv1.0.0
- mobile-app-builderv1.0.0
- mobile-optimization-expertv1.0.0
- mobile-ux-optimizerv1.0.0
Similar to form-validation-expert
More Security
cors-security-expertPlugindevsforge/marketplace79 starsCORS configuration and security best practices expert
authentication-specialistPlugindevsforge/marketplace79 starsJWT, OAuth2, and authentication security expert
Agent-Native FormsMCP serverbuilderio7.7K starsAgent-Native form builder - create, edit, and manage forms
agents-documentationPlugindavepoon/buildwithclaude3.8K starsAgents for writing, formatting, and validating documentation and technical content
security-expertPluginshipshitdev/library39 starsExpert in application security, OWASP Top 10, authentication, authorization, data protection, and se
agents-specialized-domainsPlugindavepoon/buildwithclaude3.8K starsDomain-specific expert agents for validation, knowledge-graph, and other specialized tasks