nx-import

Import and merge repository code and git history into an Nx workspace.

6|4|Updated Nov 1, 2025
One-click install
npx skills add https://github.com/Montte-erp/montte-nx --skill nx-import-montte-erp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nx-import
Source: https://github.com/Montte-erp/montte-nx/tree/main/.opencode/skills/nx-import
Command: npx skills add https://github.com/Montte-erp/montte-nx --skill nx-import-montte-erp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers and engineering teams import existing repositories into an Nx workspace while preserving commit history and minimizing post-merge friction. It addresses the common pain points of moving projects across repository boundaries including directory conflicts, missing root configuration, and mismatched tooling versions.

Core Features & Use Cases

  • Preserve Git History: Import files and full commit history so authorship and changes are retained.
  • Two Import Strategies: Subdirectory-at-a-time for monorepo sources and whole-repo import for single-project repos, with guidance on when to use each.
  • Post-import Remediations: Practical fixes for pnpm workspace globs, root dependency and nx.json merges, TypeScript project references, executor path adjustments, and plugin detection (ESLint, Jest, Vite, Next, Gradle).
  • Use Case: Consolidate several team repositories into a single Nx monorepo, importing each app or library into apps/ or libs/, resolving dependency and tsconfig mismatches, and registering necessary Nx plugins.

Quick Start

Use the nx-import skill to import a source repository into your workspace by specifying the source path and a destination (for example apps/my-app or libs/my-lib), preserve git history, then update pnpm workspace globs and root dependencies before running nx sync --yes.

Frequently Asked Questions about nx-import

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

FAQPage Schema
How do I import existing repositories into an Nx monorepo while preserving git history?

To import repositories into an Nx monorepo while preserving git history, you move code into apps/ or libs/ directories while retaining full commit authorship. This process requires an empty destination directory to avoid conflicts during the merge.

What is the best way to merge multiple standalone repos into a single Nx workspace?

Merging standalone repos into an Nx workspace is best handled by choosing between a subdirectory-at-a-time strategy for monorepo sources or a whole-repo import for single projects. This approach minimizes post-merge friction by addressing directory conflicts upfront.

How do I update pnpm workspace configuration after importing a repo into Nx?

After importing a repo into Nx, you update pnpm workspace configuration by modifying workspace globs to recognize the new apps/ or libs/ paths. You must also merge root package.json dependencies and run nx sync to ensure project references are correctly registered.

How do I fix tsconfig and executor paths when moving libraries into an Nx monorepo?

Fixing tsconfig and executor paths when moving libraries into an Nx monorepo involves updating TypeScript project references and adjusting build executor configurations. These post-import remediations ensure that newly imported apps and libs resolve correctly within the workspace.

Do I need to register Nx plugins like ESLint and Jest when importing a new app?

Yes, when importing a new app, you need to register Nx plugins like @nx/eslint, @nx/jest, and @nx/vite. The import process includes detecting required tooling and applying practical fixes to ensure plugin configurations match existing workspace standards.

Can I import a subdirectory from a monorepo source instead of the whole repository?

Yes, you can import a subdirectory from a monorepo source instead of the whole repository using the subdirectory-at-a-time strategy. This allows you to selectively move specific libraries or applications into your Nx workspace while still preserving their commit history.