nx-generate

Generate applications, libraries, and boilerplate code using Nx workspace generators.

Updated May 8, 2026
Ready to run
npx skills add https://github.com/AshleyZheng5114/smartsheet-clone-frontend --skill nx-generate-ashleyzheng5114
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: nx-generate
Source: https://github.com/AshleyZheng5114/smartsheet-clone-frontend/tree/main/smartsheet/.cursor/skills/nx-generate
Command: npx skills add https://github.com/AshleyZheng5114/smartsheet-clone-frontend --skill nx-generate-ashleyzheng5114

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scaffolding new projects in an Nx monorepo involves many decisions—choosing the right generator, setting correct options, matching existing conventions, and verifying output. This Skill guides the AI through the full generator workflow so generated code lands in the right place and passes verification. ## Core Features & Use Cases - Generator Discovery & Selection: Lists available plugin and local workspace generators, preferring local generators that match repo-specific patterns. - Source-Aware Execution: Reads generator source code and uses --dry-run to confirm file placement before running for real with --no-interactive. - Verification Workflow: Formats generated code and runs build, lint, test, and typecheck targets to confirm the workspace stays healthy. - Use Case: Ask to create a new React library in your monorepo, and the Skill discovers the right generator, checks buildable vs non-buildable conventions, dry-runs the command, generates the library, and verifies it with the workspace's targets. ## Quick Start Use the nx-generate skill to create a new React library called shared-ui in the libs directory of my Nx workspace.

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 npx nx g @nx/react:library with the appropriate options, always using --no-interactive to avoid prompts. First list available generators with npx nx list, check options with --help, and dry-run the command to verify file placement before executing.

How do I create a new app in an Nx monorepo?▼

Use the application generator for your framework, such as npx nx g @nx/react:app, after discovering available plugins with npx nx list. Examine existing apps in the repo to match naming, test runner, and build tool conventions before generating.

Should an Nx library be buildable or non-buildable?▼

Default to non-buildable libraries for internal monorepo code consumed directly by apps, since the consumer's bundler compiles the source. Choose buildable libraries with --bundler=vite or --bundler=swc when publishing to npm or when stable libs benefit from cache hits.

Why does the Nx --directory flag create files in the wrong location?▼

The --directory flag expects the full path of the generated artifact, not its parent folder. Passing --directory=libs creates files directly under libs, while --directory=libs/my-lib correctly generates the library inside libs/my-lib.

What should I do after running an Nx generator?▼

Format the generated files with nx format --fix, then run verification targets such as build, lint, test, and typecheck across affected projects. If you delete generated test files, either write replacement tests or remove the test target to avoid failing test runs.