skills/repository-mgmt/nx/workspace-patterns/SKILL.md
Configure and optimize Nx monorepo workspaces with deterministic project-graph structure, boundary enforcement, cache-aware pipelines, and affected-command CI workflows; use when designing workspace architecture, tightening dependency rules, or reducing CI cost through Nx task orchestration.
npx skillsauth add pantheon-org/tekhne nx-workspace-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Navigation hub for Nx workspace architecture and operations.
apps/, libs/, tools/).nx lint --skip-nx-cache.targetDefaults for build/test/lint dependency flow.scope:*, type:*, platform:*) if consistent.| Missing Config | Fallback | | --- | --- | | no explicit tags | allow broad deps temporarily with warning and migration plan | | no target defaults | tasks run independently with reduced optimization | | no CI base/head | default to main branch and document tradeoff |
nx graph
nx affected -t lint,test,build --base=origin/main --parallel=3
nx show project my-app --web
nx reset
rg -n "@nx/enforce-module-boundaries|depConstraints" .
{
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"],
"cache": true
},
"test": {
"dependsOn": ["build"],
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"cache": true
}
}
}
{
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "scope:web",
"onlyDependOnLibsWithTags": ["scope:web", "scope:shared"]
},
{
"sourceTag": "type:feature",
"onlyDependOnLibsWithTags": ["type:feature", "type:ui", "type:data-access", "type:util"]
},
{
"sourceTag": "type:ui",
"onlyDependOnLibsWithTags": ["type:ui", "type:util"]
}
]
}
]
}
}
]
}
libs/ui depends on libs/data while libs/data depends on libs/ui.run-many --all in CI as the default verification pathnx affected with explicit base/head.targetDefaultsdependsOn prevents optimal scheduling and can hide ordering bugs.dependsOn for build/test/lint behavior.| Topic | Reference | | --- | --- | | Project graph and nx.json patterns | references/project-graph-configuration.md | | Caching and optimization | references/caching-strategies.md | | Boundaries and tags | references/project-boundaries.md | | Affected commands and CI | references/affected-commands.md |
tools
A skill that produces warnings but no errors.
testing
A well-formed example skill for testing the validator.
development
A skill with code blocks and imperative instructions for testing content and contamination analysis.
tools