Starting a New Project Using Cursor Agent
Your PM drops a message in Slack: “We need something like Trello but simpler, focused on daily standups. Can you have a prototype by Thursday?” No spec. No wireframes. No architecture doc. Just a sentence and a deadline. You have two days and an empty directory.
This is where most developers start Googling boilerplate repos and spending half the afternoon debating whether to use Next.js or Remix. With Cursor, you can skip the bikeshedding and have a running application — with auth, a database, real-time updates, and tests — in a single focused session. The key is knowing which Cursor features to reach for at each stage.
What You’ll Walk Away With
Section titled “What You’ll Walk Away With”- A repeatable workflow for turning vague requirements into a structured PRD using Ask mode
- A project scaffolding prompt that generates config files, folder structure, and initial setup in one shot
- A
.cursor/rulesfile that keeps the AI consistent across dozens of follow-up prompts - Checkpoint discipline that lets you experiment freely without fear of losing progress
- A technique for using Plan mode to decompose complex features before Agent writes a single line
The Workflow
Section titled “The Workflow”Step 1: Extract requirements with Ask mode
Section titled “Step 1: Extract requirements with Ask mode”Before writing code, use Ask mode to turn that vague Slack message into something you can actually build against. Ask mode is read-only — it cannot edit files or run commands — which makes it the right tool for planning. Press Cmd+. to switch modes.
The model will push back on scope and suggest trade-offs. This is exactly what you want. A good AI planning session feels like talking to a senior engineer who has built this kind of app before. Ask follow-up questions until you have a clear picture of what “done” looks like.
Save the output. You will reference it throughout the project.
Step 2: Generate the PRD as a file
Section titled “Step 2: Generate the PRD as a file”Switch to Agent mode (Cmd+. again) and have Cursor create a structured document you can reference later with @-symbols.
Agent mode will create the file and the docs/ directory. Now every future prompt can reference @docs/prd.md for context, which prevents the AI from drifting away from your requirements as the conversation gets longer.
Step 3: Set up project rules before any code
Section titled “Step 3: Set up project rules before any code”This is the step most people skip, and it costs them hours later. Before generating a single line of code, create a .cursor/rules directory with project-specific instructions. These rules are automatically included in every Agent and Ask interaction.
The .cursor/rules directory with .mdc files is Cursor’s current standard for project rules. Each rule file can specify which file patterns it applies to via the globs frontmatter field, so your TypeScript rules only activate when editing .ts files.
Step 4: Scaffold the project with Agent mode
Section titled “Step 4: Scaffold the project with Agent mode”Now let Agent mode do the heavy lifting. Reference both the PRD and the rules so the generated code is consistent from the start.
Agent mode will execute terminal commands, create files, and iterate if something fails. With auto-run enabled in your Cursor settings (Settings > Cursor Settings > Agents > Auto-Run), the agent can run build tools and fix errors without asking permission each time.
Checkpoint now. After the scaffolding succeeds and the dev server starts, this is your first safe restore point. Cursor creates checkpoints automatically, but you should also commit to git:
git add -A && git commit -m "Initial project scaffolding with database schema"Step 5: Build features with Plan mode
Section titled “Step 5: Build features with Plan mode”For complex features, use Plan mode before letting Agent write code. Plan mode researches your codebase, asks clarifying questions, and generates a reviewable implementation plan. Press Shift+Tab from the chat input to switch to Plan mode.
This is particularly valuable for the first major feature, because Plan mode will catch architectural decisions you might miss — like whether the task board needs WebSocket connections or if SSE is sufficient, or whether drag-and-drop state should live in the URL or in local state.
@docs/prd.md @src/db/schema.ts
Plan the implementation of the task board feature:- Kanban-style columns (To Do, In Progress, Done)- Drag and drop cards between columns- Real-time updates when another user moves a card- Optimistic UI updates with rollback on server error
Consider: Should we use WebSockets, SSE, or polling? What's the minimum viable approach for a 2-day prototype?Review the plan. Edit it if you disagree with the approach. Then click “Build” to let Agent execute it.
Step 6: Iterate with focused follow-ups
Section titled “Step 6: Iterate with focused follow-ups”Once the core feature is running, iterate with small, focused prompts. Each prompt should do one thing well rather than asking for five features at once.
@src/components/task-board.tsx @src/db/schema.ts
The drag and drop works but there's no visual feedback during the drag.Add a shadow and slight rotation to the card being dragged, dim thesource column, and show a highlighted drop zone in the target column.Use Tailwind classes only -- no CSS-in-JS.Keep conversations short. When a conversation exceeds 15-20 exchanges, context degrades. Start a new chat, reference the specific files with @-symbols, and continue from there.
Step 7: Add authentication and deploy prep
Section titled “Step 7: Add authentication and deploy prep”@docs/prd.md @src/db/schema.ts
Add NextAuth.js with GitHub OAuth:1. Create the auth config in src/lib/auth.ts2. Add the API route at src/app/api/auth/[...nextauth]/route.ts3. Create a middleware.ts that protects all routes except /login4. Add a login page at src/app/login/page.tsx5. Update the task board to show the current user's name6. Add a users table to the schema if it doesn't exist
Use the Drizzle adapter for NextAuth. Environment variables go in .env.local.example(not .env.local -- never commit secrets).When This Breaks
Section titled “When This Breaks”Agent generates an outdated tech stack. The model sometimes suggests pages/ router patterns or deprecated NextAuth v4 APIs. Fix this with explicit version constraints in your prompt: “Use Next.js 15 App Router” or “Use Auth.js v5 (NextAuth v5).” Better yet, add version pinning to your .cursor/rules.
The project gets inconsistent after 20+ prompts. Long conversations lose context. When you notice the AI generating code that contradicts earlier patterns (different naming conventions, different error handling), start a fresh chat. Reference the rules files and key source files with @-symbols to re-establish context.
Agent creates files in the wrong locations. This happens when your project structure is not obvious from the file tree. Add a structure.mdc rule file that describes your directory layout: “Components go in src/components/, database queries go in src/db/queries/, API routes go in src/app/api/.”
Agent runs a command that breaks your setup. Use checkpoints to restore. Click the “Restore Checkpoint” button on any previous message in the Agent chat. For git-level safety, commit after every successful phase.
Plan mode generates an overly complex architecture. The model sometimes over-engineers prototypes with microservices, message queues, or elaborate caching layers. Add constraints: “This is a 2-day prototype for 12 users. Optimize for shipping speed, not scale. Use SQLite, not Postgres. Monolith, not microservices.”