Prompt to Create a Monorepo with Turborepo
A prompt to generate the complete architecture of a Turborepo monorepo with folder structure, pipelines, shared packages and CI/CD configuration.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
You are a senior software architect specializing in JavaScript/TypeScript monorepos. I want to create a monorepo with Turborepo for my project.
Project context:
- Project type: [project type (e.g., SaaS with a Next.js frontend and Node.js API, a suite of React Native mobile apps + web dashboard, a UI component library with documentation)]
- Number of apps: [number and list of apps (e.g., 2 apps - a Next.js frontend and an Express API)]
- Shared packages needed: [shared packages (e.g., ui, utils, config-eslint, config-typescript, types)]
- Package manager: [package manager (pnpm, npm, yarn, or bun)]
- Main technologies: [tech stack (e.g., TypeScript, React, Tailwind CSS, Prisma)]
Generate a complete Turborepo monorepo architecture including:
-
Folder structure: full directory tree with apps/ and packages/, explaining the role of each folder.
-
Root configuration files:
- turbo.json with the pipelines (build, dev, lint, test, type-check) and task dependencies
- Root package.json with workspaces and global scripts
- Package manager configuration (pnpm-workspace.yaml if using pnpm)
- Shared base tsconfig.json
-
Shared packages: for each package listed, provide:
- The package.json with the correct exports (main, types, exports map)
- The tsconfig.json that extends the base config
- A sample source file showing the export pattern
-
App configuration: how each app references the internal packages (using the workspace:* protocol).
-
Optimized Turborepo pipeline:
- Build order with topological dependencies
- Cache configuration (inputs, outputs)
- Environment variables (globalEnv, env)
-
Utility scripts:
- Script to create a new package
- Script to create a new app
- Common development commands
-
CI/CD: example GitHub Actions workflow that leverages the Turborepo cache and Remote Caching.
-
Best practices:
- Dependency management (internal vs. external)
- Versioning strategy
- Package naming convention
- Common pitfalls to avoid
Provide every file with its full content, ready to copy. Add explanatory comments in the code.
Personalize this prompt with Léa
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
Why this prompt works
<p>This prompt guides AI to produce a turnkey Turborepo monorepo architecture. By specifying your <strong>project type</strong> and <strong>tech stack</strong>, you get a structure tailored to your real needs rather than a generic template.</p><p>The <strong>[SHARED_PACKAGES]</strong> and <strong>[NUMBER_AND_LIST_OF_APPS]</strong> variables are essential: they allow AI to correctly configure workspace dependencies, build pipelines and exports for each package. The more specific you are about your stack, the more directly usable the generated configuration files will be.</p><p>The prompt deliberately covers the entire monorepo lifecycle — from initial structure to CI/CD — so you can start immediately without figuring out how to connect the different parts. Adapt sections based on your priority: <strong>start with structure and configs</strong>, then add CI/CD once the monorepo is working locally.</p>
Use Cases
Expected Output
A complete monorepo architecture with directory tree, all configuration files (turbo.json, package.json, tsconfig), shared package examples with their exports, a GitHub Actions workflow and a list of best practices.
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Ajoutez une contrainte de versions pour vos outils (Node, pnpm/yarn, Turborepo). Par exemple, précisez `pnpm@9` et `turborepo@2`, car la syntaxe de `turbo.json` a évolué entre les versions 1 et 2. Cela évitera de générer des pipelines obsolètes ou incompatibles avec votre environnement.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
GitHub Copilot Prompt for Generating Unit Tests
GitHub Copilot has become an indispensable ally for developers looking to speed up writing unit tests. Thanks to its direct integration into the code editor, it analyzes the context of your source files to suggest relevant tests covering edge cases. However, the quality of generated tests heavily depends on the precision of the prompt used. A vague prompt will produce superficial tests, while a structured prompt will guide Copilot toward exhaustive coverage including nominal cases, expected errors, and boundary behaviors. In this guide, we offer an optimized prompt to generate robust unit tests with GitHub Copilot, regardless of your tech stack. You will learn how to formulate your instructions to obtain tests that follow your project's conventions, use the right test framework, and cover critical scenarios you might forget. Whether you work in JavaScript with Jest, Python with pytest, or Java with JUnit, these prompts adapt to your development environment.
REST API for ML Model
Exposing a model via an API
Write a deployment script
Automate deployment scripts
Perplexity Prompt for Generating Unit Tests
Perplexity stands out from other AI tools by combining real-time web search with code generation. For creating unit tests, this advantage is significant: Perplexity can identify current best practices in testing, conventions of frameworks like Jest, Pytest or JUnit, and apply them directly to your code. Unlike a classic LLM that relies solely on its training data, Perplexity checks the APIs and function signatures of the most recent test libraries, reducing errors from outdated versions. Whether you are testing a simple utility function, a service with external dependencies, or a React component with user interactions, a well-structured prompt yields tests covering nominal cases, edge cases, and error scenarios. This page provides you with optimized prompts to fully leverage Perplexity in your testing workflow, from the beginner developer discovering tests to the technical lead seeking exhaustive coverage with mocks and stubs.