nx-import

Import repositories into an Nx workspace while preserving git history.

1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/G9000/animaOS-SWARM --skill nx-import-g9000
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nx-import
Source: https://github.com/G9000/animaOS-SWARM/tree/main/.agents/skills/nx-import
Command: npx skills add https://github.com/G9000/animaOS-SWARM --skill nx-import-g9000

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Importing repositories into an Nx workspace is error-prone and involves many manual fixes: preserving git history, avoiding directory conflicts, merging root dependencies and Nx configuration, updating pnpm workspace globs, and repairing TypeScript, ESLint, and testing setups after import. This Skill documents the recommended strategies, gotchas, and fix order required to reliably adopt Nx across single-project repos and multi-project monorepos.

Core Features & Use Cases

  • Preserve history: Use nx import to bring code and commit history into the destination workspace.
  • Import strategies: Guidance for subdirectory-at-a-time imports vs whole-repo imports and when to use each.
  • Workspace fixes: Steps to repair pnpm workspace globs, merge root package.json and nx.json settings, and resolve dependency version conflicts.
  • Tooling adjustments: Instructions for TypeScript project references (nx sync / nx reset), executor path fixups, and plugin detection/installation for ESLint, Jest, Vite, Next.js, Gradle, and Turborepo migrations.
  • Common gotchas: Advice on stale lockfiles/node_modules, .gitkeep blocking, project name collisions, and frontend tsconfig base settings.

Quick Start

Import the source repository into this workspace with nx import, preserve git history, and then reconcile root dependencies, pnpm workspace globs, and nx.json targetDefaults.

Frequently Asked Questions about nx-import

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

FAQPage Schema
How do I import a repository into an Nx workspace while preserving git history?

Use the nx import command to bring code and commit history into the destination Nx workspace. It handles subdirectory and whole-repo imports while preserving the original directory structure.

What is the best way to merge root dependencies and nx.json settings when adopting Nx across multiple repositories?

The best way to merge root dependencies and nx.json settings is to reconcile them after the import. You must also fix pnpm workspace globs and resolve any dependency version conflicts to ensure the monorepo functions correctly.

How do I fix TypeScript project references and executor paths after moving projects into a monorepo?

To fix TypeScript project references and executor paths after moving projects into a monorepo, use nx sync and nx reset. These commands update the references and repair executor configurations for the newly imported projects.

Can I import a subdirectory from a single-project repo instead of the whole repository?

Yes, you can import a subdirectory from a single-project repo instead of the whole repository. The import strategy offers guidance for subdirectory-at-a-time imports versus whole-repo imports and when to use each approach.

Why does importing a repository into an Nx monorepo break pnpm workspace globs?

Importing a repository into an Nx monorepo breaks pnpm workspace globs because the relative paths change during the move. The Skill provides steps to repair these globs alongside resolving project name collisions and frontend tsconfig base settings.

Does this Nx import process handle plugin detection for ESLint, Jest, and Vite migrations?

Yes, the Nx import process handles plugin detection and installation for ESLint, Jest, Vite, Next.js, Gradle, and Turborepo migrations. It adjusts tooling setups to function correctly within the new workspace environment.