nx-workspace

GitHub

管理 Nx monorepo 工作区,涵盖项目配置、结构探索、影响分析及 CI/CD 集成。用于优化构建缓存和设置项目边界,不包含代码生成或任务执行。

packages/skills-catalog/skills/(tooling)/nx-workspace/SKILL.md tech-leads-club/agent-skills

Trigger Scenarios

配置 Nx monorepo 工作区 分析受影响的项目 优化构建缓存 实现 CI/CD 流程

Install

npx skills add tech-leads-club/agent-skills --skill nx-workspace -g -y
More Options

Non-standard path

npx skills add https://github.com/tech-leads-club/agent-skills/tree/main/packages/skills-catalog/skills/(tooling)/nx-workspace -g -y

Use without installing

npx skills use tech-leads-club/agent-skills@nx-workspace

指定 Agent (Claude Code)

npx skills add tech-leads-club/agent-skills --skill nx-workspace -a claude-code -g -y

安装 repo 全部 skill

npx skills add tech-leads-club/agent-skills --all -g -y

预览 repo 内 skill

npx skills add tech-leads-club/agent-skills --list

SKILL.md

Frontmatter
{
    "name": "nx-workspace",
    "description": "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)."
}

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/yarn if 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: 0 in CI)
  • Cache issues: Run nx reset

For detailed troubleshooting, see reference/best-practices.md.

Version History

  • 39e57ed Current 2026-07-25 05:44

Same Skill Collection

packages/skills-catalog/skills/(architecture)/component-common-domain-detection/SKILL.md
packages/skills-catalog/skills/(architecture)/component-flattening-analysis/SKILL.md
packages/skills-catalog/skills/(architecture)/component-identification-sizing/SKILL.md
packages/skills-catalog/skills/(architecture)/coupling-analysis/SKILL.md
packages/skills-catalog/skills/(architecture)/decomposition-planning-roadmap/SKILL.md
packages/skills-catalog/skills/(architecture)/domain-analysis/SKILL.md
packages/skills-catalog/skills/(architecture)/domain-identification-grouping/SKILL.md
packages/skills-catalog/skills/(architecture)/legacy-migration-planner/SKILL.md
packages/skills-catalog/skills/(architecture)/react-composition-patterns/SKILL.md
packages/skills-catalog/skills/(cloud)/cloudflare-deploy/SKILL.md
packages/skills-catalog/skills/(cloud)/netlify-deploy/SKILL.md
packages/skills-catalog/skills/(cloud)/render-deploy/SKILL.md
packages/skills-catalog/skills/(cloud)/vercel-deploy/SKILL.md
packages/skills-catalog/skills/(creation)/create-rfc/SKILL.md
packages/skills-catalog/skills/(creation)/create-technical-design-doc/SKILL.md
packages/skills-catalog/skills/(creation)/cursor-subagent-creator/SKILL.md
packages/skills-catalog/skills/(creation)/subagent-creator/SKILL.md
packages/skills-catalog/skills/(decision-making)/the-fool/SKILL.md
packages/skills-catalog/skills/(design)/figma-implement-design/SKILL.md
packages/skills-catalog/skills/(design)/figma/SKILL.md
packages/skills-catalog/skills/(design)/frontend-design/SKILL.md
packages/skills-catalog/skills/(design)/web-design-guidelines/SKILL.md
packages/skills-catalog/skills/(development)/coding-guidelines/SKILL.md
packages/skills-catalog/skills/(development)/confluence-assistant/SKILL.md
packages/skills-catalog/skills/(development)/docs-writer/SKILL.md
packages/skills-catalog/skills/(development)/gh-address-comments/SKILL.md
packages/skills-catalog/skills/(development)/jira-assistant/SKILL.md
packages/skills-catalog/skills/(gtm)/ai-ugc-ads/SKILL.md
packages/skills-catalog/skills/(gtm)/expansion-retention/SKILL.md
packages/skills-catalog/skills/(learning)/learning-opportunities/SKILL.md
packages/skills-catalog/skills/(monitoring)/sentry/SKILL.md
packages/skills-catalog/skills/(performance)/core-web-vitals/SKILL.md
packages/skills-catalog/skills/(performance)/perf-astro/SKILL.md
packages/skills-catalog/skills/(performance)/perf-lighthouse/SKILL.md
packages/skills-catalog/skills/(performance)/perf-web-optimization/SKILL.md
packages/skills-catalog/skills/(quality)/react-best-practices/SKILL.md
packages/skills-catalog/skills/(quality)/seo/SKILL.md
packages/skills-catalog/skills/(quality)/web-accessibility/SKILL.md
packages/skills-catalog/skills/(quality)/web-best-practices/SKILL.md
packages/skills-catalog/skills/(quality)/web-quality-audit/SKILL.md
packages/skills-catalog/skills/(security)/security-best-practices/SKILL.md
packages/skills-catalog/skills/(security)/security-threat-model/SKILL.md
packages/skills-catalog/skills/(tooling)/chrome-devtools/SKILL.md
packages/skills-catalog/skills/(tooling)/gh-fix-ci/SKILL.md
packages/skills-catalog/skills/(tooling)/nx-ci-monitor/SKILL.md
packages/skills-catalog/skills/(tooling)/nx-run-tasks/SKILL.md
packages/skills-catalog/skills/(web-automation)/playwright-skill/SKILL.md
packages/skills-catalog/skills/(architecture)/evolutionary-modular-architecture/SKILL.md
packages/skills-catalog/skills/(architecture)/frontend-blueprint/SKILL.md

Metadata

Files
0
Version
fe318be
Hash
b9f3832f
Indexed
2026-07-25 05:44

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 07:16
浙ICP备14020137号-1 $mapa de visitantes$