nx-tools
Provides tools to query and analyze Nx monorepo structure and dependency graphs.
Install
mkdir -p .claude/skills/nx-tools && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14463" && unzip -o skill.zip -d .claude/skills/nx-tools && rm skill.zipInstalls to .claude/skills/nx-tools
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Queries Nx monorepo metadata via Python CLI: workspace projects, affected detection, dependency graphs, project.json configs, generator schemas. Use when analyzing monorepo structure, optimizing CI via affected projects, or inspecting workspace topology.Key capabilities
- →List all projects in an Nx workspace.
- →Get the workspace root path.
- →List available Nx generators.
- →View project configuration.
- →Run targets across projects.
- →Generate workspace dependency graphs.
How it works
This skill queries Nx monorepo metadata using a unified Python CLI, wrapping `pnpm exec nx` commands to list projects, view configurations, run targets, and generate dependency graphs.
Inputs & outputs
When to use nx-tools
- →Analyze monorepo structure
- →Detect affected projects
- →Generate dependency graphs
About this skill
[H1][NX-TOOLS]
<br>Dictum: Uniform interfaces eliminate invocation ambiguity.
Query Nx workspace with unified Python CLI. Wraps pnpm exec nx commands.
[IMPORTANT] Nx 22 features: Terminal UI, continuous tasks, pnpm catalog support, AI agent configuration, Vitest 4 atomizer. All commands run with NX_DAEMON=false for deterministic output.
[1][COMMANDS]
| [CMD] | [ARGS] | [PURPOSE] |
|---|---|---|
| workspace | -- | List all projects |
| path | -- | Get workspace root path |
| generators | -- | List available generators |
| project | <name> | View project configuration |
| run | <target> | Run target across projects |
| schema | <generator> | View generator schema |
| affected | [base] | List affected projects (default: main) |
| graph | [output] | Generate dependency graph |
| tokens | [path] | Count tokens in file/directory |
| docs | [topic] | View Nx command documentation |
[2][USAGE]
# Zero-arg commands
uv run .claude/skills/nx-tools/scripts/nx.py workspace
uv run .claude/skills/nx-tools/scripts/nx.py path
uv run .claude/skills/nx-tools/scripts/nx.py generators
# Required-arg commands
uv run .claude/skills/nx-tools/scripts/nx.py project @parametric-portal/types
uv run .claude/skills/nx-tools/scripts/nx.py run build
uv run .claude/skills/nx-tools/scripts/nx.py run typecheck
uv run .claude/skills/nx-tools/scripts/nx.py schema @nx/react:component
# Optional-arg commands (defaults shown)
uv run .claude/skills/nx-tools/scripts/nx.py affected # base=main
uv run .claude/skills/nx-tools/scripts/nx.py affected HEAD~5
uv run .claude/skills/nx-tools/scripts/nx.py graph # output=.nx/graph.json
uv run .claude/skills/nx-tools/scripts/nx.py graph custom.json
uv run .claude/skills/nx-tools/scripts/nx.py tokens # path=.
uv run .claude/skills/nx-tools/scripts/nx.py tokens CLAUDE.md
uv run .claude/skills/nx-tools/scripts/nx.py docs # topic=general
uv run .claude/skills/nx-tools/scripts/nx.py docs affected
[3][ARGUMENTS]
workspace: (no arguments)
- Returns list of all project names in workspace
path: (no arguments)
- Returns workspace root path from
CLAUDE_PROJECT_DIRorcwd
generators: (no arguments)
- Returns list of available Nx generators (plugins + local)
project: <name>
name— Project name (required, e.g.,@parametric-portal/types)- Returns full project.json configuration as JSON
run: <target>
target— Target to run (required, e.g.,build,typecheck,test)- Executes
pnpm exec nx run-many -t <target>
schema: <generator>
generator— Generator name (required, e.g.,@nx/react:component)- Returns generator help with all available options
affected: [base]
base— Git ref to compare against (default:main)- Returns JSON array of affected project names
graph: [output]
output— Output file path (default:.nx/graph.json)- Generates workspace dependency graph
tokens: [path]
path— File or directory to count (default:.)- Uses
tools/scripts/count-tokens.tsvia tsx
docs: [topic]
topic— Nx command to get help for (default: general help)
[4][OUTPUT]
Commands return: {"status": "success|error", ...}.
| [INDEX] | [CMD] | [RESPONSE] |
|---|---|---|
| [1] | workspace | {projects: string[]} |
| [2] | path | {path: string} |
| [3] | generators | {generators: string} |
| [4] | project | {name: string, project: object} |
| [5] | run | {target: string, output: string} |
| [6] | schema | {generator: string, schema: string} |
| [7] | affected | {base: string, affected: string[]} |
| [8] | graph | {file: string} |
| [9] | tokens | {path: string, output: string} |
| [10] | docs | {topic: string, docs: string} |
[5][ENVIRONMENT]
| [VAR] | [REQUIRED] | [DESCRIPTION] |
|---|---|---|
CLAUDE_PROJECT_DIR | No | Override workspace root for path cmd |
NX_DAEMON | No | Force-set to false by script |
[6][ERROR_HANDLING]
- Nx errors print
[ERROR] <message>and exit 1 - Project not found:
[ERROR] Cannot find project '<name>' - Target not found:
[ERROR] Cannot find target '<target>'for the project - Graph generation failure: verify Nx workspace configuration is valid
When not to use it
- →When the user needs to run commands without `NX_DAEMON=false` for non-deterministic output.
- →When the user needs to modify the Nx workspace configuration directly.
- →When the user needs to use Nx 22 features not supported by the Python CLI.
Limitations
- →All commands run with `NX_DAEMON=false` for deterministic output.
- →Project not found or target not found errors are explicitly handled.
- →Graph generation failure requires a valid Nx workspace configuration.
How it compares
This skill provides a standardized Python CLI interface for interacting with Nx monorepos, offering a consistent way to query workspace metadata and execute commands, unlike directly using `pnpm exec nx` with varying syntax.
Compared to similar skills
nx-tools side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| nx-tools (this skill) | 0 | 5mo | Review | Intermediate |
| applescript | 28 | 8mo | Review | Advanced |
| bazel-build-optimization | 14 | 2mo | No flags | Advanced |
| home-assistant-manager | 9 | 8mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
applescript
martinholovsky
Expert in AppleScript and JavaScript for Automation (JXA) for macOS system scripting. Specializes in secure script execution, application automation, and system integration. HIGH-RISK skill due to shell command execution and system-wide control capabilities.
bazel-build-optimization
wshobson
Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases.
home-assistant-manager
komal-SkyNET
Expert-level Home Assistant configuration management with efficient deployment workflows (git and rapid scp iteration), remote CLI access via SSH and hass-cli, automation verification protocols, log analysis, reload vs restart optimization, and comprehensive Lovelace dashboard management for tablet-optimized UIs. Includes template patterns, card types, debugging strategies, and real-world examples.
swarm-advanced
ruvnet
Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows
windows-expert
jackspace
Expert guidance for Windows, PowerShell, WSL interop, and cross-platform development
bash-linux
davila7
Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.