Development · Prompt

Cursor PRD Template for AI Coding

Structured PRD rule template to prevent AI hallucinations in code editors

This document is the first in CJ Zafir's seven-part 'Coding Docs' framework designed for AI-assisted development tools like Cursor and Windsurf. It establishes a complete Project Requirements Document (PRD) formatted as an 'Always' active rule file (project_requirements_document.mdc) to provide persistent context during AI generation. By explicitly defining scope, user flows, and technical boundaries, it stops language models from making unprompted assumptions.

The prompt

Template structure (as shown for AI Code Product Hunt):

- Rule type: Always, attached to every chat and command+K request; header instructs 'Update this rule if user requested changes to the project requirement'.

- ## 1. Project Overview: what the product is (web marketplace where no-code developers and indie hackers list startups for sale; listings with name, website, industry, revenue, user base, images; buyers explore via search filters; buyers/sellers connect via real-time chat; Google auth via Clerk), plus goals, key objectives and success metrics.

- ## 2. In-Scope vs Out-of-Scope: in-scope includes user auth/onboarding (Clerk), seller dashboard listing form, real-time chat, grid-style dashboard with filters (industry, selling price, MRR), sidebar navigation, seller analytics and reporting, admin dashboard, image upload (JPEG/PNG/GIF with size and dimension guidelines), mobile responsive design.

- ## 3. User Flow: signup via Clerk Google auth → onboarding → sellers fill listing form, buyers browse grid; edit/delete listings with pre-populated forms; buyers initiate chat with message of intent; admin dashboard moderates in background; mobile equally responsive.

- ## 4. Core Features: User Authentication and Onboarding (Clerk, intuitive onboarding); Seller Listing Management (detailed form, edit/delete with confirmation modal); Real-Time Chat (privacy settings, online/offline status, block, moderation); Dashboard and Filtering (grid display, filters for industry/selling price/MRR); Navigation (left sidebar); Analytics and Reporting for Sellers (listing views, inquiry responses, reporting dashboard); Administrative Moderation (approve/reject listings, flag content); Asset Management (JPEG/PNG/GIF, 2 MB limit, 1200x800 recommended); Mobile Optimization (responsive, larger touch targets).

- ## 5. Tech Stack & Tools: Frontend — Next.js 14 (app router), TypeScript, Tailwind CSS, Shadcn UI and Radix UI, Lucide Icons; Backend & Storage — Supabase, Clerk; Additional Tools & AI — GPT o1, Claude 3.5 Sonnet, Cursor; Starter Kit — CodeGuide Starter Pro (github.com/codeGuide-dev/codeguide-starter-pro).

- ## 6. Non-Functional Requirements: Performance (fast load <2s, optimized image handling, minimal chat latency); Security (role-based access controls especially for admin dashboard); Compliance & Usability (responsive across devices, web accessibility standards, security audits).

- ## 7. Constraints & Assumptions: chat depends on server-side event handling and websocket support; Supabase uptime assumed; AI integrations stable; starter kit basis; payments intentionally excluded (managed externally).

- ## 8. Known Issues & Potential Pitfalls: rate limits/performance bottlenecks (caching, load balancing); user management & moderation (automated flagging, admin guidelines); asset handling (server-side image resizing/compression); cross-device consistency (responsive frameworks, testing cycles); third-party dependency risks (Clerk, Supabase, OpenAI — robust error handling and contingency plan).

Closing note: the PRD is a blueprint so subsequent documents (Tech Stack, Frontend Guidelines, Backend Structure) can be generated without ambiguity.

What it's for

  • Configure a persistent Cursor or Windsurf rule file to ground code generation
  • Define clear project boundaries and out-of-scope tasks before generating code
  • Document user flows and technical constraints to minimize hallucinations across chat prompts

Key points

  • Project overview outlining core value proposition, objectives, and success metrics
  • Explicit in-scope versus out-of-scope boundaries to control AI feature creep
  • End-to-end user flow diagrams and step-by-step journeys
  • Detailed feature specifications broken down into concrete functional requirements
  • Non-functional performance, security, and accessibility benchmarks
  • Explicit technical constraints, third-party assumptions, and potential pitfalls

Pricing

Free

Details

Type
Prompt
Category
Development
Topic
AI Prompts
Open source
No
Platforms
other
For
Developers building software with AI code editors like Cursor and Windsurf
Tags
cursor, windsurf, prd, prompt engineering, ai coding, rules

Why it was saved

  • @cjzafir, 27 March 2025: Doc #1 of CJ Zafir's 7-doc 'Coding Docs' system (PRD, app flow, tech stack, frontend guidelines, backend structure, rules, implementation plan) that forms a knowledge base for AI coding models in Cursor/Windsurf, reducing AI assumptions and hallucinations. The full template is on screen to copy.

Related

All 47 in AI Prompts →

Updated