typescript-circular-dependency

Detects and resolves circular dependencies in TypeScript/JavaScript module import graphs.

7|1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/abhattacherjee/claudeception --skill typescript-circular-dependency-abhattacherjee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-circular-dependency
Source: https://github.com/abhattacherjee/claudeception/tree/main/examples/typescript-circular-dependency
Command: npx skills add https://github.com/abhattacherjee/claudeception --skill typescript-circular-dependency-abhattacherjee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Circular dependencies between modules can cause runtime initialization errors in TypeScript/JavaScript, even when the code compiles cleanly.

Core Features & Use Cases

  • Detects cycles in module import graphs and highlights problematic patterns.
  • Provides actionable refactoring guidance, including extracting shared interfaces, using dependency injection, and restructuring barrels.
  • Applies to codebases of any size where import order or module initialization order matters.

Quick Start

Run the detection workflow on your TypeScript project to locate circular dependencies and implement the recommended fixes.

Frequently Asked Questions about typescript-circular-dependency

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

FAQPage Schema
Why does my TypeScript code compile cleanly but throw runtime import errors?

Circular dependencies in TypeScript cause runtime import errors when modules reference each other before initialization completes. This Skill analyzes module import graphs to detect initialization order issues that the TypeScript compiler misses.

How do I find circular dependencies in a TypeScript project?

Find circular dependencies by analyzing module import graphs using tools like madge or TypeScript compiler checks. This Skill runs detection workflows to locate cycles and highlight problematic import patterns in your codebase.

How do I fix circular imports caused by barrel files in TypeScript?

Fix barrel file circular imports by extracting shared interfaces, using dependency injection, or restructuring barrels. This Skill provides actionable refactoring guidance to break dependency cycles in interdependent modules.

What is the best way to break circular dependencies between TypeScript services?

Break TypeScript service circular dependencies by extracting shared interfaces, applying dependency injection, or using dynamic imports. This Skill recommends specific patterns and tooling to resolve service-to-service module cycles.

Does madge work for detecting circular dependencies in large TypeScript codebases?

Yes, madge detects circular dependencies in TypeScript codebases of any size where module initialization order matters. This Skill applies cycle detection workflows to projects with interdependent modules and barrel file structures.

When should I use dynamic imports to resolve TypeScript circular dependencies?

Use dynamic imports to resolve TypeScript circular dependencies when static restructuring cannot break the cycle. This Skill guides applying dynamic import strategies and dependency injection when modules require interdependent initialization.