All skills
wshobson avatar

/nx-workspace-patterns

@be57c0b
by Seth Hobsonwshobson/agents40k stars
4,281

Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.

Use this Skill: https://skilld.dev/gh/wshobson/agents/nx-workspace-patterns

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ47 tokens always: the name and description. β‰ˆ518 when used: this file. β‰ˆ2.2k more on demand in 1 file.

Nx Workspace Patterns

Production patterns for Nx monorepo management.

When to Use This Skill

  • Setting up new Nx workspaces
  • Configuring project boundaries
  • Optimizing CI with affected commands
  • Implementing remote caching
  • Managing dependencies between projects
  • Migrating to Nx

Core Concepts

1. Nx Architecture

workspace/
β”œβ”€β”€ apps/              # Deployable applications
β”‚   β”œβ”€β”€ web/
β”‚   └── api/
β”œβ”€β”€ libs/              # Shared libraries
β”‚   β”œβ”€β”€ shared/
β”‚   β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   └── utils/
β”‚   └── feature/
β”‚       β”œβ”€β”€ auth/
β”‚       └── dashboard/
β”œβ”€β”€ tools/             # Custom executors/generators
β”œβ”€β”€ nx.json            # Nx configuration
└── workspace.json     # Project configuration

2. Library Types

Type Purpose Example
feature Smart components, business logic feature-auth
ui Presentational components ui-buttons
data-access API calls, state management data-access-users
util Pure functions, helpers util-formatting
shell App bootstrapping shell-web

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's

  • Use tags consistently - Enforce with module boundaries
  • Enable caching early - Significant CI savings
  • Keep libs focused - Single responsibility
  • Use generators - Ensure consistency
  • Document boundaries - Help new developers

Don'ts

  • Don't create circular deps - Graph should be acyclic
  • Don't skip affected - Test only what changed
  • Don't ignore boundaries - Tech debt accumulates
  • Don't over-granularize - Balance lib count

Source: SKILL.md on GitHub

No alerts16d5 checks Β· Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides standard architectural guidelines, templates, and reference configurations for managing Nx monorepo workspaces. No security vulnerabilities or malicious patterns were found.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW Β· No issues

  • Runlayer6mo

    1 file scanned Β· No issues

  • ZeroLeaks5mo

    Score: 93/100 Β· 2 sections analyzed

Signed by skilld at be57c0b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 4 months ago
  • TypeScript
  • nx
  • monorepo
  • workspace
  • build-caching
  • project-boundaries
  • javascript
  • ci-cd
  • affected-commands

README badge

README badge for wshobson/agents/nx-workspace-patterns

Configures Nx monorepo workspaces with patterns for project structure, library organization, and dependency boundaries. Covers workspace setup, remote caching, the affected command workflow, and migrations to Nx.

Generated from the current SKILL.md.

Does this skill cover remote caching setup with Nx Cloud?
The skill mentions implementing remote caching as a core use case, but the SKILL.md content provided does not include specific remote caching configuration steps. Refer to the referenced `references/details.md` file for concrete templates.
What Nx versions does this skill target?
The SKILL.md does not specify a minimum or target Nx version. Assume it applies to recent stable versions unless the bundled templates indicate otherwise.
Does this skill help with migrating an existing monorepo to Nx?
Yes. Migration to Nx is listed as a core use case, though the SKILL.md does not detail migration steps β€” see `references/details.md` for worked examples.
Can I use this skill to set up project boundaries and enforce them?
Yes. Configuring project boundaries and module boundaries is a primary use case covered by the skill, enforced via tags and dependency rules.
Does this cover custom executors and generators?
The skill acknowledges custom executors and generators in the workspace structure, and the skill description mentions using generators for consistency, but specific executor/generator implementation is not detailed in the provided content.

Generated from the current SKILL.md. These answers refresh after source changes.