Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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
.claude/skills/giuseppe-trisciuoglio-nx-monorepo/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 105% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 262% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 70% | 0% |
| case-10 | ✓→✓ | = Same ✓ | 227% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 526% | 0% |
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"
bash npx create-nx-workspace@latest Follow prompts to select preset (Integrated, Standalone, Package-based) and framework stack.
bash nx@latest init
bash npx create-nx-workspace@latest my-workspace --preset=react Verify: nx show projects lists the new workspace projects
bash nx g @nx/react:app my-app
bash # React library nx g @nx/react:lib my-lib
# TypeScript library nx g @nx/js:lib my-util **Verify:** nx show projects lists the new lib
bash nx g @nx/react:component my-comp --project=my-lib
bash nx g @nx/nest:app my-api Verify: nx show projects lists my-api and nx run my-api:build succeeds
bash nx affected -t lint test build
bash # Build all projects nx run-many -t build
# Test specific projects nx run-many -t test -p=my-app,my-lib
# Test by pattern nx run-many -t test --projects=-app
bash nx run my-app:build
bash nx graph
Each project has a project.json defining targets, executor, and configurations:
json{ "name": "my-app", "projectType": "application", "sourceRoot": "apps/my-app/src", "targets": { "build": { "executor": "@nx/react:webpack", "outputs": ["{workspaceRoot}/dist/apps/my-app"], "configurations": { "production": { "optimization": true } } }, "test": { "executor": "@nx/vite:test" } }, "tags": ["type:app", "scope:frontend"] }
json { "targets": { "build": { "dependsOn": [ { "projects": ["shared-ui"], "target": "build" } ] } } }
json { "tags": ["type:ui", "scope:frontend", "platform:web"] }
bash nx g @nx/react:remote checkout --host=dashboard
bash nx g @nx/react:host dashboard
Use affected commands in CI to only build/test changed projects:
yaml# .github/workflows/ci.yml - run: npx nx affected -t lint --parallel - run: npx nx affected -t test --parallel - run: npx nx affected -t build --parallel
Input: "Create a new Nx workspace with React and TypeScript"
Steps:
bashnpx create-nx-workspace@latest my-workspace # Select: Integrated Monorepo → React → Integrated monorepo (Nx Cloud)
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:
bashnx affected -t test --base=main~1 --head=main
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:
bash# Generate library nx g @nx/react:lib shared-ui # Generate component in library nx g @nx/react:component button --project=shared-ui # Import in app (tsconfig paths auto-configured) import { Button } from '@my-workspace/shared-ui'
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:
bash# Create host app nx g @nx/react:host dashboard # Add remote to host nx g @nx/react:remote product-catalog --host=dashboard # Start dev servers nx run dashboard:serve nx run product-catalog:serve
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:
bash# Show project graph nx graph --focused=my-app # Check implicit dependencies nx show project my-app --json | grep implicitDependencies
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 |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-10 | pass→pass | 4,629 | 2,653 | -43% | 1 | 1 | 0% | 830 | 2,711 | +227% | 0 | 0 | — |
case-01 | pass→pass | 2,952 | 3,290 | +11% | 1 | 1 | 0% | 446 | 2,792 | +526% | 0 | 0 | — |
case-20 | pass→pass | 10,298 | 8,565 | -17% | 1 | 1 | 0% | 1,721 | 3,744 | +118% | 0 | 0 | — |
case-02 | fail→pass | 8,019 | 3,375 | -58% | 1 | 1 | 0% | 1,383 | 2,839 | +105% | 0 | 0 | — |
case-03 | pass→pass | 4,143 | 4,760 | +15% | 1 | 1 | 0% | 713 | 3,097 | +334% | 0 | 0 | — |
case-04 | pass→pass | 5,411 | 4,933 | -9% | 1 | 1 | 0% | 950 | 3,208 | +238% | 0 | 0 | — |
case-05 | pass→pass | 9,319 | 3,990 | -57% | 1 | 1 | 0% | 1,516 | 2,927 | +93% | 0 | 0 | — |
case-06 | pass→pass | 5,536 | 4,997 | -10% | 1 | 1 | 0% | 1,019 | 3,089 | +203% | 0 | 0 | — |
case-07 | fail→pass | 4,477 | 2,460 | -45% | 1 | 1 | 0% | 752 | 2,723 | +262% | 0 | 0 | — |
case-08 | pass→pass | 4,250 | 4,833 | +14% | 1 | 1 | 0% | 714 | 3,099 | +334% | 0 | 0 | — |
case-09 | pass→pass | 4,058 | 2,730 | -33% | 1 | 1 | 0% | 673 | 2,756 | +310% | 0 | 0 | — |
case-21 | pass→pass | 7,927 | 5,412 | -32% | 1 | 1 | 0% | 1,606 | 3,381 | +111% | 0 | 0 | — |
case-11 | pass→pass | 8,144 | 2,859 | -65% | 1 | 1 | 0% | 1,382 | 2,772 | +101% | 0 | 0 | — |
case-12 | pass→pass | 5,139 | 1,569 | -69% | 1 | 1 | 0% | 775 | 2,510 | +224% | 0 | 0 | — |
case-13 | pass→pass | 9,281 | 4,852 | -48% | 1 | 1 | 0% | 1,622 | 3,120 | +92% | 0 | 0 | — |
case-14 | pass→pass | 5,126 | 2,779 | -46% | 1 | 1 | 0% | 841 | 2,723 | +224% | 0 | 0 | — |
case-15 | pass→pass | 8,502 | 5,989 | -30% | 1 | 1 | 0% | 1,553 | 3,318 | +114% | 0 | 0 | — |
case-16 | pass→pass | 14,007 | 9,076 | -35% | 1 | 1 | 0% | 2,615 | 4,106 | +57% | 0 | 0 | — |
case-17 | pass→pass | 16,830 | 10,039 | -40% | 1 | 1 | 0% | 2,770 | 4,049 | +46% | 0 | 0 | — |
case-18 | fail→pass | 13,727 | 8,510 | -38% | 1 | 1 | 0% | 2,164 | 3,684 | +70% | 0 | 0 | — |
case-19 | pass→pass | 9,469 | 6,444 | -32% | 1 | 1 | 0% | 1,713 | 3,320 | +94% | 0 | 0 | — |
case-22 | pass→pass | 2,537 | 2,284 | -10% | 1 | 1 | 0% | 401 | 2,671 | +566% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +14 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.