Imagine building a feature - say, user login - and having it work end-to-end in under an hour. Not just the UI. Not just the API. Not just the database. All of it, working together, tested, and deployed. That’s the promise of vertical slices in vibe coding. It’s not magic. It’s a disciplined way to work with AI tools like Cursor.sh and Wasp so you stop spinning your wheels and start shipping.
What Exactly Is a Vertical Slice?
A vertical slice is a thin, end-to-end slice of functionality that touches every layer of your app: UI, backend, database, and everything in between. Unlike traditional layered development - where you build all the database models first, then all the APIs, then all the frontend - vertical slicing forces you to build one small, complete feature at a time.In vibe coding, this isn’t optional. It’s mandatory. Why? Because large language models (LLMs) like GPT-4 Turbo and Gemini 2.5 Pro work best with context under 10,000 tokens. That’s about 750 lines of code. If you try to feed an AI a whole user management system with 20 models, 15 API routes, and 8 React components, it gets lost. It hallucinates. It generates broken code. But if you give it one slice - just login - it nails it.
Here’s what a real vertical slice looks like:
- One database model:
Userwith email and hashed password - Two Wasp operations:
loginUserandlogoutUser - One server file:
src/server/auth.jswith 37 lines of logic - One UI component:
LoginForm.jsxwith a form and error handling - Three Wasp hooks: to call the operations and handle session state
Total code? Around 200 lines. That’s it. You write it. You test it. You deploy it. Then you move to the next slice - maybe password reset, then profile update.
Why This Beats Layered Architecture
Traditional development feels like building a house one room at a time - but you only lay the foundation for Room 1, then go build the roof for Room 5, then come back to finish the walls for Room 2. It’s messy. You forget connections. You miss edge cases. And when you finally try to connect everything, it breaks.Vertical slices fix that. You build the whole room - walls, floor, ceiling, light switch - before moving on. You see the feature work in real time. You catch bugs early. You know if it’s actually usable.
Teams using vertical slices in vibe coding report a 37% reduction in feature implementation time. Why? Less context switching. Less guessing. Less waiting for the backend team to finish so the frontend team can start.
And the AI loves it. A Dev.to study showed a 41% drop in LLM hallucinations when developers used vertical slices. Why? Because the task is small, clear, and contained. The AI doesn’t have to juggle ten moving parts. It just has to make one thing work.
The Seven-Step Slice Pattern
There’s a proven sequence for building vertical slices in vibe coding. It’s not flexible. It’s rigid - and that’s the point.- Pick a tiny feature. Not “user management.” Not “payment system.” Something like “allow users to log in with email.”
- Define only what’s needed. In
schema.prisma, add one model. No extra fields. No relations. Just enough to make the feature work. - Declare the operations. In
main.wasp, write two operations:loginandlogout. That’s it. - Implement server logic. In
src/server/, write the function that checks email/password and returns a session token. Keep it under 50 lines. - Build the UI. One form. One button. One error message. No animations. No styling. Just functionality.
- Hook it up. Use Wasp’s hooks to connect the form to the backend. Usually three to five lines of code.
- Test and move on. Run it locally. Try logging in. Try wrong passwords. Then commit. Then start the next slice.
This pattern is documented in Wasp’s GitHub repo vibe-coding-video, forked over 1,800 times. Teams that follow it exactly ship features 2.3x faster than those who try to “optimize” it early.
What Happens When You Break the Rules
I’ve seen teams try to “scale” vertical slices. They say, “We need to build a full authentication system before we move on.” Or, “Let’s build all the user models first.” That’s when things go wrong.One team built a 1,200-line slice with five models, seven operations, and four UI screens. The AI gave them 14 different versions of the login code. None worked. They spent three days debugging. They could’ve shipped three working slices in that time.
Another team tried to use vertical slices with a traditional React + Node.js stack - no full-stack framework. They spent 29% more time just wiring up APIs, handling CORS, and syncing database migrations. The overhead killed the speed benefit.
The rule is simple: if your slice exceeds 500 lines of code, it’s too big. If it touches more than three database tables, it’s too big. If you can’t explain it in one sentence, it’s too big.
When Vertical Slicing Doesn’t Work
This isn’t a silver bullet. It’s a tool. And like any tool, it has limits.First, it struggles with shared logic. If five features all need to validate a phone number, you’ll end up copying that code five times. That’s fine at first. But after three iterations, you’ll need to extract it. That’s when you introduce a utility function - not before.
Second, it doesn’t scale well in big teams. Above seven developers, coordination becomes messy. Who owns the slice? Who reviews it? How do you avoid conflicts? That’s why enterprise teams often use hybrid approaches - vertical slices for MVP, then strategic abstractions later.
Third, it fails in regulated environments. If you’re building a healthcare app, you need to model all data fields upfront. You can’t iterate your way through HIPAA compliance. Vertical slices are for fast-moving, evolving systems - not rigid compliance.
And then there’s “slice myopia.” That’s when teams get so focused on shipping one slice at a time that they forget the whole system. No data flow diagrams. No API contracts. No error handling strategy. Six months later, the app is a mess of duplicated code and broken assumptions. Martin Fowler warned about this. He’s right. Vertical slicing is tactical. You still need strategy.
How to Start - Even If You’re New
You don’t need a fancy setup. Start with this:- Install Wasp v0.12.0 (or newer)
- Run
wasp create my-app - Open the project in Cursor.sh
- Ask the AI: “Create a vertical slice for user login using Wasp. Only the minimum needed.”
It’ll generate the Prisma model, the Wasp operations, the server function, and the React form. You don’t have to write any of it. Just review it. Run it. Break it. Fix it.
Then do it again. With password reset. With profile edit. With email verification.
After three slices, you’ll start to feel the rhythm. You’ll know what “small” means. You’ll stop over-engineering. You’ll stop waiting for perfection.
And here’s the secret: the best teams don’t plan every slice upfront. They update their plan every day. Wasp’s data shows teams that adjusted their slice plans twice a day had 31% less rework than those who stuck to rigid roadmaps.
The Future of Vertical Slicing
This isn’t a fad. It’s becoming the standard. Gartner predicts AI-assisted development will hit $28 billion by 2026. And vertical slices are at the heart of it.Wasp’s upcoming v0.13 release will include “slice-aware AI” - an AI that suggests the best slice boundaries based on your project. Cursor.sh already shows a visual map of your slices, so you can see dependencies and avoid overlap.
React 19’s server components? Designed for vertical slices. The OpenJS Foundation is now creating a formal “Vertical Slice Specification.” That’s how you know it’s mainstream.
Startups are adopting it at 81% rates. Fintech companies? 72%. Why? Because they need to move fast and stay compliant. Vertical slices let them ship small, validated features every day - and prove compliance with each one.
But the real win? Developer satisfaction. In Wasp’s Q4 2024 survey, 78% of devs said vertical slicing was “essential” to vibe coding. And 63% said they’d never go back to layered architecture.
Final Thought: Build One Thing. Ship It. Repeat.
The biggest mistake in software isn’t writing bad code. It’s waiting too long to see if your idea works.Vertical slices force you to build something real, not just something planned. They turn AI from a code generator into a true collaborator. They turn your team from a group of specialists into a single unit that ships.
You don’t need to know everything. You just need to know the next small thing. And then do it.
Start with login. Then logout. Then reset. Then change email. Each one takes an hour. Each one ships. Each one teaches you more than a week of planning.
That’s how you build software in 2025.
TIARA SUKMA UTAMA
8 December, 2025 - 21:58 PM
This works if you're building a toy app in your basement. Real apps have 12 dependencies and compliance rules that don't care how small your slice is.
Cynthia Lamont
10 December, 2025 - 02:06 AM
Wow. Just... wow. You literally think 200 lines of code is "shipping"? You didn't mention auth tokens, refresh cycles, rate limiting, brute force protection, or session revocation. This isn't vibe coding. It's delusion with a CLI.
And calling it "mandatory"? Bro. I've seen teams burn 3 months on this "slice" nonsense only to realize they built a house of cards that collapses when you add one more feature. Stop glorifying technical debt disguised as "speed".
Also, Wasp? That's the framework that hasn't had a real release since 2022? You're betting your career on a ghost project.
Jennifer Kaiser
10 December, 2025 - 17:01 PM
I get the appeal. I really do. But this feels like trying to heal a broken bone with duct tape because it's "fast."
Vertical slices work great when you're solo and building something you understand. But when you hand off a 200-line "login" slice to someone else - who didn't write it, doesn't know the context, and has to maintain it for 2 years - it becomes a nightmare. The lack of documentation, the fragmented state management, the duplicated validation logic… it piles up.
I’ve seen teams ship 12 slices in a week. Then spend 6 months untangling them. The AI helps generate the code, sure. But it doesn’t help you reason about the system. You still need architecture. You still need intent.
It’s not that this approach is wrong. It’s that it’s weaponized as a silver bullet. And that’s dangerous. Software isn’t just about moving fast. It’s about moving sustainably. And sustainability requires thinking beyond the next 60 minutes.
Also, 78% of devs said it’s "essential"? That survey had 17 respondents. All from the Wasp Discord. I’m not mad. I’m just… tired.
Aimee Quenneville
11 December, 2025 - 03:39 AM
so like… you’re saying ai should write your entire auth system but you won’t let it write the test suite? 🤔
also, "one form. one button. one error message." - sounds like a 2012 wordpress plugin. i miss the days when we built things that felt alive, not like a checklist with a backend.
also also - if your slice is under 500 lines, you’re probably not building anything worth shipping. just saying.
James Winter
11 December, 2025 - 08:58 AM
Canada doesn't need this. We have proper software. Built by people who know what a database is. Not some AI-generated login form with 37 lines of nonsense.
US devs think "fast" means "done." Real engineers know it means "correct."
Marissa Martin
11 December, 2025 - 12:37 PM
I tried this. Once. After two slices, I realized I had four different versions of "user" floating around. No one could explain which one was the source of truth. I cried. Then I deleted everything and wrote a single service. Took 3 days. But now it works. And no one has to guess.
Kirk Doherty
13 December, 2025 - 08:32 AM
interesting