Agent skill
sanitizing-inputs-zod
Advanced input validation and sanitization using Zod. Use to prevent XSS and ensure data integrity before sending to Appwrite.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/sanitizing-inputs-zod
SKILL.md
Input Sanitization and Zod (Advanced)
When to use this skill
- Every form that accepts user input (Reviews, Profile updates, Booking special requests).
- Before performing any database mutation in a Server Action.
Advanced Schema
import { z } from 'zod';
export const TourReviewSchema = z.object({
rating: z.number().min(1).max(5),
comment: z.string().trim()
.min(10, "Comment too short")
.max(500, "Comment too long")
.refine(s => !s.includes('<script>'), { message: "Invalid characters" }),
});
Instructions
- Server-Side Only: Validation MUST happen on the server (Server Action) even if you have client-side validation.
- Type Inference: Use
z.infer<typeof Schema>to generate TypeScript types from your validation logic. - Sanitization: Use
.trim(),.toLowerCase(), and custom transforms to clean data before persistence.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?