Monorepo Project Standard
БесплатноБез исполняемых скриптовНе проверенUse when creating, reviewing, or restructuring frontend monorepos with pnpm workspace, Turborepo, Nx, multi-package dependency boundaries, task orchestration…
от bovinphang1 157 установок в других каталогахОб этом скилле
Monorepo Project Specifications
For multi-package front-end repositories using pnpm workspace, Turborepo or Nx.
Purpose
Standardize the directory structure, dependency management, task orchestration and package release process of the Monorepo project to ensure the build efficiency and version consistency of multi-package collaboration.
Procedure
- First confirm whether the repository has used pnpm workspace, Turborepo or Nx, and continue to use the existing package naming and task conventions.
- Place applications in
apps/and shared libraries, configuration and tools inpackages/or existing equivalent directories. - Internal dependencies use
workspace:*to drive the build sequence through the dependency graph. - Configure cacheable, parallelizable, and incremental root tasks for build, lint, and test, and specify input, output, and environment variables.
- Configure the affected/changed range command in Turborepo/Nx. CI will run the affected packages first while retaining the backbone full verification entry.
- Check package boundaries, circular dependencies, exports, peer dependencies and version policies before publishing the package.
Tool selection
| Tools | Applicability | Features |
|---|---|---|
| pnpm workspace | Basics | Dependency promotion, linking, script aggregation |
| Turborepo | Recommended | Caching, parallelism, dependency graph |
| Nx | Large | Incremental build, cloud cache, plug-in ecology |
Directory structure
pnpm + Turborepo
├── package.json # Root package, workspace configuration
├── pnpm-workspace.yaml # workspace package list
├── turbo.json # Turborepo configuration
│
├── apps/
│ ├── web/ # Main application
│ │ ├── package.json
│ │ └── ...
│ ├── admin/ # Management background
│ └── docs/ # Documentation site
│
├── packages/
│ ├── ui/ # Shared UI components
│ │ ├── package.json
│ │ └── src/
│ ├── utils/ # Utility function
│ ├── config-eslint/ # Shared ESLint configuration
│ └── config-typescript/ # Shared TS configuration
│
└── tooling/ # Build/test tools (optional)
└── scripts/
pnpm-workspace.yaml
packages:
- "apps/*"
- "packages/*"
Dependency management
- Internal packages use the
workspace:*protocol - The root
package.jsonunifies some dependency versions and can be overridden by sub-packages - Disable circular dependencies, check via
pnpm why
{
"dependencies": {
"@repo/ui": "workspace:*",
"@repo/utils": "workspace:*"
}
}
Turborepo task orchestration
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
},
"lint": {
"dependsOn": ["^build"]
},
"test": {
"dependsOn": ["^build"]
}
}
}
^buildmeans executing the build of dependent packages firstoutputsis used for cache hit judgmentinputsshould include source code, configuration, lock files and environment-related files; do not write the.envsecret value into the cache key- Remote caching should distinguish between trusted CI and local development to avoid uploading products containing sensitive information.
Nx task orchestration
{
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/dist"],
"cache": true
}
}
}
Package naming
- Internal package:
@org/package-nameor@repo/package-name - Publish to npm: follow the
@scope/namespecification
Constraints
- Sub-packages are referenced through
workspace:*and are not published to npm and then installed. - Shared configurations (ESLint, TS) are placed in
packages/config-*, and sub-packages extend - The build order is determined by the dependency graph, without manually specifying irrelevant dependencies
- When executing
pnpm -r buildorturbo run buildin the root directory, all packages will be built in order - Disable circular dependencies, use
pnpm whyto check the dependency chain when adding a new package - CI cache only caches dependent installation directories and task products, and does not cache unverified build status
- Affected builds cannot replace full verification before release; the trunk or release branch still requires complete quality control
Expected Output
- Monorepo directory structure is clear (
apps/applications,packages/shared packages,tooling/tools) pnpm-workspace.yamlandturbo.json/nx.jsonare configured correctly- Internal packages use
workspace:*protocol, no circular dependencies - Build, lint, and test tasks can be executed with one click through the root command, and the cache hit rate is high
- CI can distinguish between affected quick feedback and release full verification, and the cache configuration will not leak keys or hide dependency boundary issues
Установить Monorepo Project Standard в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Monorepo Project Standard?
Use when creating, reviewing, or restructuring frontend monorepos with pnpm workspace, Turborepo, Nx, multi-package dependency boundaries, task orchestration, package naming, or package publishing; Chinese triggers include monorepo, workspace, multi-package.
Как установить скилл Monorepo Project Standard?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Monorepo Project Standard запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic