typescript-circular-dependency

Detect circular import dependencies in TypeScript and JavaScript projects.

35|222|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/AlexMikhalev/claude-code-continuous-learning-skill --skill typescript-circular-dependency-alexmikhalev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-circular-dependency
Source: https://github.com/AlexMikhalev/claude-code-continuous-learning-skill/tree/main/examples/typescript-circular-dependency
Command: npx skills add https://github.com/AlexMikhalev/claude-code-continuous-learning-skill --skill typescript-circular-dependency-alexmikhalev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Detect and resolve TypeScript/JavaScript circular import dependencies that cause runtime errors such as "Cannot access ..." or undefined imports.

Core Features & Use Cases

  • Static analysis to identify circular dependencies across modules in TS/JS projects.
  • Guidance and patterns to resolve cycles, including dependency injection and restructuring barrel files.
  • Useful for debugging initialization-order errors in tests and runtime environments.

Quick Start

Run the cycle detector on your TS/JS project to identify cycles and apply recommended refactors to break the dependency graph.

Frequently Asked Questions about typescript-circular-dependency

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

FAQPage Schema
How do I fix undefined imports and circular dependencies in TypeScript?

To fix circular dependencies in TypeScript, use static analysis to identify module cycles and apply refactoring strategies like dependency inversion or restructuring barrel files to resolve initialization order errors.

Why does my JavaScript project have runtime errors like 'Cannot access' during initialization?

Runtime errors like 'Cannot access' in JavaScript are typically caused by circular import dependencies where module initialization order resolves incorrectly, requiring static analysis to detect and refactor the dependency graph.

What is the best way to detect circular imports across a large TypeScript repository?

The best way to detect circular imports across a large TypeScript repository is running a static analysis cycle detector to map module resolution paths and identify dependency cycles.

How do I resolve circular dependencies without breaking my existing module structure?

Resolve circular dependencies by applying dependency injection or restructuring barrel files to invert the dependency graph, allowing modules to maintain their core logic while breaking cyclic import paths.

Can static analysis find circular dependencies in both small and large JavaScript codebases?

Yes, static analysis can detect circular import dependencies in JavaScript projects across both small and large repositories by mapping module resolution paths to find initialization order cycles.

When should I use dependency inversion to break a circular import cycle?

Use dependency inversion to break a circular import cycle when modules mutually depend on each other's initialization order, requiring you to invert the dependency graph so that abstractions prevent runtime undefined imports.