All skills
vercel-labs avatar

/next-forge

@59a9b51 official

next-forge expert guidance — production-grade Turborepo monorepo SaaS starter by Vercel. Use when working in a next-forge project, scaffolding with `npx next-forge init`, or editing @repo/* workspace packages.

  • 11 files
  • 67.5 KB
  • Updated last week
  • GitHub

Use this Skill: https://skilld.dev/gh/vercel-labs/vercel-plugin/next-forge

This session only. Nothing lands on disk.

referencescustomization.md

≈1.7k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Customization

Swapping Providers

next-forge is designed to be modular. Each integration can be replaced by modifying its corresponding package.

Database / ORM

Default: Prisma + Neon PostgreSQL

Alternatives:

  • Drizzle — Replace Prisma schema with Drizzle schema definitions. Update @repo/database exports to use Drizzle client.
  • PlanetScale — Change the Prisma datasource provider or use PlanetScale's serverless driver.
  • Supabase — Use Supabase's PostgreSQL connection string as DATABASE_URL, or swap to the Supabase client SDK.
  • Turso — Use Turso's libSQL adapter with Prisma or Drizzle.
  • EdgeDB — Replace Prisma with EdgeDB's schema and query builder.
  • Prisma Postgres — Use Prisma's managed PostgreSQL service.

To swap: update packages/database/, change the client export, and update DATABASE_URL.

Authentication

Default: Clerk

Alternatives:

  • Supabase Auth — Replace @repo/auth with Supabase Auth client. Update middleware and session handling.
  • Auth.js — Implement Auth.js (NextAuth v5) with chosen providers. Update session access patterns.
  • Better Auth — Use Better Auth's session management. Update @repo/auth exports.

To swap: replace packages/auth/, update the AuthProvider in the design system, and update webhook handlers.

CMS

Default: BaseHub

Alternatives:

  • Content Collections — Use local MDX/Markdown files with content collections. Remove BaseHub SDK dependency.

To swap: replace packages/cms/ with the new CMS client and update content queries in the web app.

Payments

Default: Stripe

Alternatives:

  • Paddle — Replace Stripe SDK with Paddle SDK. Update webhook handlers at /api/webhooks/payments.
  • Lemon Squeezy — Replace Stripe SDK with Lemon Squeezy SDK. Update webhook verification logic.

To swap: update packages/payments/, replace the webhook handler in apps/api/, and update pricing page logic.

Design System

Default: shadcn/ui (New York style, neutral colors)

Alternatives:

  • Tailwind Catalyst — Replace shadcn/ui components with Catalyst components.
  • Any Tailwind-based component library can be integrated.

To swap: replace components in packages/design-system/. Keep DesignSystemProvider as the wrapper.

Email

Default: Resend + React Email

To swap: replace the resend client in packages/email/ with another provider SDK (SendGrid, Postmark, AWS SES). Keep React Email templates as they compile to standard HTML.

Documentation

Default: Mintlify

Alternative: Fumadocs — MDX-based documentation framework for Next.js.

To swap: replace the docs app with a Fumadocs Next.js app.

Notifications

Default: Knock

Alternative: Novu — similar workflow-based notification platform.

To swap: replace packages/notifications/ with the new provider's SDK and update workflow triggers.

Code Formatting

Default: Ultracite (Biome-based)

Alternative: ESLint configurations.

Commands remain the same: bun run lint, bun run format.

Deployment to Vercel

Project Setup

Create three separate Vercel projects, one for each deployable app:

  1. app — Root directory: apps/app
  2. web — Root directory: apps/web
  3. api — Root directory: apps/api

For each project:

  1. Import the repository in Vercel.
  2. Set the Root Directory to the app's path (e.g., apps/app).
  3. Vercel auto-detects the Next.js framework.
  4. Add all required environment variables.
  5. Deploy.

Environment Variables on Vercel

Use Vercel Team Environment Variables to share common variables across projects (e.g., DATABASE_URL, Stripe keys). This avoids duplicating values per project.

Recommended: install the BetterStack and Sentry Vercel integrations to auto-inject their environment variables.

Production URLs

Update inter-app URL variables to production domains:

NEXT_PUBLIC_APP_URL="https://app.yourdomain.com"
NEXT_PUBLIC_WEB_URL="https://www.yourdomain.com"
NEXT_PUBLIC_API_URL="https://api.yourdomain.com"
NEXT_PUBLIC_DOCS_URL="https://docs.yourdomain.com"

Preview Deployments

Three strategies for preview environment inter-app communication:

  1. Point to production — Preview apps use production URLs for other apps. Simplest setup.
  2. Branch-based URLs — Use Vercel's deterministic branch URLs derived from VERCEL_GIT_COMMIT_REF. Each branch gets a stable preview URL.
  3. Manual override — Set custom URLs per preview deployment in Vercel project settings.

Adding New Apps

  1. Create a new directory under /apps/.
  2. Initialize a Next.js app (or other framework).
  3. Add @repo/* package dependencies as needed.
  4. Add the app to turbo.json if it needs custom pipeline tasks.
  5. Assign a unique development port.

Adding New Packages

  1. Create a new directory under /packages/.
  2. Add a package.json with the @repo/<name> naming convention.
  3. Export the package's public API.
  4. Add a keys.ts file if the package requires environment variables (use @t3-oss/env-nextjs with Zod).
  5. Add the package as a dependency in consuming apps.

Design System Theming

Colors

The design system uses CSS custom properties for theming. Edit the theme in the design system's global CSS file. shadcn/ui provides a theme generator at ui.shadcn.com/themes.

Dark Mode

Dark mode is handled by next-themes via DesignSystemProvider. The provider supports system preference detection and manual theme toggling. Use the dark: Tailwind prefix for dark mode styles.

Fonts

Font configuration is centralized in the design system package. Update the font imports and CSS variables to change the application font.

Adding Components

Add new shadcn/ui components:

npx shadcn@latest add [component] -c packages/design-system

Create custom compound components following the composable pattern:

import { Banner, BannerContent, BannerTitle, BannerDescription } from '@repo/design-system/components/banner';

Extending Features

Adding API Routes

Add routes in apps/api/app/ following Next.js App Router conventions. Export named HTTP method handlers (GET, POST, etc.).

Adding Cron Jobs

  1. Create a route at apps/api/app/cron/[job-name]/route.ts with a GET handler.
  2. Add the schedule to apps/api/vercel.json:
    { "path": "/cron/job-name", "schedule": "0 * * * *" }

Adding Webhook Handlers

Create routes in apps/api/app/webhooks/ for inbound webhooks. Verify signatures using the provider's SDK.

Adding Feature Flags

  1. Define the flag in packages/feature-flags/index.ts using createFlag('key').
  2. Create the flag in PostHog.
  3. Use it: const enabled = await myFlag().

Adding Email Templates

Create React components in the email package. Preview them at http://localhost:3003. Use the resend client to send them.

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at 59a9b51. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 11 hours ago.

Activeupdated last week
Other metadata
summary
next-forge monorepo SaaS starter (Turborepo, Clerk, Prisma/Neon, Stripe, Resend, shadcn/ui, Sentry, PostHog). See => skill:next-forge for full guide.
metadata
{
  "priority": 6,
  "docs": [
    "https://next-forge.com/docs",
    "https://github.com/vercel/next-forge"
  ],
  "pathPatterns": [
    "pnpm-workspace.yaml",
    "apps/app/**",
    "apps/web/**",
    "apps/api/**",
    "apps/email/**",
    "apps/docs/**",
    "apps/studio/**",
    "apps/storybook/**",
    "packages/auth/**",
    "packages/database/**",
    "packages/design-system/**",
    "packages/payments/**",
    "packages/email/**",
    "packages/analytics/**",
    "packages/observability/**",
    "packages/security/**",
    "packages/ai/**",
    "packages/cms/**",
    "packages/collaboration/**",
    "packages/feature-flags/**",
    "packages/internationalization/**",
    "packages/notifications/**",
    "packages/rate-limit/**",
    "packages/seo/**",
    "packages/storage/**",
    "packages/webhooks/**",
    "packages/next-config/**",
    "packages/typescript-config/**",
    "**/keys.ts",
    "**/env.ts",
    "**/proxy.ts",
    "biome.jsonc"
  ],
  "bashPatterns": [
    "\\bnext-forge\\b",
    "\\bnpx\\s+next-forge\\b",
    "\\bpnpm\\s+migrate\\b",
    "\\bpnpm\\s+bump-deps\\b",
    "\\bpnpm\\s+bump-ui\\b",
    "\\bprisma\\s+(generate|db\\s+push|format|studio)\\b",
    "\\bstripe\\s+listen\\b",
    "\\bnpx\\s+shadcn@latest\\s+add\\b.*-c\\s+packages/design-system\\b"
  ],
  "importPatterns": [
    "@repo/auth",
    "@repo/database",
    "@repo/design-system",
    "@repo/payments",
    "@repo/email",
    "@repo/analytics",
    "@repo/observability",
    "@repo/security",
    "@repo/ai",
    "@repo/cms",
    "@repo/collaboration",
    "@repo/feature-flags",
    "@repo/internationalization",
    "@repo/notifications",
    "@repo/rate-limit",
    "@repo/seo",
    "@repo/storage",
    "@repo/webhooks",
    "@repo/next-config",
    "@t3-oss/env-nextjs",
    "@rescale/nemo"
  ],
  "promptSignals": {
    "phrases": [
      "next-forge",
      "next forge",
      "@repo/"
    ],
    "allOf": [
      [
        "monorepo",
        "saas",
        "starter"
      ],
      [
        "turborepo",
        "clerk",
        "stripe"
      ]
    ],
    "anyOf": [
      "saas starter",
      "production monorepo",
      "keys.ts",
      "pnpm-workspace"
    ],
    "noneOf": [
      "create-t3-app"
    ],
    "minScore": 6
  }
}
validate
[
  {
    "pattern": "\"pipeline\"\\s*:",
    "message": "turbo.json \"pipeline\" was renamed to \"tasks\" in Turborepo v2 — update to \"tasks\"",
    "severity": "error"
  },
  {
    "pattern": "new Pool\\(",
    "message": "PrismaNeon expects a connection config object, not a Pool instance — use PrismaNeon({ connectionString: url })",
    "severity": "error",
    "skipIfFileContains": "pg\\.Pool"
  },
  {
    "pattern": "prisma studio --schema",
    "message": "Prisma v7 removed --schema flag for studio — use --config instead",
    "severity": "error"
  },
  {
    "pattern": "middleware\\.ts",
    "message": "next-forge uses proxy.ts (Next.js 16+), not middleware.ts — rename to proxy.ts",
    "severity": "warn",
    "skipIfFileContains": "proxy\\.ts"
  }
]
retrieval
{
  "aliases": [
    "saas starter",
    "monorepo starter",
    "next forge",
    "turborepo template"
  ],
  "intents": [
    "scaffold saas",
    "set up next-forge",
    "create monorepo project",
    "use next-forge"
  ],
  "entities": [
    "next-forge",
    "@repo/*",
    "Turborepo",
    "monorepo",
    "SaaS starter"
  ]
}
chainTo
[
  {
    "pattern": "export\\s+(default\\s+)?function\\s+middleware",
    "targetSkill": "routing-middleware",
    "message": "middleware.ts detected in next-forge project — loading Routing Middleware guidance for proxy.ts migration."
  },
  {
    "pattern": "@clerk/|clerkMiddleware|ClerkProvider|getAuth\\(\\)|auth\\(\\)",
    "targetSkill": "auth",
    "message": "Clerk auth patterns in next-forge — loading Auth guidance for middleware auth, sign-in/sign-up flows, and organization handling.",
    "skipIfFileContains": "@auth0/|@descope/"
  }
]

README badge

README badge for vercel-labs/vercel-plugin/next-forge