ai newsMo., 19. Okt.
EilmeldungPruning Redundant API Prompt Tokens with Tree-Sitter in Rust for AI CLI Agents

Why Most AI-Generated Apps & Scrapers Break in Week 1 (And the 5 Fixes That Save Them)

If you have spent any time building with Cursor, Bolt.new, Windsurf, or Claude Code recently, you know the feeling: you can scaffold a working fullstack app or a web scraper in under an hour. It compiles, looks beautiful, and runs locally without a single syntax error. Then you deploy it to product

dev.toMontag 02:42 路 19.10.3 Min. Lesezeit
Bild: dev.to

If you have spent any time building with Cursor, Bolt.new, Windsurf, or Claude Code recently, you know the feeling: you can scaffold a working fullstack app or a web scraper in under an hour. It compiles, looks beautiful, and runs locally without a single syntax error.

Then you deploy it to production or point it at live data, and things immediately fall apart.

Over the past few months, after reviewing dozens of vibe-coded apps and autonomous automation pipelines, I noticed the exact same five architectural holes appearing over and over again. They aren't syntax bugs鈥攖he AI generated syntactically valid code. They are boundary and failure-mode bugs.

Here are the 5 critical fixes you need before putting real users or live traffic on an AI-built stack.

The AI code generator loves direct client-side queries:

const { data, error } = await supabase. from ( ' organizations ' ). select ( ' * ' ); Enter fullscreen mode Exit fullscreen mode In your browser, this works smoothly using the Supabase anon key. But here is the trap: if Row-Level Security (RLS) is disabled or improperly scoped, that single line lets anyone in DevTools query and download every organization in your Postgres database.

select tablename, rowsecurity from pg_tables where schemaname = 'public' and rowsecurity = false; Enter fullscreen mode Exit fullscreen mode If any table returns false, enable RLS immediately and add strict user-isolation policies:

alter table organizations enable row level security; create policy "Users can only read own organization" on organizations for select using ( auth. uid () = owner_id ); Enter fullscreen mode Exit fullscreen mode 2. Unverified & Non-Idempotent Stripe Webhooks Default AI-scaffolded payment routes usually look like this:

export async function POST ( req: Request ) { const body = await req. json (); if ( body. type === ' checkout.session.completed ' ) { // grant premium access } return new Response ( ' ok ' ); } Enter fullscreen mode Exit fullscreen mode Two massive vulnerabilities exist here:

The Fix: Always read the raw body buffer and verify with Stripe's signing secret, backed by an idempotency log:

Furthermore, default Playwright or Puppeteer instances broadcast navigator.webdriver = true and mismatched Sec-CH-UA headers, triggering instant Cloudflare blocks.

AI code often accesses environment variables inline:

const apiKey = process. env. DATABASE_URL!; Enter fullscreen mode Exit fullscreen mode If a variable is missing or misspelled in your Vercel or Docker environment, the app builds cleanly, boots up, and only crashes when a user triggers that specific route at 3 AM.

The Fix: Enforce a strict schema that fails at boot:

import { z } from ' zod '; const envSchema = z. object ({ DATABASE_URL: z. string (). url (), NEXT_PUBLIC_SUPABASE_URL: z. string (). url (), SUPABASE_SERVICE_ROLE_KEY: z. string (). min ( 20 ), STRIPE_SECRET_KEY: z. string (). startsWith ( ' sk_ ' ), }); export const env = envSchema. parse ( process. env ); Enter fullscreen mode Exit fullscreen mode 5. Cursor & Agent Rules That Prevent Hallucinated Schema Drift When iterating on codebases with Cursor, Claude Code, or Windsurf, the LLM will frequently overwrite database migrations, change TypeScript types without updating SQL, or invent deprecated library methods.

Create a root.cursorrules or AGENT.md that strictly confines the AI:

If you want ready-to-drop solutions instead of rebuilding these patterns from scratch:

A production-ready foundation with Next.js 15 App Router, strict Supabase RLS migrations, signature-verified idempotent Stripe webhooks, and pre-configured.cursorrules: 馃憠 Get Cursor Hardening Pack on Gumroad Use code **VIBE30 * for 30% off.*

Our dual-engine Python scraper (Playwright Stealth + HTTPX) with anti-detection headers, phone/email/WhatsApp extraction, and formatted.xlsx export. No monthly $99 SaaS bills: 馃憠 Get OmniScraper AI on Gumroad Use code **DEV30 * for 30% off.*

Both tools are instant downloads with complete source code and zero recurring fees.

What is the biggest roadblock you have encountered when taking an AI-coded project to production? Let's discuss in the comments below!

Quelle: dev.to (dev.to). Original 枚ffnen