nx-workspace

Configure, explore, and optimize Nx monorepo workspaces and affected project analysis.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/Peterson-Benhame/agent-skills --skill nx-workspace-peterson-benhame
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nx-workspace
Source: https://github.com/Peterson-Benhame/agent-skills/tree/main/packages/skills-catalog/skills/%28tooling%29/nx-workspace
Command: npx skills add https://github.com/Peterson-Benhame/agent-skills --skill nx-workspace-peterson-benhame

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing an Nx monorepo involves complex configuration, unclear project structures, and slow CI pipelines that run everything instead of only what changed. This Skill provides the commands, configuration templates, and troubleshooting guidance needed to explore workspaces, enforce module boundaries, and optimize builds. ## Core Features & Use Cases - Workspace Exploration: List and filter projects with nx show projects, and retrieve fully resolved project configuration via nx show project <name> --json instead of reading partial project.json files. - Affected Analysis & CI/CD: Run only changed projects with nx affected commands, with ready-made pipeline templates for GitHub Actions, GitLab CI, Azure Pipelines, CircleCI, and Jenkins. - Configuration & Boundaries: Apply nx.json and project.json templates, tag-based module boundary rules, and caching strategies including Nx Cloud remote caching. - Use Case: A team notices CI runs all tests on every pull request. Use this Skill to configure affected commands with the correct base SHA and full git history, cutting pipeline time to only the projects impacted by the change. ## Quick Start Ask the AI to list all projects in your Nx workspace and show which ones are affected compared to the main branch.

Frequently Asked Questions about nx-workspace

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I see which Nx projects are affected by my changes?

Run nx show projects --affected --base=main to list projects impacted by changes since the main branch. To execute tasks on them, use nx affected -t test or nx affected -t build with the same base flag.

How do I get the full configuration of an Nx project?

Use nx show project <name> --json to get the fully resolved configuration, including inferred targets. Do not read project.json directly, since it contains only partial configuration and misses defaults and plugins.

Why is nx affected not working in my CI pipeline?

Affected commands fail in CI when git history is shallow or the base branch is wrong. Set fetch-depth: 0 in actions/checkout and pass an explicit base such as --base=origin/main to fix detection.

How do I enforce module boundaries in an Nx workspace?

Tag projects with values like type:feature or scope:web, then configure the @nx/enforce-module-boundaries ESLint rule with depConstraints defining which tags may depend on each other. Violations surface as lint errors.

Does Nx caching work across CI machines?

Local caching works per machine, but remote caching requires Nx Cloud or a self-hosted runner such as an S3-backed cache. Configure it under tasksRunnerOptions in nx.json with your access token.

When should I not use this Nx workspace skill?

Do not use it for running individual tasks, which belongs to a task-running skill, or for scaffolding code with generators, which belongs to a generation-focused skill. It covers configuration, exploration, and optimization only.