nx-import
Import, merge, or combine repositories into an Nx workspace using nx import.
Skill by nrwl
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/nrwl-nx-import-cd6937
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/nx-import
What's inside
- Skill name
nx-import- Description
- Import, merge, or combine repositories into an Nx workspace using nx import. USE WHEN the user asks to adopt Nx across repos, move projects into a monorepo, or bring code/history from another repository.
- License
- MIT
- Instructions
- 235 lines in SKILL.md · view on GitHub
Files (7)
- SKILL.md
- ESLINT.md · references/
- GRADLE.md · references/
- JEST.md · references/
- NEXT.md · references/
- TURBOREPO.md · references/
- VITE.md · references/
SKILL.md (first lines)
## Quick Start
- `nx import` brings code from a source repository or folder into the current workspace, preserving commit history.
- After nx `22.6.0`, `nx import` responds with .ndjson outputs and follow-up questions. For earlier versions, always run with `--no-interactive` and specify all flags directly.
- Run `nx import --help` for available options.
- Make sure the destination directory is empty before importing.
EXAMPLE: target has `libs/utils` and `libs/models`; source has `libs/ui` and `libs/data-access` — you cannot import `libs/` into `libs/` directly. Import each source library individually.
Primary docs:
- https://nx.dev/docs/guides/adopting-nx/import-project
- https://nx.dev/docs/guides/adopting-nx/preserving-git-histories
Read the nx docs if you have the tools for it.
## Import Strategy
**Subdirectory-at-a-time** (`nx import <source> apps --source=apps`):
- **Recommended for monorepo sources** — files land at top level, no redundant config
- Caveats: multiple import commands (separate merge commits each); dest must not have conflicting directories; root configs (deps, plugins, targetDefaults) not imported
- **Directory conflicts**: Import into alternate-named dir (e.g. `imported-apps/`), then rename
**Whole repo** (`nx import <source> imported --source=.`):
- **Only for non-monorepo sources** (single-project repos)
- For monorepos, creates messy nested config (`imported/nx.json`, `imported/tsconfig.base.json`, etc.)
- If you must: keep imported `tsconfig.base.json` (projects extend it), prefix workspace globs and executor paths
### Directory Conventions
- **Always prefer the destination's existing conventions.** Source uses `libs/`but dest uses `packages/`? Import into `packages/` (`nx import <source> packages/foo --source=libs/foo`).
- If dest has no convention (empty workspace), ask the user.
### Application vs Library Detection
Before importing, identify whether the source is an **application** or a **library**:
- **Applications**: Deployable end products. Common indicators:
- _Frontend_: `next.config.*`, `vite.config.*` with a build entry point, framework-specific app scaffolding (CRA, Angular CLI app, etc.)
- _Backend (Node.js)_: Express/Fastify/NestJS server entrypoint, no `"exports"` field in `package.json`
- _JVM_: Maven `pom.xml` with `<packaging>jar</packaging>` or `<packaging>war</packaging>` and a `main` class; Gradle `application` plugin or `mainClass` setting
- _.NET_: `.csproj`/`.fsproj` with `<OutputType>Exe</OutputType>` or `<OutputType>WinExe</OutputType>`
- _General_: Dockerfile, a runnable entrypoint, no public API surface intended for import by other projects
- **Libraries**: Reusable packages consumed by other projects. Common indicators: `"main"`/`"exports"` in `package.json`, Maven/Gradle packaging as a library jar, .NET `<OutputType>Library</OutputType>`, named exports intended for import by other packages.
**Destination directory rules**:
- Applications → `apps/<name>`. Check workspace globs (e.g. `pnpm-workspace.yaml`, `workspaces` in root `package.json`) for an existing `apps/*` entry.
- If `apps/*` is **not** present, add it before importing: update the workspace glob config and commit (or stage) the change.
- Example: `nx import <source> apps/my-app --source=packages/my-app`
- Libraries → follow the dest's existing convention (`packages/`, `libs/`, etc.).
## Common Issues
### pnpm Workspace Globs (Critical)
`nx import` adds the imported directory itself (e.g. `apps`) to `pnpm-workspace.yaml`, **NOT** glob patterns for packages within it. Cross-package imports will fail with `Cannot find module`.
**Fix**: Replace with proper globs from the source config (e.g. `apps/*`, `libs/shared/*`), then `pnpm install`.
### Root Dependencies and Config Not Imported (Critical)
`nx import` does **NOT** merge from the source's root:
- `dependencies`/`devDependencies` from `package.json`
- `targetDefaults` from `nx.json` (e.g. `"@nx/esbuild:esbuild": { "dependsOn": ["^build"] }` — critical for build ordering)
- `namedInputs` from `nx.json` (e.g. `production` exclusion patterns for test files)
- Plugin configurations from `nx.json`
**Fix**: Diff source and dest `package.json` + `nx.json`. Add missing deps, merge relevant `targetDefaults` and `namedInputs`.
### TypeScript Project References
After import, run `nx sync --yes`. If it reports nothing but typecheck still fails, `nx reset` first, then `nx sync --yes` again.
### Explicit Executor Path Fixups
Inferred targets (via Nx plugins) resolve config relative to project root — no changes needed. Explicit executor targets (e.g. `@nx/esbuild:esbuild`) have workspace-root-relative paths (`main`, `outputPath`, `tsConfig`, `assets`, `sourceRoot`) that must be prefixed with the import destination directory.
### Plugin Detection
- **Whole-repo import**: `nx import` detects and offers to install plugins. Accept them.
- **Subdirectory import**: Plugins NOT auto-detected. Manually add with `npx nx add @nx/PLUGIN`. Check `include`/`exclude` patterns — defaults won't match alternate directories (e.g. `apps-beta/`).
- Run `npx nx reset` after any plugin config changes.
### Redundant Root Files (Whole-Repo Only)
Whole-repo import brings ALL source root files into the dest subdirectory. Clean up:
- `pnpm-lock.yaml` — stale; dest has its own lockfile
- `pnpm-workspace.yaml` — source workspace config; conflicts with dest
- `node_modules/` — stale symlinks pointing to source filesystem
- `.gitignore` — redundant with dest root `.gitignore`
- `nx.json` — source Nx config; dest has its own
- `README.md` — optional; keep or remove
**Don't blindly delete** `tsconfig.base.json` — imported projects may extend it via relative paths.
### Root ESLint Config Missing (Subdirectory Import)
Subdirectory import doesn't bring the source's root `eslint.config.mjs`, but project configs reference `../../eslint.config.mjs`.
**Fix order**:
1. Install ESLint deps first: `pnpm add -wD eslint@^9 @nx/eslint-plugin typescript-eslint` (plus framework-specific plugins)
2. Create root `eslint.config.mjs` (copy from source or create with `@nx/eslint-plugin` base rules)
3. Then `npx nx add @nx/eslint` to register the plugin in `nx.json`
Install `typescript-eslint` explicitly — pnpm's strict hoisting won't auto-resolve this transitive dep of `@nx/eslint-plugin`.
### ESLint Version Pinning (Critical)
**Pin ESLint to v9** (`eslint@^9.0.0`). ESLint 10 breaks `@nx/eslint` and many plugins with cryptic errors like `Cannot read properties of undefined (reading 'version')`.
`@nx/eslint` may peer-depend on ESLint 8, causing the wrong version to resolve. If lint fails with `Cannot read properties of undefined (reading 'allow')`, add `pnpm.overrides`:
```json
{ "pnpm": { "overrides": { "eslint": "^9.0.0" } } }From nrwl/nx-ai-agents-config, MIT.
More from nrwl/nx-ai-agents-config
- 0.629score
nx-workspace
nrwl
Explore and understand Nx workspaces.
SkillAFreshness: A★ 29Claude Code +9 - 0.629score
nx-cloud-cache-investigator
nrwl
Investigate a specific Nx cache miss, artifact download or extraction failure, same-hash non-replay, or suspected unsafe cache replay.
SkillAFreshness: A★ 29Claude Code +9 - 0.629score
nx-cloud-api
nrwl
Query the read-only Nx Cloud Public API for workspace data with `npx nx-cloud api`.
SkillAFreshness: A★ 29Claude Code +9 - 0.624score
nx-cloud-ci-failure-review
nrwl
Review failed Nx Cloud CI pipeline executions and group recurring, evidence-based failure patterns.
SkillAFreshness: A★ 29Claude Code +9 - 0.624score
nx-generate
nrwl
Generate code using nx generators.
SkillAFreshness: A★ 29Claude Code +9 - 0.542score
monitor-ci
nrwl
Monitor Nx Cloud CI pipeline and handle self-healing fixes.
SkillCFreshness: C★ 29Claude Code +9 - 0.475score
nx-run-tasks
nrwl
Helps with running tasks in an Nx workspace.
SkillDFreshness: D★ 29Claude Code +9 - 0.475score
link-workspace-packages
nrwl
Link workspace packages in monorepos (npm, yarn, pnpm, bun).
SkillDFreshness: D★ 29Claude Code +9 - 0.470score
nx-plugins
nrwl
Find and add Nx plugins.
SkillDFreshness: D★ 29Claude Code +9
Signals
- Stars
- 29
- Forks
- 10
- Open issues
- 6
- Last commit (this folder)
- Mar 12, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/nrwl/nx-ai-agents-config
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.365score
nx-import
whimzyLive
Import, merge, or combine repositories into an Nx workspace using nx import.
SkillAFreshness: A★ 3Claude Code +9 - 0.365score
nx-import
storm-software
Import, merge, or combine repositories into an Nx workspace using nx import.
SkillAFreshness: A★ 3Claude Code +9 - 0.365score
nx-import
whimzyLive
Import, merge, or combine repositories into an Nx workspace using nx import.
SkillAFreshness: A★ 3Claude Code +9 - 0.361score
nx-import
storm-software
Import, merge, or combine repositories into an Nx workspace using nx import.
SkillAFreshness: A★ 2Claude Code +9 - 0.288score
nx-import
nrwl
Import, merge, or combine repositories into an Nx workspace using nx import.
SkillDFreshness: D★ 29Claude Code +9 - 0.288score
nx-import
nrwl
Import, merge, or combine repositories into an Nx workspace using nx import.
SkillDFreshness: D★ 29Claude Code +9 - 0.288score
nx-import
nrwl
Import, merge, or combine repositories into an Nx workspace using nx import.
SkillDFreshness: D★ 29Claude Code +9 - 0.246score
nx-import
johnnystefan
Import, merge, or combine repositories into an Nx workspace using nx import.
SkillDFreshness: DClaude Code +9
More from nrwl
- 0.736score

Nx Console
nrwl
The UI for Monorepos, providing visual workflows and enriching your AI Chat with deep insights
PluginAFreshness: A★ 1.4KVS Code +3 - 0.681score
comment-analyzer
nrwl
Subagent "comment-analyzer" from nrwl/nx: Use this agent during PR review to check that a PR's comments and doc-comments are TRUE.
TemplateAFreshness: A★ 29.4KClaude Code - 0.681score
alternative-approach
nrwl
Subagent "alternative-approach" from nrwl/nx: Use this agent during PR review to independently design alternative solutions to the problem a PR solves and…
TemplateAFreshness: A★ 29.4KClaude Code - 0.681score
docs-reviewer
nrwl
Subagent "docs-reviewer" from nrwl/nx: Use this agent during PR review to answer two docs questions about any PR.
TemplateAFreshness: A★ 29.4KClaude Code - 0.681score
performance-analyzer
nrwl
Subagent "performance-analyzer" from nrwl/nx: Use this agent during PR review to analyze the runtime performance of a PR's changes along two axes - (1)…
TemplateAFreshness: A★ 29.4KClaude Code - 0.681score
security-analyzer
nrwl
Subagent "security-analyzer" from nrwl/nx: Use this agent during PR review to hunt injection-class vulnerabilities in a PR's changes - command injection…
TemplateAFreshness: A★ 29.4KClaude Code
Cite this page
nx-import skill. Agent Mart. https://agentmart.dev/skills/nrwl-nx-import-cd6937 (last updated 2026-10-24)