lib-layers-move

Guides moving code and symbols between libraries in an Nx monorepo with layered boundaries.

1|Updated Jan 14, 2024
One-click install
npx skills add https://github.com/Eyhenij/rt-tools --skill lib-layers-move-eyhenij
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lib-layers-move
Source: https://github.com/Eyhenij/rt-tools/tree/main/.claude/skills/lib-layers-move
Command: npx skills add https://github.com/Eyhenij/rt-tools --skill lib-layers-move-eyhenij

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Moving code between libraries in a layered monorepo often breaks import boundaries, leaves duplicate copies behind, and silently drops imports — this Skill provides a proven procedure to avoid those failures. ## Core Features & Use Cases - Plan-first relocation: Checks docs/plans/ before choosing a new location so moves align with decisions already recorded. - Dependency-ordered moves: Derives move order from the dependency graph via grep of domain aliases rather than plan lists, avoiding temporary boundary widening. - Placement rules: Maps shared code to the correct lib (libs/common/util, common/platform, common/ui, family core) based on who consumes it. - Post-move verification: Runs nx lint --fix, project-list lint runs, check:layers, check:dupes, and manual route scenario checks. - Use Case: When moving list utilities from one lib to another in an Nx workspace, follow this pattern to pick the right destination, sequence the move, and catch vanished imports across all touched projects. ## Quick Start Ask the AI to move a symbol or domain from one library to another in the monorepo and have it follow the lib-layers move pattern for ordering, boundaries, and verification.

Frequently Asked Questions about lib-layers-move

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

FAQPage Schema
How do I move code between libraries in an Nx monorepo?

Start by grepping docs/plans for prior decisions, then order the move by the dependency graph rather than plan lists. After moving, fix import order with nx lint --fix, lint all touched projects, and run check:layers and check:dupes.

Where should shared code go in a layered monorepo?

Placement depends on consumers: framework-free code used by backend or both frontends goes to libs/common/util, Angular services to common/platform, components to common/ui, and family-wide code to the family core lib.

Why do imports disappear after moving files between libs?

The lint fix script can silently delete import lines instead of rewriting them when an alias breaks. Lint every touched project with nx run-many -t lint --projects=<list>, since building one application never reaches those files.

How do I verify moved routes still work in Angular?

Test the full screen scenario manually: open the panel, close it, and navigate back with the browser. Outlet addresses are assembled at runtime, so linters, builds, and layout checks cannot catch these breaks.

When should I create a new lib instead of moving code into an existing one?

Create a new lib only when no existing lib can see the code. This pattern covers moving code between existing libs; creating or removing a lib itself belongs to the separate lib-layers-new pattern.