Nx : tâches, générateurs et MCP

VérifiéSûr

Guide pour utiliser un monorepo Nx 22.5.3 avec npm : privilégier le serveur MCP Nx, inspecter le graphe, lancer des tâches et générer du code.

Spar Skills Guide Bot
DeveloppementIntermédiaire
3018/10/2026
Claude CodeCursor
#nx#monorepo#mcp#generators#task-runner

Recommandé pour

Notre avis

Guide l'utilisation d'un monorepo Nx 22 via le serveur MCP Nx pour inspecter le graphe de projets, lancer des tâches et générer du code.

Points forts

  • Privilégie le serveur MCP Nx plutôt que des suppositions sur la structure du workspace
  • Couvre l'inspection du graphe, les détails d'un projet et la documentation Nx à jour
  • Décrit un flux complet de génération via nx_generators, schéma puis journal du générateur
  • Permet de consulter les tâches déjà en cours d'exécution dans les terminaux de l'utilisateur

Limites

  • Suppose que le serveur MCP Nx est installé et connecté au client
  • Ne détaille pas les commandes courantes ni la correspondance packages/bibliothèques, renvoyées vers AGENTS.md
  • Figé sur Nx 22.5.3 avec npm, peu adapté aux autres gestionnaires de paquets ou versions
Quand l'utiliser

À utiliser pour toute question ou action sur un workspace Nx : architecture, cibles, générateurs ou tâches en cours.

Quand l'éviter

À éviter sur un dépôt qui n'utilise pas Nx ou lorsque le serveur MCP Nx n'est pas disponible dans l'environnement.

Analyse de sécurité

Sûr
Score qualité88/100

The skill only documents how to use Nx workspace tooling and MCP tools. It does not instruct destructive commands, exfiltration, obfuscation, or disabling safety controls. Running Nx tasks and generators is a normal, legitimate development workflow.

Aucun point d'attention détecté

Exemples

Inspect workspace architecture
Use the Nx MCP server to map out our workspace: which projects exist, how they depend on each other, and whether the project graph reports any config errors.
Scaffold a new library
I need a new shared UI library in this Nx workspace. List the available generators, show me the schema for the right one, then walk me through generating it with minimal options.
Debug a running task
A test task is already running in one of my terminals. Pull its details and output through the Nx MCP tools so we can figure out why it is failing.

name: nx description: Nx workspace commands and guidelines for running tasks, generators, and using Nx MCP tools

Nx

This is an Nx 22.5.3 monorepo using npm. Prefer the Nx MCP server over guessing about the workspace — it reflects the live project graph and config.

Use the MCP server first

  • nx_workspace — understand the project graph / architecture, and surface project-graph or config errors, before answering workspace questions.
  • nx_project_details — inspect a single project's targets and config.
  • nx_docs — fetch up-to-date Nx docs for any configuration/best-practice question instead of assuming.
  • nx_visualize_graph — show task/project dependencies.
  • nx_current_running_tasks_details / nx_current_running_task_output — inspect tasks already running in the user's terminals; rerun with nx run <taskId> so it executes in the same Nx context. Don't offer to rerun a continuous task.

Generators

When scaffolding, drive it through the MCP flow rather than hand-writing files: nx_generators to list, nx_generator_schema for options, then nx_open_generate_ui and read back nx_read_generator_log. Keep options minimal; use nx_available_plugins if no generator fits.

Commands

  • Run anything with nx run <project>[:target]; targets live in each project's project.json (or are inferred from config).
  • The canonical common commands (test / lint / typecheck / build / storybook) and the package↔lib mapping live in the Commands and Libraries sections of AGENTS.md — not duplicated here.
Skills similaires