nx-generate

Generate projects, libraries, and features in Nx monorepos using workspace and plugin generators.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scaffolding new projects, libraries, or features in an Nx monorepo requires knowing which generator exists, what options it accepts, and how to match repo conventions. This Skill guides the AI through discovering, validating, running, and verifying Nx generators so generated code fits the workspace correctly. ## Core Features & Use Cases - Generator Discovery: Lists available plugin and local workspace generators, preferring local workspace generators over external plugins when both could satisfy a request. - Pre-Execution Validation: Fetches generator schemas with --help, reads generator source code, and studies existing repo patterns before running anything. - Safe Execution & Verification: Runs generators with --no-interactive, supports dry-run, formats output, and verifies results with lint, test, and build targets. - Use Case: When asked to "create a new React library for shared UI components", the Skill discovers @nx/react:library or a local equivalent, infers options from existing libraries, generates the code, and confirms it builds and passes tests. ## Quick Start Ask the AI to create a new library or scaffold a feature in your Nx workspace, for example: generate a new React library called shared-ui using the appropriate Nx generator.

Frequently Asked Questions about nx-generate

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

FAQPage Schema
How do I generate a new library in an Nx workspace?

Run nx generate with the appropriate generator, such as nx g @nx/react:library --name=my-lib --no-interactive. First list available generators with npx nx list to find the right plugin, and check the generator's options with --help before running.

How do I find which Nx generators are available in my workspace?

Run npx nx list to see installed plugins, then npx nx list <plugin> to view that plugin's generators. Local workspace generators are typically found in tools/generators or a local plugin directory and should be preferred over external plugin generators.

Should I use a local workspace generator or an external Nx plugin generator?

Prefer the local workspace generator when both could satisfy the request. Local generators are customized for the repo's specific patterns and conventions, producing output that matches the existing codebase more closely.

Why does my Nx generator hang or fail during execution?

Generators hang when prompts wait for input, so always pass --no-interactive. Failures usually come from missing required options, invalid values, or conflicts with existing files; check the schema with --help and retry with corrected options.

When should I not use Nx generators for a task?

Do not use generators for running build, test, or lint targets, or for workspace configuration changes. Generators are for scaffolding code and automated migrations; if no generator exists for the request after checking all available ones, handle the task manually.