git-worktree-nextjs-prisma

Set up git worktrees for Next.js projects with Prisma client generation and env file copying.

9|2|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/DavidTeju/shared-skills --skill git-worktree-nextjs-prisma
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree-nextjs-prisma
Source: https://github.com/DavidTeju/shared-skills/tree/main/skills/git-worktree-nextjs-prisma
Command: npx skills add https://github.com/DavidTeju/shared-skills --skill git-worktree-nextjs-prisma

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

New git worktrees for Next.js projects with Prisma often miss the generated Prisma client and environment files, causing runtime errors.

Core Features & Use Cases

  • Guided worktree setup: Steps to create a new worktree, switch branches, and ensure isolation from the main repo.
  • Prisma client generation: Ensures npx prisma generate runs in every worktree to produce the client.
  • Environment handling: Copying non-versioned .env files into the worktree to avoid missing configs. Use cases include parallel UI variant development and bug fixing in isolated worktrees.

Quick Start

Create a new worktree for a feature branch, copy environment files, install dependencies, and run Prisma generate.

Frequently Asked Questions about git-worktree-nextjs-prisma

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

FAQPage Schema
Why does my Next.js Prisma client fail in a new git worktree?

New git worktrees lack the generated Prisma client and non-versioned environment files, causing runtime errors. You must copy the .env files and run npx prisma generate in the new worktree to resolve this.

How do I set up git worktrees for Next.js projects using Prisma?

To set up git worktrees for Next.js with Prisma, create the worktree, copy environment files, run npm install, and execute npx prisma generate. This ensures the Prisma client and configs are present for isolated feature development.

What steps are needed to generate the Prisma client in parallel git worktrees?

Generating the Prisma client in parallel git worktrees requires copying non-versioned .env files into the worktree, installing dependencies with npm install, and running npx prisma generate to produce the client locally.

Can I use git worktrees for parallel UI development without breaking Prisma?

Yes, git worktrees support parallel UI variant development and bug fixing without breaking Prisma. Enforcing deterministic steps like npm install, npx prisma generate, and proper environment handling stabilizes each isolated worktree.

How to fix missing environment files when creating a Next.js worktree?

To fix missing environment files in a Next.js worktree, copy the non-versioned .env files from your main repository into the new worktree directory. This prevents missing configuration errors during local development.

Does Prisma require npx prisma generate in every git worktree?

Yes, Prisma requires running npx prisma generate in every git worktree. Because the generated client is not versioned, each isolated worktree must produce its own client to avoid runtime errors during development.