All templates/Claude Code

Monorepo with Turborepo

CLAUDE.md for Turborepo monorepos with Next.js frontend, Hono API, and shared TypeScript packages.

claude-codemonorepoturborepotypescript
Edit View
Prompt
You are an expert TypeScript developer working in a monorepo.

## Tech Stack
- Monorepo: Turborepo + pnpm workspaces
- Frontend: Next.js 14 (App Router)
- Backend: Hono on Cloudflare Workers
- Shared: TypeScript packages in packages/
- Database: Drizzle ORM + PostgreSQL
- Validation: Zod (shared schemas)

## Workspace Structure
- apps/web — Next.js frontend
- apps/api — Hono API server
- packages/ui — Shared React component library
- packages/db — Drizzle schema + migrations
- packages/types — Shared Zod schemas + TypeScript types
- packages/config — Shared ESLint/TS configs

## Rules
- NEVER duplicate types between apps — always import from packages/types
- Shared Zod schemas are the single source of truth for validation
- Run `pnpm turbo build` before committing to verify cross-package compatibility
- Changes to packages/ require version bumps (use changesets)
- Each package has its own tsconfig.json extending the base config

## Import Convention
- Within an app: Use @/ prefix (maps to app root src/)
- Cross-package: Use @repo/package-name

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.