Prajwal Tomar Profile picture
Apr 20, 2025 11 tweets 4 min read Read on X
Cursor is literally the best AI coding tool.

But most AI projects break because of 3 core issues:

- AI hallucinations
- Loop of errors
- Context awareness

Here’s the system I use to fix all 3.

It’s called the Context Boundary Method ↓ Image
1/ Context boundary = Knowledge base for AI

This is the coding doc. system I follow for every build:

- PRD
- App Flow Doc
- Tech Stack Doc
- Frontend Guidelines
- Backend Structure
- Implementation Plan

These docs act like a knowledge base for your AI dev. Without these, it’s chaos.Image
2/ You can generate these AI coding docs with ChatGPT.

I use @CodeGuideDev to generate them because its built to generate AI coding docs.

It supports Claude, GPT-o and Gemini models, and works with all AI coding tools.

It actually saves me a lot of time on every MVP I build.

Here’s a list of docs you need: 👇Image
3/ PRD = Your product map

Before building, I generate a clear Product Requirements Doc.

It answers:
- What is this product?
- Who is it for?
- What problem does it solve?
- What’s in scope vs out of scope?

This keeps AI focused on the core, not every random idea you throw at it.
4/ App Flow Doc = The user journey

This is a plain-English breakdown of the full journey:

- What happens on each screen?
- How does a user move from one screen to the next?
- Where do key actions happen?

Be painfully specific. Don’t say “dashboard”, describe what’s inside it.
5/ Tech Stack Doc = What to build with

Tell AI exactly what tech it should use.

- Frameworks
- APIs
- Auth tools
- SDKs
- Docs for each

This avoids hallucinations like fake libraries and wrong imports.
6/ Frontend Guidelines = Your design system

You want your app to look consistent?

Then teach AI your design language.

Include:

- Fonts
- Color palette
- Spacing system
- Preferred UI patterns
- Icon set

This makes Windsurf/Cursor generate clean, unified UI.
7/ Backend Structure Doc = DB + Auth logic

This doc defines:

- Tables + schema
- Storage rules
- Auth flows
- Edge cases (like retries or errors)

CodeGuide also provide instructions to Cursor Agent to use Supabase MCP to setup backend properly, which is good.
8/ Implementation Plan = Your step-by-step build

This is the most powerful doc in your system.

I write 50+ clear steps to build the app.

Each step is a prompt.

Cursor Agent or Windsurf then builds it like a junior dev, task-by-task.
9/ Run security audits before shipping

To keep your MVP secure by default, I generate a custom security_guideline.mdc doc using @CodeGuidedev

Then inside Cursor or Windsurf:

- Attach this doc to your project
- Switch to Gemini Pro 2.5 (it handles full codebase scans)
- Prompt: “Run a complete security test across the entire codebase. List all vulnerabilities and give clear steps to fix each one.”

It gives you a full audit report before launch, clean, detailed, and dev-ready.
10/ Final Takeaway

AI should never plan your product. That’s your job.

But once you build the right context boundary, it becomes your fastest, cleanest dev copilot.

Build with coding docs. Prompt with clarity. Let AI write the code.

Bookmark this.

It’ll help you for your next project.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Prajwal Tomar

Prajwal Tomar Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @PrajwalTomar_

Jan 29
How to actually make your AI-built apps secure (from someone who ships MVPs for a living)

We’ve shipped 45+ AI-built MVPs and learned security the hard way.

If you’re building with Cursor this is how to stay safe 👇 Image
1/ Don’t blindly trust the agent

Cursor flies through code, which is great… until it isn’t.

One of our client projects looked perfect on the surface. @coderabbitai flagged a race condition in the payment system that was actually double-charging users.

The dev thought everything was fine. In production that would have been a disaster.

Let AI write code.
Let another AI review it.
You still approve the changes.
2/ Rate limiting = protecting your wallet

Most AI-built MVPs skip this and then get destroyed by bots.

I know someone whose app got spammed with fake sign-ups and blew through email credits and API usage overnight. The free trial turned into a hefty bill.

Start strict: 100 requests per hour per IP.
Loosen later if needed.
Read 13 tweets
Jan 10
After 45+ MVPs and using Lovable almost daily, here's everything I wish I knew on day one.

These tips will save you hours of struggle.

Image
1/ Don't skip planning.

Before you open Lovable, have these ready:
• PRD
• DB design
• UI dev plan
• Implementation plan

Generate them in ChatGPT or Gemini. Paste them as .md files into Lovable.
Now it has full context about your product from the start.
2/ Your first prompt decides everything.

I use my custom GPT SnapPrompt to get a detailed prompt with layout, typography, and design style. Then I attach a Dribbble reference.

SnapPrompt GPT:
chatgpt.com/g/g-674c835b12…
Read 12 tweets
Jan 6
After using @Lovable on 50+ projects, this is how I make sure the UI never looks mid.

AI can design just fine. You are just prompting it wrong.

Here is my actual workflow for shipping clean UI with Lovable.

👇 Image
1/ Start with a reference, not a description

Describing layouts from scratch almost always leads to messy output.

I take a screenshot from Dribbble, drop it into ChatGPT, and ask it to generate a design.json that includes colors, spacing, typography, and layout rules.

Then I tell Lovable to use it for styling only.

This gives me consistent output from the very first screen.
2/ Lock in your colors before you build

Most people open Lovable first and then keep asking it to “fix the UI.”

I spend five minutes on Coolors instead.

I pick a palette, export it, and use those exact values everywhere.

That one decision saves hours of back and forth later.
Read 14 tweets
Dec 30, 2025
Cursor + Opus 4.5 is the fastest way to build right now.

But here's the problem no one talks about:
AI-generated code has 1.7x more issues than human-written code.

Here's how to stop shipping broken apps. 👇 Image
1/ The real problem with vibe coding

AI writes clean-looking code. You deploy it. Users find bugs you missed.
1.75x more logic errors. 1.4x more critical issues. 2.74x more XSS vulnerabilities.

Speed is useless if the code breaks at 10 users.
coderabbit.ai/blog/state-of-…
2/ The fix is simple

Let AI write your code.

Let another AI review it.

You approve the final changes.

Three layers. Zero surprises.

The tool I use for this: CodeRabbit.
Read 9 tweets
Dec 29, 2025
I reverse-engineered how Lovable's top users build apps 10x faster.

Turns out, It's not about writing longer prompts.

It's about this structured prompting system nobody talks about ↓ Image
1/ Create a Knowledge Base before you build

Include these in your project settings:

• Project Requirements Document (PRD)
• User flow explanation
• Tech stack details
• Design guidelines
• Backend structure

The clearer your context, the better your results.
2/ Master the 4 levels of prompting

Level 1: Training Wheels

Use labeled sections in your prompts:
- Context (what you're building)
- Task (what you want)
- Guidelines (how to do it)
- Constraints (what to avoid)

Example:
Bad: "Build me a login page"

Good:
Context: I'm building a SaaS app for small businesses
Task: Create a login page with email/password
Guidelines: Use React, make it mobile-friendly
Constraints: Don't use any external auth services

Structure helps AI understand exactly what you want.

Level 2: No Training Wheels (conversational)

Level 3: Meta Prompting (use AI to improve your prompts)

Level 4: Reverse Meta (document solutions for future use)
Read 12 tweets
Dec 26, 2025
Most AI websites still look mid.

Not because AI can't design. Because people skip the basics.

Here's my actual workflow for building beautiful websites with Cursor/ Claude. 👇 Image
1/ Decide your colors before you write a single prompt

Most people jump straight into Claude and wonder why everything looks inconsistent.

I spend 5 minutes on Coolors first. Pick a palette. Export it.

This one decision saves hours of "make it look better" prompts later.
2/ Design before you build

Asking Claude to design and code at the same time is a mess.

I use Google Stitch with Gemini 3 Pro to get the UI right first. Clean layouts. Minimal. Balanced.

New update: you can generate a working prototype directly from the design. Then export and bring it into Claude.

Way cleaner than prompting blind.
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(