Skip to content
Skillpedia
Deploy & cloud (DevOps)7.1k Β· #13574

nx-workspace

What it does

This skill helps set up and understand an Nx monorepo workspace. It is for developers and tech leads who manage several apps and libraries in one repository and want faster builds.

When to use it

  • βœ“When you are setting up Nx or need to understand how a monorepo is structured.
  • βœ“When you want to set project boundaries or see which projects depend on each other.
  • βœ“When you want to speed up CI with affected commands and build caching.

Skill link

https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(tooling)/nx-workspace/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/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(tooling)/nx-workspace/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

β€œCan you explain how my Nx workspace is organized and suggest how to speed up our CI builds?”

5 new skills a week. 1 minute to read.

How it works

The agent lists the projects, reads their full resolved configuration with Nx commands, and maps out the structure. It then suggests changes to boundaries, caching, and affected commands for faster pipelines.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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

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

# 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

# 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

Type Purpose Example
feature Business logic, smart components feature-auth
ui Presentational components ui-buttons
data-access API calls, state management data-access-users
util Pure functions, helpers util-formatting

Detailed Resources

Configuration: See reference/configuration.md for:

  • nx.json templates and options
  • project.json structure
  • Module boundary rules
  • Remote caching setup

Commands: See reference/commands.md for:

  • Complete command reference
  • Advanced filtering options
  • Common workflows

CI/CD: See reference/ci-cd.md for:

  • GitHub Actions configuration
  • GitLab CI setup
  • Jenkins, Azure Pipelines, CircleCI examples
  • Affected commands in pipelines

Best Practices: See reference/best-practices.md for:

  • Do's and don'ts
  • Complete troubleshooting guide
  • Performance optimization
  • Migration guides

Common Workflows

"What's in this workspace?"

nx show projects --type app  # List applications
nx show projects --type lib  # List libraries

"How do I run project X?"

nx show project X --json | jq '.targets | keys'

"What changed?"

nx show projects --affected --base=main

Quick Troubleshooting

  • Targets not showing: Use nx show project <name> --json, not project.json
  • Affected not working: Ensure git history available (fetch-depth: 0 in CI)
  • Cache issues: Run nx reset

For detailed troubleshooting, see reference/best-practices.md.

FAQ

Why not read project.json directly?

The skill says project.json only has partial settings, so the full configuration comes from Nx.

Can it show the dependency graph?

Yes. It can show the project dependency graph with an Nx command.

Does it run tasks too?

Running tasks is a separate skill, but it can run a target when you ask.

Details

Original description by the author

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

repo: tech-leads-club/agent-skills

Popularity

GitHub stars
7.1k
Ranking position
#13574
License
β€”
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills