Skip to content

Guide · Agent skill

How to use the Nx Workspace Patterns agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The nx-workspace-patterns skill is a set of instructions that gives an AI agent established conventions for managing an Nx monorepo, a single repository holding several apps and shared libraries built with the Nx build tool. It is aimed at developers setting up a new Nx workspace, teams trying to cut slow CI runs, and engineers moving existing code into Nx. After this guide you will know how to install the skill, how to ask for help with it in plain language, and what it can and cannot do for you.

Nx Workspace Patternswshobson/agents · MIT

Quick start

  1. 1Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder.
  2. 2Or upload it in the Claude apps. In the Claude apps, open Settings, go to Capabilities, then Skills, and upload the skill.
  3. 3Confirm the Nx toolchain is ready. Make sure Nx and a Node.js environment are installed, since the commands the agent suggests need them.
  4. 4Describe your task in plain words. Ask about setting up Nx, project boundaries, build caching or affected commands, and include your repository context.
  5. 5Review the suggested layout and tags. Check the apps and libs structure and library types against your team's needs before creating anything.
  6. 6Apply the caching and affected settings. Adjust affected.defaultBase and the cacheable operations in nx.json to match your branches and tooling.
  7. 7Ask for the full template when needed. Request the detailed templates so the agent reads references/details.md for complete examples.

What the skill makes the agent do

Once installed, the agent follows Nx conventions when you work on workspace setup. It can suggest a folder layout that separates deployable apps from shared libraries, with apps in an apps folder and shared code in a libs folder.

It can label libraries by type: feature for smart components and business logic, ui for presentational components, data-access for API calls and state, util for pure functions and helpers, and shell for app bootstrapping. It can also guide you on enforcing import rules between projects using tags, and on running only the tests and builds affected by a change, which is how it speeds up CI.

  • Folder layout separating apps from shared libraries
  • Library naming by type: feature, ui, data-access, util, shell
  • Project boundary rules enforced with tags and module boundaries
  • Caching and affected commands to reduce CI time
  • A reference file with fuller templates and worked examples

Install the skill (ZIP download or Claude apps upload)

Download the skill ZIP from this page. The skill is a folder containing SKILL.md and a references/details.md file. To use it in Claude Code, unzip it into ~/.claude/skills/ to make it available to you across projects, or into a project's .claude/skills/ folder to share it with that one repository.

If you use the Claude apps instead, open Settings, go to Capabilities, then Skills, and upload the skill there.

  • Personal install: unzip into ~/.claude/skills/
  • Project install: unzip into the project's .claude/skills/ folder
  • Claude apps: Settings → Capabilities → Skills, then upload

Trigger the skill with natural requests

You do not need a special command. The skill's description tells the agent when to use it, so describe your task in ordinary words. The skill applies when you ask about setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.

Name the goal and the situation. The more context you give about your repository, the more specific the answer will be.

  • Set up a new Nx monorepo with an apps folder and a libs folder for a web app and an API.
  • Help me restrict which libraries can import from which, using tags.
  • Our CI runs every test on every commit. Show me how to run only affected tests.
  • Split this feature into feature, ui, data-access and util libraries following Nx conventions.

Configure caching and affected commands

The skill points to a template for nx.json. Its affected block sets the base branch that affected commands compare against, and tasksRunnerOptions lists the operations that can be cached. The example template caches build, lint, test, e2e and build-storybook, and sets targetDefaults so build, test, lint and e2e use cache.

Use the template as a starting point and check the values against your own branch names and tooling. Running the Nx commands the agent suggests requires the Nx toolchain and a Node.js environment.

  • Set affected.defaultBase to your main branch name
  • List the operations you want cached under cacheableOperations
  • Use targetDefaults to set inputs and cache for each target
  • If you use remote caching, you need a remote cache provider, which the skill files do not specify
"affected": { "defaultBase": "main" }

Read the reference file for full templates

The main SKILL.md gives the core patterns. For concrete templates and worked examples, the agent is directed to read references/details.md. Ask the agent to open that file when you need a complete configuration rather than an outline, for example a full nx.json or a worked library split.

  • SKILL.md: patterns, library types, do's and don'ts
  • references/details.md: nx.json template and worked examples

Follow the do's and don'ts

The skill recommends using tags consistently and enforcing them with module boundaries, enabling caching early, keeping libraries focused on a single responsibility, and using generators to keep code consistent. It warns against circular dependencies, against skipping affected commands, against ignoring boundaries, and against creating too many small libraries.

  • Do use tags and enforce them with module boundaries
  • Do enable caching early
  • Don't create circular dependencies; the dependency graph should be acyclic
  • Don't over-granularize; balance the number of libraries

What people use it for

  • Scaffolding a new Nx monorepo with apps for a web frontend and an API, plus shared libs.
  • Splitting a growing feature into feature, ui, data-access and util libraries.
  • Setting up tags so a UI library cannot import from an app.
  • Reducing CI time by running only the tests and builds affected by a pull request.
  • Migrating an existing codebase into Nx with a sensible library structure.

Frequently asked questions

How do I install the nx-workspace-patterns skill?

Download the skill ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder for a shared repository. In the Claude apps, you can instead upload it under Settings, Capabilities, Skills.

What do I need to use this skill?

You need the Nx toolchain and a Node.js environment to run the Nx commands the agent suggests. If you use remote caching, you also need a remote cache provider, which the skill files do not specify.

Is the nx-workspace-patterns skill free?

The skill is published under the MIT licence, as listed on this page. Check the licence text in the source repository for the full terms.

Does the skill run scripts or use the network?

According to this page, the skill does not run scripts and does not use the network. It provides guidance and templates that the agent uses while helping you.

Can I use this skill without Nx?

Not usefully. The guidance is specific to Nx configuration files and commands, so it does not apply to projects that do not use Nx. It is also not a good fit for a single-project repository with no need for a monorepo.

Why isn't the skill triggering when I ask about my build?

The skill is selected based on its description, which covers setting up Nx, configuring project boundaries, optimizing build caching and implementing affected commands. Mention Nx or one of those topics explicitly in your request.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill is a good fit for developers setting up a new Nx monorepo, teams trying to reduce slow CI with caching and affected commands, and engineers splitting code into libraries. It is not worth installing for a single-project repository, for non-developers, or for projects that do not use Nx.

Download the skill