The Architecture Layers Scanner classifies your source files into architectural layers and detects the project's archetype. It runs as part of a normal scan and contributes to your DriftScore. This article is for architects, tech leads, and anyone reasoning about structure at scale.
What it detects
- Architectural layers — the scanner assigns source files to layers (for example presentation, business logic, data access) based on their characteristics.
- Project archetypes — it recognizes common project shapes so the analysis reflects how your kind of project is typically organized.
The result is a layer map of your codebase derived from the files themselves rather than from documentation.
Why it matters
Architecture documents describe intent; code describes reality, and the two drift apart. A layer map built from the actual files shows where that drift has happened — business logic leaking into the presentation layer, data access scattered where it should be centralized. These structural problems make upgrades harder because change ripples across layers that should have been insulated.
Knowing the archetype matters because it sets expectations: the same file in a library and in a web application should be organized differently. For leaders, the layer map is a structural-health signal across the portfolio. For developers, it highlights where boundaries have eroded.
How to act
Scan the project:
vg
Review the layer classification and the detected archetype. Look for files in the wrong layer and for layers that have grown disproportionately. Use the findings to plan refactors that restore clean boundaries before a major upgrade forces changes across tangled layers.
Triage tips
- Treat cross-layer leakage as a refactor target before a big migration.
- Confirm the detected archetype matches your intent; a mismatch signals organizational drift.
- Re-scan after restructuring to verify boundaries improved.
Related
Pair this with the Service Dependencies Scanner and the File Hotspots Scanner. For an interactive, query-driven view of structure, use Vibgrate Graph via vg map, vg hubs, vg areas, and vg oddities, which surface hubs and surprising cross-area links.