typescript-circular-dependency

Detect and resolve circular dependencies in TypeScript/JavaScript module graphs.

9|2|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/DavidTeju/shared-skills --skill typescript-circular-dependency-davidteju
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-circular-dependency
Source: https://github.com/DavidTeju/shared-skills/tree/main/skills/claudeception/examples/typescript-circular-dependency
Command: npx skills add https://github.com/DavidTeju/shared-skills --skill typescript-circular-dependency-davidteju

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Circular dependencies between modules in TypeScript/JavaScript can cause runtime initialization issues, undefined values, and hard-to-trace errors.

Core Features & Use Cases

  • Detect cycles in a module graph and visualize dependency chains.
  • Suggest robust resolution strategies such as interface extraction, dependency injection, or dynamic imports.
  • Provide guidance for common frameworks and tooling (TS/JS projects, Node, bundlers).

Quick Start

Identify and resolve circular dependencies in your TypeScript/JavaScript projects by running the cycle-detection workflow to visualize cycles and apply fixes.

Frequently Asked Questions about typescript-circular-dependency

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

FAQPage Schema
Why do I get undefined import errors in TypeScript due to circular dependencies?

Circular dependencies in TypeScript cause undefined import errors because modules reference each other before initialization completes. This Skill detects module cycles and recommends fixes like interface extraction or dynamic imports to resolve initialization order issues.

How do I detect and resolve circular imports in a JavaScript project?

You can detect and resolve circular imports by analyzing the module graph to visualize dependency chains. This Skill identifies cycles and suggests robust resolution strategies such as dependency injection, extraction, or dynamic imports.

What is the best way to fix circular dependency issues across Node and bundlers?

The best way to fix circular dependency issues across Node and bundlers is to visualize the dependency chains and apply structural fixes. This Skill guides you through extraction, dependency injection, and dynamic imports for robust resolution.

Can I analyze module initialization order for TS/JS codebases with this tool?

Yes, you can analyze module initialization order for TS/JS codebases. This Skill targets projects with import-order related issues, detecting cycles in the module graph and providing recommended fixes for runtime initialization errors.

How do I refactor TypeScript code to break runtime circular dependency cycles?

To refactor TypeScript code and break circular dependency cycles, this Skill visualizes dependency chains and recommends structural refactoring strategies like interface extraction, dependency injection, or dynamic imports.