home / skills / sickn33 / antigravity-awesome-skills / monorepo-management

monorepo-management skill

/skills/monorepo-management

This skill helps you set up and optimize monorepos with Turborepo, Nx, and pnpm, ensuring scalable dependency sharing and fast builds.

This is most likely a fork of the monorepo-management skill from xfstudio
npx playbooks add skill sickn33/antigravity-awesome-skills --skill monorepo-management

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.2 KB
---
name: monorepo-management
description: Master monorepo management with Turborepo, Nx, and pnpm workspaces to build efficient, scalable multi-package repositories with optimized builds and dependency management. Use when setting up monorepos, optimizing builds, or managing shared dependencies.
---

# Monorepo Management

Build efficient, scalable monorepos that enable code sharing, consistent tooling, and atomic changes across multiple packages and applications.

## Use this skill when

- Setting up new monorepo projects
- Migrating from multi-repo to monorepo
- Optimizing build and test performance
- Managing shared dependencies
- Implementing code sharing strategies
- Setting up CI/CD for monorepos
- Versioning and publishing packages
- Debugging monorepo-specific issues

## Do not use this skill when

- The task is unrelated to monorepo management
- You need a different domain or tool outside this scope

## Instructions

- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open `resources/implementation-playbook.md`.

## Resources

- `resources/implementation-playbook.md` for detailed patterns and examples.

Overview

This skill helps you master monorepo management using Turborepo, Nx, and pnpm workspaces to build scalable multi-package repositories with fast, deterministic builds and consistent dependency handling. It focuses on practical setup, build optimization, dependency hygiene, and CI/CD patterns that reduce friction when sharing code across services and packages.

How this skill works

The skill inspects repository layout, tooling choices, and dependency graphs to recommend configuration and migration steps. It provides actionable commands, caching and pipeline optimizations, workspace manifest guidance, and verification checks for build correctness and dependency deduplication. You get recommended patterns for versioning, publishing, and CI integration based on repo goals and constraints.

When to use it

  • Initializing a new monorepo with multiple apps and packages
  • Migrating multiple repos into a single monorepo to enable atomic changes
  • Optimizing slow builds and tests with caching and parallelization
  • Managing shared dependencies and preventing version drift across packages
  • Designing CI/CD pipelines that scale for many packages and teams

Best practices

  • Prefer pnpm workspaces for fast, disk-efficient installs and strict node_modules hoisting control
  • Use Turborepo or Nx pipelines to cache and parallelize tasks; cache keys should include lockfile and relevant env
  • Design package boundaries with clear public APIs and minimal shared internal state
  • Keep tooling configs centralized (lint, format, test runners) and allow package-level overrides when necessary
  • Automate dependency updates and use lockfile checks in CI to avoid transient breakages

Example use cases

  • Create a new monorepo combining a React app, backend service, and shared UI component library using pnpm + Turborepo
  • Migrate three microservice repos into a single Nx workspace to enable cross-package refactors and atomic commits
  • Cut CI build time by adding remote cache and selective task hashing so only changed packages rebuild
  • Enforce consistent ESLint and TypeScript settings across hundreds of packages with a centralized config
  • Implement a canary and versioning strategy for publishing internal packages to a private registry

FAQ

Which tool should I choose: Turborepo or Nx?

Choose based on team needs: use Turborepo for simple, high-performance pipelines and lightweight config; use Nx if you need advanced dependency graphs, code generators, or integrated dev tooling.

How do I avoid dependency duplication in a monorepo?

Use pnpm workspaces to enforce a single installation and hoist strategy, keep a clear dependency policy, and run automated audits and dedupe checks in CI.