name: security-check description: This skill should be used when reviewing server actions, API routes, or pages for security. Use when the user asks to "security check", "review security", "audit code", or mentions authentication, authorization, permissions, or access control validation.
- Identify the code type - Server action (.action.ts), API route (route.ts), or page (page.tsx)
- Read the appropriate reference - Load the matching reference file
- Check against patterns - Validate the code follows required security patterns
- Report issues - List any security violations found
| Level | Server Action | API Route | Description |
|---|---|---|---|
| Public | action |
route |
No auth required |
| Authenticated | authAction |
authRoute |
User must be logged in |
| Organization | orgAction |
orgRoute |
User must be org member |
| Admin | adminAction |
- | User must have admin role |
- Missing auth - Public action/route handling sensitive data
- Missing org validation - Org-scoped data without
orgAction/orgRoute - Missing permission check - Action modifies resources without permission metadata
- Direct database access - Bypassing auth helpers
- Exposed user data - Returning sensitive fields
- Missing org filter in Prisma queries - Cross-tenant data leak risk
references/server-action.md- Server action security patternsreferences/api-route.md- API route security patternsreferences/page-server.md- Page and layout security patternsreferences/prisma-query.md- Prisma query org filtering (CRITICAL for multi-tenant)