Skip to content

Support Nested Layers (Layer Hierarchies) #33

Description

@akhundMurad

Many architectural styles (Clean Architecture, Hexagonal, DDD) use hierarchical layers, not flat ones.

Example:

  • Application
    • UseCases
    • Ports
  • Infrastructure
    • Persistence
    • Messaging

Currently, layers are treated as a flat list, which limits expressiveness and forces workarounds.

This issue proposes allowing layers inside layers, forming a tree instead of a flat structure.

Why this matters

  • Better alignment with real-world architectures
  • More precise dependency rules
  • Cleaner and more readable architecture definitions

Acceptance Criteria

  • Layers can contain sub-layers
  • Dependency rules can target parent or child layers
  • Violations clearly report the full layer path (e.g. application.usecases -> infrastructure.persistence)
  • No breaking changes for existing flat layer definitions

Out of scope

  • Visual layer editors
  • Runtime dependency analysis

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions