nx-import

Import and merge external repositories into an Nx workspace while preserving git history.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/johnnystefan/test-saas-business --skill nx-import-johnnystefan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nx-import
Source: https://github.com/johnnystefan/test-saas-business/tree/main/.github/skills/nx-import
Command: npx skills add https://github.com/johnnystefan/test-saas-business --skill nx-import-johnnystefan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

nx import handles the complexity of bringing external applications or libraries into an existing Nx monorepo, preserving git history while aligning dependencies, workspace globs, and Nx configuration.

Core Features & Use Cases

  • Guided import strategies: Offers subdirectory-at-a-time and whole-repo workflows with rules for applications versus libraries, directory conventions, and rehydrating Nx plugins.
  • Post-import validation: Highlights fixes for pnpm workspace globs, dependency merging, executor paths, ESLint/Jest/Vite/Next.js configs, and stale files so the imported code integrates cleanly.
  • Risk mitigation tips: Documents common pitfalls like duplicate scripts, typecheck issues, plugin detection, and version conflicts, plus reference links for ESLint and testing deep dives.

Quick Start

Run nx import with the source repository path and target app or lib directory to pull projects in while preserving history and then adjust pnpm globs and Nx configs as needed.

Frequently Asked Questions about nx-import

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I merge an external repository into an existing Nx monorepo without losing git history?

To merge an external repository into an Nx monorepo, use a guided import workflow that pulls projects into target directories while preserving git history. This process aligns dependencies and ensures pnpm workspace globs and Nx naming conventions are respected for clean integration.

How do I import an external app or library into an Nx workspace using pnpm?

Importing an external app or library into an Nx workspace involves moving the project into apps/ or libs/ directories and adjusting pnpm workspace globs. You must merge dependencies and update nx.json settings to ensure the imported code integrates cleanly.

What is the best way to handle directory conflicts and dependency merging when adopting projects into an Nx workspace?

The best way to handle directory conflicts and dependency merging during an Nx workspace adoption is to use a structured import strategy. This approach checks for conflicts, merges dependencies, and cleans up stale files to maintain monorepo integrity.

Can I rehydrate Nx plugins and fix ESLint or Jest configurations after moving a project into a monorepo?

Yes, post-import validation rehydrates Nx plugins and highlights fixes for ESLint, Jest, Vite, and Next.js configurations. This ensures executor paths and testing setups are correctly referenced after moving a project into the monorepo.

What are common pitfalls when importing repositories into an Nx workspace?

Common pitfalls when importing repositories into an Nx workspace include duplicate scripts, typecheck issues, plugin detection failures, and version conflicts. Risk mitigation tips help navigate these challenges and ensure a smooth repository merge.

Does nx-import support both subdirectory-at-a-time and whole-repo workflows?

Yes, nx-import supports both subdirectory-at-a-time and whole-repo workflows. These guided import strategies provide specific rules for applications versus libraries, ensuring directory conventions and Nx configuration requirements are met.