DEV Community

Cover image for The cursorrules and CLAUDE.md setup I use for every AI product I build
yangzh991
yangzh991

Posted on

The cursorrules and CLAUDE.md setup I use for every AI product I build

Every time I start a new AI product, I used to spend the first hour
doing the same thing: setting up Cursor rules, writing CLAUDE.md,

configuring the agent behavior.

Then I stopped doing that.

## What I use now

Three files. That's it.

.cursorrules — tells Cursor how to handle React + TypeScript in AI products specifically. Component patterns, streaming state conventions, how to structure tool-call UI.

CLAUDE.md — project context for Claude Code. What the app does, tech stack, file structure, what NOT to touch. Claude reads this before every session.

AGENTS.md — defines agent roles and boundaries when you're running multi-agent workflows. Which agent owns which part of the
codebase.

## Why this matters

Without these files, every AI coding session starts cold. The model doesn't know your conventions, rewrites things you already decided, asks questions you've answered before.

With them, you drop into any session and the context is already there.

## What's in the cursorrules specifically

  • React + TypeScript strict mode conventions
  • AI component patterns (streaming, tool-calls, loading states)
  • Tailwind class ordering
  • File naming and folder structure
  • What to avoid (no useEffect for data fetching, no any types)

## How to use it

Drop the three files into your project root. Adjust the stack

references to match your setup. Done.

I packaged mine up here if you want to skip writing from scratch:

https://payhip.com/b/BVfGI ($19)

Or just use this as a starting point and build your own.

What does your CLAUDE.md look like? Curious what context other

people include.

Top comments (0)