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.mdCopy 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
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
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
Comments
- β¦
More skills from this repository
screen-reader-testing
41kHas your agent test websites using screen readers to ensure they are accessible.
wcag-audit-patterns
41kHelps your agent audit websites for accessibility and fix issues according to WCAG guidelines.
multi-reviewer-patterns
41kEnables your agent to coordinate parallel code reviews, deduplicating findings and consolidating reports.
parallel-debugging
41kAllows the agent to debug complex issues with parallel investigations and root cause analysis.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.