nx
Skill275 starsChanged 53 days agoApache-2.0View on GitHub
Best practices for Nx monorepo development, project configuration, and code generation
In this repository264 other files it gives its agents.
- accessibility-a11ySkill
- alpine-jsSkill
- analytics-data-analysisSkill
- android-developmentSkill
- angular-developmentSkill
- angularSkill
- anime-jsSkill
- anthropic-claude-developmentSkill
- api-developmentSkill
- apollo-graphqlSkill
- aspnet-coreSkill
- astroSkill
- auth0-authenticationSkill
- autogen-developmentSkill
- automl-hyperparameter-optimizationSkill
- aws-developmentSkill
- azureSkill
- backend-developmentSkill
- bash-scriptingSkill
- beautifulsoup-parsingSkill
- bitbucket-workflowSkill
- blazorSkill
- blender-python-addonSkill
- blockchainSkill
- bootstrapSkill
- business-central-developmentSkill
- cheerio-parsingSkill
- chrome-extension-developmentSkill
- ci-cd-best-practicesSkill
- clean-architectureSkill
- clean-codeSkill
- clerk-authenticationSkill
- cloudflare-developmentSkill
- computer-vision-opencvSkill
- convexSkill
- cppSkill
- c-sharpSkill
- cssSkill
- cypressSkill
- data-analysis-jupyterSkill
- data-analystSkill
- data-jupyter-pythonSkill
- deep-learning-pythonSkill
- deep-learning-pytorchSkill
- deep-learningSkill
- deno-typescriptSkill
- design-systemsSkill
- devopsSkill
- django-pythonSkill
- django-rest-api-developmentSkill
- dockerSkill
- dotnetSkill
- drizzle-ormSkill
- drupal-developmentSkill
- elasticsearch-best-practicesSkill
- electron-developmentSkill
- elixirSkill
- embedded-stm32Skill
- esbuild-bundlerSkill
- ethereumSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 13 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Use consistent naming patterns: scope-type-name (e.g., shared-ui-button)
- Very specific: line 40
Use project.json for project-specific configuration
- Distinctive: line 62
Use tags for enforcing dependency constraints
- Distinctive: line 66
Use Nx generators for consistent code scaffolding:
- Distinctive: line 70
Create custom generators for project-specific patterns
- Very specific: line 71
Use --dry-run to preview changes before execution
- Distinctive: line 93
Use scopes to separate domain boundaries
- Distinctive: line 99
Use affected commands to only run tasks for changed projects:
- Distinctive: line 107
Run tasks with Nx CLI:
- Distinctive: line 111
Use task pipelines for proper dependency ordering
- Distinctive: line 116
Use Jest for unit testing with Nx presets
- Very specific: line 119
Use nx affected:test in CI for efficient test runs
- Distinctive: line 123
Use Nx Cloud for distributed task execution
- Very specific: line 130
Use nx-cloud record for capturing metrics
- Distinctive: line 134
Keep applications thin; move logic to libraries
- Distinctive: line 135
Create shared utility libraries for common code
- Very specific: line 136
Use barrel exports (index.ts) for clean imports
- Distinctive: line 138
Document library purposes and public APIs
- Distinctive: line 139
Use Nx Console VS Code extension for visual project management
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Nx Monorepo Development
You are an expert in Nx, the smart, fast, and extensible build system for monorepos.
Project Structure
- Organize projects following Nx conventions:
apps/- Application projects (web apps, APIs, mobile apps)libs/- Library projects (shared code, features, utilities)
- Use consistent naming patterns:
scope-type-name(e.g.,shared-ui-button) - Group related libraries under feature folders
Workspace Configuration
Configure nx.json for workspace-wide settings:
{
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"cache": true
},
"test": {
"cache": true
}
},
"defaultBase": "main"
}- Use
project.jsonfor project-specific configuration - Define proper
tagsfor enforcing module boundaries
Project Configuration
Each project should have a project.json:
{
"name": "my-app",
"sourceRoot": "apps/my-app/src",
"projectType": "application",
"tags": ["scope:web", "type:app"],
"targets": {
"build": { },
"serve": { },
"test": { }
}
}- Define clear project types:
applicationorlibrary - Use tags for enforcing dependency constraints
Code Generation
- Use Nx generators for consistent code scaffolding:
nx g @nx/react:app my-app- Generate React applicationnx g @nx/react:lib my-lib- Generate React librarynx g @nx/react:component my-component --project=my-lib- Generate component
- Create custom generators for project-specific patterns
- Use
--dry-runto preview changes before execution
Module Boundaries
Enforce boundaries using ESLint rules:
{
"@nx/enforce-module-boundaries": [
"error",
{
"depConstraints": [
{ "sourceTag": "type:app", "onlyDependOnLibsWithTags": ["type:lib", "type:util"] },
{ "sourceTag": "type:lib", "onlyDependOnLibsWithTags": ["type:lib", "type:util"] },
{ "sourceTag": "scope:web", "onlyDependOnLibsWithTags": ["scope:web", "scope:shared"] }
]
}
]
}- Define clear dependency rules between project types
- Use scopes to separate domain boundaries
Caching and Performance
- Enable computation caching for faster builds
- Configure Nx Cloud for distributed caching and task execution
- Use affected commands to only run tasks for changed projects:
nx affected:buildnx affected:testnx affected:lint
- Define proper
inputsandoutputsfor accurate caching
Task Execution
- Run tasks with Nx CLI:
nx build my-app- Build specific projectnx run-many -t build- Build all projectsnx affected -t test- Test affected projects
- Use task pipelines for proper dependency ordering
- Configure parallel execution for independent tasks
Testing Strategy
- Use Jest for unit testing with Nx presets
- Configure Cypress or Playwright for E2E testing
- Implement component testing for UI libraries
- Use
nx affected:testin CI for efficient test runs
CI/CD Integration
- Use Nx Cloud for distributed task execution
- Configure GitHub Actions with Nx:
- uses: nrwl/nx-set-shas@v4 - run: nx affected -t lint test build - Implement proper caching strategies
- Use
nx-cloud recordfor capturing metrics
Best Practices
- Keep applications thin; move logic to libraries
- Create shared utility libraries for common code
- Use barrel exports (
index.ts) for clean imports - Implement proper type exports from libraries
- Document library purposes and public APIs
- Use Nx Console VS Code extension for visual project management
- Leverage the project graph for understanding dependencies:
nx graph
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

