Awesome-omni-skills nx-generate
Run Nx Generator workflow skill. Use this skill when the user needs Generate code using Nx generators \u2014 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) and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.
git clone https://github.com/diegosouzapw/awesome-omni-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/nx-generate" ~/.claude/skills/diegosouzapw-awesome-omni-skills-nx-generate && rm -rf "$T"
skills/nx-generate/SKILL.mdRun Nx Generator
Overview
This public intake copy packages
packages/skills-catalog/skills/(tooling)/nx-generate from https://github.com/tech-leads-club/agent-skills into the native Omni Skills editorial shape without hiding its origin.
Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow.
This intake keeps the copied upstream files intact and uses
metadata.json plus ORIGIN.md as the provenance anchor for review.
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
Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: Generator Discovery Flow, Pre-Execution Checklist, Execution, Post-Generation, Error Handling.
When to Use This Skill
Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request.
- Use when the request clearly matches the imported source intent: 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....
- Use when the operator should preserve upstream workflow detail instead of rewriting the process from scratch.
- Use when provenance needs to stay visible in the answer, PR, or review packet.
- Use when copied upstream references, examples, or scripts materially improve the answer.
- Use when the workflow should remain reviewable in the public intake repo before the private enhancer takes over.
Operating Table
| Situation | Start here | Why it matters |
|---|---|---|
| First-time use | | Confirms repository, branch, commit, and imported path before touching the copied workflow |
| Provenance review | | Gives reviewers a plain-language audit trail for the imported source |
| Workflow execution | | Starts with the smallest copied file that materially changes execution |
| Supporting context | | Adds the next most relevant copied source file without loading the entire package |
| Handoff decision | | Helps the operator switch to a stronger native skill when the task drifts |
Workflow
This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow.
- Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task.
- Read the overview and provenance files before loading any copied upstream support files.
- Load only the references, examples, prompts, or scripts that materially change the outcome for the current request.
- Execute the upstream workflow while keeping provenance and source boundaries explicit in the working notes.
- Validate the result against the upstream expectations and the evidence you can point to in the copied files.
- Escalate or hand off to a related skill when the work moves out of this imported workflow's center of gravity.
- Before merge or closure, record what was used, what changed, and what the reviewer still needs to verify.
Imported Workflow Notes
Imported: 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.
Examples
Example 1: Ask for the upstream workflow directly
Use @nx-generate to handle <task>. Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer.
Explanation: This is the safest starting point when the operator needs the imported workflow, but not the entire repository.
Example 2: Ask for a provenance-grounded review
Review @nx-generate against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why.
Explanation: Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection.
Example 3: Narrow the copied support files before execution
Use @nx-generate for <task>. Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding.
Explanation: This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default.
Example 4: Build a reviewer packet
Review @nx-generate using the copied upstream files plus provenance, then summarize any gaps before merge.
Explanation: This is useful when the PR is waiting for human review and you want a repeatable audit packet.
Best Practices
Treat the generated public skill as a reviewable packaging layer around the upstream repository. The goal is to keep provenance explicit and load only the copied source material that materially improves execution.
- 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
Imported Operating Notes
Imported: Key Principles
-
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
to prevent hanging--no-interactive -
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
Troubleshooting
Problem: The operator skipped the imported context and answered too generically
Symptoms: The result ignores the upstream workflow in
packages/skills-catalog/skills/(tooling)/nx-generate, fails to mention provenance, or does not use any copied source files at all.
Solution: Re-open metadata.json, ORIGIN.md, and the most relevant copied upstream files. Load only the files that materially change the answer, then restate the provenance before continuing.
Problem: The imported workflow feels incomplete during review
Symptoms: Reviewers can see the generated
SKILL.md, but they cannot quickly tell which references, examples, or scripts matter for the current task.
Solution: Point at the exact copied references, examples, scripts, or assets that justify the path you took. If the gap is still real, record it in the PR instead of hiding it.
Problem: The task drifted into a different specialization
Symptoms: The imported skill starts in the right place, but the work turns into debugging, architecture, design, security, or release orchestration that a native skill handles better. Solution: Use the related skills section to hand off deliberately. Keep the imported provenance visible so the next skill inherits the right context instead of starting blind.
Related Skills
- Use when the work is better handled by that native specialization after this imported skill establishes context.@accessibility
- Use when the work is better handled by that native specialization after this imported skill establishes context.@ai-cold-outreach
- Use when the work is better handled by that native specialization after this imported skill establishes context.@ai-pricing
- Use when the work is better handled by that native specialization after this imported skill establishes context.@ai-sdr
Additional Resources
Use this support matrix and the linked files below as the operator packet for this imported skill. They should reflect real copied source material, not generic scaffolding.
| Resource family | What it gives the reviewer | Example path |
|---|---|---|
| copied reference notes, guides, or background material from upstream | |
| worked examples or reusable prompts copied from upstream | |
| upstream helper scripts that change execution or validation | |
| routing or delegation notes that are genuinely part of the imported package | |
| supporting assets or schemas copied from the source package | |
Imported Reference Notes
Imported: Pre-Execution Checklist
Before running any generator, complete these steps:
1. Fetch Generator Schema
Use the
--help flag to understand all available options:
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
to find the generators.json, then locate the source from therenode -e "console.log(require.resolve('@nx/<plugin>/generators.json'));" - If that fails, read directly from
node_modules/<plugin>/generators.json - For local generators: They are typically in
or a local plugin directory. You can search the repo for the generator name to find it.tools/generators/
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
Imported: 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.
Running the Generator
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
Handling Generator Failures
If the generator fails:
- Diagnose the error - Read the error message carefully
- Identify the cause - Missing options, invalid values, conflicts, etc.
- Attempt automatic fix - Adjust options or resolve conflicts
- 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
Imported: 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:
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:
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
Imported: 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