Nx workspace commands and guidelines

VerifiedSafe

Guidelines for using Nx workspace: running tasks, generators, and Nx MCP tools. Includes detailed workflows.

Sby Skills Guide Bot
DevelopmentIntermediate
8/15/2026
Claude CodeCursorCopilot
#nx#monorepo#code-generation#task-runner#mcp

Recommended for

Automated summary

This skill steers an agent working inside an Nx workspace: it mandates the Nx MCP server tools to explore the workspace, generate code, and diagnose failing tasks.

Strengths

  • Requires discovering the workspace with `nx_workspace` before answering, which prevents guessing at the monorepo's architecture
  • Lays out a complete, ordered generation flow (generator schema, UI, then reading the log file) instead of an improvised command
  • Gives a concrete troubleshooting path: list tasks, read the terminal output, then rerun with `nx run <taskId>` so the task stays in the Nx context
  • Consistently defers to `nx_docs` for configuration and best practices, reducing fabricated answers

Limitations

  • The file is auto-generated and pins a specific version (Nx 21.2.2 with npm), so its guidance can drift after an upgrade
  • Assumes the Nx MCP server is installed and exposed to the agent; without it most instructions cannot be followed
  • The generation flow relies on the user finishing the job in the Nx Console UI and on a log file, so it is not fully automatable end to end
  • The list of common commands is deliberately delegated to AGENTS.md and is not included here
When to use it

Reach for it whenever an agent must work in an Nx monorepo: adding a library or app, understanding the project graph, or unblocking a failing build/test/lint task.

When not to use it

Avoid it in a repository that is not an Nx workspace, or when the Nx MCP server is not available to the agent.

Security analysis

Safe
Quality score85/100

The skill provides guidelines for using Nx MCP tools and running standard Nx tasks like build, test, and lint. It does not instruct destructive commands, data exfiltration, or obfuscated actions. The 'nx run' command is a legitimate workspace task runner and is not inherently risky.

No concerns found

How this analysis is made

Examples

Generate a new library
Add a new React library called feature-billing to this workspace, placed under libs/feature-billing and tagged with scope:feature.
Debug a failing task
The build for the api project is failing — can you look at the task output and tell me what's wrong?
Understand the project graph
Explain how the projects in this workspace depend on each other and show me the graph.

name: nx description: Nx workspace commands and guidelines for running tasks, generators, and using Nx MCP tools disable-model-invocation: false

// This file is automatically generated by Nx Console

You are in an nx workspace using Nx 21.2.2 and npm as the package manager.

You have access to the Nx MCP server and the tools it provides. Use them. Follow these guidelines in order to best help the user:

General Guidelines

  • When answering questions, use the nx_workspace tool first to gain an understanding of the workspace architecture
  • For questions around nx configuration, best practices or if you're unsure, use the nx_docs tool to get relevant, up-to-date docs!! Always use this instead of assuming things about nx configuration
  • If the user needs help with an Nx configuration or project graph error, use the 'nx_workspace' tool to get any errors
  • To help answer questions about the workspace structure or simply help with demonstrating how tasks depend on each other, use the 'nx_visualize_graph' tool

Generation Guidelines

If the user wants to generate something, use the following flow:

  • learn about the nx workspace and any specifics the user needs by using the 'nx_workspace' tool and the 'nx_project_details' tool if applicable
  • get the available generators using the 'nx_generators' tool
  • decide which generator to use. If no generators seem relevant, check the 'nx_available_plugins' tool to see if the user could install a plugin to help them
  • get generator details using the 'nx_generator_schema' tool
  • you may use the 'nx_docs' tool to learn more about a specific generator or technology if you're unsure
  • decide which options to provide in order to best complete the user's request. Don't make any assumptions and keep the options minimalistic
  • open the generator UI using the 'nx_open_generate_ui' tool
  • wait for the user to finish the generator
  • read the generator log file using the 'nx_read_generator_log' tool
  • use the information provided in the log file to answer the user's question or continue with what they were doing

Running Tasks Guidelines

If the user wants help with tasks or commands (which include keywords like "test", "build", "lint", or other similar actions), use the following flow:

  • Use the 'nx_current_running_tasks_details' tool to get the list of tasks (this can include tasks that were completed, stopped or failed).
  • If there are any tasks, ask the user if they would like help with a specific task then use the 'nx_current_running_task_output' tool to get the terminal output for that task/command
  • Use the terminal output from 'nx_current_running_task_output' to see what's wrong and help the user fix their problem. Use the appropriate tools if necessary
  • If the user would like to rerun the task or command, always use nx run <taskId> to rerun in the terminal. This will ensure that the task will run in the nx context and will be run the same way it originally executed
  • If the task was marked as "continuous" do not offer to rerun the task. This task is already running and the user can see the output in the terminal. You can use 'nx_current_running_task_output' to get the output of the task to verify the output.

Commands

  • Targets are defined in project.json of each lib or app, but these can also be inferred based on each project config
  • To run a command, use nx run [project][:target].
  • For the canonical list of common commands (test / lint / typecheck / build / storybook), see the Commands section of AGENTS.md — not duplicated here.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/nx-workspace-commands-and-guidelines-mstwizc2/download' --output '.skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2/SKILL.md.part' && mv '.skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2/SKILL.md.part' '.skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2/SKILL.md' && test -s '.skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/nx' && cp -R '.skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2' '.claude/skills/nx'

Cursor
test -f '.skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2/SKILL.md' && test -s '.skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/nx' && cp -R '.skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2' '.cursor/skills/nx'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2'

openskills read 'nx-workspace-commands-and-guidelines-mstwizc2'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/nx-workspace-commands-and-guidelines-mstwizc2/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills