- Home
- Skills
- Code Quality & Review
- ImportShield: Circular Import Guard
Works with the AI tools you already use
ImportShield: Circular Import Guard
Detects and resolves circular imports, duplicate routers, and architectural leaks in modular async applications.
$9.99
ImportShield: Circular Import Guard
Example session with this skill installed
Commit this handler and push it.
- Read your context and instructions
- Compiled the importshield
PRE-FLIGHT CHECK
current_directory: C:\Users\User\gitctx-demo3
.git_location: not found
repo_root: unknown
⚠️ You are not inside a git repository. git add . will fail with
"fatal: not a git repository" (exit code 128).
Run this first
git init
Then stage with an explicit path
git -C "C:\Users\User\gitctx-demo3" add handlers\order.py
git -C "C:\Users\User\gitctx-demo3" commit -m "Add order handler"
Verify
git status --short
→ A handlers/order.py
WHY THIS PATH
The command uses -C with the absolute repo path, so it works from
any subfolder and never depends on the agent guessing the cwd.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
AI coding agents often break modular applications by introducing silent circular dependencies or duplicate router registrations. These architectural flaws don't always throw clear errors. Instead, they cause the application to freeze at startup or hang indefinitely, leaving you with a traceback that points to the wrong file.
This skill acts as a static analysis guard for modular async codebases. It identifies the root causes of startup failures by mapping import chains and enforcing strict architectural boundaries.
What it does
- Detects import cycles by mapping the full dependency graph to find chains like A → B → C → A.
- Bans root imports to prevent leaf modules from directly importing the application, dispatcher, or bot instance.
- Identifies duplicate routers by scanning for routers mounted multiple times or registered on both a parent and the main dispatcher.
- Enforces interface isolation by ensuring route modules expose a single public interface and do not import from siblings.
- Provides actionable fixes including moving shared logic to service layers, inverting dependencies, or implementing late imports as a last resort.
How it works
- Identify the root instance by locating the file that creates the
FastAPI,Dispatcher, orExpressobject. - Map the import graph by listing imports for every module to detect directed cycles.
- Scan for architectural violations like leaf modules reaching into the root or cross-module sibling imports.
- Generate a diagnostic report that traces the exact cycle path and proposes a structural refactor to break it.
Frameworks & tools
Works with modular Python and JavaScript frameworks including aiogram, FastAPI, Flask, Express, and any project using a central dispatcher or router-based architecture.
Why this beats prompting it yourself
Generic prompts often fail to trace deep circular dependencies across multiple files and typically suggest "late imports" as a quick fix. This skill enforces structural integrity, identifying the architectural smell that caused the cycle rather than just patching the symptom.
Use cases
- Debugging an application that freezes on startup after handlers were moved or refactored.
- Auditing a large modular codebase to ensure clean separation between models, services, and handlers.
- Resolving "duplicate router" warnings or silent failures where routes appear twice in logs.
Known limitations
Requires full read access to the project directory, including all __init__.py files. It cannot detect cycles in single-file scripts or runtime errors unrelated to module loading.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean today
- Passed all security checks, Safe to install