api-route-conventions

Generates standardized templates and patterns for Laravel API routes.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Sanchay-T/influencer-platform-app --skill api-route-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-route-conventions
Source: https://github.com/Sanchay-T/influencer-platform-app/tree/main/.claude/skills/api-route-conventions
Command: npx skills add https://github.com/Sanchay-T/influencer-platform-app --skill api-route-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Expert knowledge on Next.js API route patterns, authentication with getAuthOrTest, error handling, response formats, rate limiting, and webhook verification.

Core Features & Use Cases

  • Standard API Route Template: Example GET/POST patterns for /app/api/...
  • Authentication Patterns: getAuthOrTest and bypass methods.
  • Webhook Pattern: Stripe, QStash, Clerk.
  • Validation & Logging: Zod patterns, structured logging.

Quick Start

Use the standard API template at /app/api/[feature]/route.ts and adjust for your endpoint.

Frequently Asked Questions about api-route-conventions

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

FAQPage Schema
How do I structure authentication in Next.js API routes?

Use the getAuthOrTest pattern to authenticate requests consistently across your Next.js API routes. This approach validates user identity before processing, supporting bypass methods for development and webhook verification scenarios.

What's the standard way to handle errors in Next.js API endpoints?

Implement standardized error handling by returning consistent response formats with appropriate HTTP status codes, structured logging, and clear error messages. The standard template covers common failure modes across GET, POST, and webhook routes.

How do I verify webhooks from Stripe, Clerk, and QStash in Next.js?

Webhook verification requires validating signatures and timestamps from each provider using their libraries and secrets. The Skill provides verified patterns for Stripe, Clerk, and QStash webhook routes at /app/api/webhooks/[provider]/route.ts.

Can I validate and parse request data consistently across my API routes?

Yes, use Zod schemas to validate incoming GET and POST data with structured parsing. Apply validation before authentication and business logic to ensure type safety and consistent error responses across all endpoints.

Do I need rate limiting for my Next.js API routes?

Rate limiting protects endpoints from abuse and ensures fair resource allocation. The Skill includes standard rate-limiting patterns integrated into the API route template, particularly important for public webhooks and user-facing endpoints.

How should I organize and migrate existing Next.js API routes?

Migrate routes to the /app/api/[feature]/route.ts structure following the standard template patterns. This organization ensures consistency, reduces security risks from ad-hoc endpoint creation, and simplifies debugging and logging across your API surface.