skillfed

nx-import

Bring external codebases into your Nx workspace without losing version control history. This official Nx skill enables AI assistants to orchestrate repository imports and merges, maintaining full commit lineage during the integration process.

nx-import enables you to bring external repositories into your Nx workspace using the `nx import` command. The skill orchestrates the import process while preserving your full commit history. You can import either a whole repository or a specific subdirectory, depending on your project structure. nx-import handles the integration of the external codebase into your monorepo while maintaining all version control lineage.

AI-generated summary based on this skill's SKILL.md

27 7 MIT updated by nrwl

Install

nrwl/nx-ai-agents-config/nx-import · repository language: JavaScript

CLI (skillfed)coming soon
git clone https://github.com/nrwl/nx-ai-agents-config
cp -r nx-ai-agents-config/skills/nx-import ~/.claude/skills/nx-import

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I import a repository into an Nx workspace?

nx-import enables you to bring external repositories into your Nx workspace using the `nx import` command. The skill orchestrates the import process while preserving your full commit history. You can import either a whole repository or a specific subdirectory, depending on your project structure. nx-import handles the integration of the external codebase into your monorepo while maintaining all version control lineage.

What's the difference between importing a subdirectory versus a whole repository with nx-import?

nx-import supports two import strategies. Subdirectory imports are ideal when you want to bring in only a specific part of a source repository—useful for extracting a single library or application. Whole-repo imports integrate an entire external repository into your Nx workspace. The correct strategy depends on your source project type and which portions of the code you need in your monorepo. nx-import helps you determine the right approach for your use case.

How can nx-import help preserve commit history when importing code from another repo?

nx-import is designed to maintain full commit lineage during the import process. When you merge repositories into your Nx workspace, the skill ensures that all historical commits from the source repository are preserved in your monorepo. This allows you to retain the complete development history and attribution for imported code, which is critical for tracking changes and understanding project evolution.

Can nx-import handle importing non-Nx projects like plain npm or pnpm workspaces?

Yes, nx-import supports migrating non-Nx projects into an Nx-managed workspace. Whether your source project is a plain npm workspace, a pnpm workspace, or a standalone project without Nx, the skill can orchestrate the migration. nx-import helps consolidate multiple projects into a monorepo structure and handles the configuration adjustments needed to integrate them into your Nx workspace.

What common issues might arise when importing projects with nx-import, and how are they resolved?

nx-import addresses typical import challenges including dependency conflicts, configuration mismatches, path resolution issues, missing ESLint configs, and Jest preset setup problems. The skill provides troubleshooting guidance for these scenarios. It also helps with application versus library detection during import and handles directory conflicts that may occur when consolidating repositories. nx-import enables you to resolve these issues systematically during the integration process.

How does nx-import help when adopting Nx across multiple repositories?

nx-import facilitates Nx adoption across multiple projects by providing a structured approach to consolidate them into a single monorepo. The skill guides you through importing each repository while maintaining commit history and project integrity. This enables teams to transition from managing separate repositories to a unified Nx-managed workspace, improving code sharing, dependency management, and build orchestration across all projects.

SKILL.md

rendered from the published skill — quoted content, verbatim

Quick Start

  • nx import brings code from a source repository or folder into the current workspace, preserving commit history.
  • After nx 22.6.0, nx import responds with .ndjson outputs and follow-up questions. For earlier versions, always run with --no-interactive and specify all flags directly.
  • Run nx import --help for available options.
  • Make sure the destination directory is empty before importing. EXAMPLE: target has libs/utils and libs/models; source has libs/ui and libs/data-access — you cannot import libs/ into libs/ directly. Import each source library individually.

Primary docs:

  • https://nx.dev/docs/guides/adopting-nx/import-project
  • https://nx.dev/docs/guides/adopting-nx/preserving-git-histories

Read the nx docs if you have the tools for it.

Import Strategy

Subdirectory-at-a-time (nx import <source> apps --source=apps):

  • Recommended for monorepo sources — files land at top level,

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 7 files
skills/nx-import/SKILL.md
skills/nx-import/references/ESLINT.md
skills/nx-import/references/GRADLE.md
skills/nx-import/references/JEST.md
skills/nx-import/references/NEXT.md
skills/nx-import/references/TURBOREPO.md
skills/nx-import/references/VITE.md

Related skills

Tags

monorepo-migration repository-consolidation git-history-preservation workspace-adoption multi-repo-merge project-onboarding legacy-integration nx-initialization config-reconciliation dependency-alignment