nx-generate
Ce qu’il fait
Ce skill utilise les générateurs de code Nx pour créer de nouvelles bibliothèques, applications et fonctionnalités dans un monorepo. Il s'adresse aux développeurs qui veulent un code neuf cohérent, qui suit les modèles propres à leur espace de travail.
Quand l’utiliser
- ✓Quand vous avez besoin d'une nouvelle bibliothèque, application ou fonctionnalité dans un monorepo Nx.
- ✓Quand votre espace de travail dispose de générateurs personnalisés pour une tâche répétée.
- ✓Quand vous voulez que le nouveau code respecte les conventions de l'espace de travail existant.
Lien du skill
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(tooling)/nx-generate/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Peux-tu créer une nouvelle bibliothèque React dans mon espace de travail Nx avec le générateur que mon équipe utilise déjà ?”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'agent liste les générateurs disponibles, choisit celui qui correspond à votre demande et l'exécute avec les bonnes options. Il préfère les générateurs locaux de l'espace de travail aux générateurs de plugins externes, car ils suivent les modèles de votre dépôt.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
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:
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 manda
Questions fréquentes
Quel générateur choisit-il ?
Il privilégie un générateur local de l'espace de travail lorsqu'il convient, car il respecte les conventions du dépôt.
Utilise-t-il seulement l'outil Nx ?
Il utilise la ligne de commande Nx pour lister et exécuter les générateurs, y compris ceux des plugins.
Peut-il créer n'importe quoi dans un monorepo ?
Il fonctionne pour toute tâche pour laquelle un générateur Nx existe, comme des projets, des bibliothèques ou des fonctionnalités.
Détails
Description originale de l’auteur
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).
Popularité
- Étoiles GitHub
- 7.1k
- Position au classement
- #13572
- Licence
- —
- Mis à jour
- 02/11/2026
Commentaires
- …
Autres skills de ce dépôt
component-common-domain-detection
7.1kAide votre agent à repérer les règles métier répétées dans plusieurs parties d'une base de code et à suggérer comment les regrouper.
component-flattening-analysis
7.1kAide votre agent à repérer le code mal placé et à aplatir des structures de dossiers de composants désordonnées, pour que chaque élément se trouve à sa place.
component-identification-sizing
7.1kAide votre agent à cartographier les parties d'une base de code et à mesurer leur taille, pour trouver le module à découper en premier.
coupling-analysis
7.1kAide votre agent à vérifier à quel point les parties d'une base de code dépendent les unes des autres, et quelles liaisons assouplir en premier.
Skills similaires
diffs
394kPermet à votre agent de produire un diff réel et partageable de vos modifications, sous forme de lien ou d'image, plutôt qu'un résumé écrit à la main.
coding-agent
394kAide votre agent à confier une tâche de programmation plus importante à Codex, Claude Code ou OpenCode comme travailleur en arrière-plan, puis à suivre sa progression.
gh-issues
394kAide votre agent à trouver des tickets GitHub, choisir ceux à traiter et ouvrir des pull requests avec des correctifs, y compris le suivi des commentaires de relecture.