← Back to blog

AI-Assisted Development: The Setup Is Everything

aidevelopmentbest-practices

After months of shipping with AI tools, here's the uncomfortable truth most devs won't say out loud:

The AI isn't the bottleneck. Your setup is.

Best Practices Are Your Real Superpower

The single most important skill for an AI-assisted developer is not prompting. It's not picking the right model. It's not even architecture.

It's best practices.

The AI will happily generate whatever you ask for. It has no stake in your codebase's long-term health. That's your job. And the best way to protect that codebase is to give the AI fewer opportunities to go off-script — through constraints, conventions, and a well-configured environment.

Garbage in, garbage out applies here more than anywhere.

Take the Time to Set Up Your Environment Properly

I know. You want to ship. The AI is fast and you're excited. But an hour of setup saves you ten hours of debugging hallucinated APIs and mismatched conventions.

Here's what actually matters:

Load the right MCPs. I work primarily in SvelteKit, so I load the official Svelte docs MCP (https://svelte.dev/docs/ai/overview). The AI then reasons against actual, current documentation — not whatever it half-remembered from training. If you're on Next.js, they have the same. Use it.

Use Playwright for E2E tests. Let the AI write your tests, then let those tests run in a real browser. Playwright's ability to actually open a browser and verify behavior is one of the highest-leverage tools in an AI-assisted workflow. It closes the loop. The AI gets real feedback. You catch regressions before they hit production.

Define your constraints before you start. The AI will code fast. Very fast. Which means if you haven't defined your stack, your patterns, your conventions — it will invent them for you. And you'll spend the next three sessions cleaning up decisions you never consciously made.

Slow down at the start. Define your parameters. Then let it rip.

The Trick I Use Before Writing a Single Line of Code

Before I open my editor, before I configure anything, I sit down with Claude, ChatGPT, or whatever model I'm using that day — and I just talk through the project.

Not vaguely. In detail. I explain what I want to build, what the data looks like, how the pieces relate. And then I ask for one specific thing:

Show me the database schema.

That's it. Just the schema.

And almost every time, I catch something. A relationship the model misunderstood. An entity it conflated with another. A field that reveals it interpreted my requirements differently than I intended.

Fixing the schema in that conversation — before any code exists — is one of the highest-leverage things I do. Because the schema is the understanding. If the model has the schema right, it has your domain right. And everything it generates from that point is anchored to something real.

Iterate on the schema until it's exactly what you want. Then start the project.

The first output will be dramatically cleaner. Future sessions will stay on track longer. You'll spend less time correcting, more time building.

It's not glamorous. It's just how good software gets made.

The RLS Trap Nobody Talks About

I used to reach for Supabase or Nhost on every project. Great tools. But when you're vibe-coding fast with an AI that has no persistent memory and a context window that degrades over long sessions — Row Level Security and permissions management become a liability.

The AI generates code. You iterate. Context shifts. Three sessions later, your RLS policies are a patchwork of assumptions the model no longer remembers making. Silent data leaks. Access bypasses. Logic that looks right but was written in a context that no longer exists.

I switch to using just a plain PostgreSQL database, and I like to use Neon for the simplicity — all queries server-side with SSR. No magic middleware. No invisible security layer the AI can accidentally misconfigure.

Just SQL, executed in the backend, where I can see it, audit it, test it, and reason about it.

Turns out, writing SQL in the backend in 2026 hits different. Turns out PHP had a point all along.

The Mental Model Shift

Stop thinking of AI as an autocomplete on steroids. Start thinking of it as a very fast, very capable junior dev with amnesia.

It doesn't remember last session. It doesn't know your codebase unless you tell it. It will confidently implement something subtly wrong if you let it work without guardrails.

Your job is to be the senior in the room. Set the architecture. Enforce the patterns. Review the output.

The AI handles the volume. You handle the judgment.

That split — if you get it right — is genuinely the most productive development workflow I've ever experienced.

But it only works if you do the setup.