AGENT SKILL

nx-run-tasks

Helps with running tasks in an Nx workspace. USE WHEN the user wants to execute build, test, lint, serve, or run any other tasks defined in the workspace.

License 许可
MIT
最近更新
2026-11-14
Stars
★ 3
Forks
0

01 前言 Front Matter

name
nx-run-tasks
description
Helps with running tasks in an Nx workspace. USE WHEN the user wants to execute build, test, lint, serve, or run any other tasks defined in the workspace.

03 SKILL.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)

04 同仓库更多 Skills

whimzyLive
whimzyLive/nightshift-ai

designing-in-patterns

Use when designing, planning or auditing UI against a component library — naming surfaces with the repo's pattern vocabulary, deciding reuse versus extend versus new, exploring compositions, or writing the reuse table (component-plan.md, a spec's `## Reuse`, a UI audit). Carries the design method; the repo's own vocabulary, bundle and board rules come from project-context and the designer override.

★ 3
whimzyLive
whimzyLive/nightshift-ai

typeorm

Use when defining TypeORM entities, writing migrations, or building repository/query-builder code in TypeScript. Covers entity and relation decorators, the Data Mapper pattern, migrations, the query builder, transactions, and multi-database configuration.

★ 3
whimzyLive
whimzyLive/nightshift-ai

hono-api

Use when building or extending REST APIs with Hono + @hono/zod-openapi. Covers schema-first route declaration with createRoute, feature-grouped composable routers, a class-based service layer behind interfaces, the strategy pattern for multi-event webhooks, typed request validation, and auto-generated OpenAPI docs.

★ 3
whimzyLive
whimzyLive/nightshift-ai

electrodb

Use when defining DynamoDB entities, modeling indexes, or writing queries/mutations with the ElectroDB ORM. Covers entity schema, access patterns, CRUD operations, update expressions, and single-table design patterns.

★ 3
whimzyLive
whimzyLive/nightshift-ai

atomic-design

Use when structuring or decomposing any frontend UI into reusable components, regardless of framework. Applies Brad Frost's atomic design methodology — atoms, molecules, organisms, templates, and pages — to guide consistent component hierarchy, naming, and composition decisions.

★ 3
whimzyLive
whimzyLive/nightshift-ai

writing-docs

Use when writing, restructuring, or reviewing any prose documentation — a tutorial, how-to guide, reference page, or explanation/conceptual doc — for a public docs site (e.g. Mintlify MDX, docs/, README material), a getting-started guide, an API/CLI reference page, or a "why we built it this way" conceptual page. Applies the Diátaxis framework (see https://diataxis.fr/) — every document belongs to exactly one of the four quadrants (tutorial / how-to guide / reference / explanation), and mixing quadrants inside one document is the single most common documentation failure. Covers the four-quadrant compass for picking the right form, per-quadrant structure templates, an anti-pattern list for quadrant drift, and generic voice/craft rules — repo-specific voice and target output format (e.g. Mintlify MDX) are resolved from the repo's docs-manifest (falling back to project-context), never hardcoded here.

★ 3