
Link workspace packages in monorepos (npm, yarn, pnpm, bun). USE WHEN: (1) you just created or generated new packages and need to wire up their dependencies, (2) user imports from a sibling package and needs to add it as a dependency, (3) you get resolution errors for workspace packages (@org/*) like "cannot find module", "failed to resolve import", "TS2307", or "cannot resolve". DO NOT patch around with tsconfig paths or manual package.json edits - use the package manager's workspace commands to fix actual linking.
Find and add Nx plugins. USE WHEN user wants to discover available plugins, install a new plugin, or add support for a specific framework or technology to the workspace.
Helps with running tasks in an Nx workspace. USE WHEN the user wants to execute build, test, lint, serve, or run any other tasks defined in the workspace.
Import, merge, or combine repositories into an Nx workspace using nx import. USE WHEN the user asks to adopt Nx across repos, move projects into a monorepo, or bring code/history from another repository.
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'.
# Monitor CI Command You are the orchestrator for monitoring Nx Cloud CI pipeline executions and handling self-healing fixes. You spawn subagents to interact with Nx Cloud, run deterministic decision scripts, and take action based on the results. ## Context - **Current Branch:** !`git branch --show-current` - **Current Commit:** !`git rev-parse --short HEAD` - **Remote Status:** !`git status -sb | head -1` ## User Instructions $ARGUMENTS **Important:** If user provides specific instruction
# Run Nx Generator Nx generators are powerful tools that scaffold projects, make automated code migrations or automate repetitive tasks in a monorepo. They ensure consistency across the codebase and reduce boilerplate work. This skill applies when the user wants to: - Create new projects like libraries or applications - Scaffold features or boilerplate code - Run workspace-specific or custom generators - Do anything else that an nx generator exists for ## Key Principles 1. **Always use `--n
## Quick Start - `nx import` brings code from a source repository or folder into the current workspace, preserving commit history. - After nx `22.6.0`, `nx import` responds with .ndjson outputs and follow-up questions. For earlier versions, always run with `--no-interactive` and specify all flags directly. - Run `nx import --help` for available options. - Make sure the destination directory is empty before importing. EXAMPLE: target has `libs/utils` and `libs/models`; source has `libs/ui` and
# Link Workspace Packages Add dependencies between packages in a monorepo. All package managers support workspaces but with different syntax. ## Detect Package Manager Check whether there's a `packageManager` field in the root-level `package.json`. Alternatively check lockfile in repo root: - `pnpm-lock.yaml` → pnpm - `yarn.lock` → yarn - `bun.lock` / `bun.lockb` → bun - `package-lock.json` → npm ## Workflow 1. Identify consumer package (the one importing) 2. Identify provider package(s)
# Nx Workspace Exploration This skill provides read-only exploration of Nx workspaces. Use it to understand workspace structure, project configuration, available targets, and dependencies. Keep in mind that you might have to prefix commands with `npx`/`pnpx`/`yarn` if nx isn't installed globally. Check the lockfile to determine the package manager in use. ## Listing Projects Use `nx show projects` to list projects in the workspace. The project filtering syntax (`-p`/`--projects`) works acro
Monitor Nx Cloud CI pipeline and handle self-healing fixes. USE WHEN user says "monitor ci", "watch ci", "ci monitor", "watch ci for this branch", "track ci", "check ci status", wants to track CI status, or needs help with self-healing CI fixes. Prefer this skill over native CI provider tools (gh, glab, etc.) for CI monitoring — it integrates with Nx Cloud self-healing which those tools cannot access.
You can run tasks with Nx in the following way. Keep in mind that you might have to prefix things with npx/pnpx/yarn if the user doesn't have nx installed globally. Look at the package.json or lockfile to determine which package manager is in use. For more details on any command, run it with `--help` (e.g. `nx run-many --help`, `nx affected --help`). ## Understand which tasks can be run You can check those via `nx show project <projectname> --json`, for example `nx show project myapp --json`
## Finding and Installing new plugins - List plugins: `pnpm nx list` - Install plugins `pnpm nx add <plugin>`. Example: `pnpm nx add @nx/react`.
Generate code using nx generators. INVOKE IMMEDIATELY when user mentions scaffolding, setup, structure, creating apps/libs, or setting up project structure. Trigger words - scaffold, setup, create a new app, create a new lib, project structure, generate, add a new project. ALWAYS use this BEFORE calling nx_docs or exploring - this skill handles discovery internally.