nx-workspace
Explore and understand Nx workspaces. USE WHEN answering questions about the workspace, projects, or tasks. ALSO USE WHEN an nx command fails or you need to check available targets/configuration before running a task. EXAMPLES: 'What projects are in this workspace?', 'How is project X configured?', 'What depends on library Y?', 'What targets can I run?', 'Cannot find configuration for task', 'debug nx task failure'.
Security Assessment
About nx-workspace
The nx-workspace skill is designed to provide comprehensive, read-only exploration of Nx workspaces. It allows users to inspect the structure of their workspace, including projects, configurations, available targets, and dependencies, without modifying any files. This skill addresses the common challenge of navigating complex monorepos managed by Nx, where understanding project relationships, target definitions, and workspace configuration is essential for effective development and task execution.
The skill offers several key capabilities. Users can list all projects within a workspace, apply filters based on project names, glob patterns, tags, or target availability, and output results in JSON for programmatic analysis. It also enables inspection of individual project configurations, including full resolved configurations, targets, executors, options, and inputs/outputs for caching purposes. Workspace-level configuration can be examined through the nx.json file, allowing insights into default target configurations, reusable inputs, plugins, and generators. Additionally, this skill provides guidance on using the appropriate command prefixes and package managers when Nx is not installed globally.
Target users include developers and DevOps engineers working with Nx monorepos who need to understand project structures, debug failing tasks, or verify configurations before running commands. It is particularly useful for teams maintaining large-scale applications or libraries, where knowing the dependencies, available targets, and project metadata is crucial for efficient workflow management and troubleshooting.
FAQ
How can I list all projects in an Nx workspace?
You can use the command `nx show projects` to list all projects. You may also apply filters with `--projects` or `-p` to narrow results by patterns, tags, directories, or specific targets.
Can I see the full configuration of a project?
Yes, using `nx show project <project-name> --json` returns the full resolved configuration, including inferred targets. Avoid reading `project.json` directly as it contains only partial information.
How do I check which targets are available for a project?
Targets can be listed by inspecting the JSON output of a project configuration. For example, `nx show project <project-name> --json | jq '.targets | keys'` lists all targets.
Do I need Nx installed globally to use these commands?
Not necessarily. Commands may need to be prefixed with `npx`, `pnpx`, or `yarn` depending on your environment. Check the lockfile to determine the package manager in use.
Where can I find workspace-level configuration?
Workspace-level settings are stored in `nx.json`. You can read it directly or use tools like `jq` to inspect sections such as `targetDefaults`, `namedInputs`, `plugins`, and `generators`.
Install nx-workspace
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
nrwl/nx-ai-agents-config