nx-run-tasks
The nx-run-tasks skill executes Nx workspace tasks including build, test, lint, and serve operations using single runs, run-many, and affected commands. Use it when users request task execution like "run tests," "build my app," "lint affected files," or "serve the project," but not for code generation or workspace configuration tasks.
git clone --depth 1 https://github.com/tech-leads-club/agent-skills /tmp/nx-run-tasks && cp -r /tmp/nx-run-tasks/packages/skills-catalog/skills/(tooling)/nx-run-tasks ~/.claude/skills/nx-run-tasksSKILL.md
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`)
Finds duplicate business logic spread across multiple components and suggests consolidation. Use when asking "where is this logic duplicated?", "find common code between services", "what can be consolidated?", "detect shared domain logic", or analyzing component overlap before refactoring. Do NOT use for code-level duplication detection (use linters) or dependency analysis (use coupling-analysis).
Detects misplaced classes and fixes component hierarchy problems — finds code that should belong inside a component but sits at the root level. Use when asking "clean up component structure", "find orphaned classes", "fix module hierarchy", "flatten nested components", or analyzing why namespaces have misplaced code. Do NOT use for dependency analysis (use coupling-analysis) or domain grouping (use domain-identification-grouping).
Maps architectural components in a codebase and measures their size to identify what should be extracted first. Use when asking "how big is each module?", "what components do I have?", "which service is too large?", "analyze codebase structure", "size my monolith", or planning where to start decomposing. Do NOT use for runtime performance sizing or infrastructure capacity planning.
Analyzes coupling between modules using the three-dimensional model (strength, distance, volatility) from "Balancing Coupling in Software Design". Use when asking "are these modules too coupled?", "show me dependencies", "analyze integration quality", "which modules should I decouple?", "coupling report", or evaluating architectural health. Do NOT use for domain boundary analysis (use domain-analysis) or component sizing (use component-identification-sizing).
Creates step-by-step decomposition plans and migration roadmaps for breaking apart monolithic applications. Use when asking "what order should I extract services?", "plan my migration", "create a decomposition roadmap", "prioritize what to split", "monolith to microservices strategy", or tracking decomposition progress. Do NOT use for domain analysis (use domain-analysis) or component sizing (use component-identification-sizing).
Maps business domains and suggests service boundaries in any codebase using DDD Strategic Design. Use when asking "what are the domains in this codebase?", "where should I draw service boundaries?", "identify bounded contexts", "classify subdomains", "DDD analysis", or analyzing domain cohesion. Do NOT use for grouping existing components into domains (use domain-identification-grouping) or dependency analysis (use coupling-analysis).
Groups existing components into logical business domains to plan service-based architecture. Use when asking "which components belong together?", "group these into services", "organize by domain", "component-to-domain mapping", or planning service extraction from an existing codebase. Do NOT use for identifying new domains from scratch (use domain-analysis) or analyzing coupling (use coupling-analysis).
AI frontend specialist and design consultant that guides users through a structured discovery process before generating any code. Collects visual references, design tokens, typography, icons, layout preferences, and brand guidelines to ensure the final output matches the user's vision with high fidelity. Use when the user asks to build, design, create, or improve any frontend interface — websites, landing pages, dashboards, components, apps, emails, forms, modals, or any UI element. Also triggers on "build me a UI", "design a page", "create a component", "improve this layout", "make this look better", "frontend", "interface", "redesign", or when the user provides mockups, screenshots, or design references. Do NOT use for backend logic, API design, database schemas, or non-visual code tasks.