Workflow
Project Setup

Project Setup

Do these once per project to set yourself up for success.

Create a solid project structure

AI works better with organized codebases. Set up clear folders from day one.

project/
β”œβ”€β”€ docs/           # Documentation only
β”œβ”€β”€ scripts/        # Utility scripts
β”œβ”€β”€ tests/          # All test files
β”œβ”€β”€ src/            # Source code
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ utils/
β”‚   └── services/
β”œβ”€β”€ .gitignore      # Comprehensive, from day 1
└── README.md

Write a README or project doc

AI will reference this implicitly. Include:

# My Project
 
## What it does
A brief description of the project's purpose.
 
## Tech Stack
- Next.js 14
- Prisma + PostgreSQL
- TypeScript (strict)
 
## Key Patterns
- Use server components by default
- API routes in /app/api
- Zod for validation

Set up your rules file

Create .cursorrules (or similar) for project-specific conventions:

# .cursorrules

## Language & Framework
- TypeScript strict mode
- Next.js App Router
- Tailwind CSS

## Conventions
- Use async/await, not .then()
- Prefer named exports
- Use Zod for all validation

## Security
- Never log sensitive data
- Always sanitize user input
- Use parameterized queries

## Don't
- Don't use any
- Don't add unnecessary dependencies
- Don't create files at project root

Create .gitignore immediately

# Environment
.env
.env.local
.env*.local

# Dependencies
node_modules/
vendor/

# Build
dist/
build/
.next/

# IDE
.idea/
.vscode/
*.swp

# OS
.DS_Store
Thumbs.db

# Logs
*.log
logs/

# Secrets (belt and suspenders)
*.pem
*.key
secrets/
⚠️

Enforce file organization from day 1

AI will dump files wherever you let it. Explicitly specify paths in every prompt:

βœ… "Create the UserService class in /src/services/UserService.ts"

❌ "Create the UserService class" (AI picks random location)

When AI Puts Files in Wrong Places

Stop immediately. Move the file to correct location. Then tell AI:

"From now on, all services go in /src/services/"

This trains the context for future prompts.