npx skills add ...
npx skills add giuseppe-trisciuoglio/developer-kit --skill nx-monorepo
Provides comprehensive Nx monorepo management guidance for TypeScript/JavaScript projects. Use when creating Nx workspaces, generating apps/libraries/components, running affected commands, setting up CI/CD, configuring Module Federation, or implementing NestJS backends within Nx
npx skills add giuseppe-trisciuoglio/developer-kit --skill nx-monorepo
Provides guidance for Nx monorepo management in TypeScript/JavaScript projects. Covers workspace creation, project generation, task execution, caching strategies, Module Federation, and CI/CD integration.
Use this skill when:
Trigger phrases: "create Nx workspace", "Nx monorepo", "generate Nx app", "Nx affected", "Nx CI/CD", "Module Federation Nx", "Nx Cloud"
Create a new workspace with interactive setup:
Follow prompts to select preset (Integrated, Standalone, Package-based) and framework stack.
Initialize Nx in an existing project:
Create with specific preset (non-interactive):
Verify: nx show projects lists the new workspace projects
Generate a React application:
Generate a library:
Verify: nx show projects lists the new lib
Generate a component in lib:
Generate NestJS backend:
Verify: nx show projects lists my-api and nx run my-api:build succeeds
Run tasks for affected projects only:
Run tasks across all projects:
Run specific target on single project:
Visualize dependency graph:
Each project has a project.json defining targets, executor, and configurations:
Set up project dependencies:
Use tags for organization:
Generate a remote (micro-frontend):
Generate a host:
Use affected commands in CI to only build/test changed projects:
Input: "Create a new Nx workspace with React and TypeScript"
Steps:
Verify: cd my-workspace && nx show projects lists the created app
Expected Result: Workspace created with:
apps/ directory with React applibs/ directory for shared librariesnx.json with cache configurationInput: "Run tests only for projects affected by recent changes"
Command:
Expected Result: Only tests for projects affected by changes between commits are executed, leveraging cached results from previous runs.
Input: "Create a shared UI library and use it in the app"
Steps:
Verify: nx run shared-ui:build completes successfully and nx graph shows the dependency link to your app
Expected Result: Buildable library at libs/shared-ui with proper TypeScript path mapping configured.
Input: "Configure Module Federation for micro-frontends"
Steps:
Verify: Both servers start without errors and nx graph shows dashboard → product-catalog remote connection
Expected Result: Two separate applications running where product-catalog loads dynamically into dashboard at runtime.
Input: "Why is my app rebuilding when unrelated lib changes?"
Diagnosis:
Solution: Add explicit dependency configuration or use namedInputs in nx.json to exclude certain files from triggering builds.
Verify Fix Worked: Make a change to the unrelated lib, run nx affected -t build — my-app should not appear in the affected projects list.
nx affected in CI to only test/build changed projectstype:app|lib, scope:frontend|backend|shared)workspaceLayout boundaries in nx.jsonnx.json when possiblenamedInputs to exclude test files from production cache keystools/ for project-specific scaffolding~/.nx/cache can grow large; configure cacheDirectory in nx.json if needednx graph to visualizeFor detailed guidance on specific topics, consult:
| Topic | Reference File |
|---|---|
| Workspace setup, basic commands | references/basics.md |
| Generators (app, lib, component) | references/generators.md |
| React, Next.js, Expo patterns | references/react.md |
| NestJS backend patterns | references/nestjs.md |
| TypeScript packages | references/typescript.md |
| CI/CD (GitHub, CircleCI, etc.) | references/ci-cd.md |
| Caching, affected, advanced | references/advanced.md |