Skip to content
Skillpedia
Deploy & cloud (DevOps)7.1k Β· #13573

nx-run-tasks

What it does

This skill runs common development tasks in an Nx workspace, such as build, test, and lint. It is for developers who work in monorepos and want to run the right tasks quickly.

When to use it

  • βœ“When you want to run tests, a build, or a lint for one project in an Nx workspace.
  • βœ“When you want to run a task across many projects or only the ones affected by a change.
  • βœ“When you need to start a project's development server.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(tooling)/nx-run-tasks/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œCan you run the tests for only the projects my changes affect in this Nx workspace?”

5 new skills a week. 1 minute to read.

How it works

The agent checks which tasks each project has, then runs a single task, a group of tasks, or the affected projects with the right Nx command. It can limit runs to certain projects and control how many run in parallel.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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)
FAQ

Do I need Nx installed?

Not necessarily. The agent can use npx, pnpx, or yarn, depending on the lock file.

How does it find available tasks?

It reads the project configuration with Nx, which also finds tasks inferred by plugins.

Is it for code generation?

No. Code generation is handled by a separate Nx generator skill.

Details

Original description by the author

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

Popularity

GitHub stars
7.1k
Ranking position
#13573
License
β€”
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills