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

nx-workspace-patterns

Helps your agent set up and optimize large projects using Nx. It improves building and code organization.

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.

Example of what to ask your AI

“How can I organize my large project so it runs faster?”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

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

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.
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.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add wshobson/agents --skill nx-workspace-patterns

Or download just the file:

curl -L https://raw.githubusercontent.com/wshobson/agents/main/plugins/developer-essentials/skills/nx-workspace-patterns/SKILL.md -o SKILL.md
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
#4849
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills