circular-import-safety

Detect and resolve circular Python import cycles with approved wrapper patterns.

1|Updated Mar 5, 2025
One-click install
npx skills add https://github.com/niksavis/burndown-chart --skill circular-import-safety
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: circular-import-safety
Source: https://github.com/niksavis/burndown-chart/tree/main/.github/skills/circular-import-safety
Command: npx skills add https://github.com/niksavis/burndown-chart --skill circular-import-safety

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers detect, diagnose, and safely resolve circular Python import cycles, preventing ImportErrors and ensuring code stability.

Core Features & Use Cases

  • Cycle Detection: Identifies known circular import paths within the codebase.
  • Decision Guidance: Provides a decision tree to determine if lazy imports are necessary or if structural refactoring is a better solution.
  • Pattern Enforcement: Details approved lazy wrapper patterns and explicitly forbids problematic import strategies.
  • Validation Tools: Includes commands to quickly test for import errors and enforce linting rules.
  • Use Case: When encountering an ImportError during application startup or when about to introduce a new import that might create a cycle, use this skill to understand the problem and apply the correct fix.

Quick Start

Run the combined pre-edit safety check to ensure no circular imports exist before making changes.

Frequently Asked Questions about circular-import-safety

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

FAQPage Schema
How do I fix Python circular import errors during application startup?

Fix Python circular imports by identifying known import paths and applying structural refactoring or approved lazy import wrapper patterns to break the cycle and resolve startup ImportErrors safely.

What is the best way to resolve PLC0415 Ruff violations for circular dependencies?

Resolve PLC0415 Ruff violations by running pre-edit safety checks and applying approved lazy import wrapper syntax to restructure the problematic Python import cycles and enforce linting rules.

Should I use lazy imports or refactor my code structure to break a Python import cycle?

Choose between lazy imports and structural refactoring by using a defined decision tree that evaluates the specific circular dependency path to determine the safest protocol for resolving the import cycle.

Can I run a safety check for circular dependencies before modifying my Python codebase?

Run a combined pre-edit safety check using provided validation commands to detect existing circular imports and ensure code stability before introducing new imports or modifying the codebase.

Why does Python throw an ImportError when I introduce a new import that creates a cycle?

Python throws an ImportError during startup because circular dependencies prevent the interpreter from fully loading the required modules, which requires structural fixes or specific lazy wrapper syntax to resolve.