nx-workspace-architecture

Structure Nx workspaces with domain-based libraries and explicit boundaries.

1|1|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/juristr/tusky --skill nx-workspace-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nx-workspace-architecture
Source: https://github.com/juristr/tusky/tree/main/.claude/skills/nx-workspace-architecture
Command: npx skills add https://github.com/juristr/tusky --skill nx-workspace-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams structure Nx workspaces by business domain, define clear library boundaries, and enforce explicit ownership to reduce complexity as projects scale.

Core Features & Use Cases

  • Domain-focused organization: Group code by business domains (products, orders, checkout) to improve maintainability.
  • Thin App Shell: Keep business logic in libs, not in apps.
  • Explicit Boundaries & Tagging: Use project.json (or nx.json) to enforce domain and library-type boundaries.
  • Guided Growth: Decide when to split libraries to avoid circular dependencies and keep codebases scalable.
  • Use Case: When adding a new feature, structure associated libs under feat-, ui-, data-access-*, and shared util.

Quick Start

Plan a new feature in the products domain: create libs feat-product-/ui-/data-access-*/shared-util as needed to encapsulate domain logic.

Frequently Asked Questions about nx-workspace-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure an Nx workspace by domain to keep code organized?

Domain-based workspace structure groups libraries by business domains (products, orders, checkout) rather than technical layers. Organize code under a packages folder with domain folders, use library-type prefixes like feat-*, ui-*, and data-access-*, and apply tagging in project.json to enforce boundaries. This approach reduces complexity and improves maintainability as your monorepo scales.

What's the best way to organize libraries and set boundaries in an Nx monorepo?

Define explicit boundaries using project.json tags to mark domain ownership and library type (feature, UI, data access, utilities). Create a thin app shell that delegates business logic to domain libraries, and enforce these boundaries through lint rules. This prevents circular dependencies and makes code ownership clear across teams.

When should I split libraries in an Nx workspace?

Split libraries when a domain grows complex enough to justify separate feature, UI, and data-access libraries, or when shared utilities emerge that multiple domains need. Criteria include avoiding circular dependencies, reducing library size, and clarifying ownership. Use a decision flow to evaluate whether new functionality belongs in an existing library or warrants a new one.

Can I use domain-driven design with Nx to structure a large monorepo?

Yes. Domain-driven design aligns naturally with Nx workspace architecture through domain-focused library organization, explicit boundaries via tagging, and library-type conventions. Group feat-*, ui-*, and data-access libraries under domain folders, apply consistent tagging strategy, and use generator commands to scaffold new libraries consistently.

How do I keep business logic out of my Nx app shell?

Implement a thin app shell pattern by moving all business logic into domain libraries organized under packages. Use feat-*, ui-*, and data-access-* libraries to encapsulate domain functionality, and configure your app to import only from these libraries. Enforce this separation through project.json boundary rules and lint policies.

What naming conventions and folder structure should I use for Nx libraries?

Use a packages folder at workspace root with domain subfolders. Within each domain, prefix libraries with their type: feat-* for features, ui-* for components, data-access-* for services and state, and shared-util-* for reusable utilities. Apply corresponding tags in project.json to automate boundary enforcement and enable targeted builds.