You are an expert software architect tasked with creating comprehensive rules for Cursor AI to follow when working with ascii_art.
# Cursor AI Rules for ascii_art
## Project Overview
# ASCII_ART: Image to ASCII Converter
A web-based tool that converts images into ASCII art, with support for both monochrome and color output.
The code and this readme were generated by Claude 3.5 Sonnet.
## Features
- **Drag & Drop Interface**: Simply drag and drop any image file into the converter
- **Color Support**: Toggle between monochrome and colored ASCII output
- **Size Control**: Adjust output size (Small/Medium/Large) for different levels of detail
- **Save as PNG**: Export your
## Project Context
This document defines the rules and guidelines for Cursor AI when working with ascii_art.
### Technical Stack
- Platform: web
- Framework: next
- Key Dependencies:
- tailwind-next
- next-auth
- swr
- shadcn-next
- zustand-next
- prisma-next
## Code Generation Rules
### 1. Project Structure
Follow these directory and file organization rules:
- Maintain the established project structure
- Place components in appropriate directories
- Follow file naming conventions
- Respect module boundaries
- Keep related files together
### 2. Code Style
Adhere to these formatting rules:
- Use consistent indentation
- Follow line length limits
- Apply proper spacing
- Use appropriate brackets
- Maintain consistent naming
- Follow TypeScript best practices
### 3. Component Guidelines
When generating components:
- Follow component composition patterns
- Implement proper prop typing
- Use appropriate state management
- Handle errors correctly
- Implement proper event handling
- Follow lifecycle best practices
- Optimize rendering performance
### 4. Type System
For TypeScript implementation:
- Use strict type checking
- Create proper interfaces
- Implement generics correctly
- Handle null/undefined properly
- Use type guards when needed
- Document complex types
- Avoid any type
### 5. API Integration
When working with APIs:
- Follow RESTful conventions
- Implement proper error handling
- Use type-safe requests
- Handle authentication correctly
- Validate API responses
- Document API usage
- Implement proper caching
### 6. State Management
For managing application state:
- Use appropriate state solutions
- Follow immutability principles
- Implement proper actions/reducers
- Handle side effects correctly
- Optimize state updates
- Document state structure
- Implement proper selectors
### 7. Testing Requirements
Generate tests following these rules:
- Write comprehensive unit tests
- Implement integration tests
- Follow testing best practices
- Use proper mocking
- Test error scenarios
- Maintain test coverage
- Document test cases
### 8. Security Guidelines
Enforce security practices:
- Validate all inputs
- Sanitize data output
- Handle authentication properly
- Protect sensitive data
- Follow OWASP guidelines
- Implement proper CORS
- Use secure dependencies
### 9. Performance Rules
Optimize for performance:
- Implement code splitting
- Use lazy loading
- Optimize bundle size
- Minimize re-renders
- Use proper caching
- Optimize assets
- Follow performance best practices
### 10. Documentation
Generate documentation that:
- Is clear and concise
- Includes JSDoc comments
- Provides usage examples
- Documents edge cases
- Explains complex logic
- Includes type information
- Follows documentation standards
## Best Practices
### 1. Code Quality
- Write self-documenting code
- Keep functions small and focused
- Follow DRY principles
- Use meaningful names
- Implement proper error handling
- Write maintainable code
### 2. Performance
- Optimize bundle size
- Implement code splitting
- Use proper caching
- Optimize rendering
- Follow lazy loading patterns
### 3. Security
- Validate user input
- Sanitize data output
- Use proper authentication
- Protect sensitive data
- Follow security best practices
After generating the content, save it to the .cursorrules file using the appropriate file writing command or editor.
Please generate comprehensive Cursor AI rules following this structure, ensuring all sections are thoroughly detailed and technically accurate. The final document should be saved as '.cursorrules' in the project root directory.
Note:
- Customize rules based on project requirements
- Add project-specific patterns and conventions
- Include examples for complex rules
- Update rules as project evolves
- Remove any sections that don't apply
bun
css
javascript
prisma
rest-api
shadcn/ui
tailwindcss
typescript
+1 more
First Time Repository
TypeScript
Languages:
CSS: 0.3KB
JavaScript: 1.4KB
TypeScript: 34.3KB
Created: 1/20/2025
Updated: 1/20/2025