devtools-import-boundary

Enforces permitted cross-package import rules within the devtools monorepo scope.

615|491|Updated Jan 4, 2022
One-click install
npx skills add https://github.com/LedgerHQ/ledger-live --skill devtools-import-boundary
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: devtools-import-boundary
Source: https://github.com/LedgerHQ/ledger-live/tree/main/.agents/skills/devtools-import-boundary
Command: npx skills add https://github.com/LedgerHQ/ledger-live --skill devtools-import-boundary

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers working in the devtools scope can accidentally create forbidden cross-package imports that break lazy loading, introduce circular dependencies, and defeat code-splitting between the shell, registry, and tool packages.

Core Features & Use Cases

  • Import Rule Enforcement: Defines exactly which @devtools/* packages may import from each other via an explicit allowlist table.
  • Architecture Rationale: Explains why violations collapse the lazy-load boundary, create circular dependencies, and break the registry's discriminated union typing.
  • Correct Pattern Guidance: Directs shared utilities into standalone libraries outside the @devtools/* scope and routes app state through @devtools/bindings props.
  • Use Case: When adding a new devtools package or refactoring an existing one, check the rules table before adding any @devtools/* import to confirm it is permitted.

Quick Start

Ask the AI to review your changes in the devtools directory and verify that all cross-package imports comply with the devtools import boundary rules.

Frequently Asked Questions about devtools-import-boundary

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

FAQPage Schema
How do I check if an import between devtools packages is allowed?▼

Consult the rules table in the skill: each @devtools/* package has an explicit allowlist of packages it may import. For example, @devtools/shell may import @devtools/transport and @devtools/registry, while tool packages may import nothing from the devtools scope.

Why can't a devtools tool package import the shell or registry?▼

Tool packages are lazy-loaded by the shell through the registry's metadata.loader. If a tool imports the shell or registry directly, the lazy-load boundary collapses, the tool is bundled eagerly, and circular dependencies between tool, shell, and registry become likely.

Where should shared utilities live in the devtools architecture?▼

Shared types and utilities must not live in a tool package. Extract them into a standalone library with no @devtools/* scope, then import that library from whichever packages need it.

How does a devtools tool get access to Ledger Live app state?▼

App state and wiring arrive as props built in @devtools/bindings, which is the single sanctioned bridge to Ledger Live internals. A tool needing more data receives new props rather than adding a new import.

What happens if shell or bindings import a tool package directly?▼

Direct imports bypass the registry's discriminated union, so TypeScript loses narrowing on DevToolsConfig. The dynamic import split point also disappears, defeating code-splitting and forcing the tool into the eager bundle.