Tool for building and managing monorepo workspaces with task caching and orchestration.

Install

mkdir -p .claude/skills/nx && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18067" && unzip -o skill.zip -d .claude/skills/nx && rm skill.zip

Installs to .claude/skills/nx

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.

Build and manage monorepos with Nx. Use when a user asks to set up a monorepo, manage multiple packages/apps, cache builds, run affected tests, or migrate from Lerna.
166 chars✓ has a “when” trigger
Beginner

Key capabilities

  • →Create a new Nx workspace
  • →Add projects like React apps, JS libraries, or Node.js apps
  • →Run tasks such as serving, building, or testing projects
  • →Execute tasks only on affected projects
  • →Run multiple tasks across all projects
  • →Configure workspace settings in `nx.json`

How it works

Nx uses a build system for monorepos that provides computation caching, task orchestration, and a dependency graph.

Inputs & outputs

You give it
User request to manage a monorepo or run tasks
You get back
Command-line output from Nx operations

When to use nx

  • →Initialize a monorepo
  • →Run affected tests
  • →Optimize build performance
  • →Manage library dependencies

About this skill

Nx

Overview

Nx is a build system for monorepos. It reads your workspace into a project graph, runs tasks in dependency order, caches results (locally, and remotely with Nx Cloud or a self-hosted cache), and can run only the tasks affected by a change. Plugins (@nx/js, @nx/react, @nx/node, @nx/next, ...) infer tasks from the tool configs they find (tsconfig, vite config, jest config), so most projects need no hand-written project.json. Checked against Nx 23.2.

Instructions

Step 1: Create a workspace or add Nx to an existing repo

# New workspace: pick a preset with --preset, skip the Nx Cloud prompt, no questions
npx create-nx-workspace@latest acme-platform --preset=ts --nxCloud=skip --no-interactive --packageManager=npm

# Existing repo (any package manager): installs nx and creates nx.json
cd acme-platform && npx nx@latest init

Other presets include react-monorepo, next, node-monorepo, angular-monorepo, vue-monorepo, nest, expo. With --no-interactive, --preset is required.

Step 2: Add plugins and projects

npx nx add @nx/react                                     # install + initialize a plugin
npx nx g @nx/js:lib packages/shared-utils --bundler=tsc  # new library
npx nx g @nx/react:app apps/storefront                   # new app (answers prompts if interactive)

New projects are named from their package.json (for example @org/shared-utils); nx build shared-utils still works with the short name when it is unique.

Step 3: Run tasks

npx nx build shared-utils           # one project, dependencies built first (^build)
npx nx run-many -t build test lint  # everything
npx nx affected -t test --base=origin/main   # only projects changed since main
npx nx graph                        # open the project graph; nx show projects lists them
npx nx show project shared-utils    # inferred targets, cache flags, inputs and outputs

Rerun a cached task and Nx replays the output ("1/1 hit (100%)") instead of running it.

Step 4: Tune nx.json

Plugin-inferred tasks (build, typecheck, test) are already cacheable. Use targetDefaults for your own targets or to change inputs:

{
  "namedInputs": {
    "production": ["default", "!{projectRoot}/**/*.spec.ts"]
  },
  "targetDefaults": {
    "build": { "dependsOn": ["^build"], "cache": true, "inputs": ["production", "^production"] },
    "lint": { "cache": true }
  }
}

Tasks that are not deterministic (deploy, dev servers) must not be cached.

Step 5: Remote cache and CI

npx nx@latest connect     # link the workspace to Nx Cloud for a shared cache
npx nx reset              # clear local cache and the daemon state when results look stale
npx nx migrate latest && npx nx migrate --run-migrations   # upgrade; one major version at a time

Examples

Example 1: Start a TypeScript monorepo with a shared library

Request: "Set up a monorepo with a shared utils package and build it."

npx create-nx-workspace@latest acme-platform --preset=ts --nxCloud=skip --no-interactive
cd acme-platform
npx nx g @nx/js:lib packages/shared-utils --bundler=tsc --unitTestRunner=none --linter=none
npx nx build shared-utils && npx nx build shared-utils

The first build prints Cache: 0/1 hit (0%); the second replays from the cache and prints 1/1 hit (100%) in a few milliseconds.

Example 2: Only test what a pull request touched

Request: "CI takes 25 minutes, make it run only what changed."

git fetch origin main
npx nx affected -t lint test build --base=origin/main --head=HEAD --parallel=3

Nx finds the changed files, maps them to projects through the graph, and also runs dependents of those projects. Untouched packages are skipped; if nothing is affected it prints "No tasks were run". In GitHub Actions use a full checkout (fetch-depth: 0) so the base commit exists.

Guidelines

  • Cache correctness depends on declared inputs and outputs: if a task reads an env var or a file outside the project, add it to inputs, or stale results will be replayed.
  • nx affected needs git history; a shallow clone gives wrong or empty results.
  • Remote caches are shared: do not put secrets in task outputs, and restrict write access to CI.
  • Keep Nx and all @nx/* packages on the same version; upgrade with nx migrate, not by editing versions.
  • A single small package does not need Nx; it pays off with several projects, shared libraries or slow CI.

When not to use it

  • →When the user needs to manage a single repository without monorepo features
  • →When the user does not want computation caching or task orchestration

Limitations

  • →Requires Node.js for `npx` commands
  • →Does not provide remote caching without Nx Cloud
  • →Does not automatically add Nx to any repository

How it compares

This skill provides a structured approach to monorepo management with caching and affected commands, which is more efficient than manually running tasks across all projects.

Compared to similar skills

nx side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
nx (this skill)05moReviewBeginner
inngest09moNo flagsIntermediate
senior-fullstack3510moReviewIntermediate
ai-sdk-documentation19moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

inngest

davila7

Inngest expert for serverless-first background jobs, event-driven workflows, and durable execution without managing queues or workers. Use when: inngest, serverless background job, event-driven workflow, step function, durable execution.

00

senior-fullstack

davila7

Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects, analyzing code quality, implementing design patterns, or setting up development workflows.

35110

ai-sdk-documentation

malob

This skill should be used when working with Vercel AI SDK, AI Gateway, streamText, generateText, generateObject, streamObject, tool calling, or AI SDK providers. Also relevant for "ai-sdk", "@ai-sdk/*" packages, or questions about AI SDK patterns, configuration, and best practices.

13

clerk-install-auth

jeremylongshore

Install and configure Clerk SDK/CLI authentication. Use when setting up a new Clerk integration, configuring API keys, or initializing Clerk in your project. Trigger with phrases like "install clerk", "setup clerk", "clerk auth", "configure clerk API key", "add clerk to project".

12

senior-qa

diegosouzapw

Comprehensive QA and testing skill for quality assurance, test automation, and testing strategies for ReactJS, NextJS, NodeJS applications. Includes test suite generation, coverage analysis, E2E testing setup, and quality metrics. Use when designing test strategies, writing test cases, implementing

00

fullstack-developer

daithang59

|

00

Search skills

Search the agent skills registry