Skip to content
Back to skills

Monorepo Manager

ASecurity

Manage dependencies, workspace configurations, and cross-package relationships in monorepos using npm workspaces, pnpm, Yarn, Turborepo, or Nx. Use when syncing dependency versions across packages, resolving version conflicts, analyzing the dependency graph, or setting up build orchestration. Trigger words: monorepo, workspace, dependency sync, version conflict, turborepo, nx, pnpm workspace, cross-package, internal dependency.

  • 155 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 6, 2026
developmenttypescriptgoreactnextjsnodeexpressapidatabase

Works with

  • terminal
  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned November 8, 2026

npx -y skills add TerminalSkills/skills --skill monorepo-manager --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Monorepo Manager?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Monorepo Manager
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/terminalskills-monorepo-manager/badge)](https://www.skillsdirectory.com/skills/terminalskills-monorepo-manager)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: monorepo-manager
description: >-
  Manage dependencies, workspace configurations, and cross-package relationships
  in monorepos using npm workspaces, pnpm, Yarn, Turborepo, or Nx. Use when
  syncing dependency versions across packages, resolving version conflicts,
  analyzing the dependency graph, or setting up build orchestration. Trigger
  words: monorepo, workspace, dependency sync, version conflict, turborepo,
  nx, pnpm workspace, cross-package, internal dependency.
license: Apache-2.0
compatibility: "Node.js monorepos (npm/pnpm/yarn workspaces, Turborepo, Nx)"
metadata:
  author: terminal-skills
  version: "1.1.0"
  category: development
  tags: "monorepo, dependencies, workspaces, turborepo"
---

# Monorepo Manager

## Overview

Analyze, maintain, and optimize monorepo dependency graphs. Detect version mismatches across packages, sync shared dependencies, configure build pipelines, and resolve workspace conflicts that slow teams down.

## Instructions

### 1. Detect monorepo structure

Identify the monorepo tool in use:
- Check for `pnpm-workspace.yaml` → pnpm workspaces
- Check `package.json` for `"workspaces"` → npm/yarn workspaces
- Check for `turbo.json` → Turborepo
- Check for `nx.json` → Nx
- Check for `lerna.json` → Lerna (maintained by the Nx team; versioning and publishing)

Map all packages:
```
Monorepo: pnpm workspaces + Turborepo
Packages (14):
  apps/
    web          → Next.js 14 app
    api          → Express server
    admin        → React admin panel
  packages/
    ui           → Shared component library
    config       → ESLint/TS configs
    database     → Prisma schema + client
    utils        → Shared utilities
    types        → TypeScript type definitions
```

### 2. Audit dependency versions

Scan all package.json files and flag mismatches:
```
## Dependency Version Mismatches

| Package    | apps/web | apps/api | apps/admin | packages/ui |
|------------|----------|----------|------------|-------------|
| react      | 18.3.1   | —        | 18.2.0 ⚠️  | 18.3.1      |
| typescript | 5.4.2    | 5.3.3 ⚠️ | 5.4.2      | 5.4.2       |
| zod        | 3.22.4   | 3.21.1 ⚠️| —          | —           |

3 mismatches found across 14 packages.
```

### 3. Resolve conflicts

For each mismatch, recommend and apply fixes:
- Identify which version to standardize on (usually latest)
- Check for breaking changes between versions
- Update all package.json files
- Run the appropriate install command
- Verify build still passes

### 4. Analyze internal dependency graph

Map which packages depend on which:
```
packages/types ← packages/utils ← packages/ui ← apps/web
                                                ← apps/admin
               ← packages/database ← apps/api
```

Flag circular dependencies and suggest extraction points.

### 5. Optimize build configuration

For Turborepo/Nx, ensure:
- Build tasks declare correct `dependsOn` relationships (`"^build"` means "build my dependencies first"); in Turborepo 2.x tasks live under the `tasks` key of `turbo.json` (it was `pipeline` in 1.x)
- Caching is configured for all cacheable tasks
- Only affected packages rebuild on changes (`turbo run build test --affected`, `nx affected -t build`)
- CI pipeline uses remote caching (`turbo login` and `turbo link`, or Nx Cloud)

## Examples

### Example 1: Sync React versions

**Input:** "Our monorepo has 6 apps using different React versions. Sync them all."

**Output:**
```
Found React version mismatches:

| Package       | Current | Target |
|---------------|---------|--------|
| apps/web      | 18.3.1  | 18.3.1 ✅ |
| apps/admin    | 18.2.0  | 18.3.1 ⬆️ |
| apps/mobile   | 18.2.0  | 18.3.1 ⬆️ |
| packages/ui   | 18.3.1  | 18.3.1 ✅ |

Updated 2 package.json files. Run `pnpm install` to apply.

Breaking changes in 18.2→18.3: None (patch release).
Recommend running `pnpm turbo build` to verify all packages compile.
```

### Example 2: Add shared dependency

**Input:** "Add date-fns to packages/utils and make sure all apps use the same version"

**Output:**
```
Current date-fns usage:
- apps/web: date-fns@3.3.1
- apps/api: date-fns@2.30.0 (major version behind!)
- apps/admin: not installed

Plan:
1. Add date-fns@^4.1.0 to the pnpm catalog and to packages/utils
2. Upgrade apps/web from 3.3.1 → 4.x (no code changes expected)
3. Upgrade apps/api from 2.30.0 → 4.x (major jump — see migration notes)
4. Remove direct date-fns deps from apps, import via packages/utils

⚠️ date-fns v2→v3+ breaking changes:
- Per-function default imports (`import format from 'date-fns/format'`) are gone; use named imports from 'date-fns'
- Check the changelog for removed or renamed helpers before merging

Updated 4 package.json files. Review the v3 migration in apps/api.
```

## Guidelines

- Always map the full dependency graph before making changes
- Check for breaking changes before bumping major versions
- Prefer hoisting shared deps to the root when possible
- Use the `catalog:` protocol (versions defined once in `pnpm-workspace.yaml`, pnpm 9.5+) or `resolutions` in yarn for version pinning
- A tool like `syncpack list-mismatches` can find drifting versions automatically in large repos
- After any dependency change, verify builds across all affected packages
- Circular dependencies between packages are a code smell — suggest extraction
- For large monorepos (50+ packages), prioritize the most impactful mismatches first
- Internal packages should use `workspace:*` protocol, not pinned versions

Files in this skill

  • SKILL.md4.9 KB
  • _scores.json1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.