nx-workspace-patterns

Configure Nx monorepo workspaces with module boundaries, caching, and affected commands.

1|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/ratnesh-maurya/tracker.ratnesh-maurya.com --skill nx-workspace-patterns-ratnesh-maurya
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nx-workspace-patterns
Source: https://github.com/ratnesh-maurya/tracker.ratnesh-maurya.com/tree/main/.claude/skills/nx-workspace-patterns
Command: npx skills add https://github.com/ratnesh-maurya/tracker.ratnesh-maurya.com --skill nx-workspace-patterns-ratnesh-maurya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up and maintaining an Nx monorepo involves complex configuration decisions around project structure, dependency boundaries, build caching, and CI optimization that are easy to get wrong without proven patterns. ## Core Features & Use Cases - Workspace Configuration: Provides production-ready nx.json and project.json templates covering caching, target defaults, and generator settings. - Module Boundary Enforcement: Supplies ESLint rules with tag-based dependency constraints to keep the project graph acyclic and maintainable. - CI Optimization: Includes GitHub Actions workflows using affected commands and remote caching setups with Nx Cloud or self-hosted S3. - Use Case: When migrating a growing codebase to an Nx monorepo, use this Skill to scaffold the workspace layout, enforce library type boundaries (feature, ui, data-access, util), and configure CI to only build and test affected projects. ## Quick Start Ask the AI to set up an Nx workspace with module boundary rules and affected-based CI caching for your monorepo.

Frequently Asked Questions about nx-workspace-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up an Nx monorepo workspace?▼

Set up an Nx workspace by organizing code into apps and libs directories, then configuring nx.json with cacheable operations and target defaults. Use Nx generators to scaffold applications and libraries with consistent settings.

How to enforce module boundaries in Nx?▼

Enforce module boundaries using the @nx/enforce-module-boundaries ESLint rule with tag-based dependency constraints. Assign tags like type:feature or scope:shared to projects, then define which tags each project type may depend on.

What are Nx affected commands and how do they speed up CI?▼

Nx affected commands run tasks only on projects impacted by a code change, determined by comparing against a base branch. Running nx affected -t test or build in CI avoids rebuilding unchanged projects, significantly reducing pipeline time.

Does Nx support remote build caching?▼

Yes, Nx supports remote caching through Nx Cloud by setting the tasks runner to nx-cloud with an access token. Self-hosted options also exist, such as S3-based caching via community runners like @nx-aws-cache.

When should I not use Nx for a project?▼

Nx adds overhead that may not suit small single-application repos without shared code. It is designed for monorepos with multiple apps and libraries where dependency graphs, caching, and boundary enforcement provide real value.