One-click install
npx skills add https://github.com/TheCardGoat/lorcana-simulator --skill nx-import-thecardgoat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nx-import
Source: https://github.com/TheCardGoat/lorcana-simulator/tree/main/.opencode/skills/nx-import
Command: npx skills add https://github.com/TheCardGoat/lorcana-simulator --skill nx-import-thecardgoat

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

nx-import helps you migrate codebases into an Nx monorepo by importing repositories or subdirectories while preserving history and setting you up for correct Nx task inference.

Core Features & Use Cases

  • Repository import into Nx workspaces: Bring projects into an existing Nx workspace using nx import while controlling how merge commits and directory placement work.
  • Monorepo-safe structure and naming: Handle common pitfalls like importing libs vs apps into the right destination conventions (e.g., apps/<name> vs packages/<name>).
  • Post-import correctness checks: Address critical gaps that Nx import does not merge automatically (root dependencies, nx.json config like namedInputs/targetDefaults, workspace globs, plugin detection, and TS/ESLint/Jest/Vite/Next nuances).

Quick Start

Use the nx-import skill when you want to adopt Nx in lorcana-simulator by importing another repository or moving projects into the current monorepo without losing commit history.

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 while preserving git history?

Importing a repository into an Nx workspace while preserving git history requires using the nx import command to merge external codebases. This process controls merge commits and directory placement to consolidate projects into your monorepo.

What is the correct directory structure for importing apps and libraries into an Nx monorepo?

Importing apps and libraries into an Nx monorepo requires aligning with destination conventions, placing projects into correct directories like apps/<name> or packages/<name>. Following this structure ensures proper naming conventions and enables correct Nx task inference.

Does nx import automatically merge root configurations like nx.json and dependencies?

No, nx import does not automatically merge root dependencies or nx.json configurations. You must manually address root configs, namedInputs, targetDefaults, workspace globs, and framework-specific tooling like TS, ESLint, Jest, Vite, and Next to ensure inferred targets work properly.

Can I migrate a subdirectory from another repository into my Nx workspace without losing commit history?

Yes, you can migrate a subdirectory from an external repository into your Nx workspace using nx import. This allows you to bring specific projects into an existing workspace while preserving the original commit history and setting up correct Nx task inference.

Why are my inferred Nx targets not working correctly after importing a project?

Inferred Nx targets fail after importing a project when workspace glob configuration is incorrect or framework-specific tooling for TS, ESLint, Jest, Vite, or Next is not properly aligned. Post-import correctness checks are required to fix these configuration gaps.