flext-architecture-layers

Enforce flext-core architectural layer boundaries via AST-based import validation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill enforces architectural integrity within the flext-core module, preventing unintended dependencies and ensuring a clean, maintainable codebase.

Core Features & Use Cases

  • Layer Enforcement: Defines and enforces strict dependency rules between architectural layers (L3, L2, L1, L0).
  • Import Validation: Automatically checks for and flags disallowed imports from private flext_core modules in subprojects.
  • Use Case: When developing a new feature in a subproject that interacts with flext-core, this Skill ensures you adhere to the established architectural patterns, preventing technical debt.

Quick Start

Run make check PROJECT=flext-core to verify architecture layer compliance.

Frequently Asked Questions about flext-architecture-layers

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

FAQPage Schema
How do I enforce architectural layer boundaries in Python?

The flext-architecture-layers Skill enforces layer boundaries by utilizing AST-based static analysis to validate import directions, preventing subprojects from importing private modules and ensuring strict L3 -> L2 -> L1 -> L0 layering.

Why does my subproject import a private flext_core module and fail checks?

Subproject imports fail checks when they violate dependency direction contracts by importing private flext_core modules. AST-based static analysis flags these disallowed imports to prevent unintended dependencies and maintain architectural integrity.

What is the best way to prevent unintended dependencies in a layered architecture?

The best way to prevent unintended dependencies in a layered architecture is defining strict dependency rules between layers and automatically validating imports using AST-based static analysis to flag disallowed cross-layer access.

How do I check flext-core architecture layer compliance?

To check flext-core architecture layer compliance, run a command like `make check PROJECT=flext-core` to verify that all subproject imports adhere to the established L3 -> L2 -> L1 -> L0 dependency direction contracts.

Does AST-based static analysis work for validating Python import contracts?

AST-based static analysis works for validating Python import contracts by precisely parsing the abstract syntax tree to detect and flag disallowed imports from private modules before runtime execution.