Skip to content
Skillpedia
Deploy & cloud (DevOps)41k Β· #6682

nx-workspace-patterns

What it does

This guide helps organize large software projects using a tool called Nx. It teaches how to separate code into smaller, reusable parts, optimizing build and test times.

When to use it

  • βœ“When starting a new large project.
  • βœ“When the project starts getting messy.
  • βœ“To speed up tests and builds.

Skill link

https://github.com/wshobson/agents/blob/main/plugins/developer-essentials/skills/nx-workspace-patterns/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/wshobson/agents/blob/main/plugins/developer-essentials/skills/nx-workspace-patterns/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œHow can I organize my large project so it runs faster?”

5 new skills a week. 1 minute to read.

How it works

It uses a structure where code is divided into applications (that run) and libraries (that are reused). This allows Nx to know exactly what needs to be rebuilt or tested, saving time.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Nx Workspace Patterns

Production patterns for Nx monorepo management.

When to Use This Skill

  • Setting up new Nx workspaces
  • Configuring project boundaries
  • Optimizing CI with affected commands
  • Implementing remote caching
  • Managing dependencies between projects
  • Migrating to Nx

Core Concepts

1. Nx Architecture

workspace/
β”œβ”€β”€ apps/              # Deployable applications
β”‚   β”œβ”€β”€ web/
β”‚   └── api/
β”œβ”€β”€ libs/              # Shared libraries
β”‚   β”œβ”€β”€ shared/
β”‚   β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   └── utils/
β”‚   └── feature/
β”‚       β”œβ”€β”€ auth/
β”‚       └── dashboard/
β”œβ”€β”€ tools/             # Custom executors/generators
β”œβ”€β”€ nx.json            # Nx configuration
└── workspace.json     # Project configuration

2. Library Types

Type Purpose Example
feature Smart components, business logic feature-auth
ui Presentational components ui-buttons
data-access API calls, state management data-access-users
util Pure functions, helpers util-formatting
shell App bootstrapping shell-web

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's

  • Use tags consistently - Enforce with module boundaries
  • Enable caching early - Significant CI savings
  • Keep libs focused - Single responsibility
  • Use generators - Ensure consistency
  • Document boundaries - Help new developers

Don'ts

  • Don't create circular deps - Graph should be acyclic
  • Don't skip affected - Test only what changed
  • Don't ignore boundaries - Tech debt accumulates
  • Don't over-granularize - Balance lib count
FAQ

What are 'apps' and 'libs'?

'Apps' are the parts of your project that can be run or deployed (like a website or a service). 'Libs' are pieces of code that can be used by multiple 'apps' or other 'libs' (like UI components or utility functions).

Why is organizing code important?

Organizing code in a large project prevents it from becoming a mess. It helps find things more easily, reuse code, and ensures only modified parts are tested, making development faster and more efficient.

What are 'circular dependencies'?

It's when part A of your code needs part B, and part B, in turn, needs part A. This creates a loop that confuses the system and should be avoided to maintain organization.

Details

Original description by the author

Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.

repo: wshobson/agents

Popularity

GitHub stars
41k
Ranking position
#6682
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills