nx-import

Import repositories into an Nx workspace while preserving git history and fixing configuration issues.

Updated May 8, 2026
Ready to run
npx skills add https://github.com/AshleyZheng5114/smartsheet-clone-frontend --skill nx-import-ashleyzheng5114
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: nx-import
Source: https://github.com/AshleyZheng5114/smartsheet-clone-frontend/tree/main/smartsheet/.opencode/skills/nx-import
Command: npx skills add https://github.com/AshleyZheng5114/smartsheet-clone-frontend --skill nx-import-ashleyzheng5114

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Merging existing repositories into an Nx monorepo often breaks builds due to missing root dependencies, wrong pnpm workspace globs, incompatible TypeScript settings, and missing ESLint or Jest configuration. This Skill guides the entire nx import process and provides fixes for the common failures that follow. ## Core Features & Use Cases - Import Strategy Selection: Choose between subdirectory-at-a-time imports for monorepo sources and whole-repo imports for single-project repositories, with application vs library detection rules. - Post-Import Troubleshooting: Fix pnpm workspace globs, merge root dependencies and nx.json targetDefaults, resolve project name collisions, and repair TypeScript project references. - Technology-Specific Guidance: Dedicated references for ESLint, Jest, Next.js, Vite (React, Vue, React Router 7, TanStack Start), Gradle, and Turborepo migrations. - Use Case: You need to merge a standalone create-next-app repository and a Vite React app into an existing Nx workspace. The Skill walks you through the import commands, stale file cleanup, tsconfig fixes, and plugin setup until all build, test, and lint targets pass. ## Quick Start Ask the AI to import a source repository into your Nx workspace and resolve any resulting build, lint, or test 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 existing repository into an Nx workspace?▼

Run nx import with the source path and destination directory, choosing subdirectory-at-a-time imports for monorepo sources or whole-repo imports for single-project repositories. Ensure the destination directory is empty and commit any uncommitted changes in the source first.

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 non-monorepo single-project sources, 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 dependencies, devDependencies, targetDefaults, namedInputs, or plugin configurations from the source root. Diff the source and destination package.json and nx.json files, then manually add missing dependencies and merge relevant settings.

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, add composite, emitDeclarationOnly, declarationMap, outDir, and tsBuildInfoFile settings in all imported tsconfigs.

How do I migrate from Turborepo to Nx?▼

Import the Turborepo repository, then merge the config-as-package pattern (@repo/typescript-config, @repo/eslint-config) 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.