Agent skill

Nx Generate

by nrwl in nrwl/nx

Generate code using nx generators. An agent skill from nrwl/nx.

MITAuto-check passedDevelopment

Install Nx Generate

skills CLI
$ npx skills add nrwl/nx --skill nx-generate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nrwl/nx nx-generate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nrwl/nx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/nx-generate .claude/skills/nx-generate && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
nx-generate
GitHub stars
29k
Used in
1 other repo
Token cost
~2.2k tokens
SKILL.md length
1,143 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

Generate code using nx generators. An agent skill from nrwl/nx.

  • Works in 10 steps: List Available Generators → Match Generator to User Request → Fetch Generator Schema → …
  • Scaffolding code
  • SKILL.md covers Generator Discovery Flow, Pre-Execution Checklist, Execution and Post-Generation, plus 2 more sections
  • Calls nx, npx and node

What it does

Nx Generate is an agent skill from nrwl/nx. Generate code using nx generators. USE WHEN scaffolding code or transforming existing code - for example creating libraries or applications, or anything else that is boilerplate code or automates repetitive tasks. ALWAYS use this first when generating code with Nx instead of calling MCP tools or running nx generate immediately.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Project scaffolding. It works with Nx. The repository describes itself as: The Monorepo Platform that amplifies both developers and AI agents. Nx optimizes your builds, scales your CI, and fixes failed PRs automatically. Ship in half the time. The licence is MIT.

When your agent uses it

  • Scaffolding code
  • Transforming existing code - for example creating libraries
  • Anything else that is boilerplate code
  • Automates repetitive tasks

Example prompts

  • “/nx-generate”

Requirements

  • Node.js

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. List Available Generators
  2. Match Generator to User Request
  3. Fetch Generator Schema
  4. Read Generator Source Code
  5. Understand Repo Context
  6. Validate Required Options
  7. Modify Generated Code (If Needed)
  8. Format Code
  9. Run Verification
  10. Handle Verification Failures

What it can do on your machine

Read from SKILL.md and the folder at commit 200edc8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • nx
    • npx
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Nx Generate loads about 2.2k tokens when it runs. Until then it costs about 85 tokens; SKILL.md has 1,143 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~85
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nrwl/nx at commit 200edc8, republished under its MIT licence (© nrwl). 1,143 words, ~2,173 tokens.

Download SKILL.mdSave it as .claude/skills/nx-generate/SKILL.md (or your agent's skills folder).
name
nx-generate
description
Generate code using nx generators. USE WHEN scaffolding code or transforming existing code - for example creating libraries or applications, or anything else that is boilerplate code or automates repetitive tasks. ALWAYS use this first when generating code with Nx instead of calling MCP tools or running nx generate immediately.

Run Nx Generator

Nx generators are powerful tools that scaffold projects, make automated code migrations or automate repetitive tasks in a monorepo. They ensure consistency across the codebase and reduce boilerplate work.

This skill applies when the user wants to:

  • Create new projects like libraries or applications
  • Scaffold features or boilerplate code
  • Run workspace-specific or custom generators
  • Do anything else that an nx generator exists for

Generator Discovery Flow

Step 1: List Available Generators

Use the Nx CLI to discover available generators:

  • List all generators for a plugin: npx nx list @nx/react
  • View available plugins: npx nx list

This includes:

  • Plugin generators (e.g., @nx/react:library, @nx/js:library)
  • Local workspace generators (defined in the repo's own plugins)
Step 2: Match Generator to User Request

Based on the user's request, identify which generator(s) could fulfill their needs. Consider:

  • What artifact type they want to create (library, application, etc.)
  • Which framework or technology stack is relevant
  • Whether they mentioned specific generator names

IMPORTANT: When both a local workspace generator and an external plugin generator could satisfy the request, always prefer the local workspace generator. Local generators are customized for the specific repo's patterns and conventions.

It's possible that the user request is something that no Nx generator exists for whatsoever. In this case, you can stop using this skill and try to help the user another way. HOWEVER, the burden of proof for this is high. Before aborting, carefully consider each and every generator that's available. Look into details for any that could be related in any way before making this decision.

Pre-Execution Checklist

Before running any generator, complete these steps:

1. Fetch Generator Schema

Use the --help flag to understand all available options:

bash
npx nx g @nx/react:library --help

Pay attention to:

  • Required options that must be provided
  • Optional options that may be relevant to the user's request
  • Default values that might need to be overridden
2. Read Generator Source Code

Understanding what the generator actually does helps you:

  • Know what files will be created/modified
  • Understand any side effects (updating configs, installing deps, etc.)
  • Identify options that might not be obvious from the schema

To find generator source code:

  • For plugin generators: Use node -e "console.log(require.resolve('@nx/<plugin>/generators.json'));" to find the generators.json, then locate the source from there
  • If that fails, read directly from node_modules/<plugin>/generators.json
  • For local generators: They are typically in tools/generators/ or a local plugin directory. You can search the repo for the generator name to find it.
2.5 Reevaluate if the generator is right

Once you have built up an understanding of what the selected generator does, reconsider: Is this the right generator to service the user request? If not, it's okay to go back to the Generator Discovery Flow and select a different generator before proceeding. If you do, make sure to go through the entire pre-execution checklist once more.

3. Understand Repo Context

Before generating, examine the target area of the codebase:

  • Look at similar existing artifacts (other libraries, applications, etc.)
  • Identify patterns and conventions used in the repo
  • Note naming conventions, file structures, and configuration patterns
  • Try to match these patterns when configuring the generator

For example, if similar libraries are using a specific test runner, build tool or linter, try to match that if possible. If projects or other artifacts are organized with a specific naming convention, try to match it.

4. Validate Required Options

Ensure all required options have values:

  • Map the user's request to generator options
  • Infer values from context where possible
  • Ask the user for any critical missing information

Execution

Keep in mind that you might have to prefix things with npx/pnpx/yarn if the user doesn't have nx installed globally. Many generators will behave differently based on where they are executed. For example, first-party nx library generators use the cwd to determine the directory that the library should be placed in. This is highly important.

Consider Dry-Run (Optional)

Running with --dry-run first is strongly encouraged but not mandatory. Use your judgment:

  • For complex generators or unfamiliar territory: do a dry-run first
  • For simple, well-understood generators: may proceed directly
  • Dry-run shows file names and created/deleted/modified markers, but not content
  • There are cases where a generator does not support dry-run (for example if it had to install an npm package) - in that case --dry-run might fail. Don't be discouraged but simply move on to running the generator for real and iterating from there.
Show full SKILL.md (424 more words)Show less
Running the Generator

Execute the generator with:

bash
nx generate <generator-name> <options> --no-interactive

CRITICAL: Always include --no-interactive to prevent prompts that would hang the execution.

Example:

bash
nx generate @nx/react:library --name=my-utils --no-interactive
Handling Generator Failures

If the generator fails:

  1. Diagnose the error - Read the error message carefully
  2. Identify the cause - Missing options, invalid values, conflicts, etc.
  3. Attempt automatic fix - Adjust options or resolve conflicts
  4. Retry - Run the generator again with corrected options

Common failure reasons:

  • Missing required options
  • Invalid option values
  • Conflicting with existing files
  • Missing dependencies
  • Generator doesn't support certain flag combinations

Post-Generation

1. Modify Generated Code (If Needed)

Generators provide a starting point, but the output may need adjustment to match the user's specific requirements:

  • Add or modify functionality as requested
  • Adjust imports, exports, or configurations
  • Integrate with existing code patterns in the repo
2. Format Code

Run formatting on all generated/modified files:

bash
nx format --fix

Languages other than javascript/typescript might need other formatting invocations too.

3. Run Verification

Verify that the generated code works correctly. What this looks like will vary depending on the type of generator and the targets available. If the generator created a new project, run its targets directly Use your best judgement to determine what needs to be verified.

Example:

bash
nx lint <new-project>
nx test <new-project>
nx build <new-project>
4. Handle Verification Failures

When verification fails:

If scope is manageable (a few lint errors, minor type issues):

  • Fix the issues
  • Re-run verification to confirm

If issues are extensive (many errors, complex problems):

  • Attempt simple, obvious fixes first
  • If still failing, escalate to the user with:
    • Description of what was generated
    • What verification is failing
    • What you've attempted to fix
    • Remaining issues that need user input

Error Handling

Generator Failures
  • Check the error message for specific causes
  • Verify all required options are provided
  • Check for conflicts with existing files
  • Ensure the generator name and options are correct
Missing Options
  • Consult the generator schema for required fields
  • Infer values from context when reasonable
  • Ask the user for values that cannot be inferred

Key Principles

  1. Local generators first - Always prefer workspace/local generators over external plugin generators when both could work

  2. Understand before running - Read both the schema AND the source code to fully understand what will happen

  3. No prompts - Always use --no-interactive to prevent hanging

  4. Generators are starting points - Modify the output as needed to fully satisfy the user's requirements

  5. Verify changes work - Don't just generate; ensure the code builds, lints, and tests pass

  6. Be proactive about fixes - Don't just report errors; attempt to resolve them automatically when possible

  7. Match repo patterns - Study existing similar code in the repo and match its conventions

© nrwl, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .cursor/skills/nx-generate of nrwl/nx.

Open the folder on GitHubat commit 200edc8

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in nrwl/nx, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Nx Generate next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Nx Generate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nx Generate this skillnrwl/nx29k1 repos~2.2kAutomated safety check: PassMIT
Nx Workspace Patternswshobson/agents40k9 repos~547Automated safety check: PassMIT
Frontmcp Setupagentfront/frontmcp146—~5.8kAutomated safety check: PassApache-2.0
Nx Workspacenomcopter/react-mosaic4.8k8 repos~1.9kAutomated safety check: PassCustom licence
Nx Run Tasksnomcopter/react-mosaic4.8k8 repos~613Automated safety check: PassCustom licence
Nx Generatenomcopter/react-mosaic4.8k7 repos~1.9kAutomated safety check: PassCustom licence

Similar skills

  • Nx Workspace Patterns

    wshobson/agents

    Guidance for setting up and tuning Nx monorepos: project boundaries, library types, affected commands, remote caching and moving existing code into Nx.

    40k GitHub starsUsed in 9 repos~547 tokens
    DevelopmentAuto-check passed
  • Frontmcp Setup

    agentfront/frontmcp

    A skill your agent uses when starting, scaffolding, or organizing a FrontMCP project.

    146 GitHub stars~5.8k tokensUpdated today
    DatabasesAuto-check passed
  • Nx Workspace

    nomcopter/react-mosaic

    Explore and understand Nx workspaces. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 8 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Nx Run Tasks

    nomcopter/react-mosaic

    Helps with running tasks in an Nx workspace. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 8 repos~613 tokens
    DevelopmentAuto-check passed
  • Nx Generate

    nomcopter/react-mosaic

    Generate code using nx generators. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 7 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Ponytail

    DavidObando/gsharp

    Forces the laziest solution that actually works, simplest, shortest, most minimal.

    565 GitHub starsUsed in 7 repos~1.7k tokens
    DevelopmentAuto-check passed
  • Monitor CI

    nrwl/nx

    Monitor Nx Cloud CI pipeline and handle self-healing fixes. An agent skill from nrwl/nx.

    29k GitHub starsUsed in 6 repos~4.7k tokens
    Auto-check passed
  • Nx Import

    nrwl/nx

    Import, merge, or combine repositories into an Nx workspace using nx import.

    29k GitHub starsUsed in 6 repos~3.5k tokens
    Auto-check passed
  • Run Nx generators with prioritization for workspace-plugin generators.

    29k GitHub starsUsed in 2 repos~592 tokens
    Auto-check: notes
  • Author or scope a first-party Nx migration. An agent skill from nrwl/nx.

    29k GitHub stars~12k tokensUpdated today
    Auto-check: notes
  • Check modified Nx documentation pages against the astro-docs style guide.

    29k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Sync docs commits from master out to the live docs branches in the nx repo: cherry-picks docs( / feat(nx-dev) commits onto website-<major AND the latest <major.<minor.x release branch.

    29k GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Nx Generate

What does Nx Generate do?

Generate code using nx generators. An agent skill from nrwl/nx. Nx Generate is an agent skill from nrwl/nx. Generate code using nx generators.

When should I use Nx Generate?

Nx Generate fits situations like: scaffolding code; transforming existing code - for example creating libraries; anything else that is boilerplate code; automates repetitive tasks.

How do I install Nx Generate in Claude Code?

Run `npx skills add nrwl/nx --skill nx-generate -a claude-code`. Or copy the skill folder (.cursor/skills/nx-generate in nrwl/nx) into .claude/skills/nx-generate in your project. Claude Code loads it when a task matches its description.

How do I install Nx Generate in Codex?

Run `npx skills add nrwl/nx --skill nx-generate -a codex`. Or copy the skill folder (.cursor/skills/nx-generate in nrwl/nx) into .agents/skills/nx-generate in your project. Codex loads it when a task matches its description.

Can I use Nx Generate in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nrwl/nx --skill nx-generate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/nx-generate, .gemini/skills/nx-generate, .github/skills/nx-generate and .opencode/skills/nx-generate in your project.

What does Nx Generate need to run?

Going by SKILL.md and its folder, Nx Generate needs the command-line tools its instructions call (nx, npx and node). Our summary lists: Node.js.

Does Nx Generate access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Nx Generate safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Nx Generate use?

Nx Generate is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Nx Generate use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Nx Generate?

Skills that share tags, products or a category with Nx Generate: Nx Workspace Patterns (wshobson/agents, 40k stars), Frontmcp Setup (agentfront/frontmcp, 146 stars), Nx Workspace (nomcopter/react-mosaic, 4.8k stars) and Nx Run Tasks (nomcopter/react-mosaic, 4.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Nx Generate?

nrwl (a GitHub organization) maintains it in nrwl/nx, which has 29,401 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 10, 2026.

Source: nrwl/nx on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.