nx-generate

Run Nx generators with dry-run verification and validate generated code.

1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/G9000/animaOS-SWARM --skill nx-generate-g9000
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nx-generate
Source: https://github.com/G9000/animaOS-SWARM/tree/main/.agents/skills/nx-generate
Command: npx skills add https://github.com/G9000/animaOS-SWARM --skill nx-generate-g9000

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates discovery, configuration, and execution of Nx generators to scaffold projects and features in monorepos, preventing incorrect file placement, inconsistent patterns, and manual setup mistakes.

Core Features & Use Cases

  • Generator discovery & preference: locate plugin and local workspace generators and prefer local workspace generators customized for the repo.
  • Safe execution workflow: always run generators with --no-interactive and perform a --dry-run first to verify file placement.
  • Source-aware verification and follow-up: read generator source code to understand side effects, match existing repo patterns, modify outputs if needed, and validate with format, lint, test, build, and typecheck targets.
  • Use Case: scaffold a new internal non-buildable library that follows existing naming and structure conventions, or add a feature via a custom workspace generator.

Quick Start

Run an Nx generator in dry-run mode with --no-interactive to verify where files will be created before applying the changes.

Frequently Asked Questions about nx-generate

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

FAQPage Schema
How do I scaffold a new Nx project safely without manual setup mistakes?

To scaffold an Nx project safely, use Nx generators with the --no-interactive and --dry-run flags. This dry-run workflow verifies file placement and configuration before applying changes, preventing incorrect file structure and inconsistent monorepo patterns.

How do I discover and use local workspace generators in an Nx monorepo?

Discovering local workspace generators involves locating plugin and custom generators within the monorepo. You should prefer local workspace generators over plugin defaults to ensure scaffolded code matches existing repo naming and structure conventions.

What's the best way to verify side effects before running Nx generators?

The best way to verify side effects is reading the generator source code and schemas before execution. Running the generator in --dry-run mode then confirms expected file placement and outputs without modifying the workspace.

How do I validate code after generating new libraries or features with Nx?

After generating Nx libraries or features, validate the code by running format, lint, test, build, and typecheck targets. This ensures the scaffolded artifacts integrate correctly and maintain workspace quality standards.

Can I modify the output of Nx generators to match existing repo patterns?

Yes, you can modify generator outputs. By reading the generator source code to understand its logic, you can adjust the generated files post-execution to precisely match existing repo patterns and required structural conventions.

Why should I use --no-interactive when running Nx code generation?

Using --no-interactive during Nx code generation ensures the generator executes without prompting for manual input. This automates the scaffolding process reliably, which is essential for consistent execution in monorepo workflows.