flext-import-rules

Enforce strict Python import conventions across FLEXT project files.

Updated May 20, 2025
One-click install
npx skills add https://github.com/flext-sh/flext --skill flext-import-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flext-import-rules
Source: https://github.com/flext-sh/flext/tree/main/.claude/skills/flext-import-rules
Command: npx skills add https://github.com/flext-sh/flext --skill flext-import-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enforces strict import rules within the FLEXT codebase, preventing common Python pitfalls like wildcard imports, relative imports, and outdated typing syntax, ensuring code clarity and maintainability.

Core Features & Use Cases

  • Import Hygiene: Enforces rules against wildcard and relative imports.
  • Modern Typing: Promotes the use of modern Python typing features over legacy typing module constructs.
  • Domain Isolation: Prevents direct imports of underlying libraries (e.g., grpc, ldap3) and enforces the use of FLEXT wrappers.
  • Use Case: When developing a new module within FLEXT, this Skill automatically flags any import statements that violate the established project conventions, guiding developers to write cleaner, more robust code.

Quick Start

Run the flext-import-rules skill to verify all Python files adhere to FLEXT's import guidelines.

Frequently Asked Questions about flext-import-rules

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

FAQPage Schema
How do I enforce Python import conventions and ban wildcard imports in my project?

To enforce Python import conventions, you can use linting rules that ban wildcard and relative imports. This skill automatically flags such violations across your Python files, promoting modern typing syntax and ensuring code clarity and maintainability.

What is the best way to prevent direct imports of third-party libraries like grpc and ldap3 in Python?

Preventing direct third-party imports requires domain isolation rules. This skill enforces domain isolation by flagging direct imports of underlying libraries like grpc and ldap3, guiding developers to use approved project-specific wrappers instead.

Does this import linting tool check Python test files for relative import violations?

No, this import linting tool specifically excludes test files from its checks. It covers Python files within specified projects to enforce strict import guidelines, ensuring that standard source code adheres to conventions without affecting test file structures.

Can I use this tool to promote modern Python typing syntax over legacy typing module constructs?

Yes, you can use this tool to promote modern Python typing syntax. It enforces modern typing features by flagging outdated legacy typing module constructs, automatically guiding developers toward cleaner, more robust code practices.

Why should I enforce strict import rules and domain isolation in a Python codebase?

Enforcing strict import rules and domain isolation prevents common Python pitfalls like wildcard imports and direct third-party library dependencies. This ensures code clarity, maintainability, and robustness by standardizing how modules interact.