2a-layer-boundary-gate

Detect prohibited imports between Clean Architecture layers using AST analysis.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/AgustinMadygraf/skills --skill 2a-layer-boundary-gate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 2a-layer-boundary-gate
Source: https://github.com/AgustinMadygraf/skills/tree/main/2a-layer-boundary-gate
Command: npx skills add https://github.com/AgustinMadygraf/skills --skill 2a-layer-boundary-gate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires audit_utils, and includes scripts (resource) components.

What problem does it solve?

Enforce layer boundaries in Clean Architecture by validating and preventing forbidden imports between entities, use_cases, gateways, controllers, presenters, and infrastructure.

Core Features & Use Cases

  • AST-based analysis of Python source to detect violations of layer boundaries.
  • Generates or updates docs/todo.md with findings and supports CI integration.
  • Returns a non-zero exit code on critical violations to prompt repair.

Quick Start

Ejecuta el gate para validar las fronteras entre capas en tu repositorio.

Frequently Asked Questions about 2a-layer-boundary-gate

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

FAQPage Schema
How do I enforce Clean Architecture layer boundaries in Python?

The gate performs AST-based import analysis on Python source files to detect prohibited dependencies, such as use_cases importing infrastructure or presenters importing controllers, ensuring your Clean Architecture layers remain decoupled.

How do I prevent use_cases from importing infrastructure in my Python project?

The gate performs AST-based import analysis on Python source files to detect prohibited dependencies, such as use_cases importing infrastructure or presenters importing controllers, ensuring your Clean Architecture layers remain decoupled.

Can I integrate a layer-boundary gate into my CI pipeline to check Python imports?

Yes, the gate supports CI integration by automatically checking Python imports, writing findings to a docs/todo.md report, and returning a non-zero exit code when critical layer-boundary violations are detected.

Does the gate require a specific project structure to analyze Clean Architecture layers?

The gate applies to Python projects organized under Clean Architecture, requiring standard directories for entities, use_cases, gateways, controllers, presenters, and infrastructure to accurately map and validate dependencies.

What is the best way to report layer-boundary violations found during Python import analysis?

The gate generates or updates a docs/todo.md file with detailed findings of prohibited imports, providing a persistent report of layer-boundary violations while returning a non-zero exit code to prompt immediate repair.

Why does my Python gate return a non-zero exit code during layer-boundary checks?

The gate returns a non-zero exit code when it detects critical layer-boundary violations, such as forbidden imports between entities, use_cases, gateways, and infrastructure, to halt pipelines and prompt code repair.