{"slug": "ai-agents-changed-my-opinion-on-vertical-slices", "title": "AI agents changed my opinion on vertical slices.", "summary": "A developer argues that vertical slice architecture is better suited for AI agent collaboration than traditional layered architecture. Organizing code by features rather than layers reduces coordination overhead and makes ownership boundaries clear for both human developers and AI agents.", "body_md": "For years, I preferred a traditional layered architecture.\n\n```\nControllers/\nServices/\nRepositories/\nDTOs/\nModels/\n```\n\nIt makes navigation straightforward. If I need a repository, I know exactly where to look.\n\nThen I started working with multiple AI agents, and suddenly the optimization target changed. Imagine one agent implementing Shipping while another implements Billing.\n\nWith a layered architecture, they both end up touching controllers, services, repositories, tests, and dependency injection, even though they are working on different features. The implementation of a single feature becomes scattered across the entire project. So does the code review.\n\nThe model that worked better was organizing the code around features instead of layers. Shipping and Billing stop being scattered concepts that have to be reconstructed from several folders. They become visible parts of the project structure.\n\n```\nFeatures/\n├── Shipping/\n│   ├── Controllers/\n│   ├── Services/\n│   ├── Repositories/\n│   └── DTOs/\n│\n└── Billing/\n    ├── Controllers/\n    ├── Services/\n    ├── Repositories/\n    └── DTOs/\n```\n\nNow each agent owns an entire feature, not just a few files spread across the solution. Reviewing changes becomes opening `Features/Shipping`\n\ninstead of searching through controllers, services, repositories, DTOs, dependency injection, and tests in different places.\n\nThe same ownership boundary applies to verification. If the implementation belongs to a feature, the tests that prove it works should be organized by that feature too. Otherwise the review still requires jumping between multiple layers within the test project aswell.\n\n```\nFeatures/\n├── Shipping/\n│   ├── HTTP/\n│   ├── Repository/\n│   └── Unit/\n│\n└── Billing/\n    ├── HTTP/\n    ├── Repository/\n    └── Unit/\n```\n\nEach agent only owns the implementation and everything required to verify it. That keeps the task boundary clear: the agent changes the feature, updates the relevant tests, and leaves the rest of the system alone. Nothing more.\n\nI previously argued that event-driven architectures work well with AI because they make behavior observable. I think this is the architectural equivalent.\n\nVertical slices make ownership immediately observable. You immediately know which agent owns a feature, where to review its changes, and where its tests live.\n\nThe interesting part is that vertical slices were not designed for AI. They were designed to improve cohesion. Agentic development simply exposes the same problems again: Agents need to coordinate with each other just like humans do.\n\nThe less coordination your architecture requires, the better it works for humans and AI alike.", "url": "https://wpnews.pro/news/ai-agents-changed-my-opinion-on-vertical-slices", "canonical_source": "https://dev.to/themassiveone/ai-agents-changed-my-opinion-on-vertical-slices-3k92", "published_at": "2026-07-28 16:38:21+00:00", "updated_at": "2026-07-28 17:04:33.957670+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools"], "entities": [], "alternates": {"html": "https://wpnews.pro/news/ai-agents-changed-my-opinion-on-vertical-slices", "markdown": "https://wpnews.pro/news/ai-agents-changed-my-opinion-on-vertical-slices.md", "text": "https://wpnews.pro/news/ai-agents-changed-my-opinion-on-vertical-slices.txt", "jsonld": "https://wpnews.pro/news/ai-agents-changed-my-opinion-on-vertical-slices.jsonld"}}