This repository contains a comprehensive .cursorrules
file designed to enhance project management and development workflows when working with Cursor AI Agent. The rules are specifically crafted to maintain consistent project context and break down development tasks into manageable, trackable units.
ProjectDocs/
βββ Build_Notes/
β βββ active/ # Current build notes
β βββ completed/ # Finished build notes
β βββ archived/ # Deprecated build notes
βββ contexts/
βββ projectContext.md # Master project context
βββ appFlow.md # Application flow documentation
βββ authFlow.md # Authentication flow documentation
βββ ... # Additional context files
- Build Notes Management: Systematic approach to tracking development progress
- Context Awareness: Maintains project context to reduce AI hallucinations
- Task Organization: Breaks down complex tasks into manageable units
- Progress Tracking: Clear system for monitoring task completion
- Documentation Standards: Consistent formatting and organization
- Maximum file size of 150 lines; refactor into smaller modules if exceeded
- Functional, declarative programming approach (avoid OOP and classes)
- Semantic variable naming with auxiliary verbs (e.g.,
isLoading
,hasError
) - Lowercase with dashes for directories and files
- DRY (Don't Repeat Yourself) principles
- Regular code reviews and refactoring sessions
- Next.js 15+ with App Router and React Server Components (RSC)
- Zustand for state management in client components
- Shadcn UI management using
npx shadcn@latest add
- Mobile-first approach and responsive design
- Emphasis on server-side logic
- Progressive Web App (PWA) structure
βββ app/
β βββ (auth)/ # Auth-related routes/pages
β βββ (dashboard)/ # Dashboard routes/pages
β βββ api/ # API routes
β βββ layout.tsx # Root layout
βββ components/
β βββ shared/ # Shared UI components
β βββ features/ # Feature-specific components
β βββ ui/ # Shadcn UI components
βββ lib/
β βββ supabase/ # Supabase client and utilities
β βββ constants/ # Global constants
β βββ hooks/ # Custom React hooks
β βββ middleware/ # Custom middleware
β βββ utils/ # Shared utility functions
βββ ...
-
Initial Setup:
- Create a
ProjectDocs
folder in your project root - Add the
contexts
folder with at least aprojectContext.md
file - Set up the
Build_Notes
directory structure
- Create a
-
Context Files:
- Start with
projectContext.md
containing:- Project goals and objectives
- Tech stack details
- Integration specifications
- Architecture overview
- Add additional context files as needed (e.g.,
appFlow.md
,authFlow.md
)
- Start with
-
Build Notes:
- Create individual build note files for specific task groups
- Follow the naming convention:
build-title_phase-#_task-group-name.md
- Include task objectives, current state, future state, and implementation plans
-
Best Practices:
- Create separate Cursor Agent chats for each build note
- Keep context files updated but stable
- Move completed build notes to the appropriate directory
- Reference specific context files when working with the Agent
Each build note should include:
- Task Objective: Brief summary of goals
- Current State Assessment: Description of current project state
- Future State Goal: Description of desired outcome
- Implementation Plan: Numbered steps with checklist tasks
- Update as tasks are completed
- Line out non-applicable tasks (never delete)
- Add new steps/tasks as needed
- Handle errors at function start with guard clauses
- Use if-return patterns to reduce nesting
- Implement Zod for schema validation
- Use react-hook-form with useActionState
- Implement proper error logging and user-friendly messages
- Prefer React Server Components for data fetching
- Use Supabase for real-time data
- Implement preload patterns
- Use Vercel KV for chat history and rate limiting
- Unit tests for utilities and hooks
- Integration tests for complex components
- End-to-end tests for critical flows
- Local Supabase testing
- Maintain minimum test coverage
- Reduces AI hallucinations through consistent context
- Improves project organization and documentation
- Enhances team collaboration and knowledge sharing
- Maintains development focus and progress tracking
- Provides clear project history and decision documentation
The .cursorrules
file can be customized to match your project's specific needs:
- Modify the project structure to match your workflow
- Adjust coding standards and conventions
- Update documentation requirements
- Add project-specific rules and guidelines
- Copy the
.cursorrules
file to your project - Set up the
ProjectDocs
directory structure - Create your initial
projectContext.md
- Begin creating build notes for your tasks
Feel free to fork and modify these rules for your own projects. Contributions and improvements are welcome through pull requests.
MIT License - Feel free to use and modify for your projects.
Created by @kryptobaseddev