Generate Hierarchical & Nested CLAUDE.md Files for Monorepos & Microservices
Design a clean hierarchy of root and nested CLAUDE.md files for Turborepo, Nx, or polyglot microservice architectures.
System Directive • Copy and Paste Below
You are an Enterprise Monorepo Architect and Build Systems Specialist. Design a multi-tier instruction architecture comprising a root `CLAUDE.md` and specialized nested `CLAUDE.md` files for a complex monorepo or microservices project. ### MONOREPO SPECIFICATIONS: - Monorepo Tooling (Turborepo, Nx, pnpm workspaces, Lerna): [MONOREPO_TOOL] - Workspace Directory Tree: [WORKSPACE_STRUCTURE] - Shared Packages (UI library, shared configs, database client, types): [SHARED_PACKAGES] - Individual Applications (Web app, mobile app, background worker, API gateway): [APPLICATIONS_LIST] ### ARCHITECTURAL REQUIREMENTS: 1. **Root `CLAUDE.md`**: - Global repository rules, package manager standards, workspace dependency graph. - Global linting, typechecking, and build pipeline commands (e.g. `pnpm turbo build`). - Cross-package boundary rules (e.g. apps can import from packages, but packages cannot import from apps). 2. **App-Specific Nested `CLAUDE.md` (e.g. `apps/web/CLAUDE.md`)**: - Local development server commands, routing conventions, frontend state management. 3. **Service-Specific Nested `CLAUDE.md` (e.g. `services/api/CLAUDE.md`)**: - Database migration commands, API schema standards, integration test commands. 4. **Conflict Prevention Protocol**: - Rules explaining how Claude should inherit root instructions and override them with local package rules without creating contradictory context. Deliver the Root `CLAUDE.md` and 2 specialized nested `CLAUDE.md` files in clean markdown blocks.
Customization & Placeholders
Describe your monorepo tooling and package layout. Claude will output a harmonious set of root and package-level CLAUDE.md files.
Example Input Values
Tool: Turborepo + pnpm, Packages: packages/ui, packages/db, packages/config, Apps: apps/web (Next.js), apps/api (Node Fastify).
Expected Output Structure
Root CLAUDE.md for global build pipelines plus apps/web/CLAUDE.md and apps/api/CLAUDE.md tailored to each sub-project.
Enterprise Architecture & Monorepo Modernization
Qubenix untangles sprawling codebases into streamlined monorepos with shared type safety and ultra-fast CI/CD pipelines.
More Prompts in Claude Development Toolkit
Generate a Production-Ready CLAUDE.md for an Existing Repository
Inspect an existing codebase and generate a comprehensive, accurate CLAUDE.md with project architecture, build commands, and coding conventions.
Create a Professional design.md Specification from Current Website
Inspect an existing web application or website and extract a complete, structured design.md with design tokens, typography, and component specs.
Create a Reusable Claude Skill for React & Next.js Development
Generate a fully conformant SKILL.md for React and Next.js development that enforces type safety, component modularity, and zero-re-render patterns.