⚡ Perfect for Vibe Coding — Skip weeks of setup. Browse 100+ production-ready boilerplates.

Browse boilerplates →

Choose Your Stack Before You Prompt

James Park
11 min read 2,199 words

Coding agents do not refuse ambiguous stack questions. They answer them, confidently, and differently each session. If you have not decided your database, auth provider, and payment processor before the first prompt, the agent decides for you incrementally, and you find out three weeks later in the form of an inconsistency you have to unwind. Stack choice is a founder decision, not a generation artifact.

The failure mode this article prevents

You know the repo when you see it. Prisma in one folder and hand-written SQL in another, because two sessions three days apart disagreed about the right level of abstraction. Two date libraries. A getCurrentUser in lib/auth.ts and a nearly identical requireSession in server/session.ts, both used, neither deleted. Nothing here is broken. Everything here is now twice as expensive to change.

The mechanism is not a model failure. Each session starts without memory of what you decided last week and reconstructs your conventions from whatever files it happens to read. Ask for a new endpoint and it reads two nearby ones. If those disagree, it picks one. If it reads neither, it invents a third. The agent is not being inconsistent, it is being locally consistent with an unrepresentative sample.

The fix is not better prompting. Decisions get written down once and enforced, not re-answered per prompt.

Why agents amplify stack mistakes

Agents are pattern-matchers over public code, so a stack with a large body of well-written public code behind it gets noticeably better output. The model has seen thousands of correct Next.js route handlers and a handful of examples for whatever shipped six months ago. Boring is not a moral position here, it is a throughput one: the conventional stack produces code that needs less correction, and you feel the difference within a day.

The cost of a wrong choice also changed shape. Picking the wrong framework used to cost the rewrite of code you had written, bounded by how fast you type. Now it costs the rewrite of everything the agent generated on top of it. Sixty files of consistent, working, well-tested code built on the wrong database abstraction is worse than six files of the same.

The corollary annoys people and is still true: obscure or brand-new tools are worse with agents than they were without them. Adopting something new used to mean reading docs and being slightly slower. Now it means the agent hallucinates an API that does not exist, you correct it, and it hallucinates the same API next session because the correction lived in a conversation that is gone. That gap closes as training data catches up, on a schedule you do not control.

The decision order that matters

1. Runtime and framework

This is the least reversible choice you will make and should therefore be the most conventional one available. Next.js on Node remains the default for SaaS, and the plain reason is worth saying out loud: it has the most public code, the most maintained boilerplates, the widest deployment support, and the largest population of solved edge cases. That is not a claim about which framework is best designed, it is a claim about which one your tooling knows best.

If you have landed on Next.js, the kit shortlist is in the best Next.js boilerplates for 2026. Decide the framework first, then look at kits, not the other way around.

2. Database and ORM

Treat these as one decision. The ORM constrains your hosting options, your connection pooling story, and your migration workflow, so choosing Postgres and then choosing a query layer independently lands you on a combination nobody runs and no agent has good examples of. Pick a pair that is commonly deployed together and let it select your hosting rather than the reverse.

The full argument is in the SaaS database decision guide. What matters here is only that the decision happens before you prompt, because data access is the most copied pattern in a codebase and the agent replicates whatever it finds first.

3. Auth

Auth is where "just let the agent build it" is most dangerous. Generated auth code is usually structurally fine and subtly wrong: the session cookie is missing a flag, the reset token does not expire, the OAuth state parameter is unvalidated, the middleware protects the page but not the API route underneath it. None of that surfaces in testing, because testing auth means being one logged-in user, the case that always works.

Decide auth before the first prompt, and decide it as a product question rather than a library question, since it determines your tenancy model, your invite flow, and half your permission checks. The SaaS auth decision guide covers hosted providers against self-managed sessions.

4. Payments

The payments decision is mostly not about API quality. The major processors all have workable APIs and the integration effort is roughly the same. What differs is whether the provider acts as merchant of record, which determines whether you or they collect and remit sales tax and VAT across jurisdictions. That is a compliance decision with ongoing cost, and it is unpleasant to change once you have live subscriptions, because migrating between processors means migrating payment methods you do not hold. The SaaS payments decision guide works through where each model stops making sense.

5. Everything else

Email, file storage, background jobs, analytics. These sit behind small interfaces and replacing one is an afternoon at any point in the project's life. Do not let them consume decision energy before you have written anything. Pick whatever your kit integrates, ship, and revisit when something hurts. The instinct to research all of these carefully at the start is procrastination wearing the costume of diligence.

The one-pattern rule

Take one constraint from this article: one blessed pattern per concern. One way to fetch data. One error shape from every handler. One form library. One validation approach. One place where authorization is checked. Not the best pattern, the only pattern.

Encode it in the agent instruction file rather than a wiki nobody loads. State the rule and point at a file that demonstrates it, because a reference to real working code in your repo beats a description of what you want. The AGENTS.md template has the structure, and the AGENTS.md generator will draft it from your stack.

Consistency beats optimality here by a wide margin. A slightly worse pattern used in every file is cheaper than two good patterns used in half the files each, because the cost you are managing is comprehension, not execution. Every additional pattern is another thing to hold in your head while reviewing and another thing the agent can pick wrong. Two good options is not twice as flexible, it is a permanent tax.

How a boilerplate collapses this decision

The honest framing of buying a kit is that you are buying someone else's stack decisions, already made, already integrated, and already consistent with each other. That last part is undervalued. The individual choices in a good kit are rarely surprising, but they have been wired together and debugged as a set, which is different from a list of tools you agree with.

The trade is real. You give up freedom. You will inherit a data-fetching convention you would not have chosen and a directory structure that is not how you would organize it. What you should notice is that the freedom you are giving up is mostly the freedom to get it wrong. That freedom feels much more valuable before you have spent a week reconciling two ORMs than after.

To narrow candidates, the tech stack recommender filters kits by the stack you decided on rather than by marketing copy. If the concept is new, start with what a SaaS boilerplate is.

When to deviate from the boring stack

There are legitimate reasons to leave the default path. A hard requirement is the clearest: you need to self-host, you are selling on-prem, or a compliance regime rules out certain providers or data locations. Genuine domain fit is the second. If your product is fundamentally about real-time collaborative editing, heavy geospatial queries, or timeseries at volume, the specialized tool is what makes the product possible. Existing expertise is the third, and it counts even when the team is one person.

Novelty is not on that list. Neither is personal preference, at least not when an agent is writing most of the code. That stings, because choosing your tools used to be one of the pleasures of starting a project. Wanting to try the new framework is a fine reason for a side project and a bad reason for the thing you intend to charge money for.

If you do deviate, price it in rather than hoping. Expect to review more, because the agent's error rate on unfamiliar territory is higher. Expect to hand-write two or three reference implementations yourself so the agent has correct in-repo examples to match against. And expect to correct the same hallucinated API more than once.

Writing the stack down so it sticks

The deliverable is small: a stack section near the top of your agent instruction file, maybe fifteen lines. List the chosen tools, with versions where versions matter. Then, the part people skip, list the rejected ones with a one-line reason each.

The rejected list matters more. The chosen list tells the agent what to use, which it would mostly infer from your dependencies anyway. The rejected list stops it from reintroducing something. Without it, an agent that needs to format a date reaches for whatever it has seen most often, adds the dependency, and now you own it. A line reading no moment, use Intl, see lib/format.ts prevents that permanently. The same applies to the ORM you rejected and the second HTTP client that keeps trying to appear.

For where that file lives and which filename your tools actually read, CLAUDE.md vs AGENTS.md settles the question faster than debating it would. To skip the setup entirely, kits in the Agent-Ready category ship with an instruction file written against their own stack, so the decisions and their enforcement arrive together.

Frequently Asked Questions

Can I just ask the AI to pick my stack?

You can, and it will give you a reasonable answer. The problem is that it gives you a different reasonable answer next Tuesday, because there is no single right answer and the model is sampling from a space of defensible ones. That makes it an excellent tool for generating options and a terrible one for making the decision, since the decision's whole value is that it stops changing. Use it to produce a shortlist with tradeoffs, then commit and write the commitment down.

How much does the stack choice actually matter in 2026?

More than it did in 2024, which surprises people who expected agents to make stack differences irrelevant. Output quality tracks how well represented a stack is in training data, so the gap between a conventional stack and an unusual one now shows up as how much generated code you have to fix. The volume produced on your foundation is also much higher, so a bad foundation compounds faster. The choice matters more precisely because you write less of the code yourself.

Should I pick the boilerplate or the stack first?

Stack first, but loosely. Decide the small set of stacks you would be happy with, which usually means committing to a framework and a database family and staying open on the rest. Then let the available kits decide within that set, because a well-maintained kit on your second-choice ORM beats an abandoned one on your first. The stack recommender linked above is built for this order.

What if I change my mind later?

Distinguish the cheap swaps from the expensive ones. Email providers, analytics, file storage, and background job runners sit behind thin interfaces and can be replaced in an afternoon at almost any stage, so changing your mind about them is not a real event. The framework, the database, and the auth model are different: each is referenced by nearly every file, and changing one means regenerating or hand-editing most of the codebase. Once you have paying customers it also means migrating their data or their payment methods. The honest signal that you need a rewrite rather than a migration is when the new choice invalidates your data model, not just your imports.

Do I need to know the stack deeply to use it?

You need to know it well enough to review generated code in it, which is a lower bar than writing it from scratch but a real one. Recognizing that a query is missing a tenant filter, that a route handler is not checking the session, or that a migration will lock a table is a reading skill, and reading skill develops much faster than writing fluency. What does not work is merging because tests passed, since the failures that matter in auth, permissions, and payments are exactly the ones that pass tests. Budget a few days of deliberately reading the kit's existing code before generating on top of it.

BoilerplateHub BoilerplateHub ⚡ Perfect for Vibe Coding

You have the idea. Now get the code.

Save weeks of setup. Browse production-ready boilerplates with auth, billing, and email already wired up.

Reviews

Leave a comment

Your rating (optional)

0/2000