The Problem: AI Doesn't Understand Your Project Structure
Here's what happens when you use AI coding tools with traditional Clean Architecture:
You ask Copilot to "add a validation rule to the Create Order endpoint." Copilot looks at the file you're in — maybe CreateOrderCommand.cs in the Application project. It generates code. But the code is wrong because Copilot can't see that the validation should also check a business rule in the Domain project, a permission defined in the Infrastructure project, and an existing query in the Persistence project. Those are in different folders, different projects, different context windows.
You end up playing ping-pong with the AI: "No, also check this..." — "Wait, there's another rule in..." — "The repository interface is actually..." Each round-trip is a context switch. Each context switch is a chance for the AI to hallucinate.
🔑 The Core Insight
AI tools work best when all relevant code is visible within a single context window. VSA puts all feature code in one folder. Traditional architecture scatters it across 5-7 projects. Guess which one produces better AI-generated code?
How VSA Makes AI 10x More Effective
❌ Layered Architecture + AI
- • AI sees 1 of 7 files in context
- • Generated code misses cross-project dependencies
- • Developer must manually assemble context
- • Every prompt needs 5+ files as reference
- • High hallucination rate
✅ VSA + AI
- • AI sees endpoint + handler + DTOs + queries
- • Single file has complete feature context
- • Developer opens 1 file, AI understands everything
- • One prompt = complete feature modification
- • Dramatically lower hallucination rate
A Real Scenario: Adding a Field with AI
Let's walk through a concrete example. You need to add a DiscountCode field to the Create Order feature.
In Layered Architecture (The Painful Way)
- Open
Controllers/OrdersController.cs— tell AI about the endpoint - Open
Application/Orders/CreateOrderCommand.cs— tell AI about the DTO - Open
Application/Orders/CreateOrderHandler.cs— tell AI about the business logic - Open
Domain/Entities/Order.cs— tell AI about the domain model - Open
Infrastructure/Persistence/AppDbContext.cs— tell AI about the EF configuration - Run EF Core migration — another context switch
7 files. 4 projects. 6+ AI prompts. Each prompt is a new context window. Each context window is a chance for the AI to forget what you told it 3 prompts ago. This is why AI-generated code in layered projects is notoriously unreliable.
In Vertical Slice Architecture (The Elegant Way)
- Open
Features/Orders/CreateOrder.cs - Tell AI: "Add a
DiscountCodestring property. Validate it's max 20 chars. Save it to the Order entity. Return it in the response DTO." - AI sees the endpoint, command, handler, and validation — all in one file. Generates correct code in one shot.
1 file. 1 folder. 1 prompt. This is the difference between fighting your AI tools and flowing with them.
The Context Window is Everything
Modern AI coding assistants — GitHub Copilot, Cursor, Claude, ChatGPT — all operate on a context window. They can "see" the file you're editing plus some surrounding context (open tabs, recently viewed files). The quality of their output is directly proportional to the quality and completeness of that context.
VSA maximizes context quality by design:
- Endpoint + Handler + DTOs in one file: The AI sees the HTTP contract, business logic, and data shapes simultaneously. It won't generate a handler that returns a DTO the endpoint can't serialize.
- Validation in the same folder: The AI knows the validation rules exist. It won't generate business logic that bypasses validation.
- EF Core queries inline: The AI sees exactly how data is fetched. It won't hallucinate repository methods that don't exist.
AI-Friendly Means Developer-Friendly
Here's the beautiful symmetry: what makes code AI-friendly is exactly what makes it human-friendly. Maximum cohesion. Minimum scattering. One concept per folder. No abstractions between you and the business logic.
When a new developer joins your team and you say "add a discount code to order creation," they should be able to do it by reading one file. That same principle applies to AI tools. The architecture that's best for humans is also best for machines. VSA delivers both.
Indotalent Products: Built for the AI Era
Every Indotalent product is a single .NET 10 Blazor Server project built with Vertical Slice Architecture. Each feature — 50 to 100 per application — lives in its own folder Features/[FeatureName]/ with its endpoint, MediatR handler, FluentValidation validator, and EF Core queries all in one place.
This means:
- GitHub Copilot generates accurate code because all context is in one file
- Cursor AI understands complete features in a single tab
- ChatGPT & Claude can be given one file as reference and generate correct modifications
- You spend less time debugging AI hallucinations and more time shipping features
Key Takeaways
- VSA keeps all feature code in one folder — the perfect context window for AI tools
- Layered architecture forces AI to work with fragmented context → high hallucination rate
- Adding a field in VSA: 1 file, 1 prompt. In layered: 7 files, 6+ prompts
- AI-friendly architecture = human-friendly architecture = Vertical Slice Architecture
- All 9 Indotalent products are VSA monoliths — ready for AI-assisted customization