nx-import

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

3|Updated May 14, 2026
One-click install
npx skills add https://github.com/jbadeau/fabster --skill nx-import-jbadeau
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nx-import
Source: https://github.com/jbadeau/fabster/tree/main/.opencode/skills/nx-import
Command: npx skills add https://github.com/jbadeau/fabster --skill nx-import-jbadeau

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Moving projects from standalone repositories or other monorepos into an Nx workspace breaks builds, tests, linting, and TypeScript project references in dozens of subtle ways. This Skill guides the nx import process and provides fixes for the common failure modes encountered during monorepo consolidation. ## Core Features & Use Cases - Import Strategy Selection: Choose between subdirectory-at-a-time and whole-repo imports based on whether the source is a monorepo, and detect applications versus libraries to place them in the correct destination directories. - Post-Import Troubleshooting: Fix pnpm workspace globs, missing root dependencies, TypeScript project references, ESLint version conflicts, Jest preset setup, and project name collisions. - Technology-Specific Guides: Apply dedicated references for ESLint, Gradle, Jest, Next.js, Turborepo, and Vite (including React, Vue, React Router 7, and TanStack Start) migrations. - Use Case: You need to merge five standalone React apps (CRA, Next.js, Vite, React Router 7, TanStack Start) into one Nx workspace. The Skill walks you through importing each repo, cleaning stale files, fixing tsconfig settings, and verifying all build, test, and lint targets pass. ## Quick Start Ask the assistant to import a source repository into your Nx workspace and fix any resulting build, test, or lint failures.

Frequently Asked Questions about nx-import

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

FAQPage Schema
How do I import an external repository into an Nx workspace?

Run nx import with the source path and destination directory, such as nx import <source> apps/my-app --source=packages/my-app. For Nx versions before 22.6.0, always pass --no-interactive and specify all flags directly. Ensure the destination directory is empty before importing.

Should I use subdirectory import or whole-repo import with nx import?

Use subdirectory-at-a-time import for monorepo sources so files land at the top level without redundant nested config. Use whole-repo import only for single-project repositories, since importing a monorepo whole creates messy nested nx.json and tsconfig.base.json files.

Why do cross-package imports fail after nx import with pnpm?

nx import adds the imported directory itself to pnpm-workspace.yaml rather than glob patterns for packages within it, causing Cannot find module errors. Replace the entry with proper globs like apps/* and libs/*, then run pnpm install.

Does nx import merge root dependencies and nx.json configuration?

No, nx import does not merge root dependencies, targetDefaults, namedInputs, or plugin configurations from the source repository. You must diff the source and destination package.json and nx.json files and manually add missing dependencies and configuration.

Why does typecheck fail with noEmit errors after importing a non-Nx project?

Plain TypeScript projects use noEmit: true, which is incompatible with Nx project references and triggers TS6310 errors. Remove noEmit, then add composite: true, emitDeclarationOnly: true, declarationMap: true, plus outDir and tsBuildInfoFile settings in all imported tsconfigs.

How do I migrate a Turborepo monorepo to Nx?

Import the Turborepo projects, then merge the @repo/typescript-config and @repo/eslint-config packages into root tsconfig.base.json and eslint.config.mjs if the destination uses shared root configs. Delete turbo.json files, remove turbo and eslint-plugin-turbo dependencies, and validate with nx run-many.