用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill monorepo-patterns命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | monorepo-patterns |
| description | Monorepo — workspace tooling, package boundaries, CI optimization. |
| Tool | Key Features | Best For |
|---|---|---|
| Turborepo | Remote caching, task pipelines, incremental builds | JS/TS monorepos, fast CI |
| Nx | Affected-build detection, generators, plugin ecosystem | Large orgs, polyglot repos |
| pnpm workspaces | Built-in workspace protocol, disk-efficient hoisting | JS/TS, lean setup |
| Yarn workspaces | Mature, broad compatibility | Teams already on Yarn |
| Lerna | Package publishing, changelog automation | Library monorepos with many npm packages |
Turborepo + pnpm workspaces is the recommended default for new JS/TS monorepos. For polyglot (JS + Go + Python), prefer Nx or Bazel.
packages/auth, packages/billing, packages/notificationspackages/shared (or packages/types)apps/web, apps/api) depend on packages, never on each otherprivate: true in package.json — they are not published to npmmonorepo/
apps/
web/ ← Next.js / React app
api/ ← Node.js / Express API
packages/
shared/ ← types, constants, utilities
ui/ ← design system, primitives
auth/ ← auth logic, shared between apps
config/ ← ESLint, TypeScript, Prettier configs
"@acme/shared": "workspace:*""react": "18.3.1") for leaf apps to ensure reproducible builds"^18.0.0") only for published library packagespackage.json to avoid duplicate installspnpm dedupe periodically to collapse duplicate transitive dependencies# Turborepo
turbo run build test --filter=...[HEAD^1]
# Nx
nx affected --target=build --base=HEAD~1
lint and typecheck in parallel with test; gate deploy on both passing| Package type | Strategy | Tool |
|---|---|---|
Published libraries (packages/*) | Independent — each has its own semver | Changesets, Lerna |
Internal apps (apps/*) | Fixed / date-based, not published | Git tags per app |
| Shared internal packages | Follow apps that consume them; no independent publish | — |
Use Changesets for automated changelog generation and version bumps on published packages.
packages/shared — never copy-pastepackages/ui; app-specific components stay in apps/webpackages/config/eslint, packages/config/tsconfig) keep shared tooling config DRYsrc/ directory — only from published/workspace packageseslint-plugin-import no-restricted-paths to block cross-app imports:// .eslintrc — prevent apps/web from importing apps/api internals
"import/no-restricted-paths": ["error", {
"zones": [{ "target": "apps/web", "from": "apps/api/src" }]
}]
@nx/enforce-module-boundaries with depConstraints to declare allowed dependency directions# Build from root
COPY pnpm-workspace.yaml ./
COPY packages/shared ./packages/shared
COPY apps/api ./apps/api
RUN pnpm install --frozen-lockfile --filter api...
dist/ and node_modules to the final imageacme/api:abc1234pnpm store layer in Docker BuildKit cache mounts to speed up dependency installs