Generate code using nx generators. INVOKE IMMEDIATELY when user mentions scaffolding, setup, structure, creating apps/libs, or setting up project structure. Trigger words - scaffold, setup, create a new app, create a new lib, project structure, generate, add a new project. ALWAYS use this BEFORE calling nx_docs or exploring - this skill handles discovery internally.
The `nx-generate` skill is designed to streamline project scaffolding and code generation within Nx-managed monorepos. By leveraging Nx generators, this skill automates repetitive tasks, enforces consistency across the codebase, and reduces boilerplate work. It is especially valuable for developers managing large projects with multiple applications and libraries, ensuring that newly created code follows established patterns and integrates smoothly with existing infrastructure. The skill operates by identifying and executing the appropriate generator based on user intent, handling options, and validating generated artifacts against linting, testing, and build processes.
Key features of the `nx-generate` skill include discovering available generators using the Nx CLI, matching user requests to the correct generator, and providing guidance on generator options and best practices. It emphasizes reading generator source code to fully understand side effects, created files, and configuration changes. The skill also differentiates between buildable and non-buildable libraries, guiding users to choose the appropriate setup based on whether a library is meant for internal consumption or external publishing. It enforces the use of `--no-interactive` to prevent execution from stalling due to prompts.
Typical use cases for `nx-generate` include creating new applications or libraries, scaffolding feature modules or boilerplate code, and executing custom workspace generators. It is particularly suited for developers working in Nx monorepos who need to maintain code quality, consistency, and efficiency. Target users include frontend and backend developers using frameworks like React, TypeScript, or other Nx-supported stacks, as well as DevOps engineers responsible for maintaining scalable project structures and automating repetitive setup tasks.
You can use the Nx CLI commands `npx nx list` to view all plugins and `npx nx list @plugin-name` to see generators for a specific plugin. This includes both workspace-specific and external plugin generators.
Non-buildable libraries are the default and are ideal for internal use consumed directly by apps. Buildable libraries are needed when publishing to npm, sharing across repos, or when caching is important. If unsure, ask the user about their intended use.
It prevents generators from prompting for input, ensuring automation can run uninterrupted.
No. It is critical to read the generator's source code to fully understand created files, side effects, and options not documented in the schema.
Carefully evaluate all available generators before concluding none apply. If still no generator fits the request, you may stop using this skill.
Quick Setup:
.claude/skills/Repository
nrwl/nx-ai-agents-config