nx-monorepo
Provides comprehensive Nx monorepo management guidance for TypeScript/JavaScript projects. Use when creating Nx workspaces, generating apps/libraries/components, running affected commands, setting up CI/CD, configuring Module Federation, or implementing NestJS backends within Nx
What this skill does
# Nx Monorepo
## Overview
Provides guidance for Nx monorepo management in TypeScript/JavaScript projects. Covers workspace creation, project generation, task execution, caching strategies, Module Federation, and CI/CD integration.
## When to Use
Use this skill when:
- Creating a new Nx workspace or initializing Nx in an existing project
- Generating applications, libraries, or components with Nx generators
- Running affected commands or executing tasks across multiple projects
- Setting up CI/CD pipelines for Nx projects (GitHub Actions, CircleCI, etc.)
- Configuring Module Federation with React or Next.js
- Implementing NestJS backend applications within Nx
- Managing TypeScript package libraries with buildable and publishable libs
- Setting up remote caching or Nx Cloud
- Optimizing monorepo build times and caching strategies
- Debugging dependency graph issues or circular dependencies
**Trigger phrases:** "create Nx workspace", "Nx monorepo", "generate Nx app", "Nx affected", "Nx CI/CD", "Module Federation Nx", "Nx Cloud"
## Instructions
### Workspace Creation
1. **Create a new workspace with interactive setup:**
```bash
npx create-nx-workspace@latest
```
Follow prompts to select preset (Integrated, Standalone, Package-based) and framework stack.
2. **Initialize Nx in an existing project:**
```bash
nx@latest init
```
3. **Create with specific preset (non-interactive):**
```bash
npx create-nx-workspace@latest my-workspace --preset=react
```
**Verify:** `nx show projects` lists the new workspace projects
### Project Generation
1. **Generate a React application:**
```bash
nx g @nx/react:app my-app
```
2. **Generate a library:**
```bash
# React library
nx g @nx/react:lib my-lib
# TypeScript library
nx g @nx/js:lib my-util
```
**Verify:** `nx show projects` lists the new lib
3. **Generate a component in lib:**
```bash
nx g @nx/react:component my-comp --project=my-lib
```
4. **Generate NestJS backend:**
```bash
nx g @nx/nest:app my-api
```
**Verify:** `nx show projects` lists `my-api` and `nx run my-api:build` succeeds
### Task Execution
1. **Run tasks for affected projects only:**
```bash
nx affected -t lint test build
```
2. **Run tasks across all projects:**
```bash
# Build all projects
nx run-many -t build
# Test specific projects
nx run-many -t test -p=my-app,my-lib
# Test by pattern
nx run-many -t test --projects=*-app
```
3. **Run specific target on single project:**
```bash
nx run my-app:build
```
4. **Visualize dependency graph:**
```bash
nx graph
```
### Project Configuration
Each project has a `project.json` defining targets, executor, and configurations:
```json
{
"name": "my-app",
"projectType": "application",
"sourceRoot": "apps/my-app/src",
"targets": {
"build": {
"executor": "@nx/react:webpack",
"outputs": ["{workspaceRoot}/dist/apps/my-app"],
"configurations": {
"production": {
"optimization": true
}
}
},
"test": {
"executor": "@nx/vite:test"
}
},
"tags": ["type:app", "scope:frontend"]
}
```
### Dependency Management
1. **Set up project dependencies:**
```json
{
"targets": {
"build": {
"dependsOn": [
{ "projects": ["shared-ui"], "target": "build" }
]
}
}
}
```
2. **Use tags for organization:**
```json
{ "tags": ["type:ui", "scope:frontend", "platform:web"] }
```
### Module Federation (Nx 17+)
1. **Generate a remote (micro-frontend):**
```bash
nx g @nx/react:remote checkout --host=dashboard
```
2. **Generate a host:**
```bash
nx g @nx/react:host dashboard
```
### CI/CD Setup
Use affected commands in CI to only build/test changed projects:
```yaml
# .github/workflows/ci.yml
- run: npx nx affected -t lint --parallel
- run: npx nx affected -t test --parallel
- run: npx nx affected -t build --parallel
```
## Examples
### Example 1: Create New React Workspace
**Input:** "Create a new Nx workspace with React and TypeScript"
**Steps:**
```bash
npx create-nx-workspace@latest my-workspace
# Select: Integrated Monorepo → React → Integrated monorepo (Nx Cloud)
```
**Verify:** `cd my-workspace && nx show projects` lists the created app
**Expected Result:** Workspace created with:
- `apps/` directory with React app
- `libs/` directory for shared libraries
- `nx.json` with cache configuration
- CI/CD workflow files ready
### Example 2: Run Tests for Changed Projects
**Input:** "Run tests only for projects affected by recent changes"
**Command:**
```bash
nx affected -t test --base=main~1 --head=main
```
**Expected Result:** Only tests for projects affected by changes between commits are executed, leveraging cached results from previous runs.
### Example 3: Generate and Build a Shared Library
**Input:** "Create a shared UI library and use it in the app"
**Steps:**
```bash
# Generate library
nx g @nx/react:lib shared-ui
# Generate component in library
nx g @nx/react:component button --project=shared-ui
# Import in app (tsconfig paths auto-configured)
import { Button } from '@my-workspace/shared-ui'
```
**Verify:** `nx run shared-ui:build` completes successfully and `nx graph` shows the dependency link to your app
**Expected Result:** Buildable library at `libs/shared-ui` with proper TypeScript path mapping configured.
### Example 4: Set Up Module Federation
**Input:** "Configure Module Federation for micro-frontends"
**Steps:**
```bash
# Create host app
nx g @nx/react:host dashboard
# Add remote to host
nx g @nx/react:remote product-catalog --host=dashboard
# Start dev servers
nx run dashboard:serve
nx run product-catalog:serve
```
**Verify:** Both servers start without errors and `nx graph` shows dashboard → product-catalog remote connection
**Expected Result:** Two separate applications running where product-catalog loads dynamically into dashboard at runtime.
### Example 5: Debug Build Dependencies
**Input:** "Why is my app rebuilding when unrelated lib changes?"
**Diagnosis:**
```bash
# Show project graph
nx graph --focused=my-app
# Check implicit dependencies
nx show project my-app --json | grep implicitDependencies
```
**Solution:** Add explicit dependency configuration or use `namedInputs` in `nx.json` to exclude certain files from triggering builds.
**Verify Fix Worked:** Make a change to the unrelated lib, run `nx affected -t build` — `my-app` should not appear in the affected projects list.
## Best Practices
- **Always use `nx affected` in CI** to only test/build changed projects
- **Organize libs by domain/business capability**, not by technical layer
- **Use tags consistently** (`type:app|lib`, `scope:frontend|backend|shared`)
- **Prevent circular dependencies** by configuring `workspaceLayout` boundaries in `nx.json`
- **Enable remote caching** with Nx Cloud for team productivity
- **Keep project.json simple** - use defaults from `nx.json` when possible
- **Leverage generators** instead of manual file creation for consistency
- **Configure `namedInputs`** to exclude test files from production cache keys
- **Use Module Federation** for independent deployment of micro-frontends
- **Keep workspace generators** in `tools/` for project-specific scaffolding
## Constraints and Warnings
- **Node.js 18.10+** is required for Nx 17+
- **Windows users**: Use WSL or Git Bash for best experience
- **First-time setup** may take longer due to package installation
- **Large monorepos** (50+ projects) should use distributed task execution
- **Module Federation** requires webpack 5+ and specific Nx configuration
- **Some generators** require additional plugins to be installed first
- **Cache location**: Default `~/.nx/cache` can grow large; configure `cacheDirectory` in `nx.json` if needed
- **Circular dependencies** will cause build failures; use `nx graph` to visualize
- **Preset migraRelated in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.