As the title says, I run a development agency and I’m sharing the system we use to set up Cursor before coding starts. This approach ensures the AI generates high-quality code that fits our project standards, frameworks, and UI conventions.
It’s saved us time and kept our output consistent. Here’s the step-by-step process we follow. Feel free to use it or adapt it for your own work.
Step 1: Define the Project Upfront
We start by documenting the project clearly to give Cursor proper context.
- Project Overview: We create a
README.md
ordocs/project-overview.md
with the basics: purpose, tech stack, features, and requirements. Example: "Next.js ecommerce site with React, TypeScript, and Stripe integration." - Feature List: A
docs/status.md
tracks tasks and their status, like "in progress: user authentication" or "pending: payment system." - UI Standards: We write
docs/ui-standards.md
with rules such as "Use Tailwind, PascalCase for components, mobile-first design."
This keeps everything organized and gives Cursor a solid foundation.
Step 2: Configure Cursor’s Settings
Next, we set up Cursor to follow our coding standards.
- Add
.cursorrules
: A file in the root defines our preferences. For a TypeScript/React project, it might include:- Use TypeScript with strict mode.
- Write functional components.
- Use Tailwind CSS for styling.
- Name files in kebab-case (e.g.,
user-profile.tsx
). - Include Jest unit tests.
We adjust this based on the project’s needs.
- Global Settings: In Cursor’s settings, we might set 2-space indentation for consistency across projects.
Step 3: Provide Context
We make sure Cursor understands the codebase and dependencies.
- Index the Project: Opening the project in Cursor lets it scan everything, so it can reference the codebase with
@codebase
. - Use
@
Tags: We point to key files in prompts, like@docs/project-overview.md
or@src/lib/utils.ts
. Example:@docs/ui-standards.md Create a Button component
. - External Docs: For libraries like Next.js, we add relevant guides to
docs/
and tag them if needed.
Step 4: Test the Setup
We verify Cursor’s output before diving in.
- Run a Test Prompt: Something simple like:
@docs/ui-standards.md Create a Tailwind Button component
. We check if it follows our rules (e.g., TypeScript, naming). - Adjust Rules: If something’s off, like using
any
, we update.cursorrules
to fix it. - Lint and Test: We run ESLint and Jest on the output to ensure it meets our quality bar.
Step 5: Define the Workflow
Here’s how we use Cursor during development:
- Clear Prompts: We write specific requests, like “Refactor this function to use a Map for O(1) lookups.”
- Incremental Commits: We apply changes in small batches and commit often.
- Ask Questions: If we’re unsure about output, we ask Cursor, “Why did you do this?”
Example: Next.js Project Setup
Here’s what it looks like for a typical Next.js project:
my-nextjs-app/
├── .cursorrules
├── docs/
│ ├── project-overview.md
│ ├── ui-standards.md
│ └── status.md
├── src/
│ ├── components/
│ └── lib/
.cursorrules
:
- Use Next.js 14 with App Router.
- TypeScript with strict mode.
- Tailwind CSS for styling.
- Prefer server components.
- Add JSDoc for public APIs.
Test Prompt:
@docs/ui-standards.md @src/components Create a product-card.tsx with title, price, and button.
Output:
// src/components/product-card.tsx
interface ProductCardProps {
title: string;
price: number;
}
/**
* Product card component.
*/
export const ProductCard = ({ title, price }: ProductCardProps) => (
<div className="p-4 border rounded-lg shadow-md">
<h2 className="text-lg font-semibold">{title}</h2>
<p className="text-gray-600">${price.toFixed(2)}</p>
<button className="mt-2 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600">
Add to Cart
</button>
</div>
);
Why It Works for Us
Quality on Autopilot: Cursor’s output matches our senior devs’ work – clients can’t tell the difference.
Time Savings: Setup takes an hour, saves days of cleanup.
Consistency: Every component, every file, is consistent.
So there it is. My agency’s secret sauce for making MVPs with Cursor. Try it, roast it, improve it, then tell me how it goes.