Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)7.1k · #13573

nx-run-tasks

Skill này làm gì

Skill này chạy các tác vụ phát triển thông thường trong workspace Nx, như build, test và lint. Skill dành cho lập trình viên làm việc trong monorepo và muốn chạy đúng tác vụ một cách nhanh chóng.

Khi nào nên dùng

  • ✓Khi bạn muốn chạy test, build hoặc lint cho một dự án trong workspace Nx.
  • ✓Khi bạn muốn chạy một tác vụ trên nhiều dự án hoặc chỉ trên những dự án bị ảnh hưởng bởi một thay đổi.
  • ✓Khi bạn cần khởi động máy chủ phát triển của một dự án.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(tooling)/nx-run-tasks/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể chạy test cho chỉ những dự án bị ảnh hưởng bởi thay đổi của tôi trong workspace Nx này không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent kiểm tra mỗi dự án có những tác vụ nào, rồi chạy một tác vụ đơn, một nhóm tác vụ hoặc các dự án bị ảnh hưởng bằng lệnh Nx phù hợp. Agent có thể giới hạn lần chạy trong một số dự án và kiểm soát số lượng chạy song song.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

You can run tasks with Nx in the following way.

Keep in mind that you might have to prefix things with npx/pnpx/yarn if the user doesn't have nx installed globally. Look at the package.json or lockfile to determine which package manager is in use.

For more details on any command, run it with --help (e.g. nx run-many --help, nx affected --help).

Understand which tasks can be run

You can check those via nx show project <projectname> --json, for example nx show project myapp --json. It contains a targets section which has information about targets that can be run. You can also just look at the package.json scripts or project.json targets, but you might miss out on inferred tasks by Nx plugins.

Run a single task

nx run <project>:<task>

where project is the project name defined in package.json or project.json (if present).

Run multiple tasks

nx run-many -t build test lint typecheck

You can pass a -p flag to filter to specific projects, otherwise it runs on all projects. You can also use --exclude to exclude projects, and --parallel to control the number of parallel processes (default is 3).

Examples:

  • nx run-many -t test -p proj1 proj2 — test specific projects
  • nx run-many -t test --projects=*-app --exclude=excluded-app — test projects matching a pattern
  • nx run-many -t test --projects=tag:api-* — test projects by tag

Run tasks for affected projects

Use nx affected to only run tasks on projects that have been changed and projects that depend on changed projects. This is especially useful in CI and for large workspaces.

nx affected -t build test lint

By default it compares against the base branch. You can customize this:

  • nx affected -t test --base=main --head=HEAD — compare against a specific base and head
  • nx affected -t test --files=libs/mylib/src/index.ts — specify changed files directly

Useful flags

These flags work with run, run-many, and affected:

  • --skipNxCache — rerun tasks even when results are cached
  • --verbose — print additional information such as stack traces
  • --nxBail — stop execution after the first failed task
  • --configuration=<name> — use a specific configuration (e.g. production)
Câu hỏi thường gặp

Tôi có cần cài Nx không?

Không nhất thiết. Agent có thể dùng npx, pnpx hoặc yarn, tùy vào file khóa.

Skill tìm các tác vụ có sẵn bằng cách nào?

Skill đọc cấu hình dự án bằng Nx, bao gồm cả các tác vụ được plugin suy ra.

Skill có dùng để sinh mã không?

Không. Việc sinh mã do một skill generator Nx riêng đảm nhiệm.

Chi tiết

Mô tả gốc của tác giả

Execute build, test, lint, serve, and other tasks in an Nx workspace using single runs, run-many, and affected commands. Use when user says "run tests", "build my app", "lint affected", "serve the project", "run all tasks", or "nx affected". Do NOT use for code generation (use nx-generate) or workspace configuration (use nx-workspace).

repo: tech-leads-club/agent-skills

Độ phổ biến

Sao GitHub
7.1k
Vị trí xếp hạng
#13573
Giấy phép
—
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự