route-auditor

Scan Next.js app/api route files for security and architectural violations.

3|Updated Aug 3, 2025
One-click install
npx skills add https://github.com/CleanExpo/Synthex --skill route-auditor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: route-auditor
Source: https://github.com/CleanExpo/Synthex/tree/main/.claude/skills/route-auditor
Command: npx skills add https://github.com/CleanExpo/Synthex --skill route-auditor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many Next.js API route handlers drift from established security and architecture patterns, introducing vulnerabilities like raw JWT verification, missing validation, exposed error messages, duplicate utilities, and missing organization scoping; this Skill finds those issues before they reach production and enforces the SYNTHEX route standard.

Core Features & Use Cases

  • Critical enforcement checks: Detects raw jwt.verify usage, forbidden as any casts, and duplicated local JWT utilities.
  • Higher-level validations: Ensures Zod input validation, sanitized error responses, proper Prisma scoping by user/org, and correct NextRequest types.
  • Automated fixes & reporting: Produces grouped reports with line numbers, suggested fixes, and can safely auto-apply fixes for a subset of issues.
  • Integration & workflows: Run during route creation, PR reviews, bulk audits across app/api/, or as part of a senior-reviewer agent pipeline.

Quick Start

Run a full audit on app/api/ to identify auth drift, missing validation, and org-scoping gaps and receive a grouped report with suggested fixes.

Frequently Asked Questions about route-auditor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Next.js API route drift from established security patterns?

To audit Next.js API routes, scan app/api/ files to detect raw JWT usage, missing Zod validation, exposed errors, duplicate utilities, and Prisma org-scoping gaps. This process produces structured findings with line numbers, severities, and remediation suggestions.

Can I automatically fix missing Zod validation and JWT compliance issues in Next.js?

Yes, you can automatically fix missing Zod validation and JWT compliance issues. The scanner safely auto-applies fixes for a subset of detected issues and generates grouped reports with suggested remediation for centralized JWT utilities and scoping.

Does this route auditing tool work with Prisma and Zod in a Next.js project?

Yes, this route auditing tool works with Prisma and Zod. It verifies proper Prisma scoping by user or organization and ensures Zod input validation is correctly implemented within your Next.js app/api/ route files.

What's the best way to enforce centralized JWT utilities across multiple API routes?

The best way to enforce centralized JWT utilities is running a bulk compliance audit across app/api/ directories. This identifies duplicated local JWT utilities and raw jwt.verify calls, providing actionable fixes to standardize authentication patterns.

When should I run an API route compliance check during development?

You should run an API route compliance check when creating, modifying, or reviewing API routes, and during bulk compliance audits. It acts as a senior-reviewer agent pipeline to verify NextRequest types and sanitized error responses before production deployment.