nx-workspace
できること
このスキルは、Nxのモノレポのワークスペースを設定し、理解する手助けをします。一つのリポジトリで複数のアプリやライブラリを管理し、ビルドを速くしたいリードや開発者向けです。
使う場面
- ✓Nxを設定しているとき、またはモノレポの構造を理解する必要があるとき。
- ✓プロジェクトの境界を設定したり、どのプロジェクトが互いに依存しているかを確認したりしたいとき。
- ✓影響を受けるコマンドやビルドキャッシュで、CIを速くしたいとき。
スキルのリンク
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(tooling)/nx-workspace/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のNxワークスペースがどう構成されているか説明し、CIのビルドを速くする方法を提案してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、プロジェクトを一覧にし、Nxのコマンドで各プロジェクトの完全な解決済みの設定を読み、構造を図解します。そのうえで、境界、キャッシュ、影響を受けるコマンドの変更を提案します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Nx Workspace Management
Quick Start
Exploring workspace: nx show projects and nx show project <name> --json
Running tasks: nx <target> <project> (e.g., nx build my-app)
Affected analysis: nx show projects --affected or nx affected -t <target>
Note: Prefix commands with
npx/pnpx/yarnif nx isn't installed globally.
Core Commands
List and Explore Projects
# List all projects
nx show projects
# Filter by type, pattern, or target
nx show projects --type app
nx show projects --projects "apps/*"
nx show projects --withTarget build
# Find affected projects
nx show projects --affected --base=main
Get Project Information
Critical: Always use nx show project <name> --json for full resolved configuration. Do NOT read project.json directly - it contains only partial configuration.
# Get full configuration
nx show project my-app --json
# Extract targets
nx show project my-app --json | jq '.targets | keys'
Configuration schemas:
- Workspace:
node_modules/nx/schemas/nx-schema.json - Project:
node_modules/nx/schemas/project-schema.json
Run Tasks
# Run specific project
nx build web --configuration=production
# Run affected
nx affected -t test --base=main
# View dependency graph
nx graph
Workspace Architecture
workspace/
├── apps/ # Deployable applications
├── libs/ # Shared libraries
│ ├── shared/ # Shared across scopes
│ └── feature/ # Feature-specific
├── nx.json # Workspace configuration
└── tools/ # Custom executors/generators
Library Types
| Type | Purpose | Example |
|---|---|---|
| feature | Business logic, smart components | feature-auth |
| ui | Presentational components | ui-buttons |
| data-access | API calls, state management | data-access-users |
| util | Pure functions, helpers | util-formatting |
Detailed Resources
Configuration: See reference/configuration.md for:
- nx.json templates and options
- project.json structure
- Module boundary rules
- Remote caching setup
Commands: See reference/commands.md for:
- Complete command reference
- Advanced filtering options
- Common workflows
CI/CD: See reference/ci-cd.md for:
- GitHub Actions configuration
- GitLab CI setup
- Jenkins, Azure Pipelines, CircleCI examples
- Affected commands in pipelines
Best Practices: See reference/best-practices.md for:
- Do's and don'ts
- Complete troubleshooting guide
- Performance optimization
- Migration guides
Common Workflows
"What's in this workspace?"
nx show projects --type app # List applications
nx show projects --type lib # List libraries
"How do I run project X?"
nx show project X --json | jq '.targets | keys'
"What changed?"
nx show projects --affected --base=main
Quick Troubleshooting
- Targets not showing: Use
nx show project <name> --json, not project.json - Affected not working: Ensure git history available (
fetch-depth: 0in CI) - Cache issues: Run
nx reset
For detailed troubleshooting, see reference/best-practices.md.
よくある質問
project.jsonを直接読んではいけないのはなぜですか?
project.jsonには部分的な設定しかなく、完全な設定はNxから得る必要があるからです。
依存関係グラフを表示できますか?
はい。Nxのコマンドでプロジェクトの依存関係グラフを表示できます。
タスクも実行しますか?
タスクの実行は別のスキルの役目ですが、依頼があれば対象を一つ実行できます。
詳細
作者による元の説明
Configure, explore, and optimize Nx monorepo workspaces. Use when setting up Nx, exploring workspace structure, configuring project boundaries, analyzing affected projects, optimizing build caching, or implementing CI/CD with affected commands. Keywords — nx, monorepo, workspace, projects, targets, affected. Do NOT use for running tasks (use nx-run-tasks) or code generation with generators (use nx-generate).
人気
- GitHubのスター
- 7.1k
- ランキング
- #13574
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
component-common-domain-detection
7.1kエージェントが、コードベースのいくつかの部分に繰り返し現れるビジネスロジックを見つけ、それらをどう統合できるかを提案できるよう支援します。
component-flattening-analysis
7.1kエージェントが、迷った位置にあるコードを見つけ、乱雑なコンポーネントのフォルダ構造を平らにし、各部分が正しい場所に収まるよう支援します。
component-identification-sizing
7.1kエージェントが、コードベースの部品を洗い出して大きさを測り、最初に分割すべきモジュールを見つけられるよう支援します。
coupling-analysis
7.1kエージェントが、システムの部分同士がどれほど強く依存し合っているかを確認し、最初にどの結びつきを緩めるべきかを教えられるよう支援します。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。