Problem: Team Has Inconsistent AI Prompts and Settings
Your team uses Cursor, but everyone has different AI rules, custom prompts, and settings. Code reviews catch style issues that should've been caught by consistent AI prompts.
You'll learn:
- How to version control Cursor settings
- Auto-sync AI prompts and rules across the team
- Set up per-project Cursor configurations
Time: 15 min | Level: Beginner
Why This Happens
Cursor stores settings in two places:
- Global settings:
~/.cursor/(personal preferences) - Workspace settings:
.cursor/in project (team-shared)
Most teams don't commit workspace settings, so everyone's AI behaves differently.
Common symptoms:
- Different code formatting from AI suggestions
- Inconsistent variable naming in AI-generated code
- Team members unaware of project-specific prompts
- New developers miss crucial context
Solution
Step 1: Create Workspace Settings
# In your project root
mkdir -p .cursor
# Create team rules file
touch .cursor/rules
Expected: .cursor/ directory created in project root
Step 2: Add Team AI Rules
Create .cursor/rules with project-specific guidelines:
# Team AI Rules - MyProject
## Code Style
- Use const/let, never var
- Max line length: 100 characters
- Prefer functional components in React
- Use async/await, not .then() chains
## Naming Conventions
- Components: PascalCase (UserProfile.tsx)
- Utilities: camelCase (formatDate.ts)
- Constants: UPPER_SNAKE_CASE (API_TIMEOUT)
- Types: PascalCase with T prefix (TUserData)
## Project Context
- We use tRPC for API calls, not REST
- Tailwind for styling, no CSS modules
- Zod for runtime validation
- Server actions in Next.js 15, not API routes
## Testing
- Write tests alongside features
- Use Vitest, not Jest
- Prefer integration over unit tests
Why this works: Cursor reads .cursor/rules automatically and applies these to all AI suggestions.
Step 3: Create Cursor Workspace Settings
Create .cursor/settings.json:
{
"cursor.general.enableTelemetry": false,
"cursor.ai.model": "claude-sonnet-4",
"cursor.ai.contextLines": 100,
"cursor.ai.maxTokens": 4000,
"cursor.autocomplete.enabled": true,
"cursor.autocomplete.debounceDelay": 150,
"cursor.chat.defaultModel": "claude-sonnet-4",
"cursor.chat.includeWorkspaceContext": true,
"files.exclude": {
"**/.git": true,
"**/node_modules": true,
"**/.next": true
}
}
Team-specific settings:
enableTelemetry: Consistent privacy stanceai.model: Everyone uses same Claude modelcontextLines: Standard context windowincludeWorkspaceContext: AI sees project structure
Step 4: Add Custom Prompts (Optional)
Create .cursor/prompts/ for reusable team prompts:
mkdir -p .cursor/prompts
Example .cursor/prompts/component.md:
# React Component Template
Create a new React component following our standards:
1. Functional component with TypeScript
2. Props interface with TComponentNameProps
3. Tailwind for styling (no inline styles)
4. Error boundary if it handles data
5. Loading state for async operations
6. Accessible HTML (proper ARIA labels)
Example structure:
- ComponentName.tsx (component)
- ComponentName.test.tsx (tests)
- index.ts (export)
Usage in Cursor: Reference with @component.md in chat
Step 5: Commit to Version Control
# Add to Git
git add .cursor/
# .gitignore should NOT ignore .cursor/
# Only ignore personal cache
echo ".cursor/.cursorcache" >> .gitignore
git commit -m "Add team Cursor settings and AI rules"
git push
If it fails:
- ".cursor already in .gitignore": Remove that line, keep only
.cursor/.cursorcache - "Permission denied": Check file permissions with
ls -la .cursor/
Step 6: Team Onboarding
Share this with your team:
# Cursor Setup for New Team Members
1. Pull latest from main
2. Restart Cursor to load `.cursor/` settings
3. Verify rules loaded: Open Cursor chat → should see project context
4. Test: Ask Cursor to "create a new component" → should follow our template
**Troubleshooting:**
- Settings not applied? Check Cursor → Settings → "Workspace" tab
- Rules not working? Ensure `.cursor/rules` has no syntax errors
Verification
Test the sync:
# Pull on different machine
git pull
# Open Cursor and check
# Cursor → Settings → Workspace
# Should show your team settings
Test AI rules:
Open Cursor chat and ask:
"Create a utility function to format dates"
You should see: Code following your naming conventions (camelCase) and standards (const, not var)
Advanced: Per-Developer Overrides
Some settings should stay personal. Create .cursor/settings.local.json:
{
"cursor.theme": "dark",
"cursor.fontSize": 14,
"cursor.fontFamily": "JetBrains Mono",
"editor.minimap.enabled": false
}
Add to .gitignore:
echo ".cursor/settings.local.json" >> .gitignore
How Cursor merges:
- Global settings (
~/.cursor/) - Workspace settings (
.cursor/settings.json) - overrides global - Local workspace (
.cursor/settings.local.json) - overrides workspace
What You Learned
- Cursor workspace settings (
.cursor/) can be version controlled .cursor/rulesapplies team standards to all AI suggestions- Personal preferences go in
.local.jsonfiles - Settings sync automatically on
git pull
Limitation: Cursor must be restarted to reload workspace settings after pulling changes.
Common mistake: Don't commit .cursor/.cursorcache - it's 100MB+ of temp files.
Bonus: CI/CD Validation
Validate team rules on every PR:
# .github/workflows/cursor-validate.yml
name: Validate Cursor Settings
on: [pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Cursor rules exist
run: |
if [ ! -f .cursor/rules ]; then
echo "❌ .cursor/rules missing"
exit 1
fi
- name: Validate JSON settings
run: |
if [ -f .cursor/settings.json ]; then
jq empty .cursor/settings.json || exit 1
fi
- name: Check for committed cache
run: |
if [ -d .cursor/.cursorcache ]; then
echo "❌ Don't commit .cursorcache"
exit 1
fi
Team Rules Examples by Framework
Next.js 15 Team
# .cursor/rules
- Use Server Components by default
- Client Components: 'use client' at top
- Server Actions in app/actions/, not API routes
- Zod schemas in lib/schemas/
- No useState for server data, use React Server Components
Python/FastAPI Team
# .cursor/rules
- Type hints required (PEP 484)
- Pydantic models for data validation
- async/await for all IO operations
- Docstrings: Google style
- Max function length: 50 lines
Rust Team
# .cursor/rules
- Use Result<T, E> for errors, not panic!
- Prefer iterators over loops
- Public APIs must have docs
- Run clippy before committing
- Use thiserror for custom errors
Tested on Cursor 0.42+, Git 2.43+, works on macOS, Linux, and WSL2