CJ Zafir Profile picture
Feb 20 9 tweets 4 min read Read on X
Cursor/Windsurf cheat code.

{Provide detailed context about your coding project}

It will minimize 85% of AI hallucinations and errors.

Here's how you can do it using ChatGPT: Image
1. Project Requirements Document.

Ask AI to write a PRD (for AI coding model) about your project.

It should include these sections.
- App overview
- User flow
- Tech stack & APIs
- Core features
- In-scope and out-of-scope

To make it air tight add these too:
- Non-functional requirements
- Constraints & assumptions
- Known issues & potential pitfalls

This doc will provide high level overview to Cursor/WindsurfImage
2. App Flow Document

This document will provide a detailed user journey from landing page to all the pages of the app.

This doc creates a map for AI coding model.

Tips:
- Don't use bullet points in this doc
- Don't miss any page
- Use simple language Image
3. Tech Stack Document

This is the technical doc of your coding project. It will provide details about what packages and dependencies to install.

You can also add API documentation to this page (with links) and Cursor/Windsurf will search the web. Image
4. Frontend Guidelines Document

This doc should provide in depth details about the UI, styling, design principles of the app

To make it more detailed you should also add:
- colour palettes
- fonts
- icons

This document will make sure the style is consistent throughout the app Image
5. Backend Structure

Most AI devs use Supabase for the Backend for a reason. Because AI can write SQL queries, for your database tables in Supabase.

All you need to do is copy and paste the queries and policies to SQL editor in Supabase.

This doc will make sure that database, authentication and storage structure is built properly.Image
These are the 5 core documents that are MUST for your coding projects.

You should also create:
- cursorrules/windsurfrules file
- implementation plan file

Implementation plan should list all (50+) steps to code this app.

This one document is a game changer. Image
The quality of docs generated by ChatGPT is not so good.

I've built 35+ projects with AI code and to fix the project documentation problem I built @CodeGuidedev

I use a mix of AI models:
o3-mini
GPT4o
Sonnet 3.5

You can follow simple 5 steps and download all docs in best structure.

Build web apps, mobile apps, extensions, landing pages or even plugins.
Join here - Home of 2489 AI Coders

40% discount on Yearly Membership - Only $199 right now.

Create project docs
Use Starter Kits
Use templates
Community
Discounts
AI Agent
and more features and partnerships are coming...codeguide.dev

• • •

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

Keep Current with CJ Zafir

CJ Zafir 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 @cjzafir

Jun 15
The most important document in AI coding: PRD
(Project Requirements Document)

It serves like a blueprint & explains:
- project's overview
- tech stack
- user flow
- core features
- ui details
- backend schema
- security guidelines
- regulations

Here's how you can create PRDs:
Before you create a PRD, brainstorm with ChatGPT voice.

This step will help you finalize what features you want in your version 1.

In the end ask ChatGPT: "now add all approved features in one document and create a detailed draft)

Now it's time to create a PRD.
I use @CodeGuidedev to create all my coding docs including PRD

It uses 03 + 04-mini + Sonnet 4 model to create extensive set of docs

Flow is simple

Step 1: Open "New Project" and paste the feature draft in the input field

Step 2: Now select AI tools & AI models you'll use
Read 8 tweets
Apr 18
What are AI Agents?

OpenAI just published 30-page guide on AI agents.

I explained the guide in 10 points. Bookmark this: Image
1. Agents ≠ basic workflows

A normal “workflow” just runs a fixed list of steps with an LLM; it doesn’t think for itself.

On the other hand, Agents are systems that independently accomplish tasks on your behalf.

Workflows are linear. Agents are dynamic & autonomous. Image
2. Use agents for the complex jobs

Agents handle changing rules, tricky choices, and unstructured data better than any fixed script.

Pick jobs that need judgment, change a lot, or rely on messy text, images, or PDFs. Image
Read 12 tweets
Apr 10
I tested Gemini Pro 2.5 as my main coding model for 40+ hours.

Here're 2 documents that are working brilliantly well with Gemini.

"App flow document + App flowchart."

This made my Cursor workflow 10x better. Here's why it is working: ↓
Gemini Pro 2.5 has a 1 million token context window.

In simple terms it can scan upto 100,000 lines of code instantly to understand full codebase.

Claude & GPT models has 200k context window and that's why they struggle with large codebases.
But large context window doesn't mean Gemini doesn't hallucinate or assume things.

That issue is still there but I'm able to fix hallucinations by 95% in Gemini with my 'Context Boundary' technique.

You need to provide context with coding docs:
- PRD
- App flow doc
- Tech stack doc
etc

But here's how 2 docs are working really good with Gemini.Image
Read 7 tweets
Apr 8
Debugging is the most frustrating part of AI coding.

But it can be solved if you build a strong "wall of context" around AI models.

Here's how you can fix debugging in Cursor/Windsurf: ↓ Image
If you say "build me a spotify like app" and you expect AI to code the entire frontend and backend in 1 prompt. That's not possible.

AI models can output limited code in 1 request.

Also, AI models are not perfect they have 2 limitations:
1. AI hallucinations
2. Context window
So, first you need to provide deep context about your idea in the form of a context boundary around AI models.

To build this boundary, you need to turn your plain english idea into a set of coding docs:

1. Project Requirement Document (PRD)
2. App Flow Doc.
3. Tech Stack Doc.
4. Frontend Guidelines
5. Backend Structure

These 5 docs are your core docs. Let's expand them:Image
Read 11 tweets
Apr 6
Google's Gemini Pro 2.5 is the best AI coding model right now.

I use Gemini 2.5 + Sonnet 3.5 + GPT o1 models in my new coding workflow.

After using it for 20 hours, here're my finding: ↓ Image
I admit, Google has done a wonderful job this time with Gemini Pro 2.5 model.

They competed with Claude's Sonnet models for coding and the code quality is far better.

In new workflow I use:
- 80% of the time Gemini Pro 2.5
- 10% of the time Sonnet 3.5
- 10% of the time GPT o1
My findings after testing Gemini for 20+ hours:

1. Gemini is great for planning docs, understanding large codebases and one-shotting code snippets.

But there're some issues.

It struggles to understand the user's requests sometimes. (You need to be super clear) Image
Read 12 tweets
Apr 5
What is Vibe Coding?

Here's a complete Crash Course for you: 🧵 Image
2024 has changed coding forever.

It gave birth to AI coding models like Claude Sonnet 3.5, GPT 4o that can code better than junior devs.

We saw AI coding tools like Cursor, Windsurf, Bolt, Replit, Lovable etc built on top of AI coding models.

But..
The biggest change of all is that it made 'English' the largest coding language of all time.

Now anyone with an idea can code.

So people started coding landing pages, websites, web apps, mobile apps, browser extensions or even browsers.

Until recently this type of coding is given a name by @karpathy - Vibe Coding

"you forget about the code even exists...... Just see tuff, say stuff, run stuff and copy paste stuff, and it mostly works"Image
Read 12 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!

:(