Skip to content

Nx Workspace Patterns

Set up and tune Nx monorepo workspaces: project boundaries, build caching, and affected commands.

Repository
wshobson/agents
Stars
42,095
Licence
MIT
Files
2 files

What it does

Once installed, the agent knows established conventions for organizing a large code repository (a monorepo) managed by Nx, a build tool. It can suggest a folder layout separating apps from shared libraries, label libraries by type (feature, UI, data-access, util, shell), enforce import rules between projects, and speed up CI by running only the tests and builds affected by a change. It also points to a reference file with fuller templates and worked examples.

Great for

  • Developers setting up a new Nx monorepo
  • Teams trying to reduce slow CI runs with caching and affected commands
  • Engineers migrating an existing codebase into Nx and needing a library structure

Skip it if

  • Single-project repositories with no need for a monorepo, where the added Nx structure adds overhead
  • Non-developers, since the content assumes familiarity with build tooling and CI pipelines
  • Projects that are not using Nx: the guidance is specific to Nx configuration files and commands

Try asking

  • “Set up an Nx workspace with separate apps for web and api and shared libraries for ui and utils”
  • “Review my nx.json and suggest how to enable remote caching for CI”
  • “Help me define project boundary tags so the feature libraries cannot import from apps”
  • “Show me how to run only the tests affected by my pull request using Nx”
Step-by-step guide: how to use Nx Workspace PatternsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 2 original files, the MIT licence and an attribution note.

    nx-workspace-patterns.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip nx-workspace-patterns.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip nx-workspace-patterns.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Give the agent your existing nx.json and project layout so suggestions match your setup rather than the generic template
  • Ask for the reference templates in references/details.md when you need concrete config files, and verify them against current Nx docs since the skill itself is brief
  • Review any suggested boundary rules before applying them, because tightening import rules on an existing codebase can break builds

What's inside

  • references/details.md
  • SKILL.md

Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.