nextjs-dropflow

Implements Next.js 14 App Router patterns for routes, API handlers, middleware, and server actions.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/gengirish/dropflow --skill nextjs-dropflow-gengirish
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nextjs-dropflow
Source: https://github.com/gengirish/dropflow/tree/main/.cursor/skills/nextjs-dropflow
Command: npx skills add https://github.com/gengirish/dropflow --skill nextjs-dropflow-gengirish

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building a multi-tenant Next.js 14 application requires consistent conventions for route groups, API handlers, server actions, and middleware. This Skill codifies DropFlow's App Router patterns so generated code follows the same structure, response shapes, and naming conventions every time. ## Core Features & Use Cases - Route Group Conventions: Defines the (auth), (dashboard), (storefront), and (supplier) route groups plus the app/api/v1 REST structure. - API Route Pattern: Standard POST handler using requireAuth, tenant-scoped Prisma, Zod validation, and ok/err response helpers. - Server Action Pattern: Typed server actions via authAction with schema validation in actions/[domain]/verb-noun.ts files. - Middleware Setup: Clerk middleware resolving tenant subdomains, applying rate limits, and injecting x-tenant-id headers. - Use Case: When adding a new orders endpoint, generate app/api/v1/orders/route.ts that authenticates the tenant, validates input with Zod, and returns the standard { success, data, error } response shape. ## Quick Start Create a new API route for products in the DropFlow app following the standard tenant-scoped pattern.

Frequently Asked Questions about nextjs-dropflow

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

FAQPage Schema
How do I create an API route in Next.js 14 App Router?▼

Create a route.ts file under app/api/v1/[resource]/ and export async functions like POST. Authenticate with requireAuth, validate the body with a Zod schema, use the tenant-scoped Prisma client, and return responses via the ok and err helpers.

How to structure route groups in a Next.js multi-tenant app?▼

Use parenthesized folders like (auth), (dashboard), (storefront), and (supplier) to organize routes without affecting URLs. The dashboard group uses a layout.tsx with an auth guard and tenant resolver for tenant-scoped pages.

How do I write server actions with validation in Next.js?▼

Define actions in actions/[domain]/verb-noun.ts files marked with "use server". Chain authAction with a Zod schema via .schema() and implement logic in .action(), accessing the tenant Prisma client from the context.

Does Clerk middleware support multi-tenant subdomain resolution?▼

Yes, clerkMiddleware can resolve the subdomain to a tenantId, apply per-tenant rate limiting, and attach the tenantId to request headers via NextResponse.next. Configure the matcher to cover /api/v1/* and /(dashboard)/* routes.

Why should environment variables be parsed with Zod in Next.js?▼

Parsing environment variables through a lib/env.ts module with Zod validates them at startup and provides typed access. This avoids using process.env directly in business logic, catching misconfiguration early.