# Nx Workspace

Configure, explore, and optimize Nx monorepo workspaces.

- Repository: https://github.com/tech-leads-club/agent-skills (7121 stars)
- Category: DevOps
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add tech-leads-club/agent-skills --skill nx-workspace -g -a claude-code -y`
Codex: `npx skills add tech-leads-club/agent-skills --skill nx-workspace -g -a codex -y`
Cursor: `npx skills add tech-leads-club/agent-skills --skill nx-workspace -g -a cursor -y`
Gemini CLI: `npx skills add tech-leads-club/agent-skills --skill nx-workspace -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add tech-leads-club/agent-skills`

## Description

Configure, explore, and optimize Nx monorepo workspaces. Use when setting up Nx, exploring workspace structure, configuring project boundaries, analyzing affected projects, optimizing build caching, or implementing CI/CD with affected commands. Keywords, nx, monorepo, workspace, projects, targets, affected. Do NOT use for running tasks (use nx-run-tasks) or code generation with generators (use nx-generate).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Nx Workspace Management

## Quick Start

**Exploring workspace**: `nx show projects` and `nx show project <name> --json`  
**Running tasks**: `nx <target> <project>` (e.g., `nx build my-app`)  
**Affected analysis**: `nx show projects --affected` or `nx affected -t <target>`

> **Note**: Prefix commands with `npx`/`pnpx`/`yarn` if nx isn't installed globally.

## Core Commands

### List and Explore Projects

```bash
# List all projects
nx show projects

# Filter by type, pattern, or target
nx show projects --type app
nx show projects --projects "apps/*"
nx show projects --withTarget build

# Find affected projects
nx show projects --affected --base=main
```

### Get Project Information

**Critical**: Always use `nx show project <name> --json` for full resolved configuration. Do NOT read `project.json` directly - it contains only partial configuration.

```bash
# Get full configuration
nx show project my-app --json

# Extract targets
nx show project my-app --json | jq '.targets | keys'
```

Configuration schemas:

- Workspace: `node_modules/nx/schemas/nx-schema.json`
- Project: `node_modules/nx/schemas/project-schema.json`

### Run Tasks

```bash
# Run specific project
nx build web --configuration=production

# Run affected
nx affected -t test --base=main

# View dependency graph
nx graph
```

## Workspace Architecture

```
workspace/
├── apps/              # Deployable applications
├── libs/              # Shared libraries
│   ├── shared/        # Shared across scopes
│   └── feature/       # Feature-specific
├── nx.json            # Workspace configuration
└── tools/             # Custom executors/generators
```

### Library Types

The rest: https://github.com/tech-leads-club/agent-skills/blob/HEAD/packages/skills-catalog/skills/(tooling)/nx-workspace/SKILL.md
