Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)7.1k Β· #13574

nx-workspace

Fungsinya

Skill ini membantu menyiapkan dan memahami workspace monorepo Nx. Skill ini ditujukan untuk pengembang dan technical lead yang mengelola banyak aplikasi dan pustaka dalam satu repositori dan menginginkan build yang lebih cepat.

Kapan dipakai

  • βœ“Saat Anda menyiapkan Nx atau perlu memahami bagaimana monorepo disusun.
  • βœ“Ketika Anda ingin menetapkan batas proyek atau melihat proyek mana yang bergantung pada yang lain.
  • βœ“Ketika Anda ingin mempercepat CI dengan perintah affected dan caching build.

Link skill

https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(tooling)/nx-workspace/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(tooling)/nx-workspace/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda menjelaskan bagaimana workspace Nx saya diatur dan menyarankan cara mempercepat build CI kami?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mendaftar proyek, membaca konfigurasi lengkap yang telah diselesaikan melalui perintah Nx, dan memetakan strukturnya. Setelah itu agent menyarankan perubahan pada batas, caching, dan perintah affected untuk pipeline yang lebih cepat.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Nx Workspace Management

Quick Start

Exploring workspace: nx show projects and nx show project <name> --json
Running tasks: nx <target> <project> (e.g., nx build my-app)
Affected analysis: nx show projects --affected or nx affected -t <target>

Note: Prefix commands with npx/pnpx/yarn if nx isn't installed globally.

Core Commands

List and Explore Projects

# List all projects
nx show projects

# Filter by type, pattern, or target
nx show projects --type app
nx show projects --projects "apps/*"
nx show projects --withTarget build

# Find affected projects
nx show projects --affected --base=main

Get Project Information

Critical: Always use nx show project <name> --json for full resolved configuration. Do NOT read project.json directly - it contains only partial configuration.

# Get full configuration
nx show project my-app --json

# Extract targets
nx show project my-app --json | jq '.targets | keys'

Configuration schemas:

  • Workspace: node_modules/nx/schemas/nx-schema.json
  • Project: node_modules/nx/schemas/project-schema.json

Run Tasks

# Run specific project
nx build web --configuration=production

# Run affected
nx affected -t test --base=main

# View dependency graph
nx graph

Workspace Architecture

workspace/
β”œβ”€β”€ apps/              # Deployable applications
β”œβ”€β”€ libs/              # Shared libraries
β”‚   β”œβ”€β”€ shared/        # Shared across scopes
β”‚   └── feature/       # Feature-specific
β”œβ”€β”€ nx.json            # Workspace configuration
└── tools/             # Custom executors/generators

Library Types

Type Purpose Example
feature Business logic, smart components feature-auth
ui Presentational components ui-buttons
data-access API calls, state management data-access-users
util Pure functions, helpers util-formatting

Detailed Resources

Configuration: See reference/configuration.md for:

  • nx.json templates and options
  • project.json structure
  • Module boundary rules
  • Remote caching setup

Commands: See reference/commands.md for:

  • Complete command reference
  • Advanced filtering options
  • Common workflows

CI/CD: See reference/ci-cd.md for:

  • GitHub Actions configuration
  • GitLab CI setup
  • Jenkins, Azure Pipelines, CircleCI examples
  • Affected commands in pipelines

Best Practices: See reference/best-practices.md for:

  • Do's and don'ts
  • Complete troubleshooting guide
  • Performance optimization
  • Migration guides

Common Workflows

"What's in this workspace?"

nx show projects --type app  # List applications
nx show projects --type lib  # List libraries

"How do I run project X?"

nx show project X --json | jq '.targets | keys'

"What changed?"

nx show projects --affected --base=main

Quick Troubleshooting

  • Targets not showing: Use nx show project <name> --json, not project.json
  • Affected not working: Ensure git history available (fetch-depth: 0 in CI)
  • Cache issues: Run nx reset

For detailed troubleshooting, see reference/best-practices.md.

Pertanyaan umum

Mengapa tidak membaca project.json langsung?

Skill ini menyatakan project.json hanya berisi sebagian pengaturan, sehingga konfigurasi lengkapnya berasal dari Nx.

Bisakah skill ini menampilkan grafik dependensi?

Bisa. Skill ini dapat menampilkan grafik dependensi proyek dengan perintah Nx.

Apakah skill ini juga menjalankan tugas?

Menjalankan tugas adalah skill yang terpisah, tetapi bisa menjalankan target jika Anda memintanya.

Detail

Deskripsi asli dari pembuat

Configure, explore, and optimize Nx monorepo workspaces. Use when setting up Nx, exploring workspace structure, configuring project boundaries, analyzing affected projects, optimizing build caching, or implementing CI/CD with affected commands. Keywords β€” nx, monorepo, workspace, projects, targets, affected. Do NOT use for running tasks (use nx-run-tasks) or code generation with generators (use nx-generate).

repo: tech-leads-club/agent-skills

Popularitas

Bintang GitHub
7.1k
Peringkat
#13574
Lisensi
β€”
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa