Generate code using Nx generators — scaffold projects, libraries, features, or run workspace-specific generators with proper discovery, validation, and verification. Use when user says "create a new library", "scaffold a component", "generate code with Nx", "run a generator", "nx generate", or any code scaffolding task in a monorepo. Prefers local workspace-plugin generators over external plugins. Do NOT use for running build/test/lint tasks (use nx-run-tasks) or workspace configuration (use nx-workspace).
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionnx-generateExecute the skills CLI command in your project's root directory to begin installation:
Fetches nx-generate from tech-leads-club/agent-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate nx-generate. Access via /nx-generate in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
4.4K
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
4.4K
stars
| name | nx-generate |
| description | Generate code using Nx generators — scaffold projects, libraries, features, or run workspace-specific generators with proper discovery, validation, and verification. Use when user says "create a new library", "scaffold a component", "generate code with Nx", "run a generator", "nx generate", or any code scaffolding task in a monorepo. Prefers local workspace-plugin generators over external plugins. Do NOT use for running build/test/lint tasks (use nx-run-tasks) or workspace configuration (use nx-workspace). |
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:
Use the Nx CLI to discover available generators:
npx nx list @nx/reactnpx nx listThis includes:
@nx/react:library, @nx/js:library)Based on the user's request, identify which generator(s) could fulfill their needs. Consider:
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.
Before running any generator, complete these steps:
Use the --help flag to understand all available options:
npx nx g @nx/react:library --help
Pay attention to:
Understanding what the generator actually does helps you:
To find generator source code:
node -e "console.log(require.resolve('@nx/<plugin>/generators.json'));" to find the generators.json, then locate the source from therenode_modules/<plugin>/generators.jsontools/generators/ or a local plugin directory. You can search the repo for the generator name to find it.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.
Before generating, examine the target area of the codebase:
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.
Ensure all required options have values:
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.
Running with --dry-run first is strongly encouraged but not mandatory. Use your judgment:
Execute the generator with:
nx generate <generator-name> <options> --no-interactive
CRITICAL: Always include --no-interactive to prevent prompts that would hang the execution.
Example:
nx generate @nx/react:library --name=my-utils --no-interactive
If the generator fails:
Common failure reasons:
Generators provide a starting point, but the output may need adjustment to match the user's specific requirements:
Run formatting on all generated/modified files:
nx format --fix
Languages other than javascript/typescript might need other formatting invocations too.
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:
nx lint <new-project>
nx test <new-project>
nx build <new-project>
When verification fails:
If scope is manageable (a few lint errors, minor type issues):
If issues are extensive (many errors, complex problems):
Local generators first - Always prefer workspace/local generators over external plugin generators when both could work
Understand before running - Read both the schema AND the source code to fully understand what will happen
No prompts - Always use --no-interactive to prevent hanging
Generators are starting points - Modify the output as needed to fully satisfy the user's requirements
Verify changes work - Don't just generate; ensure the code builds, lints, and tests pass
Be proactive about fixes - Don't just report errors; attempt to resolve them automatically when possible
Match repo patterns - Study existing similar code in the repo and match its conventions
Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
tech-leads-club/agent-skills
tech-leads-club/agent-skills
tech-leads-club/agent-skills
tech-leads-club/agent-skills
tech-leads-club/agent-skills
tech-leads-club/agent-skills
nx-generate reduced setup friction for our internal harness; good balance of opinion and flexibility.
Useful defaults in nx-generate — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
nx-generate has been reliable in day-to-day use. Documentation quality is above average for community skills.
nx-generate is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Registry listing for nx-generate matched our evaluation — installs cleanly and behaves as described in the markdown.
Useful defaults in nx-generate — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
nx-generate fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
We added nx-generate from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
nx-generate is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Keeps context tight: nx-generate is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 73