[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-c714794b-9dd0-47a8-a67a-ef264bf71944":3,"$fW5fflq2RIZpOGWXh9q-BN0UcqBfz47ygnY50JLvDW3g":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"c714794b-9dd0-47a8-a67a-ef264bf71944","monorepo-navigator","导航、管理和优化单一代码库。涵盖Turborepo、Nx、pnpm工作空间和Lerna。跨包影响分析、受影响包的选区构建\u002F测试、远程缓存、依赖图可视化以及结构化多代码库到单一代码库迁移。在设置新单一代码库、优化大型工作空间的CI、调试跨包依赖问题或规划多代码库整合时使用。","cat_life_career","mod_other","alirezarezvani,other","---\nname: \"monorepo-navigator\"\ndescription: \"Navigate, manage, and optimize monorepos. Covers Turborepo, Nx, pnpm workspaces, and Lerna. Cross-package impact analysis, selective builds\u002Ftests 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.\"\n---\n\n# Monorepo Navigator\n\n**Tier:** POWERFUL  \n**Category:** Engineering  \n**Domain:** Monorepo Architecture \u002F Build Systems  \n\n---\n\n## Overview\n\nNavigate, manage, and optimize monorepos. Covers Turborepo, Nx, pnpm workspaces, and Lerna. Enables cross-package impact analysis, selective builds\u002Ftests 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.\n\n---\n\n## Core Capabilities\n\n- **Cross-package impact analysis** — determine which apps break when a shared package changes\n- **Selective commands** — run tests\u002Fbuilds only for affected packages (not everything)\n- **Dependency graph** — visualize package relationships as Mermaid diagrams\n- **Build optimization** — remote caching, incremental builds, parallel execution\n- **Migration** — step-by-step multi-repo → monorepo with zero history loss\n- **Publishing** — changesets for versioning, pre-release channels, npm publish workflows\n- **Claude Code config** — workspace-aware CLAUDE.md with per-package instructions\n\n---\n\n## When to Use\n\nUse when:\n- Multiple packages\u002Fapps share code (UI components, utils, types, API clients)\n- Build times are slow because everything rebuilds when anything changes\n- Migrating from multiple repos to a single repo\n- Need to publish packages to npm with coordinated versioning\n- Teams work across multiple packages and need unified tooling\n\nSkip when:\n- Single-app project with no shared packages\n- Team\u002Fproject boundaries are completely isolated (polyrepo is fine)\n- Shared code is minimal and copy-paste overhead is acceptable\n\n---\n\n## Tool Selection\n\n| Tool | Best For | Key Feature |\n|---|---|---|\n| **Turborepo** | JS\u002FTS monorepos, simple pipeline config | Best-in-class remote caching, minimal config |\n| **Nx** | Large enterprises, plugin ecosystem | Project graph, code generation, affected commands |\n| **pnpm workspaces** | Workspace protocol, disk efficiency | `workspace:*` for local package refs |\n| **Lerna** | npm publishing, versioning | Batch publishing, conventional commits |\n| **Changesets** | Modern versioning (preferred over Lerna) | Changelog generation, pre-release channels |\n\nMost modern setups: **pnpm workspaces + Turborepo + Changesets**\n\n---\n\n## Turborepo\n→ See references\u002Fmonorepo-tooling-reference.md for details\n\n## Workspace Analyzer\n\n```bash\npython3 scripts\u002Fmonorepo_analyzer.py \u002Fpath\u002Fto\u002Fmonorepo\npython3 scripts\u002Fmonorepo_analyzer.py \u002Fpath\u002Fto\u002Fmonorepo --json\n```\n\nAlso see `references\u002Fmonorepo-patterns.md` for common architecture and CI patterns.\n\n## Common Pitfalls\n\n| Pitfall | Fix |\n|---|---|\n| Running `turbo run build` without `--filter` on every PR | Always use `--filter=...[origin\u002Fmain]` in CI |\n| `workspace:*` refs cause publish failures | Use `pnpm changeset publish` — it replaces `workspace:*` with real versions automatically |\n| All packages rebuild when unrelated file changes | Tune `inputs` in turbo.json to exclude docs, config files from cache keys |\n| Shared tsconfig causes one package to break all type-checks | Use `extends` properly — each package extends root but overrides `rootDir` \u002F `outDir` |\n| git history lost during migration | Use `git filter-repo --to-subdirectory-filter` before merging — never move files manually |\n| Remote cache not working in CI | Check TURBO_TOKEN and TURBO_TEAM env vars; verify with `turbo run build --summarize` |\n| CLAUDE.md too generic — Claude modifies wrong package | Add explicit \"When working on X, only touch files in apps\u002FX\" rules per package CLAUDE.md |\n\n---\n\n## Best Practices\n\n1. **Root CLAUDE.md defines the map** — document every package, its purpose, and dependency rules\n2. **Per-package CLAUDE.md defines the rules** — what's allowed, what's forbidden, testing commands\n3. **Always scope commands with --filter** — running everything on every change defeats the purpose\n4. **Remote cache is not optional** — without it, monorepo CI is slower than multi-repo CI\n5. **Changesets over manual versioning** — never hand-edit package.json versions in a monorepo\n6. **Shared configs in root, extended in packages** — tsconfig.base.json, .eslintrc.base.js, jest.base.config.js\n7. **Impact analysis before merging shared package changes** — run affected check, communicate blast radius\n8. **Keep packages\u002Ftypes as pure TypeScript** — no runtime code, no dependencies, fast to build and type-check\n","","imported","https:\u002F\u002Fgithub.com\u002Falirezarezvani\u002Fclaude-skills","user_system_seed","SkillOPIC",true,152,1535,"2026-05-16 13:54:36",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"其他","other","mdi-page-next-outline","其他类型Skill",5,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"职场发展","career","mdi-briefcase-outline","面试准备、简历优化、职业规划",4,575,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"38a94587-3292-4b6d-a9f0-2b39c5735844","1.0.0","monorepo-navigator.zip",9275,"uploads\u002Fskills\u002Fc714794b-9dd0-47a8-a67a-ef264bf71944\u002Fmonorepo-navigator.zip","3998ff809940ea5459b2fdafb339db51dd21aab45e4c2dd830dcb39559446041","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":4948},{\"path\":\"references\u002Fmonorepo-patterns.md\",\"isDirectory\":false,\"size\":1011},{\"path\":\"references\u002Fmonorepo-tooling-reference.md\",\"isDirectory\":false,\"size\":11999},{\"path\":\"scripts\u002Fmonorepo_analyzer.py\",\"isDirectory\":false,\"size\":5561}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]