技能 run-nx-generator
🔧

run-nx-generator

安全 🌐 網路存取📁 檔案系統存取⚙️ 外部命令

运行 Nx 生成器进行单体仓库代码生成

在单体仓库中生成代码需要导航复杂的项目结构并选择正确的生成器。此技能优先使用工作区插件生成器用于自定义解决方案,并指导您通过适当的验证步骤运行生成器。

支援: Claude Codex Code(CC)
📊 69 充足
1

下載技能 ZIP

2

在 Claude 中上傳

前往 設定 → 功能 → 技能 → 上傳技能

3

開啟並開始使用

測試它

正在使用「run-nx-generator」。 Generate a new React component called Button in the ui package

預期結果:

  • To generate the Button component, run: nx generate @nx/react:component Button --project=ui --export
  • The generator will create Button.tsx and Button.spec.tsx files
  • After generation, remember to run: nx affected -t test to verify tests pass
  • Format the new files with: npx prettier --write apps/my-app/src/lib/button/*

正在使用「run-nx-generator」。 How do I bump the Maven plugin version in my workspace?

預期結果:

  • Use the workspace-plugin generator for version updates:
  • nx generate @nx/workspace-plugin:bump-maven-version --newVersion 0.0.10 --nxVersion 22.1.0-beta.7
  • This automates all version bumping across your workspace instead of manual file edits

正在使用「run-nx-generator」。 What generators are available for creating a new plugin?

預期結果:

  • For creating a new create-nodes plugin:
  • nx generate @nx/workspace-plugin:create-nodes-plugin --name my-custom-plugin
  • Check workspace-plugin generators first for custom solutions specific to your workspace

安全審計

安全
v4 • 1/17/2026

This is a documentation-only skill providing guidance on running Nx generators. All 29 static findings are false positives: MD5 hashes are content identifiers in metadata, backticks are markdown code formatting, URLs are source references, and the skill contains no executable code, network requests, or external command execution.

2
已掃描檔案
265
分析行數
3
發現項
4
審計總數
審計者: claude 查看審計歷史 →

品質評分

38
架構
100
可維護性
85
內容
21
社群
100
安全
91
規範符合性

你能建構什麼

在单体仓库中生成代码

在 Nx 工作区的多个项目中搭建新功能、库和组件

更新工作区插件

运行自定义工作区插件生成器以维护和更新内部工具及配置

自动化版本迁移

执行迁移生成器以进行版本更新和跨项目的配置更改

試試這些提示

列出生成器
Show me the available Nx generators in this workspace
生成器模式
What options are available for the @nx/workspace-plugin:create-nodes-plugin generator
预览更改
Run a dry-run of the @nx/react:component generator for my new component
运行生成
Generate a new Node.js library called utils in the shared directory

最佳實務

  • 首先检查工作区插件生成器以获取自定义解决方案
  • 使用 --dry-run 标志在应用前预览更改
  • 生成后立即格式化和测试生成的代码

避免

  • 当工作区插件生成器有自定义解决方案时却使用核心生成器
  • 跳过运行生成器前的干运行预览
  • 生成新代码后忘记运行测试

常見問題

支持哪些 Nx 版本?
支持 Nx 16+ 工作区。请检查 nx.json 的版本兼容性。
生成器有什么限制?
生成器可用性取决于已安装的插件。优先使用核心 Nx 和工作区插件。
可以与 CI 流水线集成吗?
可以。在脚本中使用 nx generate,并使用 nx affected -t test,lint,build 进行 CI 验证。
我的数据安全吗?
此技能仅读取生成器文档。不会存储或向外部传输任何数据。
为什么找不到我的生成器?
确保插件已安装并在 nx.json 中列出。使用 mcp__nx-mcp__nx_generators 列出可用的生成器。
这与 nx CLI 相比如何?
此技能提供指导和建议。实际的 nx CLI 命令必须在终端中手动运行。

開發者詳情

檔案結構

📄 SKILL.md