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
Ready-to-paste message
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-patternsOr download just the file:
curl -L https://raw.githubusercontent.com/wshobson/agents/main/plugins/developer-essentials/skills/nx-workspace-patterns/SKILL.md -o SKILL.mdTechnical 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
Comments
- …
More skills from this repository
screen-reader-testing
Has your agent test websites using screen readers to ensure they are accessible.
wshobson/agents
wcag-audit-patterns
Helps your agent audit websites for accessibility and fix issues according to WCAG guidelines.
wshobson/agents
multi-reviewer-patterns
Enables your agent to coordinate parallel code reviews, deduplicating findings and consolidating reports.
wshobson/agents
parallel-debugging
Allows the agent to debug complex issues with parallel investigations and root cause analysis.
wshobson/agents
Similar skills
bun-runtime
Has your agent use Bun to run, organize, and test code. It helps choose Bun over other tools and migrate existing projects.
affaan-m/ECC
database-migrations
Helps your agent make safe changes to databases. It ensures changes can be undone and minimizes downtime.
affaan-m/ECC
deployment-patterns
Sets up deployment and CI/CD workflows, containerization, and rollback strategies to ensure safe releases.
affaan-m/ECC