nx-workspace-patterns

Configure Nx monorepo workspaces with optimized caching and CI patterns.

38.6k|4.1k|Updated Jul 24, 2025
One-click install
npx skills add https://github.com/wshobson/agents --skill nx-workspace-patterns-wshobson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nx-workspace-patterns
Source: https://github.com/wshobson/agents/tree/main/plugins/developer-essentials/skills/nx-workspace-patterns
Command: npx skills add https://github.com/wshobson/agents --skill nx-workspace-patterns-wshobson

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides production-ready patterns and configurations to streamline the setup, optimization, and management of Nx monorepo workspaces.

Core Features & Use Cases

  • Nx Configuration: Optimized nx.json and project.json templates for build caching, affected commands, and task running.
  • Module Boundaries: Enforces clear project dependencies using ESLint rules for maintainability.
  • Custom Generators: Includes examples for creating custom Nx generators for consistent project scaffolding.
  • CI/CD Integration: Provides a template for CI pipelines leveraging Nx's affected commands for efficient builds.
  • Remote Caching: Demonstrates setup for both Nx Cloud and self-hosted S3 caching.

Quick Start

Use the nx-workspace-patterns skill to generate a new Nx workspace with optimized configurations for React applications and libraries.

Frequently Asked Questions about nx-workspace-patterns

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

FAQPage Schema
How do I speed up builds in an Nx monorepo using affected commands?

Speed up builds in an Nx monorepo by configuring `nx.json` with task runners and leveraging the `affected` command to only rebuild changed projects. This Skill provides optimized templates for CI pipelines to accelerate build times through targeted execution.

What's the best way to enforce module boundaries in a TypeScript monorepo?

Enforce module boundaries in a TypeScript monorepo using ESLint rules that restrict project dependencies. This Skill configures clear architectural constraints to maintain codebase scalability and prevent unauthorized cross-library imports.

How do I set up remote caching for an Nx workspace?

Set up remote caching for an Nx workspace by configuring either Nx Cloud or a self-hosted S3 bucket. This Skill demonstrates the necessary `nx.json` configurations to share build artifacts across local machines and CI runners.

Can I use Nx workspace patterns to scaffold new React applications consistently?

Yes, you can scaffold React applications consistently by using custom Nx generators. This Skill includes examples of custom generators to standardize project creation and ensure maintainable monorepo architecture across new libraries and apps.

How do I optimize CI/CD pipelines for a monorepo?

Optimize CI/CD pipelines for a monorepo by integrating Nx affected commands to skip unchanged builds and tests. This Skill provides CI templates that leverage advanced caching strategies to reduce overall pipeline execution time.