security-hardening
Application security covering input validation, auth, headers, secrets management, and dependency auditing
npx skills add rohitg00/awesome-claude-code-toolkit --skill security-hardening --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Security Hardening ## Input Validation Validate all input at the boundary. Never trust client-side validation alone. ```typescript import { z } from 'zod'; const CreateUserSchema = z.object({ email: z.string().email().max(255), name: z.string().min(1).max(100).regex(/^[a-zA-Z\s'-]+$/), age: z.number().int().min(13).max(150), }); function createUser(req: Request) { const result = CreateUserSchema.safeParse(req.body); if (!result.success) { return { status: 400, errors: result.error.flatten().fieldErrors }; } // result.data is typed and validated } ``` Rules: - Validate type, length, format, and range on every input - Use allowlists over denylists (accept known good, reject everything else) - Validate file uploads: check MIME type, file extension, and magic bytes - Limit request body size at the server/proxy level (e.g., 1MB max) ## Output Encoding ```typescript // Prevent XSS: encode output based on context // HTML context: use framework auto-escaping (React does this by default) // Never use dangerouslySetInnerHTML with user input // URL context: encode parameters const safeUrl = `/search?q=${encodeURIComponent(userInput)}`; // JSON context: use JSON.stringify (handles escaping)
- Input Validation
- Output Encoding
- SQL Injection Prevention
- CSRF Protection
- Content Security Policy
- Security Headers
- Rate Limiting
- JWT Best Practices
- Secrets Management
- Dependency Auditing
- Checklist Before Deploy
Check for secrets in git history gitleaks detect --source . --verbose Pre-commit hook to prevent secret commits gitleaks protect --staged Node.js npm audit --production npx better-npm-audit audit --level=high Python pip-audit safety check
What does the security-hardening skill do?
Application security covering input validation, auth, headers, secrets management, and dependency auditing
How do I install it?
Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill security-hardening --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From rohitg00/awesome-claude-code-toolkit, a repository with 2,438 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.