nx-workspace-patterns – skill Lập trình cho agent AI
Cấu hình và tối ưu workspace monorepo Nx. Dùng khi thiết lập Nx, cấu hình ranh giới dự án (project boundaries), tối ưu bộ nhớ đệm build (build caching) hoặc triển khai các lệnh affected.
Cài skill nx-workspace-patterns bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/nx-workspace-patterns-6bbad.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /nx-workspace-patterns – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/nx-workspace-patterns-6bbad.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $nx-workspace-patterns – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/nx-workspace-patterns-6bbad.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /nx-workspace-patterns – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/nx-workspace-patterns-6bbad.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /nx-workspace-patterns – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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 configuration2. 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
Skill liên quan
- opentrons-integration – Soạn thảo, rà soát, di chuyển, mô phỏng và gỡ lỗi các giao thức Python Protocol API v2…
- azure-security-keyvault-secrets-java – SDK Azure Key Vault Secrets cho Java để quản lý bí mật. Dùng khi lưu trữ, lấy hoặc quản…
- azure-servicebus-rust – Thư viện Azure Service Bus cho Rust. Gửi và nhận tin nhắn qua queue, topic và…
- azure-storage-blob-java – Xây dựng ứng dụng lưu trữ blob bằng SDK Azure Storage Blob cho Java.
- openapi-spec-generation – Tạo và duy trì đặc tả OpenAPI 3.1 từ mã nguồn, đặc tả thiết kế trước (design-first) và…
- parallel-debugging – Gỡ lỗi các vấn đề phức tạp bằng cách đưa ra các giả thuyết cạnh tranh, điều tra song…
- hunt-source-leak – Săn lỗ hổng rò rỉ mã nguồn và artifact build: source map JavaScript (.js.map) khôi phục…
- azure-storage-blob-rust – SDK Azure Blob Storage cho Rust. Dùng để tải lên, tải xuống và quản lý blob cùng…