nx-run-tasks

Executes build, test, lint, and serve tasks in Nx workspaces using run, run-many, and affected commands.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/Peterson-Benhame/agent-skills --skill nx-run-tasks-peterson-benhame
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nx-run-tasks
Source: https://github.com/Peterson-Benhame/agent-skills/tree/main/packages/skills-catalog/skills/%28tooling%29/nx-run-tasks
Command: npx skills add https://github.com/Peterson-Benhame/agent-skills --skill nx-run-tasks-peterson-benhame

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Running tasks across an Nx monorepo requires knowing the right commands, flags, and project targeting syntax. This Skill guides the AI to correctly execute single tasks, multi-project runs, and affected-only tasks without manual command lookup. ## Core Features & Use Cases - Single Task Execution: Run any target on a specific project with nx run <project>:<task>, including configuration selection. - Multi-Project Runs: Execute tasks across many projects with nx run-many, filtering by project names, patterns, or tags. - Affected-Only Execution: Use nx affected to run tasks only on changed projects and their dependents, ideal for CI pipelines. - Use Case: After modifying a shared library, ask the agent to run tests only for affected projects instead of the entire workspace, cutting CI time significantly. ## Quick Start Run the tests for all projects affected by my current changes in this Nx workspace.

Frequently Asked Questions about nx-run-tasks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run tests for all projects in an Nx workspace?

Use nx run-many -t test to run the test target across all projects. Add -p proj1 proj2 to limit to specific projects, or use --projects with patterns like *-app or tag:api-* for filtering.

How to run tasks only on changed projects in Nx?

Use nx affected -t build test lint to run tasks only on changed projects and their dependents. Customize the comparison with --base and --head, or pass specific files with --files.

How do I find which targets a project supports in Nx?

Run nx show project <projectname> --json to see the targets section, which includes inferred tasks from Nx plugins. Checking package.json scripts or project.json alone may miss plugin-inferred targets.

Does nx affected work in CI pipelines?

Yes, nx affected is designed for CI and large workspaces. It compares against the base branch by default, and you can set --base=main --head=HEAD to control the comparison explicitly.

How do I force Nx to rerun a task ignoring the cache?

Pass the --skipNxCache flag to run, run-many, or affected commands. Other useful flags include --nxBail to stop after the first failure and --verbose for stack traces.

When should I not use nx-run-tasks?

Do not use it for code generation, which belongs to nx-generate, or for workspace configuration, which belongs to nx-workspace. It only covers executing existing build, test, lint, and serve targets.