api-design-security
CommunitySecure admin APIs with enterprise-grade controls.
AuthorArtisanClarinets
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This skill addresses the challenge of building and maintaining secure admin APIs in Next.js 16 apps. It provides a proven pattern to enforce authentication, authorization, CSRF protection, multi-tenant data isolation, rate limiting, and comprehensive audit logging across critical admin routes.
Core Features & Use Cases
- Admin route wrappers: Use
adminReadfor reads andadminMutationfor mutations to consistently apply security controls. - RBAC & CSRF: Integrate role-based access control and cross-site request forgery protections across endpoints.
- Tenant isolation: Ensure all queries are scoped by tenantId to prevent cross-tenant data access.
- Audit & safety: Automatically audit privileged operations and enforce safe data selection to redact sensitive fields.
Quick Start
- Choose the appropriate wrapper (adminRead for GET, adminMutation for writes).
- Define input validation with Zod schemas.
- Apply tenant scoping and use safe selects.
- Implement security tests (CSRF, RBAC, audit logging). Example: export async function POST(req: NextRequest) { return adminMutation(req, { permissions: ["users.write"], audit: { action: "create_user", resource: "user" } }, async (user, body) => { const validatedData = createUserSchema.parse(body); // Implementation with tenant scoping and security }); }
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: api-design-security Download link: https://github.com/ArtisanClarinets/crispy-fishstick/archive/main.zip#api-design-security Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.