monorepo-navigator — Claude Code skill: what it does, how to install
Analyzes package dependencies and runs builds only for affected workspaces in monorepos. Useful when configuring Turborepo, Nx, or pnpm workspaces.
/plugin marketplace add alirezarezvani/claude-skills
/plugin install engineering-advanced-skills@claude-code-skillsWhat monorepo-navigator does
The skill configures monorepo workflows around Turborepo, Nx, pnpm workspaces, and Lerna. It includes a Python script, scripts/monorepo_analyzer.py. The script scans workspaces and renders dependency graphs in Mermaid format. Claude Code learns to trace blast radiuses when shared code changes, running tests strictly on affected targets.
For CI pipelines, it supplies filtering patterns with --filter flags and remote cache instructions. It also introduces package-level CLAUDE.md configurations. This prevents the agent from modifying neighboring packages unprompted. For workspace consolidation, it prescribes migrations via git filter-repo to preserve git history.
Skip this skill if you work in an isolated single-app repository. For multi-package codebases sharing UI libraries or utilities, it keeps workspaces organized.
What it helps with
- determine which apps break when a shared library changes
- run CI builds and tests strictly on affected packages
- render monorepo package relationships as Mermaid diagrams
- migrate multiple git repositories into a monorepo without losing commit history
Example prompts for the agent
- Run monorepo_analyzer.py to inspect the workspace dependency graph
- Check what packages are affected if I modify packages/types
- Configure turbo.json inputs and cache settings to speed up PR builds
How to install monorepo-navigator
1Plugin marketplace
/plugin marketplace add alirezarezvani/claude-skills/plugin install engineering-advanced-skills@claude-code-skillsThis installs the whole engineering-advanced-skills plugin with all its skills
2Skills CLI (Vercel)
npx skills add alirezarezvani/claude-skills --skill monorepo-navigator -a claude-code3Manually: put the files in place
~/.claude/skills/monorepo-navigator/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/monorepo-navigator/
Manually: put the files in place
.agents/skills/monorepo-navigator/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/monorepo-navigator/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install alirezarezvani/claude-skills monorepo-navigator2Manually: put the files in place
.github/skills/monorepo-navigator/SKILL.mdPlatform CLI
gemini skills install https://github.com/alirezarezvani/claude-skills --path engineering/skills/monorepo-navigatorManually: put the files in place
.devin/skills/monorepo-navigator/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set349
The whole set →Similar
Questions about monorepo-navigator
How do I install monorepo-navigator in Claude Code?
Run /plugin marketplace add alirezarezvani/claude-skills or install via CLI using npx skills add alirezarezvani/claude-skills --skill monorepo-navigator -a claude-code.
What does monorepo-navigator do?
It provides workspace-aware rules and analysis scripts, helping Claude inspect package graphs and test only affected targets.
Which monorepo build tools are supported?
It supports Turborepo, Nx, pnpm workspaces, Lerna, and Changesets for automated versioning.
Source text
SKILL.md · MIT
--- name: "monorepo-navigator" description: "Navigate, manage, and optimize monorepos. Covers Turborepo, Nx, pnpm workspaces, and Lerna. Cross-package impact analysis, selective builds/tests on affected packages, remote caching, dependency graph visualization, and structured multi-repo to monorepo migrations. Use when setting up a new monorepo, optimizing CI for a large workspace, debugging cross-package dependency issues, or planning a multi-repo consolidation." --- # Monorepo Navigator **Tier:** POWERFUL **Category:** Engineering **Domain:** Monorepo Architecture / Build Systems --- ## Overview Navigate, manage, and optimize monorepos. Covers Turborepo, Nx, pnpm workspaces, and Lerna. Enables cross-package impact analysis, selective builds/tests on affected packages only, remote caching, dependency graph visualization, and structured migrations from multi-repo to monorepo. Includes Claude Code configuration for workspace-aware development. --- ## Core Capabilities - **Cross-package impact analysis** — determine which apps break when a shared package changes - **Selective commands** — run tests/builds only for affected packages (not everything) - **Dependency graph** — visualize package relationships as Mermaid diagrams - **Build optimization** — remote caching, incremental builds, parallel execution - **Migration** — step-by-step multi-repo → monorepo with zero history loss - **Publishing** — changesets for versioning, pre-release channels, npm publish workflows - **Claude Code config** — workspace-aware CLAUDE.md with per-package instructions --- ## When to Use Use when: - Multiple packages/apps share code (UI components, utils, types, API clients) - Build times are slow because everything rebuilds when anything changes - Migrating from multiple repos to a single repo - Need to publish packages to npm with coordinated versioning - Teams work across multiple packages and need unified tooling Skip when: - Single-app project with no shared packages - Team/project boundaries are completely isolated (polyrepo is fine) - Shared code is minimal and copy-paste overhead is acceptable --- ## Tool Selection | Tool | Best For | Key Feature | |---|---|---| | **Turborepo** | JS/TS monorepos, simple pipeline config | Best-in-class remote caching, minimal config | | **Nx** | Large enterprises, plugin ecosystem | Project graph, code generation, affected commands | | **pnpm workspaces** | Workspace protocol, disk efficiency | `workspace:*` for local package refs | | **Lerna** | npm publishing, versioning | Batch publishing, conventional commits | | **Changesets** | Modern versioning (preferred over Lerna) | Changelog generation, pre-release channels | Most modern setups: **pnpm workspaces + Turborepo + Changesets** --- ## Turborepo → See references/monorepo-tooling-reference.md for details ## Workspace Analyzer ```bash python3 scripts/monorepo_analyzer.py /path/to/monorepo python3 scripts/monorepo_analyzer.py /path/to/monorepo --json ``` Also see `references/monorepo-patterns.md` for common architecture and CI patterns. ## Common Pitfalls | Pitfall | Fix | |---|---| | Running `turbo run build` without `--filter` on every PR | Always use `--filter=...[origin/main]` in CI | | `workspace:*` refs cause publish failures | Use `pnpm changeset publish` — it replaces `workspace:*` with real versions automatically | | All packages rebuild when unrelated file changes | Tune `inputs` in turbo.json to exclude docs, config files from cache keys | | Shared tsconfig causes one package to break all type-checks | Use `extends` properly — each package extends root but overrides `rootDir` / `outDir` | | git history lost during migration | Use `git filter-repo --to-subdirectory-filter` before merging — never move files manually | | Remote cache not working in CI | Check TURBO_TOKEN and TURBO_TEAM env vars; verify with `turbo run build --summarize` | | CLAUDE.md too generic — Claude modifies wrong package | Add explicit "When working on X, only touch files in apps/X" rules per package CLAUDE.md | --- ## Best Practices 1. **Root CLAUDE.md defines the map** — document every package, its purpose, and dependency rules 2. **Per-package CLAUDE.md defines the rules** — what's allowed, what's forbidden, testing commands 3. **Always scope commands with --filter** — running everything on every change defeats the purpose 4. **Remote cache is not optional** — without it, monorepo CI is slower than multi-repo CI 5. **Changesets over manual versioning** — never hand-edit package.json versions in a monorepo 6. **Shared configs in root, extended in packages** — tsconfig.base.json, .eslintrc.base.js, jest.base.config.js 7. **Impact analysis before merging shared package changes** — run affected check, communicate blast radius 8. **Keep packages/types as pure TypeScript** — no runtime code, no dependencies, fast to build and type-check
© Alireza Rezvani · MIT · alirezarezvani/claude-skills