nx-generate
하는 일
이 스킬은 Nx 코드 생성기를 사용해 모노레포에서 새 라이브러리, 앱, 기능의 뼈대를 만듭니다. 작업 공간의 고유한 패턴을 따르는 일관된 새 코드를 원하는 개발자를 위한 것입니다.
사용하는 경우
- ✓Nx 모노레포에 새 라이브러리, 앱, 기능의 뼈대가 필요할 때.
- ✓작업 공간에 반복 작업을 위한 자체 생성기가 있을 때.
- ✓새 코드가 기존 작업 공간의 관례를 따르기를 원할 때.
스킬 링크
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(tooling)/nx-generate/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“팀이 이미 쓰는 생성기를 사용해서, 제 Nx 작업 공간에 새 React 라이브러리를 만들어 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 사용 가능한 생성기를 나열하고, 요청에 맞는 생성기를 고른 뒤, 알맞은 옵션을 주어 실행합니다. 저장소의 관례를 따르므로 외부 플러그인 생성기보다 로컬 작업 공간 생성기를 우선합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
어떤 생성기를 고르나요?
맞는 로컬 작업 공간 생성기가 있으면 그것을 우선합니다. 저장소의 관례에 맞기 때문입니다.
Nx 도구만 쓰나요?
아니요. 플러그인 생성기를 포함해 생성기를 나열하고 실행하는 데 Nx 명령줄을 사용합니다.
모노레포에서 무엇이든 만들 수 있나요?
프로젝트, 라이브러리, 기능처럼 Nx 생성기가 있는 작업이라면 무엇이든 다룰 수 있습니다.
상세 정보
작성자의 원본 설명
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).
인기도
- GitHub 스타
- 7.1k
- 순위
- #13572
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
component-common-domain-detection
7.1k에이전트가 코드베이스의 여러 부분에 반복되는 비즈니스 로직을 찾아, 그것을 어떻게 합칠지 제안하도록 돕습니다.
component-flattening-analysis
7.1k에이전트가 잘못 놓인 코드를 찾고, 복잡한 컴포넌트 폴더 구조를 평평하게 정리해 각 조각이 제자리에 있도록 돕습니다.
component-identification-sizing
7.1k에이전트가 코드베이스의 부품을 파악하고 크기를 재어, 먼저 나눠야 할 모듈을 찾도록 돕습니다.
coupling-analysis
7.1k에이전트가 코드베이스의 부분들이 서로 얼마나 단단히 묶여 있는지 확인하고, 먼저 느슨하게 만들 연결을 알려 주도록 돕습니다.