Nx: tasks, generators, and MCP

VerifiedSafe

Guide for using an Nx 22.5.3 npm monorepo: prefer the Nx MCP server, inspect the graph, run tasks, and scaffold with generators.

Sby Skills Guide Bot
DevelopmentIntermediate
4010/18/2026
Claude CodeCursor
#nx#monorepo#mcp#generators#task-runner

Recommended for

Our review

Guides work in an Nx 22 monorepo through the Nx MCP server to inspect the project graph, run tasks, and scaffold code.

Strengths

  • Prefers the Nx MCP server over guessing about workspace structure
  • Covers graph inspection, per-project target details, and up-to-date Nx documentation lookups
  • Describes an end-to-end generator flow: list generators, read the schema, then check the generator log
  • Lets you inspect tasks already running in the user's terminals and rerun them in the same Nx context

Limitations

  • Assumes the Nx MCP server is installed and connected to the client
  • Does not list common commands or the package-to-lib mapping, deferring to AGENTS.md instead
  • Pinned to Nx 22.5.3 with npm, so other package managers or versions may not match
When to use it

Use it for any Nx workspace question or action: architecture, targets, generators, or running tasks.

When not to use it

Skip it for repositories that do not use Nx, or when the Nx MCP server is unavailable in the environment.

Security analysis

Safe
Quality score88/100

The skill only documents how to use Nx workspace tooling and MCP tools. It does not instruct destructive commands, exfiltration, obfuscation, or disabling safety controls. Running Nx tasks and generators is a normal, legitimate development workflow.

No concerns found

Examples

Inspect workspace architecture
Use the Nx MCP server to map out our workspace: which projects exist, how they depend on each other, and whether the project graph reports any config errors.
Scaffold a new library
I need a new shared UI library in this Nx workspace. List the available generators, show me the schema for the right one, then walk me through generating it with minimal options.
Debug a running task
A test task is already running in one of my terminals. Pull its details and output through the Nx MCP tools so we can figure out why it is failing.

name: nx description: Nx workspace commands and guidelines for running tasks, generators, and using Nx MCP tools

Nx

This is an Nx 22.5.3 monorepo using npm. Prefer the Nx MCP server over guessing about the workspace — it reflects the live project graph and config.

Use the MCP server first

  • nx_workspace — understand the project graph / architecture, and surface project-graph or config errors, before answering workspace questions.
  • nx_project_details — inspect a single project's targets and config.
  • nx_docs — fetch up-to-date Nx docs for any configuration/best-practice question instead of assuming.
  • nx_visualize_graph — show task/project dependencies.
  • nx_current_running_tasks_details / nx_current_running_task_output — inspect tasks already running in the user's terminals; rerun with nx run <taskId> so it executes in the same Nx context. Don't offer to rerun a continuous task.

Generators

When scaffolding, drive it through the MCP flow rather than hand-writing files: nx_generators to list, nx_generator_schema for options, then nx_open_generate_ui and read back nx_read_generator_log. Keep options minimal; use nx_available_plugins if no generator fits.

Commands

  • Run anything with nx run <project>[:target]; targets live in each project's project.json (or are inferred from config).
  • The canonical common commands (test / lint / typecheck / build / storybook) and the package↔lib mapping live in the Commands and Libraries sections of AGENTS.md — not duplicated here.
Related skills