api-integration
Use this skill when the user says 'API integration', 'connect APIs', 'sync data', 'data mapping', 'rate limiting', or needs…
Use this skill when the user says 'audit API', 'check API security', 'API routes security', 'endpoint audit', 'check my routes', or needs to verify API route protection. Reviews API endpoints for authentication, authorization, and input validation gaps. Do NOT use for frontend
$ npx -y skills add cwinvestments/memstack --skill api-audit --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/api-auditContext preview
The summary Claude sees to decide when to auto-load this skill.
Use this skill when the user says 'audit API', 'check API security', 'API routes security', 'endpoint audit', 'check my routes', or needs to verify API route protection. Reviews API endpoints for authentication, authorization, and input validation gaps. Do NOT use for frontend
name: memstack-security-api-audit description: "Use this skill when the user says 'audit API', 'check API security', 'API routes security', 'endpoint audit', 'check my routes', or needs to verify API route protection. Reviews API endpoints for authentication, authorization, and input validation gaps. Do NOT use for frontend security headers or dependency scanning." version: 1.0.0 license: "Proprietary, MemStack™ Pro by CW Affiliate Investments LLC. See LICENSE.txt"
*Audit Next.js API routes for authentication, authorization, validation, and common vulnerabilities.*
When this skill activates, output:
`🛡️ API Audit: Checking API Route Security...`
Then execute the protocol below.
| Context | Status | |---------|--------| | **User asks to audit/check API routes** | ACTIVE: full audit | | **User mentions API security** | ACTIVE: full audit | | **User asks about endpoint protection** | ACTIVE: full audit | | **User is writing a new API route** | DORMANT: let them finish first | | **Non-Next.js project** | DORMANT, not applicable (adapt if Express/Fastify detected) |
Find all API route files in the project:
1. **App Router (Next.js 13+):**
find . -path "*/app/api/*/route.ts" -o -path "*/app/api/*/route.js"
Each file exports named functions: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`.
2. **Pages Router (legacy):**
find . -path "*/pages/api/*.ts" -o -path "*/pages/api/*.js"
Each file exports a default handler.
3. **Middleware:**
find . -name "middleware.ts" -o -name "middleware.js" | head -5
Check if global auth middleware exists (reduces per-route auth requirements).
4. **Server Actions (Next.js 14+):**
grep -r "'use server'" --include="*.ts" --include="*.tsx" -l
Server actions are also attack surface: treat as API routes. For each server action function, verify it performs authentication before accessing data. Server actions are callable from any client component and receive no automatic auth: they are functionally identical to unauthenticated POST endpoints unless the function explicitly calls `getSession()`, `getAuthContext()`, or equivalent.
Compile a list of all routes with their HTTP methods and file paths.
For each route, determine if it verifies the caller is authenticated:
**Search for auth patterns in each route file:**
**Classify each route:** | Status | Meaning | |--------|---------| | ✅ Authenticated | Auth check found before data access | | 🔴 No Auth | No authentication pattern detected | | ℹ️ Public | Route is intentionally public (webhooks, health checks, public data) | | ⚠️ Middleware-only | Auth handled by middleware, verify matcher covers this route |
**Flag as CRITICAL** if a route performs database writes or returns user-specific data with no auth.
**Known public route patterns** (classify as ℹ️ INFO, not CRITICAL):
For authenticated routes, verify they check *what* the user can access:
**Search for authorization patterns:**
**Flag as WARNING if:**
**Pattern to enforce:**
// BAD, trusts client-provided org ID
const { orgId } = await req.json();
const data = await db.from('documents').select().eq('org_id', orgId);
// GOOD, derives org from authenticated session
const { orgId } = await getAuthContext(req);
const data = await db.from('documents').select().eq('org_id', orgId);For routes that accept request body or query params:
**Search for validation patterns:**
**Flag as WARNING if:**
**Flag as CRITICAL if:**
For public-facing routes:
**Search for rate limiting patterns:**
**Flag as WARNING if:**
#
The structured skill framework for Claude Code: 131 professional skills for deployment, security, databases, content, marketing, and more. Skills activate automatically when you need them. Say "deploy this to Railway" and the right skill loads on demand.
Use this skill when the user says 'API integration', 'connect APIs', 'sync data', 'data mapping', 'rate limiting', or needs…
Use this skill when the user says 'content pipeline', 'content automation', 'auto-publish', 'repurpose content', 'multi-platform…
Use this skill when the user says 'cron job', 'scheduled task', 'run every', 'cron expression', 'recurring job', or needs…
Use when the user says 'what MCP servers', 'find an MCP for', 'hosted MCP', 'list MCP servers', 'MCP catalog', 'available MCP…
Use this skill when the user says 'n8n workflow', 'build a workflow', 'automation workflow', 'connect services', or needs visual…
Use this skill when the user says 'webhook', 'webhook handler', 'webhook endpoint', 'receive events', 'HMAC verification',…