monorepo-backend-layout

Enforce backend code placement under designated monorepo subdirectories.

2|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/pmarashian/cursor-agent-skills --skill monorepo-backend-layout
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: monorepo-backend-layout
Source: https://github.com/pmarashian/cursor-agent-skills/tree/main/monorepo-backend-layout
Command: npx skills add https://github.com/pmarashian/cursor-agent-skills --skill monorepo-backend-layout

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents common structural errors when working with monorepos that have a dedicated backend directory, ensuring code is placed in the correct subdirectories to avoid build and runtime failures.

Core Features & Use Cases

  • Enforces Backend Root: Identifies and uses the designated backend directory (e.g., backend/) as the primary location for all backend application code.
  • Correct Pathing: Ensures API routes are created under backend/src/app/... and library code under backend/src/lib/... (or project-specific equivalents).
  • Use Case: When adding a new API endpoint to a monorepo project with a backend/ directory, this skill guides the AI to place the new route file within backend/src/app/api/... instead of the repository root.

Quick Start

Use the monorepo-backend-layout skill to ensure new backend API routes are created under the correct directory.

Frequently Asked Questions about monorepo-backend-layout

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

FAQPage Schema
How do I structure backend API routes in a monorepo to prevent 404 errors?

To prevent 404 errors in a monorepo backend, place API routes under the designated `backend/src/app/` directory and library code under `backend/src/lib/`. This enforces correct pathing and maintains project integrity.

Why does my monorepo backend build fail when I add new code to the root directory?

Monorepo backend builds fail when code is placed in the root because the project requires a dedicated backend directory. Application code must go under `backend/src/app/` and library code under `backend/src/lib/` to resolve correctly.

What is the correct directory structure for backend code within a monorepo?

The correct directory structure for backend code within a monorepo uses a dedicated backend folder as the root. API routes go in `backend/src/app/` and library code goes in `backend/src/lib/` to ensure proper organization.

Can I use custom path conventions for my monorepo backend layout?

Yes, the layout adheres to project-specific path conventions for backend development. While it defaults to `backend/src/app/` for routes and `backend/src/lib/` for libraries, it adjusts to your project's designated equivalents.

Where should I put library code in a monorepo backend project?

Library code in a monorepo backend project should be placed under the `backend/src/lib/` directory. This separates shared libraries from API route logic and prevents structural errors during builds.